summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/eip_status.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-04-24 12:12:17 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-04-25 13:23:40 -0300
commit477f57876be9bdc8b90cb0a031dc2c7d691a8574 (patch)
tree81fa49f28c82a3a28b5d6e5755e21298fc0546eb /src/leap/bitmask/gui/eip_status.py
parentb74620fd45d56a7a9a193572010068efa6be681f (diff)
Improve action/widget/menu display conditions.
* Hide services that the current logged in provider does not have. * If we don't have a provider supporting that service we hide the actions along with the widgets. * Use more significative method naming. * Keep track of ui component groups visibility.
Diffstat (limited to 'src/leap/bitmask/gui/eip_status.py')
-rw-r--r--src/leap/bitmask/gui/eip_status.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/leap/bitmask/gui/eip_status.py b/src/leap/bitmask/gui/eip_status.py
index bc31b91d..ca28b8bf 100644
--- a/src/leap/bitmask/gui/eip_status.py
+++ b/src/leap/bitmask/gui/eip_status.py
@@ -260,11 +260,12 @@ class EIPStatusWidget(QtGui.QWidget):
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)
+ if self.isVisible():
+ 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):
@@ -278,7 +279,8 @@ class EIPStatusWidget(QtGui.QWidget):
# Restore the eip action menu
menu = self._systray.contextMenu()
menu.removeAction(self._eip_disabled_action)
- self._eip_status_menu.menuAction().setVisible(True)
+ if self.isVisible():
+ self._eip_status_menu.menuAction().setVisible(True)
# XXX disable (later) --------------------------
def set_eip_status(self, status, error=False):