Display message in chat when your quirk gets disabled

This commit is contained in:
Kiooeht 2011-07-11 16:55:44 -07:00
parent 94a8b2cd69
commit cca3f83984
2 changed files with 16 additions and 1 deletions

View file

@ -280,6 +280,10 @@ class PesterProfile(object):
else: modeon = "no longer"
return "<c=%s>Memo is %s <c=black>%s</c> by <c=%s>%s</c></c>" % \
(syscolor.name(), modeon, modeverb, opchum.colorhtml(), opinit)
def memoquirkkillmsg(self, opchum, opgrammar, syscolor):
opinit = opgrammar.pcf+opchum.initials()+opgrammar.number
return "<c=%s><c=%s>%s</c> turned off you quirk.</c>" % \
(syscolor.name(), opchum.colorhtml(), opinit)
@staticmethod
def checkLength(handle):

View file

@ -819,7 +819,18 @@ class PesterMemo(PesterConvo):
if msg == self.mainwindow.profile().handle:
self.quirksOff.setChecked(True)
self.applyquirks = False
# TODO: Politely notify the client
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
chum = self.mainwindow.profile()
opchum = PesterProfile(op)
if self.times.has_key(op):
opgrammar = self.times[op].getGrammar()
elif op == self.mainwindow.profile().handle:
opgrammar = self.time.getGrammar()
else:
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
msg = chum.memoquirkkillmsg(opchum, opgrammar, systemColor)
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.channel, msg)
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
def userPresentChange(self, handle, channel, update):