summaryrefslogtreecommitdiff
path: root/src/leap/gui/mainwindow.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-22 16:12:26 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-22 16:12:26 -0300
commite267ebd09c57c869dc0ab8d57baaed6d63fb2f13 (patch)
tree413ea105bcabbed518c4a806470b4548a4a05e60 /src/leap/gui/mainwindow.py
parent2b53c03c9acf42b240a57901ae1e6d4046f52fb2 (diff)
Improve systray behavior with context menu and activation
Diffstat (limited to 'src/leap/gui/mainwindow.py')
-rw-r--r--src/leap/gui/mainwindow.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index 3f29f957..e039fdf1 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -287,18 +287,19 @@ class MainWindow(QtGui.QMainWindow):
self._vpn_systray.setIcon(QtGui.QIcon(self.ERROR_ICON))
self._vpn_systray.setVisible(False)
- def _toggle_visible(self):
+ def _toggle_visible(self, reason=None):
"""
SLOT
TRIGGER: self._systray.activated
Toggles the window visibility
"""
- self.setVisible(not self.isVisible())
- action_visible_text = self.tr("Hide")
- if not self.isVisible():
- action_visible_text = self.tr("Show")
- self._action_visible.setText(action_visible_text)
+ if reason != QtGui.QSystemTrayIcon.Context:
+ self.setVisible(not self.isVisible())
+ action_visible_text = self.tr("Hide")
+ if not self.isVisible():
+ action_visible_text = self.tr("Show")
+ self._action_visible.setText(action_visible_text)
def _center_window(self):
"""