This commit is contained in:
Stephen Dranger 2011-02-09 10:44:48 -06:00
parent 547fdb71b4
commit db768e178b
3 changed files with 11 additions and 6 deletions

2
TODO
View file

@ -1,6 +1,6 @@
Features: Features:
* Tray doesn't disappear on windows after close * Tray doesn't disappear on windows after close
* System tray menu * System tray menu - Moods
* troll colors * troll colors
* ctrl-tab should prefer new convos * ctrl-tab should prefer new convos
* Idling * Idling

BIN
convo.pyc

Binary file not shown.

View file

@ -1514,8 +1514,9 @@ class PesterWindow(MovingWindow):
if reason == QtGui.QSystemTrayIcon.Trigger: if reason == QtGui.QSystemTrayIcon.Trigger:
self.systemTrayFunction() self.systemTrayFunction()
elif reason == QtGui.QSystemTrayIcon.Context: elif reason == QtGui.QSystemTrayIcon.Context:
# show context menu i guess
pass pass
# show context menu i guess
#self.showTrayContext.emit()
closeToTraySignal = QtCore.pyqtSignal() closeToTraySignal = QtCore.pyqtSignal()
newConvoStarted = QtCore.pyqtSignal(QtCore.QString, bool, name="newConvoStarted") newConvoStarted = QtCore.pyqtSignal(QtCore.QString, bool, name="newConvoStarted")
@ -1557,9 +1558,6 @@ class PesterTray(QtGui.QSystemTrayIcon):
def __init__(self, icon, mainwindow, parent): def __init__(self, icon, mainwindow, parent):
QtGui.QSystemTrayIcon.__init__(self, icon, parent) QtGui.QSystemTrayIcon.__init__(self, icon, parent)
self.mainwindow = mainwindow self.mainwindow = mainwindow
traymenu = QtGui.QMenu()
traymenu.addAction("Hi!! HI!!")
self.setContextMenu(traymenu)
@QtCore.pyqtSlot(int) @QtCore.pyqtSlot(int)
def changeTrayIcon(self, i): def changeTrayIcon(self, i):
@ -1584,6 +1582,12 @@ class MainProgram(QtCore.QObject):
self.widget.show() self.widget.show()
self.trayicon = PesterTray(PesterIcon(self.widget.theme["main/icon"]), self.widget, self.app) self.trayicon = PesterTray(PesterIcon(self.widget.theme["main/icon"]), self.widget, self.app)
self.traymenu = QtGui.QMenu()
exitAction = QtGui.QAction("EXIT", self)
self.trayicon.connect(exitAction, QtCore.SIGNAL('triggered()'),
self.widget, QtCore.SLOT('close()'))
self.traymenu.addAction(exitAction)
self.trayicon.setContextMenu(self.traymenu)
self.trayicon.show() self.trayicon.show()
self.trayicon.connect(self.trayicon, self.trayicon.connect(self.trayicon,
QtCore.SIGNAL('activated(QSystemTrayIcon::ActivationReason)'), QtCore.SIGNAL('activated(QSystemTrayIcon::ActivationReason)'),
@ -1597,6 +1601,7 @@ class MainProgram(QtCore.QObject):
QtCore.SIGNAL('closeToTraySignal()'), QtCore.SIGNAL('closeToTraySignal()'),
self.trayicon, self.trayicon,
QtCore.SLOT('show()')) QtCore.SLOT('show()'))
print self.trayicon.contextMenu()
self.irc = PesterIRC(self.widget) self.irc = PesterIRC(self.widget)
self.connectWidgets(self.irc, self.widget) self.connectWidgets(self.irc, self.widget)
@ -1726,7 +1731,7 @@ class MainProgram(QtCore.QObject):
status = self.widget.loadingscreen.exec_() status = self.widget.loadingscreen.exec_()
if status == QtGui.QDialog.Rejected: if status == QtGui.QDialog.Rejected:
sys.exit(0) sys.exit(0)
sys.exit(self.app.exec_()) os._exit(self.app.exec_())
pesterchum = MainProgram() pesterchum = MainProgram()
pesterchum.run() pesterchum.run()