diff options
author | kali <kali@leap.se> | 2012-10-26 02:04:34 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-10-26 02:04:34 +0900 |
commit | 593e4ba1ddf185d14f27c96ffb970fde7a3271fa (patch) | |
tree | d448619e6487d4f17edd936344700206862ea30f /src/leap/baseapp | |
parent | b847bbfb8e1fed3dd478a0314ed618b6a1ae8cb6 (diff) |
fix systray context menu.
Closes #761
Diffstat (limited to 'src/leap/baseapp')
-rw-r--r-- | src/leap/baseapp/mainwindow.py | 3 | ||||
-rw-r--r-- | src/leap/baseapp/systray.py | 16 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/leap/baseapp/mainwindow.py b/src/leap/baseapp/mainwindow.py index c5f956fb..38fa4a45 100644 --- a/src/leap/baseapp/mainwindow.py +++ b/src/leap/baseapp/mainwindow.py @@ -95,6 +95,9 @@ class LeapWindow(QtGui.QMainWindow, lambda status: self.onOpenVPNStatusChange(status)) self.eipStatusChange.connect( lambda newstatus: self.onEIPConnStatusChange(newstatus)) + # can I connect 2 signals? + self.eipStatusChange.connect( + lambda newstatus: self.toggleEIPAct()) # do first run wizard and init signals self.mainappReady.connect(self.do_first_run_wizard_check) 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() |