diff options
author | Kali Kaneko <kali@leap.se> | 2013-09-10 20:58:47 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-09-10 20:58:47 +0200 |
commit | 075d50f10c5ec3be6b008824c34a3aa3509e2c9e (patch) | |
tree | ea847cfa9e79ca57132f3a6fbae8031cd68ee067 /src/leap/bitmask/gui/statuspanel.py | |
parent | 4255d5753a6ad74dc09692dc8fea980edf9d8204 (diff) | |
parent | 724d149aea99173674493ad1f1f4f9a948202749 (diff) |
Merge remote-tracking branch 'ivan-github/feature/3758_improve-systray-tooltip' into develop
Diffstat (limited to 'src/leap/bitmask/gui/statuspanel.py')
-rw-r--r-- | src/leap/bitmask/gui/statuspanel.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/leap/bitmask/gui/statuspanel.py b/src/leap/bitmask/gui/statuspanel.py index 3a91f08e..10e6bca3 100644 --- a/src/leap/bitmask/gui/statuspanel.py +++ b/src/leap/bitmask/gui/statuspanel.py @@ -141,6 +141,9 @@ class StatusPanelWidget(QtGui.QWidget): self.hide_status_box() + # set systray tooltip statuses + self._eip_status = self._mx_status = "" + # Set the EIP status icons self.CONNECTING_ICON = None self.CONNECTED_ICON = None @@ -336,6 +339,16 @@ class StatusPanelWidget(QtGui.QWidget): """ leap_assert_type(systray, QtGui.QSystemTrayIcon) self._systray = systray + self._systray.setToolTip(self.tr("All services are OFF")) + + def _update_systray_tooltip(self): + """ + Updates the system tray icon tooltip using the eip and mx statuses. + """ + status = self.tr("Encrypted Internet is {0}").format(self._eip_status) + status += '\n' + status += self.tr("Encrypted Mail is {0}").format(self._mx_status) + self._systray.setToolTip(status) def set_action_eip_startstop(self, action_eip_startstop): """ @@ -400,10 +413,12 @@ class StatusPanelWidget(QtGui.QWidget): """ leap_assert_type(error, bool) - self._systray.setToolTip(status) + self._eip_status = status + if error: status = "<font color='red'>%s</font>" % (status,) self.ui.lblEIPStatus.setText(status) + self._update_systray_tooltip() def set_startstop_enabled(self, value): """ @@ -530,14 +545,14 @@ class StatusPanelWidget(QtGui.QWidget): """ selected_pixmap = self.ERROR_ICON selected_pixmap_tray = self.ERROR_ICON_TRAY - tray_message = self.tr("Encryption is OFF") + tray_message = self.tr("Encrypted Internet is OFF") if status in ("WAIT", "AUTH", "GET_CONFIG", "RECONNECTING", "ASSIGN_IP"): selected_pixmap = self.CONNECTING_ICON selected_pixmap_tray = self.CONNECTING_ICON_TRAY tray_message = self.tr("Turning ON") elif status in ("CONNECTED"): - tray_message = self.tr("Encryption is ON") + tray_message = self.tr("Encrypted Internet is ON") selected_pixmap = self.CONNECTED_ICON selected_pixmap_tray = self.CONNECTED_ICON_TRAY @@ -559,15 +574,18 @@ class StatusPanelWidget(QtGui.QWidget): """ self.ui.lblMailStatus.setText(status) + self._mx_status = self.tr('OFF') tray_status = self.tr('Encrypted Mail is OFF') icon = QtGui.QPixmap(self.MAIL_OFF_ICON) if ready: icon = QtGui.QPixmap(self.MAIL_ON_ICON) + self._mx_status = self.tr('ON') tray_status = self.tr('Encrypted Mail is ON') self.ui.lblMailIcon.setPixmap(icon) self._action_mail_status.setText(tray_status) + self._update_systray_tooltip() def _mail_handle_soledad_events(self, req): """ |