From b01ef289572d507a1f09d5f3c26c774564d7c8af Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 1 Nov 2017 02:15:12 +0100 Subject: [feature] restore with double-click --- src/leap/bitmask/gui/app.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index 9823d293..44d1d80f 100644 --- a/src/leap/bitmask/gui/app.py +++ b/src/leap/bitmask/gui/app.py @@ -89,6 +89,7 @@ class WithTrayIcon(QDialog): self._createIcons() self._createActions() self._createTrayIcon() + self.trayIcon.activated.connect(self.iconActivated) self.setVPNStatus('off') self.setUpEventListener() self.trayIcon.show() @@ -130,6 +131,11 @@ class WithTrayIcon(QDialog): "&Quit", self, triggered=self.closeFromSystray) + def iconActivated(self, reason): + # can use .Trigger also for single click + if reason in (QSystemTrayIcon.DoubleClick, ): + self.showNormal() + def closeFromSystray(self): self.user_closed = True self.close() @@ -144,9 +150,9 @@ class WithTrayIcon(QDialog): if self.trayIcon.isVisible() and not self.user_closed: QMessageBox.information( self, "Systray", - "The program will keep running in the system tray. To " - "terminate the program, choose Quit in the " - "context menu of the system tray entry.") + "Bitmask will minimize to the system tray. " + "You can choose 'Quit' from the menu with a " + "right click on the icon.") self.hide() if not self.user_closed: event.ignore() -- cgit v1.2.3