diff options
author | Rael <rael.gc@gmail.com> | 2015-03-04 12:49:00 -0300 |
---|---|---|
committer | Rael <rael.gc@gmail.com> | 2015-03-04 12:49:00 -0300 |
commit | 2acc63f46b90506f2ab79b9fd4d79ad27994c410 (patch) | |
tree | ced5c15b9d9c73e126e16c187d37aa9b1af0ab2f /scudcloud-1.0/lib/systray.py | |
parent | e4dab6357b6c4ce06d353d627ce689b8cc2f8da0 (diff) | |
download | scudcloud-2acc63f46b90506f2ab79b9fd4d79ad27994c410.zip scudcloud-2acc63f46b90506f2ab79b9fd4d79ad27994c410.tar.gz scudcloud-2acc63f46b90506f2ab79b9fd4d79ad27994c410.tar.bz2 |
Generating compiled files during install (#13)
Diffstat (limited to 'scudcloud-1.0/lib/systray.py')
-rw-r--r-- | scudcloud-1.0/lib/systray.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scudcloud-1.0/lib/systray.py b/scudcloud-1.0/lib/systray.py new file mode 100644 index 0000000..81f5d81 --- /dev/null +++ b/scudcloud-1.0/lib/systray.py @@ -0,0 +1,23 @@ +from PyQt4 import QtCore, QtGui + +class Systray(QtGui.QSystemTrayIcon): + def __init__(self, window): + super(Systray, self).__init__(QtGui.QIcon.fromTheme("scudcloud"), window) + self.window = window + self.setToolTip(self.window.APP_NAME) + self.menu = QtGui.QMenu(self.window) + self.menu.addAction('Show', self.activated) + self.menu.addAction('Exit', self.window.close) + self.setContextMenu(self.menu) + + def alert(self): + self.setIcon(QtGui.QIcon.fromTheme("scudcloud-attention")) + + def stopAlert(self): + self.setIcon(QtGui.QIcon.fromTheme("scudcloud")) + + def activated(self): + self.window.setWindowState(self.window.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive) + self.window.activateWindow() + self.stopAlert() + |