Notification when minimizing Pesterchum to systray
This commit is contained in:
parent
e580fc4b11
commit
9e47811aea
2 changed files with 22 additions and 6 deletions
|
@ -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
|
||||
----
|
||||
|
|
|
@ -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)',
|
||||
|
|
Loading…
Reference in a new issue