Notification when minimizing Pesterchum to systray

This commit is contained in:
Kiooeht 2011-08-07 11:48:16 -07:00
parent e580fc4b11
commit 9e47811aea
2 changed files with 22 additions and 6 deletions

View file

@ -18,10 +18,8 @@ Features
* Customizable name alerts
* When 'banned' make impossible to connect using timestamp banned under
* Explain why a chumhandle is invalid
* Make some kind of notification when the program is 'closed' but is
still running in the system tray, like how MSN does it. ("MSN is still
running in the system tray. Right click it to close it. Click here not
to show this message again.")
* Notify on sign on/offs in chumroll (toasts)
* Resizable memo userlist
Bugs
----

View file

@ -526,6 +526,8 @@ class userConfig(object):
return self.config.get('nameSound', True)
def volume(self):
return self.config.get('volume', 100)
def trayMessage(self):
return self.config.get('traymsg', True)
def set(self, item, setting):
self.config[item] = setting
try:
@ -3070,12 +3072,16 @@ class MainProgram(QtCore.QObject):
QtCore.SLOT('changeTrayIcon(int)'))
self.trayicon.connect(self.widget,
QtCore.SIGNAL('closeToTraySignal()'),
self.trayicon,
QtCore.SLOT('show()'))
self,
QtCore.SLOT('trayiconShow()'))
self.trayicon.connect(self.widget,
QtCore.SIGNAL('closeSignal()'),
self.trayicon,
QtCore.SLOT('mainWindowClosed()'))
self.connect(self.trayicon,
QtCore.SIGNAL('messageClicked()'),
self,
QtCore.SLOT('trayMessageClick()'))
self.attempts = 0
@ -3128,6 +3134,18 @@ class MainProgram(QtCore.QObject):
def alertWindow(self, widget):
self.app.alert(widget)
@QtCore.pyqtSlot()
def trayiconShow(self):
self.trayicon.show()
if self.widget.config.trayMessage():
self.trayicon.showMessage("Pesterchum", "Pesterchum is still running in the system tray.\n\
Right click to close it.\n\
Click this message to never see this again.")
@QtCore.pyqtSlot()
def trayMessageClick(self):
self.widget.config.set('traymsg', False)
widget2irc = [('sendMessage(QString, QString)',
'sendMessage(QString, QString)'),
('sendNotice(QString, QString)',