summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/statuspanel.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-09-05 17:15:49 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-09-09 12:27:56 -0300
commit528ed8aa4fbd4550fe41fa6afa96eb6ddcab7d1c (patch)
tree065d7e6b1b3dc7c343668027b3b7399050dd55d8 /src/leap/bitmask/gui/statuspanel.py
parentb90f6525b13657b6ed845c56d1b8f6a101ce8e33 (diff)
Improve systray tooltip.
Diffstat (limited to 'src/leap/bitmask/gui/statuspanel.py')
-rw-r--r--src/leap/bitmask/gui/statuspanel.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/leap/bitmask/gui/statuspanel.py b/src/leap/bitmask/gui/statuspanel.py
index 3a91f08e..190bc02f 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,15 @@ 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 += self.tr("\nEncrypted Mail is {0}").format(self._mx_status)
+ self._systray.setToolTip(status)
def set_action_eip_startstop(self, action_eip_startstop):
"""
@@ -400,10 +412,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):
"""
@@ -559,15 +573,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):
"""