diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-12-06 14:16:21 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-12-06 14:16:21 -0300 |
commit | da658d40aaee598e8b35f34cb298bd267eeb2216 (patch) | |
tree | f154b583152d2945d11ade8eb22156503fc81126 /src/leap/bitmask/gui/eip_status.py | |
parent | 0fb7258806b8112fd5072e1be4d2f280ad2e42a4 (diff) | |
parent | 65d7232bc2c78be022bbc793aac1a0c933dd8b34 (diff) |
Merge remote-tracking branch 'refs/remotes/ivan/bug/4630_disable-turn-on-eip-in-tray' into develop
Diffstat (limited to 'src/leap/bitmask/gui/eip_status.py')
-rw-r--r-- | src/leap/bitmask/gui/eip_status.py | 18 |
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): """ |