diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-06 17:22:49 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-06 17:22:49 -0300 |
commit | 275109e17f53c2fceb21d6f87626762800f53e22 (patch) | |
tree | 3063444f76c683a9bb340cf842159d97bef92539 /src/leap/gui | |
parent | 8f57fbc04d2fa224a5a3fb4560da7ef9b91c202c (diff) | |
parent | a6abc1ea31319d23ca14763f6058784ae69b4830 (diff) |
Merge remote-tracking branch 'chiiph/bug/update_hideshow_text' into develop
Diffstat (limited to 'src/leap/gui')
-rw-r--r-- | src/leap/gui/mainwindow.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 39160db9..a1ba4df4 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -580,13 +580,7 @@ class MainWindow(QtGui.QMainWindow): Displays the context menu from the tray icon """ - get_action = lambda visible: ( - self.tr("Show Main Window"), - self.tr("Hide Main Window"))[int(visible)] - - # set labels - visible = self.isVisible() - self._action_visible.setText(get_action(visible)) + self._update_hideshow_menu() context_menu = self._systray.contextMenu() if not IS_MAC: @@ -596,6 +590,19 @@ class MainWindow(QtGui.QMainWindow): # this works however. context_menu.exec_(self._systray.geometry().center()) + def _update_hideshow_menu(self): + """ + Updates the Hide/Show main window menu text based on the + visibility of the window. + """ + get_action = lambda visible: ( + self.tr("Show Main Window"), + self.tr("Hide Main Window"))[int(visible)] + + # set labels + visible = self.isVisible() + self._action_visible.setText(get_action(visible)) + def _toggle_visible(self): """ SLOT @@ -609,6 +616,8 @@ class MainWindow(QtGui.QMainWindow): else: self.hide() + self._update_hideshow_menu() + def _center_window(self): """ Centers the mainwindow based on the desktop geometry |