From cc1d8f31071bb99690a355c244b945aa753918a9 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Wed, 10 Jul 2013 15:06:45 -0300 Subject: Bugfix: Systray Turn ON action fails. Closes #3125 --- changes/bug_3125-systray-turn-on-problem | 1 + src/leap/gui/mainwindow.py | 5 ++++- src/leap/gui/statuspanel.py | 13 ++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 changes/bug_3125-systray-turn-on-problem diff --git a/changes/bug_3125-systray-turn-on-problem b/changes/bug_3125-systray-turn-on-problem new file mode 100644 index 00000000..6abe0038 --- /dev/null +++ b/changes/bug_3125-systray-turn-on-problem @@ -0,0 +1 @@ + o Bugfix: Systray Turn ON action fails because is not correctly enabled/disabled. Closes #3125. diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 8283e72f..93a1eafa 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -238,9 +238,12 @@ class MainWindow(QtGui.QMainWindow): self._action_eip_status) self._action_eip_startstop = QtGui.QAction( - self.tr("Turn ON"), self) + self.tr("Turn OFF"), self) self._action_eip_startstop.triggered.connect( self._stop_eip) + self._action_eip_startstop.setEnabled(False) + self._status_panel.set_action_eip_startstop( + self._action_eip_startstop) self._action_visible = QtGui.QAction(self.tr("Hide Main Window"), self) self._action_visible.triggered.connect(self._toggle_visible) diff --git a/src/leap/gui/statuspanel.py b/src/leap/gui/statuspanel.py index 3e5a5093..dcb6e802 100644 --- a/src/leap/gui/statuspanel.py +++ b/src/leap/gui/statuspanel.py @@ -105,6 +105,15 @@ class StatusPanelWidget(QtGui.QWidget): leap_assert_type(systray, QtGui.QSystemTrayIcon) self._systray = systray + def set_action_eip_startstop(self, action_eip_startstop): + """ + Sets the action_eip_startstop to use. + + :param action_eip_startstop: action_eip_status to be used + :type action_eip_startstop: QtGui.QAction + """ + self._action_eip_startstop = action_eip_startstop + def set_action_eip_status(self, action_eip_status): """ Sets the action_eip_status to use. @@ -156,13 +165,15 @@ class StatusPanelWidget(QtGui.QWidget): def set_startstop_enabled(self, value): """ - Enable or disable btnEipStartStop based on value + Enable or disable btnEipStartStop and _action_eip_startstop + based on value :param value: True for enabled, False otherwise :type value: bool """ leap_assert_type(value, bool) self.ui.btnEipStartStop.setEnabled(value) + self._action_eip_startstop.setEnabled(value) def eip_pre_up(self): """ -- cgit v1.2.3