summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/eip_status.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-12-06 16:44:32 -0300
committerTomás Touceda <chiiph@leap.se>2013-12-06 16:44:32 -0300
commit496036f15cf257d16b6594770812da64a249280c (patch)
tree3f3e13d86df06613eca22884f02c3bdb0b4e266e /src/leap/bitmask/gui/eip_status.py
parentd51d6bedfecd41491f2c8243235e7d3db043a4d7 (diff)
parent5e18d4e5459595f369d94d0d5b3a280348370ebe (diff)
Merge branch 'release-0.3.8'0.3.8
Diffstat (limited to 'src/leap/bitmask/gui/eip_status.py')
-rw-r--r--src/leap/bitmask/gui/eip_status.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py
index 1899d6a4..4b4d360f 100644
--- a/src/leap/bitmask/gui/eip_status.py
+++ b/src/leap/bitmask/gui/eip_status.py
@@ -77,6 +77,10 @@ class EIPStatusWidget(QtGui.QWidget):
self._provider = ""
+ # Action for the systray
+ self._eip_disabled_action = QtGui.QAction(
+ "{0} is {1}".format(self._service_name, self.tr("disabled")), self)
+
def _make_status_clickable(self):
"""
Makes upload and download figures clickable.
@@ -252,6 +256,15 @@ class EIPStatusWidget(QtGui.QWidget):
self.eip_button.hide()
msg = self.tr("You must login to use {0}".format(self._service_name))
self.eip_label.setText(msg)
+ self._eip_status_menu.setTitle("{0} is {1}".format(
+ self._service_name, self.tr("disabled")))
+
+ # Replace EIP tray menu with an action that displays a "disabled" text
+ menu = self._systray.contextMenu()
+ menu.insertAction(
+ self._eip_status_menu.menuAction(),
+ self._eip_disabled_action)
+ self._eip_status_menu.menuAction().setVisible(False)
@QtCore.Slot()
def enable_eip_start(self):
@@ -262,6 +275,11 @@ class EIPStatusWidget(QtGui.QWidget):
logger.debug('Showing EIP start button')
self.eip_button.show()
+ # Restore the eip action menu
+ menu = self._systray.contextMenu()
+ menu.removeAction(self._eip_disabled_action)
+ self._eip_status_menu.menuAction().setVisible(True)
+
# XXX disable (later) --------------------------
def set_eip_status(self, status, error=False):
"""