begin fix and colorchange

This commit is contained in:
Stephen Dranger 2011-01-28 03:07:20 -06:00
parent f6b5f2b343
commit 6e8e496926
2 changed files with 13 additions and 2 deletions

1
TODO
View file

@ -1,5 +1,4 @@
Features: Features:
* pesterchum:cease
* changeColor * changeColor
* protect against messages from yourself :P * protect against messages from yourself :P
* Theme Changing * Theme Changing

View file

@ -281,6 +281,8 @@ class chumListing(QtGui.QListWidgetItem):
def setMood(self, mood): def setMood(self, mood):
self.chum.mood = mood self.chum.mood = mood
self.updateMood() self.updateMood()
def setColor(self, color):
self.chum.color = color
def updateMood(self): def updateMood(self):
mood = self.chum.mood mood = self.chum.mood
self.mood = mood self.mood = mood
@ -310,6 +312,10 @@ class chumArea(QtGui.QListWidget):
chums = self.findItems(handle, QtCore.Qt.MatchFlags(0)) chums = self.findItems(handle, QtCore.Qt.MatchFlags(0))
for c in chums: for c in chums:
c.setMood(mood) 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): class MovingWindow(QtGui.QFrame):
def __init__(self, *x, **y): def __init__(self, *x, **y):
@ -509,6 +515,8 @@ class PesterConvo(QtGui.QFrame):
else: else:
self.setWindowIcon(mood.icon(self.mainwindow.theme)) self.setWindowIcon(mood.icon(self.mainwindow.theme))
# print mood update? # print mood update?
def updateColor(self, color):
self.chum.color = color
def addMessage(self, text, me=True): def addMessage(self, text, me=True):
if me: if me:
chum = self.mainwindow.profile chum = self.mainwindow.profile
@ -634,7 +642,10 @@ class PesterWindow(MovingWindow):
# play sound here # play sound here
def changeColor(self, handle, color): 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): def updateMood(self, handle, mood):
self.chumList.updateMood(handle, mood) self.chumList.updateMood(handle, mood)
@ -656,6 +667,7 @@ class PesterWindow(MovingWindow):
self.connect(convoWindow, QtCore.SIGNAL('windowClosed(QString)'), self.connect(convoWindow, QtCore.SIGNAL('windowClosed(QString)'),
self, QtCore.SLOT('closeConvo(QString)')) self, QtCore.SLOT('closeConvo(QString)'))
self.convos[chum.handle] = convoWindow self.convos[chum.handle] = convoWindow
convoWindow.setChumOpen(True)
self.newConvoStarted.emit(QtCore.QString(chum.handle), initiated) self.newConvoStarted.emit(QtCore.QString(chum.handle), initiated)
convoWindow.show() convoWindow.show()
def createTabWindow(self): def createTabWindow(self):