This commit is contained in:
Stephen Dranger 2011-02-08 16:47:07 -06:00
parent 68c3b30d20
commit f1aff28b39
60 changed files with 71 additions and 20 deletions

2
TODO
View file

@ -1,7 +1,5 @@
Features: Features:
* Tray doesn't disappear on windows after close * Tray doesn't disappear on windows after close
* memo quirk toggle
* mood change system msg
* comment history (up button) * comment history (up button)
* page up/down scrolling * page up/down scrolling
* System tray menu * System tray menu

View file

@ -350,12 +350,17 @@ class PesterConvo(QtGui.QFrame):
def icon(self): def icon(self):
return self.chum.mood.icon(self.mainwindow.theme) return self.chum.mood.icon(self.mainwindow.theme)
def updateMood(self, mood, unblocked=False): def updateMood(self, mood, unblocked=False, old=None):
syscolor = QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"])
if mood.name() == "offline" and self.chumopen == True and not unblocked: if mood.name() == "offline" and self.chumopen == True and not unblocked:
msg = self.chum.pestermsg(self.mainwindow.profile(), QtGui.QColor(self.mainwindow.theme["convo/systemMsgColor"]), self.mainwindow.theme["convo/text/ceasepester"]) msg = self.chum.pestermsg(self.mainwindow.profile(), syscolor, self.mainwindow.theme["convo/text/ceasepester"])
self.textArea.append(convertTags(msg)) self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.title(), convertTags(msg, "bbcode")) self.mainwindow.chatlog.log(self.title(), convertTags(msg, "bbcode"))
self.chumopen = False self.chumopen = False
elif old and old.name() != mood.name():
msg = self.chum.moodmsg(syscolor, self.mainwindow.theme)
self.textArea.append(convertTags(msg))
self.mainwindow.chatlog.log(self.title(), convertTags(msg, "bbcode"))
if self.parent(): if self.parent():
self.parent().updateMood(self.title(), mood, unblocked) self.parent().updateMood(self.title(), mood, unblocked)
else: else:

BIN
convo.pyc

Binary file not shown.

View file

@ -25,7 +25,6 @@ class Mood(object):
name = "chummy" name = "chummy"
return name return name
def icon(self, theme): def icon(self, theme):
try: try:
f = theme["main/chums/moods"][self.name()]["icon"] f = theme["main/chums/moods"][self.name()]["icon"]
except KeyError: except KeyError:
@ -139,6 +138,8 @@ class PesterProfile(object):
return "<c=%s>-- %s%s <c=%s>[%s]</c> %s --</c>" % (syscolor.name(), handle, suffix, self.colorhtml(), initials, msg) return "<c=%s>-- %s%s <c=%s>[%s]</c> %s --</c>" % (syscolor.name(), handle, suffix, self.colorhtml(), initials, msg)
def pestermsg(self, otherchum, syscolor, verb): def pestermsg(self, otherchum, syscolor, verb):
return "<c=%s>-- %s <c=%s>[%s]</c> %s %s <c=%s>[%s]</c> at %s --</c>" % (syscolor.name(), self.handle, self.colorhtml(), self.initials(), verb, otherchum.handle, otherchum.colorhtml(), otherchum.initials(), datetime.now().strftime("%H:%M")) return "<c=%s>-- %s <c=%s>[%s]</c> %s %s <c=%s>[%s]</c> at %s --</c>" % (syscolor.name(), self.handle, self.colorhtml(), self.initials(), verb, otherchum.handle, otherchum.colorhtml(), otherchum.initials(), datetime.now().strftime("%H:%M"))
def moodmsg(self, syscolor, theme):
return "<c=%s>-- %s <c=%s>[%s]</c> changed their mood to %s <img src='%s' /> --</c>" % (syscolor.name(), self.handle, self.colorhtml(), self.initials(), self.mood.name().upper(), theme["main/chums/moods"][self.mood.name()]["icon"])
def memoclosemsg(self, syscolor, timeGrammar, verb): def memoclosemsg(self, syscolor, timeGrammar, verb):
return "<c=%s><c=%s>%s%s%s</c> %s.</c>" % (syscolor.name(), self.colorhtml(), timeGrammar.pcf, self.initials(), timeGrammar.number, verb) return "<c=%s><c=%s>%s%s%s</c> %s.</c>" % (syscolor.name(), self.colorhtml(), timeGrammar.pcf, self.initials(), timeGrammar.number, verb)
def memoopenmsg(self, syscolor, td, timeGrammar, verb, channel): def memoopenmsg(self, syscolor, td, timeGrammar, verb, channel):

Binary file not shown.

