summaryrefslogtreecommitdiff
path: root/plugins/Systray.py
diff options
context:
space:
mode:
authorjerous <jerous@gmail.com>2008-11-23 21:45:39 +0100
committerjerous <jerous@gmail.com>2008-11-23 21:45:39 +0100
commit583a9d157c62de42cf530ed6250c429c025e3d47 (patch)
treeba1b729484c550f200db2378b39ba09008f210b9 /plugins/Systray.py
parentae34f4909003da7f390b652d8d1a4a1f45e321e8 (diff)
save position of mainwindow
Systray: save and restore position of window at hide/show mainwindow stores and restores position
Diffstat (limited to 'plugins/Systray.py')
-rw-r--r--plugins/Systray.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/Systray.py b/plugins/Systray.py
index 911eea0..e8bc007 100644
--- a/plugins/Systray.py
+++ b/plugins/Systray.py
@@ -38,6 +38,7 @@ class pluginSystray(Plugin):
, self.onSysTrayClick)
self.o.show()
self.update(None)
+
def _unload(self):
self.o.hide()
self.o=None
@@ -66,11 +67,24 @@ class pluginSystray(Plugin):
def onSysTrayClick(self, reason):
if reason==QtGui.QSystemTrayIcon.Trigger \
or reason==QtGui.QSystemTrayIcon.Context:
+ w=self.getWinMain()
# left mouse button
- self.getWinMain().setVisible(not(self.getWinMain().isVisible()))
+ if w.isVisible():
+ settings.set('winMain.pos', '%i %i'%(w.x(), w.y()))
+ w.setVisible(False)
+ else:
+ w.setVisible(True)
+ pos=settings.get('winMain.pos')
+ try:
+ x=int(size[0:size.find(' ')].strip())
+ y=int(size[size.find(' '):].strip())
+ except:
+ x,y=0,0
+ w.move(x, y)
elif reason==QtGui.QSystemTrayIcon.MiddleClick:
# middle mouse button
if monty.isPlaying():
monty.pause()
else:
monty.resume()
+