theme changes pt2

This commit is contained in:
Stephen Dranger 2011-01-28 05:26:13 -06:00
parent 707d1b8209
commit 420922f7a6
2 changed files with 17 additions and 4 deletions

View file

@ -134,6 +134,18 @@ class userProfile(object):
Mood(0)) Mood(0))
self.theme = pesterTheme(self.userprofile["theme"]) self.theme = pesterTheme(self.userprofile["theme"])
self.quirks = pesterQuirks(self.userprofile["quirks"]) self.quirks = pesterQuirks(self.userprofile["quirks"])
def setTheme(self, theme):
self.theme = theme
self.userprofile["theme"] = theme.name
self.save()
def setColor(self, color):
self.chat.color = color
self.userprofile["color"] = color.name()
self.save()
def setQuirks(self, quirks):
self.quirks = quirks
self.userprofile["quirks"] = quirks.repr()
self.save()
def getTheme(self): def getTheme(self):
return self.theme return self.theme
def save(self): def save(self):
@ -863,10 +875,11 @@ class PesterWindow(MovingWindow):
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def themeSelected(self): def themeSelected(self):
themename = self.choosetheme.themeBox.currentText() themename = unicode(self.choosetheme.themeBox.currentText())
if themename != self.theme.name: if themename != self.theme.name:
# update profile
self.changeTheme(pesterTheme(themename)) self.changeTheme(pesterTheme(themename))
# update profile
self.userprofile.setTheme(self.theme)
self.choosetheme = None self.choosetheme = None
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def closeTheme(self): def closeTheme(self):
@ -878,7 +891,7 @@ class PesterWindow(MovingWindow):
handle = unicode(self.chooseprofile.profileBox.currentText()) handle = unicode(self.chooseprofile.profileBox.currentText())
self.userprofile = userProfile(handle) self.userprofile = userProfile(handle)
self.profile = self.userprofile.chat self.profile = self.userprofile.chat
# update themes here self.changeTheme(self.userprofile.getTheme())
else: else:
profile = PesterProfile(unicode(self.chooseprofile.chumHandle.text()), profile = PesterProfile(unicode(self.chooseprofile.chumHandle.text()),
self.chooseprofile.chumcolor, self.chooseprofile.chumcolor,

View file

@ -1 +1 @@
{"color": "#00aaff", "theme": "pesterchum", "quirks": [], "handle": "superGhost"} {"color": "#00aaff", "theme": "trollian", "quirks": [], "handle": "superGhost"}