Binary file not shown.

BIN
irc.pyc

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -318,6 +318,13 @@ class PesterMemo(PesterConvo):
self.userlist.optionsMenu.addAction(self.addchumAction) self.userlist.optionsMenu.addAction(self.addchumAction)
# ban & op list added if we are op # ban & op list added if we are op
self.optionsMenu = QtGui.QMenu(self)
self.quirksOff = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/quirksoff"], self)
self.quirksOff.setCheckable(True)
self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'),
self, QtCore.SLOT('toggleQuirks(bool)'))
self.optionsMenu.addAction(self.quirksOff)
self.timeslider = TimeSlider(QtCore.Qt.Horizontal, self) self.timeslider = TimeSlider(QtCore.Qt.Horizontal, self)
self.timeinput = TimeInput(self.timeslider, self) self.timeinput = TimeInput(self.timeslider, self)
self.timeinput.setText(timestr) self.timeinput.setText(timestr)
@ -387,6 +394,7 @@ class PesterMemo(PesterConvo):
self.op = False self.op = False
self.newmessage = False self.newmessage = False
self.applyquirks = True
def title(self): def title(self):
return self.channel return self.channel
@ -532,14 +540,17 @@ class PesterMemo(PesterConvo):
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def sentMessage(self): def sentMessage(self):
text = self.textInput.text() text = unicode(self.textInput.text())
if text == "": if text == "":
return return
if self.time.getTime() == None: if self.time.getTime() == None:
self.sendtime() self.sendtime()
grammar = self.time.getGrammar() grammar = self.time.getGrammar()
# deal with quirks here # deal with quirks here
qtext = self.mainwindow.userprofile.quirks.apply(unicode(text)) if self.applyquirks:
qtext = self.mainwindow.userprofile.quirks.apply(text)
else:
qtext = text
if qtext[0:3] != "/me": if qtext[0:3] != "/me":
initials = self.mainwindow.profile().initials() initials = self.mainwindow.profile().initials()
colorcmd = self.mainwindow.profile().colorcmd() colorcmd = self.mainwindow.profile().colorcmd()
@ -549,12 +560,11 @@ class PesterMemo(PesterConvo):
else: else:
clientText = qtext clientText = qtext
serverText = clientText serverText = clientText
self.textInput.setText("")
self.addMessage(clientText, True) self.addMessage(clientText, True)
# convert color tags # convert color tags
text = convertTags(unicode(serverText), "ctag") serverText = convertTags(unicode(serverText), "ctag")
self.messageSent.emit(serverText, self.title()) self.messageSent.emit(serverText, self.title())
self.textInput.setText("")
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def namesUpdated(self): def namesUpdated(self):
# get namesdb # get namesdb

BIN
memos.pyc

Binary file not shown.

BIN
menus.pyc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -43,11 +43,8 @@ def convertTags(string, format="html"):
string = _urlre.sub(urlrep, string) string = _urlre.sub(urlrep, string)
if format == "html": if format == "html":
string = _memore.sub(r" <a href='\1'>\1</a>", string) string = _memore.sub(r" <a href='\1'>\1</a>", string)
string = string.replace(" :trollcool:", " <img src='%s' />" % ("themes/pesterchum/trollcool.gif")) # ugh hardcoded, gross i know. but its just 2 smilies for (code, f) in smiledict.iteritems():
string = string.replace(" :cool:", " <img src='%s' />" % ("themes/pesterchum/pccool.gif")) string = string.replace(" %s" % (code), " <img src='smilies/%s' />" % (f))
elif format == "bbcode":
string = string.replace(" :trollcool:", " [img]http://www.mspaintadventures.com/storyfiles/hs2/scraps/trollcool.gif[/img]")
string = string.replace(" :cool:", " [img]http://www.mspaintadventures.com/storyfiles/hs2/scraps/pccool.gif[/img]")
return string return string
def escapeBrackets(string): def escapeBrackets(string):
@ -141,3 +138,40 @@ def timeDifference(td):
else: else:
timetext = "%d HOURS %s" % (hours, when) timetext = "%d HOURS %s" % (hours, when)
return timetext return timetext
smiledict = {
":rancorous:": "pc_rancorous.gif",
":apple:": "apple.gif",
":bathearst:" "bathearst.gif"
":pleasant:": "pc_pleasant.gif",
":blueghost:": "blueslimer.gif",
":candycorn:": "candycorn.gif",
":cheer:": "cheer.gif",
":duhjohn:": "confusedjohn.gif",
":datrump:": "datrump.gif",
":facepalm:": "facepalm.gif",
":bonk:": "headbonk.gif",
":mspa:": "mspa_face.gif",
":gun:": "mspa_reader.gif",
":cal:": "lilcal.png",
":amazedfirman:": "pc_amazedfirman.gif",
":amazed:": "pc_amazed.gif",
":chummy:": "pc_chummy.gif",
":cool:": "pccool.gif",
":smooth:": "pccool.gif",
":distraughtfirman": "pc_distraughtfirman.gif",
":distraught:": "pc_distraught.gif",
":insolent:": "pc_insolent.gif",
":3:": "pckitty.gif",
":mystified:": "pc_mystified.gif",
":pranky:": "pc_pranky.gif",
":tense:": "pc_tense.gif",
":record:": "record.gif",
":squiddle:": "squiddle.gif",
":tab:": "tab.gif",
":beetip:": "theprofessor.gif",
":flipout:": "weasel.gif",
":befuddled:": "what.gif",
":pumpkin:": "whatpumpkin.gif",
":trollcool:": "trollcool.gif"}

