summaryrefslogtreecommitdiff
path: root/src/leap/gui/mainwindow.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-03-26 02:23:01 +0900
committerkali <kali@leap.se>2013-03-26 02:23:01 +0900
commit36c944d24cd31fe380375ff7f8c709b1cf7c7827 (patch)
treec0fb6b1200e0df5c70ea1bcde441f547403f9faa /src/leap/gui/mainwindow.py
parentbd883c86aec15673a56b954cc6046b43e759e562 (diff)
parente267ebd09c57c869dc0ab8d57baaed6d63fb2f13 (diff)
Merge branch 'bug/systray_behavior' of git://github.com/chiiph/leap_client into develop
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 aa29e843..a62bfc3b 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -289,18 +289,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):
"""