diff options
Diffstat (limited to 'scudcloud-1.0/lib/systray.py')
-rw-r--r-- | scudcloud-1.0/lib/systray.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scudcloud-1.0/lib/systray.py b/scudcloud-1.0/lib/systray.py index dc2ec73..68b7600 100644 --- a/scudcloud-1.0/lib/systray.py +++ b/scudcloud-1.0/lib/systray.py @@ -1,5 +1,6 @@ from PyQt4 import QtCore, QtGui from resources import Resources +import scudcloud class Systray(QtGui.QSystemTrayIcon): @@ -12,6 +13,8 @@ class Systray(QtGui.QSystemTrayIcon): self.setToolTip(Resources.APP_NAME) self.menu = QtGui.QMenu(self.window) self.menu.addAction('Show', self.restore) + if scudcloud.Unity is None: + self.menu.addAction('Toggle Menubar', self.toggleMenuBar) self.menu.addSeparator() self.menu.addAction(self.window.menus["file"]["preferences"]) self.menu.addAction(self.window.menus["help"]["about"]) @@ -43,6 +46,9 @@ class Systray(QtGui.QSystemTrayIcon): self.window.show() self.stopAlert() + def toggleMenuBar(self): + self.window.toggleMenuBar() + def activatedEvent(self, reason): if reason in [QtGui.QSystemTrayIcon.MiddleClick, QtGui.QSystemTrayIcon.Trigger]: if self.window.isHidden() or self.window.isMinimized() or not self.window.isActiveWindow(): |