Options on taskbar flashing, pesters/memos

This commit is contained in:
Kiooeht 2011-06-26 23:27:47 -07:00
parent 4d1c77247c
commit ca81a33e82
3 changed files with 35 additions and 2 deletions

View file

@ -616,6 +616,11 @@ class PesterConvo(QtGui.QFrame):
# ok if it has a tabconvo parent, send that the notify.
if self.parent():
self.parent().notifyNewMessage(self.title())
if type(self.parent()).__name__ == "PesterTabWindow":
if self.mainwindow.config.blink() & self.mainwindow.config.PBLINK:
self.mainwindow.gainAttention.emit(self.parent())
elif type(self.parent()).__name__ == "MemoTabWindow":
if self.mainwindow.config.blink() & self.mainwindow.config.MBLINK:
self.mainwindow.gainAttention.emit(self.parent())
# if not change the window title and update system tray
else:
@ -624,6 +629,11 @@ class PesterConvo(QtGui.QFrame):
def func():
self.showChat()
self.mainwindow.waitingMessages.addMessage(self.title(), func)
if type(self).__name__ == "PesterConvo":
if self.mainwindow.config.blink() & self.mainwindow.config.PBLINK:
self.mainwindow.gainAttention.emit(self)
elif type(self).__name__ == "PesterMemo":
if self.mainwindow.config.blink() & self.mainwindow.config.MBLINK:
self.mainwindow.gainAttention.emit(self)
def clearNewMessage(self):

View file

@ -1071,6 +1071,13 @@ class PesterOptions(QtGui.QDialog):
layout_close.addWidget(QtGui.QLabel("Close"))
layout_close.addWidget(self.closeBox)
self.pesterBlink = QtGui.QCheckBox("Blink Taskbar on Pesters", self)
if self.config.blink() & self.config.PBLINK:
self.pesterBlink.setChecked(True)
self.memoBlink = QtGui.QCheckBox("Blink Taskbar on Memos", self)
if self.config.blink() & self.config.MBLINK:
self.memoBlink.setChecked(True)
if parent.advanced:
self.modechange = QtGui.QLineEdit(self)
layout_change = QtGui.QHBoxLayout()
@ -1125,6 +1132,8 @@ class PesterOptions(QtGui.QDialog):
layout_interface.addWidget(self.tabcheck)
layout_interface.addLayout(layout_mini)
layout_interface.addLayout(layout_close)
layout_interface.addWidget(self.pesterBlink)
layout_interface.addWidget(self.memoBlink)
self.pages.addWidget(widget)
# Sound

View file

@ -316,6 +316,9 @@ class userConfig(object):
# Use for bit flag log setting
self.LOG = 1
self.STAMP = 2
# Use for bit flag blink
self.PBLINK = 1
self.MBLINK = 2
if sys.platform != "darwin":
self.filename = "pesterchum.js"
else:
@ -423,6 +426,8 @@ class userConfig(object):
return self.config.get('lastUCheck', 0)
def checkMSPA(self):
return self.config.get('mspa', False)
def blink(self):
return self.config.get('blink', self.PBLINK | self.MBLINK)
def addChum(self, chum):
if chum.handle not in self.chums():
fp = open(self.filename) # what if we have two clients open??
@ -2709,6 +2714,15 @@ class PesterWindow(MovingWindow):
curmspacheck = self.config.checkMSPA()
if mspachecksetting != curmspacheck:
self.config.set('mspa', mspachecksetting)
# Taskbar blink
blinksetting = 0
if self.optionmenu.pesterBlink.isChecked():
blinksetting = blinksetting | self.config.PBLINK
if self.optionmenu.memoBlink.isChecked():
blinksetting = blinksetting | self.config.MBLINK
curblink = self.config.blink()
if blinksetting != curblink:
self.config.set('blink', blinksetting)
# advanced
## user mode
if self.advanced: