From 6e8e496926c902b3a6d5d4c61452972fdc381b8e Mon Sep 17 00:00:00 2001 From: Stephen Dranger Date: Fri, 28 Jan 2011 03:07:20 -0600 Subject: [PATCH] begin fix and colorchange --- TODO | 1 - pesterchum.py | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 2fc0cc6..1101ce2 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ Features: -* pesterchum:cease * changeColor * protect against messages from yourself :P * Theme Changing diff --git a/pesterchum.py b/pesterchum.py index a8b3f12..d3c89b1 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -281,6 +281,8 @@ class chumListing(QtGui.QListWidgetItem): def setMood(self, mood): self.chum.mood = mood self.updateMood() + def setColor(self, color): + self.chum.color = color def updateMood(self): mood = self.chum.mood self.mood = mood @@ -310,6 +312,10 @@ class chumArea(QtGui.QListWidget): chums = self.findItems(handle, QtCore.Qt.MatchFlags(0)) for c in chums: c.setMood(mood) + def updateColor(self, handle, color): + chums = self.findItems(handle, QtCore.Qt.MatchFlags(0)) + for c in chums: + c.setColor(color) class MovingWindow(QtGui.QFrame): def __init__(self, *x, **y): @@ -509,6 +515,8 @@ class PesterConvo(QtGui.QFrame): else: self.setWindowIcon(mood.icon(self.mainwindow.theme)) # print mood update? + def updateColor(self, color): + self.chum.color = color def addMessage(self, text, me=True): if me: chum = self.mainwindow.profile @@ -634,7 +642,10 @@ class PesterWindow(MovingWindow): # play sound here def changeColor(self, handle, color): - pass + # pesterconvo and chumlist + self.chumList.updateColor(handle, color) + if self.convos.has_key(handle): + self.convos[handle].updateColor(color) def updateMood(self, handle, mood): self.chumList.updateMood(handle, mood) @@ -656,6 +667,7 @@ class PesterWindow(MovingWindow): self.connect(convoWindow, QtCore.SIGNAL('windowClosed(QString)'), self, QtCore.SLOT('closeConvo(QString)')) self.convos[chum.handle] = convoWindow + convoWindow.setChumOpen(True) self.newConvoStarted.emit(QtCore.QString(chum.handle), initiated) convoWindow.show() def createTabWindow(self):