-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display systray notification to make offline mode more obvious to the…
… users (PR #1342) Display systray notification on backend disconnected event
- Loading branch information
Showing
8 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Display systray notification to make offline mode more obvious to the users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2019 Scille SAS | ||
|
||
import pytest | ||
from parsec.core.gui.lang import translate | ||
|
||
|
||
@pytest.mark.gui | ||
@pytest.mark.trio | ||
async def test_offline_notification(aqtbot, running_backend, logged_gui): | ||
|
||
central_widget = logged_gui.test_get_central_widget() | ||
assert central_widget is not None | ||
|
||
# Assert connected | ||
assert central_widget.menu.label_connection_state.text() == translate( | ||
"TEXT_BACKEND_STATE_CONNECTED" | ||
) | ||
|
||
# Assert offline | ||
def _offline(): | ||
central_widget.menu.label_connection_state.text() == translate( | ||
"TEXT_BACKEND_STATE_DISCONNECTED" | ||
) | ||
|
||
async with aqtbot.wait_signal(central_widget.systray_notification): | ||
with running_backend.offline(): | ||
await aqtbot.wait_until(_offline) |