Binary file not shown.

View file

@ -1 +1 @@
{"tabs": true, "soundon": false, "chums": ["marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "maxiumumFatness", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "acapellaWaterfall", "anguillaNuntia", "oilslickOrchid"], "block": []} {"tabs": true, "soundon": true, "chums": ["marineAquist", "unknownTraveler", "tentacleTherapist", "macruralAlchemist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "superGhost", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "adiosToreador", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "maxiumumFatness", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "acapellaWaterfall", "anguillaNuntia", "oilslickOrchid", "confusedTransient"], "defaultprofile": "ghostDunk", "block": []}

View file

@ -364,8 +364,11 @@ class chumArea(RightClickList):
return chums return chums
def updateMood(self, handle, mood): def updateMood(self, handle, mood):
chums = self.getChums(handle) chums = self.getChums(handle)
oldmood = None
for c in chums: for c in chums:
oldmood = c.mood
c.setMood(mood) c.setMood(mood)
return oldmood
def updateColor(self, handle, color): def updateColor(self, handle, color):
chums = self.findItems(handle, QtCore.Qt.MatchFlags(0)) chums = self.findItems(handle, QtCore.Qt.MatchFlags(0))
for c in chums: for c in chums:
@ -804,9 +807,9 @@ class PesterWindow(MovingWindow):
self.chumdb.setColor(handle, color) self.chumdb.setColor(handle, color)
def updateMood(self, handle, mood): def updateMood(self, handle, mood):
self.chumList.updateMood(handle, mood) oldmood = self.chumList.updateMood(handle, mood)
if self.convos.has_key(handle): if self.convos.has_key(handle):
self.convos[handle].updateMood(mood) self.convos[handle].updateMood(mood, old=oldmood)
if hasattr(self, 'trollslum') and self.trollslum: if hasattr(self, 'trollslum') and self.trollslum:
self.trollslum.updateMood(handle, mood) self.trollslum.updateMood(handle, mood)
def newConversation(self, chum, initiated=True): def newConversation(self, chum, initiated=True):

View file

@ -1 +1 @@
{"color": "#ff00ff", "theme": "trollian", "quirks": [], "handle": "ghostDunk"} {"color": "#ff00ff", "theme": "pesterchum", "quirks": [], "handle": "ghostDunk"}

BIN
smilies/Smilies.zip Normal file

Binary file not shown.

BIN
smilies/Thumbs.db Normal file

Binary file not shown.

BIN
smilies/apple.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

BIN
smilies/bathearst.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

BIN
smilies/blacktear.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

BIN
smilies/blueslimer.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

BIN
smilies/candycorn.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

BIN
smilies/cathearst.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
smilies/cheer.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
smilies/confusedjohn.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
smilies/datrump.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

BIN
smilies/facepalm.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
smilies/headbonk.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
smilies/lilcal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

BIN
smilies/mspa_face.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

BIN
smilies/mspa_reader.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
smilies/pc_amazed.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

BIN
smilies/pc_amazedfirman.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

BIN
smilies/pc_bemused.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

BIN
smilies/pc_chummy.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

BIN
smilies/pc_distraught.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
smilies/pc_insolent.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

BIN
smilies/pc_mystified.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
smilies/pc_pleasant.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
smilies/pc_pranky.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
smilies/pc_rancorous.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

BIN
smilies/pc_tense.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

BIN
smilies/pccool.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

BIN
smilies/pckitty.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
smilies/record.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

BIN
smilies/squiddle.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

BIN
smilies/tab.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
smilies/theprofessor.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
smilies/trollcool.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

BIN
smilies/weasel.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
smilies/what.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
smilies/whatpumpkin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B