Skip to content

Commit 051670e

Browse files
committed
about dialog: xdg activation
1 parent e9521b2 commit 051670e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

safeeyes/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def __getitem__(self, key: str) -> typing.Callable:
4343
def show_settings(self, activation_token: typing.Optional[str] = None) -> None:
4444
utility.execute_main_thread(self._application.show_settings, activation_token)
4545

46-
def show_about(self) -> None:
47-
utility.execute_main_thread(self._application.show_about)
46+
def show_about(self, activation_token: typing.Optional[str] = None) -> None:
47+
utility.execute_main_thread(self._application.show_about, activation_token)
4848

4949
def enable_safeeyes(self, next_break_time=-1) -> None:
5050
utility.execute_main_thread(self._application.enable_safeeyes, next_break_time)

safeeyes/plugins/trayicon/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,12 @@ def show_settings(self) -> None:
678678
"""
679679
self.on_show_settings(self.sni_service.last_activation_token)
680680

681-
def show_about(self):
681+
def show_about(self) -> None:
682682
"""Handle About menu action.
683683
684684
This action shows the About dialog.
685685
"""
686-
self.on_show_about()
686+
self.on_show_about(self.sni_service.last_activation_token)
687687

688688
def next_break_time(self, dateTime):
689689
"""Update the next break time to be displayed in the menu and

safeeyes/safeeyes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,16 @@ def disable_plugin(self, plugin_id):
358358

359359
self.restart(config, set_active=True)
360360

361-
def show_about(self):
361+
def show_about(self, activation_token: typing.Optional[str] = None):
362362
"""Listen to tray icon About action and send the signal to About
363363
dialog.
364364
"""
365365
logging.info("Show About dialog")
366366
about_dialog = AboutDialog(self, SAFE_EYES_VERSION)
367+
368+
if activation_token is not None:
369+
about_dialog.set_startup_id(activation_token)
370+
367371
about_dialog.show()
368372

369373
def quit(self):

0 commit comments

Comments
 (0)