summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/systray.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-26 02:04:34 +0900
committerkali <kali@leap.se>2012-10-26 02:04:34 +0900
commit593e4ba1ddf185d14f27c96ffb970fde7a3271fa (patch)
treed448619e6487d4f17edd936344700206862ea30f /src/leap/baseapp/systray.py
parentb847bbfb8e1fed3dd478a0314ed618b6a1ae8cb6 (diff)
fix systray context menu.
Closes #761
Diffstat (limited to 'src/leap/baseapp/systray.py')
-rw-r--r--src/leap/baseapp/systray.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/leap/baseapp/systray.py b/src/leap/baseapp/systray.py
index 061de98e..bf57c0f8 100644
--- a/src/leap/baseapp/systray.py
+++ b/src/leap/baseapp/systray.py
@@ -129,10 +129,22 @@ class StatusAwareTrayIconMixin(object):
# this is too simple by now.
# XXX We need to get the REAL info for Encryption state.
# (now is ON as soon as vpn launched)
- if self.eip_service_started is True:
+
+ # XXX get STATUS CONSTANTS INSTEAD
+
+ icon_status = self.conductor.status.get_state_icon()
+ if icon_status == "connected":
+ self.connAct.setEnabled(True)
self.connAct.setText('Encryption ON turn o&ff')
- else:
+ return
+ if icon_status == "disconnected":
+ self.connAct.setEnabled(True)
self.connAct.setText('Encryption OFF turn &on')
+ return
+ if icon_status == "connecting":
+ self.connAct.setDisabled(True)
+ self.connAct.setText('connecting...')
+ return
def detailsWin(self):
visible = self.isVisible()