added OOC mode, also fixed a small bug with animations that i made

This commit is contained in:
Stephen Dranger 2011-09-15 19:05:07 -05:00
parent efda266420
commit f05f6c845b
5 changed files with 35 additions and 9 deletions

View file

@ -3,7 +3,6 @@ Todo
Features Features
-------- --------
* OOC
* Log viewer needs to have BBCode/HTML/Text copy modes * Log viewer needs to have BBCode/HTML/Text copy modes
* Copy quirks between profiles? * Copy quirks between profiles?
* More complex quirks: by-sound * More complex quirks: by-sound
@ -17,11 +16,12 @@ Features
* When 'banned' make impossible to connect using timestamp banned under * When 'banned' make impossible to connect using timestamp banned under
* Auto download/install updates via Windows installer * Auto download/install updates via Windows installer
* Turn memo notifications on/off from right-click menu on memos (Idea: lostGash) * Turn memo notifications on/off from right-click menu on memos (Idea: lostGash)
* Use MemoServ to send offline messages in email-like fashion (Idea: ghostDunk) * Use web connection to send offline messages in email-like fashion (Idea: ghostDunk)
* Use MemoServ to save profiles (Idea: ghostDunk) * Use web connection to save profiles (Idea: ghostDunk)
* Better NickServ registering * Better NickServ registering
* Unified data storage, OS-based user data location * Unified data storage, OS-based user data location
* Spectation notices (Idea: lexicalNuance) * Spectation notices (Idea: lexicalNuance) (probly WONTFIX)
* "Pester" menu option to just pester a handle
Bugs Bugs
---- ----

View file

@ -10,7 +10,8 @@ from PyQt4 import QtGui, QtCore
from mood import Mood from mood import Mood
from dataobjs import PesterProfile, PesterHistory from dataobjs import PesterProfile, PesterHistory
from generic import PesterIcon from generic import PesterIcon
from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, img2smiley, smiledict from parsetools import convertTags, lexMessage, splitMessage, mecmd, colorBegin, colorEnd, \
img2smiley, smiledict, oocre
class PesterTabWindow(QtGui.QFrame): class PesterTabWindow(QtGui.QFrame):
def __init__(self, mainwindow, parent=None, convo="convo"): def __init__(self, mainwindow, parent=None, convo="convo"):
@ -539,6 +540,10 @@ class PesterConvo(QtGui.QFrame):
self.quirksOff.setCheckable(True) self.quirksOff.setCheckable(True)
self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'), self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'),
self, QtCore.SLOT('toggleQuirks(bool)')) self, QtCore.SLOT('toggleQuirks(bool)'))
self.oocToggle = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/ooc"], self)
self.oocToggle.setCheckable(True)
self.connect(self.oocToggle, QtCore.SIGNAL('toggled(bool)'),
self, QtCore.SLOT('toggleOOC(bool)'))
self.unblockchum = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/unblockchum"], self) self.unblockchum = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/unblockchum"], self)
self.connect(self.unblockchum, QtCore.SIGNAL('triggered()'), self.connect(self.unblockchum, QtCore.SIGNAL('triggered()'),
self, QtCore.SLOT('unblockChumSlot()')) self, QtCore.SLOT('unblockChumSlot()'))
@ -550,6 +555,7 @@ class PesterConvo(QtGui.QFrame):
self, QtCore.SLOT('openChumLogs()')) self, QtCore.SLOT('openChumLogs()'))
self.optionsMenu.addAction(self.quirksOff) self.optionsMenu.addAction(self.quirksOff)
self.optionsMenu.addAction(self.oocToggle)
self.optionsMenu.addAction(self.logchum) self.optionsMenu.addAction(self.logchum)
self.optionsMenu.addAction(self.addChumAction) self.optionsMenu.addAction(self.addChumAction)
self.optionsMenu.addAction(self.blockAction) self.optionsMenu.addAction(self.blockAction)
@ -557,6 +563,7 @@ class PesterConvo(QtGui.QFrame):
self.chumopen = False self.chumopen = False
self.applyquirks = True self.applyquirks = True
self.ooc = False
if parent: if parent:
parent.addChat(self) parent.addChat(self)
@ -679,6 +686,9 @@ class PesterConvo(QtGui.QFrame):
self.optionsMenu.popup(event.globalPos()) self.optionsMenu.popup(event.globalPos())
def closeEvent(self, event): def closeEvent(self, event):
self.mainwindow.waitingMessages.messageAnswered(self.title()) self.mainwindow.waitingMessages.messageAnswered(self.title())
for movie in self.textArea.urls:
movie.stop()
del movie
self.windowClosed.emit(self.title()) self.windowClosed.emit(self.title())
def setChumOpen(self, o): def setChumOpen(self, o):
@ -714,10 +724,13 @@ class PesterConvo(QtGui.QFrame):
text = unicode(self.textInput.text()) text = unicode(self.textInput.text())
if text == "" or text[0:11] == "PESTERCHUM:": if text == "" or text[0:11] == "PESTERCHUM:":
return return
oocDetected = oocre.match(text.strip())
if self.ooc and not oocDetected:
text = "(( %s ))" % (text)
self.history.add(text) self.history.add(text)
quirks = self.mainwindow.userprofile.quirks quirks = self.mainwindow.userprofile.quirks
lexmsg = lexMessage(text) lexmsg = lexMessage(text)
if type(lexmsg[0]) is not mecmd and self.applyquirks: if type(lexmsg[0]) is not mecmd and self.applyquirks and not (self.ooc or oocDetected):
try: try:
lexmsg = quirks.apply(lexmsg) lexmsg = quirks.apply(lexmsg)
except: except:
@ -754,6 +767,9 @@ class PesterConvo(QtGui.QFrame):
@QtCore.pyqtSlot(bool) @QtCore.pyqtSlot(bool)
def toggleQuirks(self, toggled): def toggleQuirks(self, toggled):
self.applyquirks = not toggled self.applyquirks = not toggled
@QtCore.pyqtSlot(bool)
def toggleOOC(self, toggled):
self.ooc = toggled
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def openChumLogs(self): def openChumLogs(self):
currentChum = self.chum.handle currentChum = self.chum.handle

View file

@ -9,10 +9,9 @@ from dataobjs import PesterProfile, PesterHistory
from generic import PesterIcon, RightClickList, mysteryTime from generic import PesterIcon, RightClickList, mysteryTime
from convo import PesterConvo, PesterInput, PesterText, PesterTabWindow from convo import PesterConvo, PesterInput, PesterText, PesterTabWindow
from parsetools import convertTags, addTimeInitial, timeProtocol, \ from parsetools import convertTags, addTimeInitial, timeProtocol, \
lexMessage, colorBegin, colorEnd, mecmd, smiledict lexMessage, colorBegin, colorEnd, mecmd, smiledict, oocre
from logviewer import PesterLogViewer from logviewer import PesterLogViewer
def delta2txt(d, format="pc"): def delta2txt(d, format="pc"):
if type(d) is mysteryTime: if type(d) is mysteryTime:
return "?" return "?"
@ -393,6 +392,10 @@ class PesterMemo(PesterConvo):
# ban & op list added if we are op # ban & op list added if we are op
self.optionsMenu = QtGui.QMenu(self) self.optionsMenu = QtGui.QMenu(self)
self.oocToggle = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/ooc"], self)
self.oocToggle.setCheckable(True)
self.connect(self.oocToggle, QtCore.SIGNAL('toggled(bool)'),
self, QtCore.SLOT('toggleOOC(bool)'))
self.quirksOff = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/quirksoff"], self) self.quirksOff = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/quirksoff"], self)
self.quirksOff.setCheckable(True) self.quirksOff.setCheckable(True)
self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'), self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'),
@ -404,6 +407,7 @@ class PesterMemo(PesterConvo):
self.connect(self.invitechum, QtCore.SIGNAL('triggered()'), self.connect(self.invitechum, QtCore.SIGNAL('triggered()'),
self, QtCore.SLOT('inviteChums()')) self, QtCore.SLOT('inviteChums()'))
self.optionsMenu.addAction(self.quirksOff) self.optionsMenu.addAction(self.quirksOff)
self.optionsMenu.addAction(self.oocToggle)
self.optionsMenu.addAction(self.logchum) self.optionsMenu.addAction(self.logchum)
self.optionsMenu.addAction(self.invitechum) self.optionsMenu.addAction(self.invitechum)
@ -501,6 +505,7 @@ class PesterMemo(PesterConvo):
self.newmessage = False self.newmessage = False
self.history = PesterHistory() self.history = PesterHistory()
self.applyquirks = True self.applyquirks = True
self.ooc = False
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def toggleUserlist(self): def toggleUserlist(self):
@ -802,6 +807,9 @@ class PesterMemo(PesterConvo):
text = unicode(self.textInput.text()) text = unicode(self.textInput.text())
if text == "" or text[0:11] == "PESTERCHUM:": if text == "" or text[0:11] == "PESTERCHUM:":
return return
oocDetected = oocre.match(text.strip())
if self.ooc and not oocDetected:
text = "(( %s ))" % (text)
self.history.add(text) self.history.add(text)
if self.time.getTime() == None: if self.time.getTime() == None:
self.sendtime() self.sendtime()
@ -809,7 +817,7 @@ class PesterMemo(PesterConvo):
quirks = self.mainwindow.userprofile.quirks quirks = self.mainwindow.userprofile.quirks
lexmsg = lexMessage(text) lexmsg = lexMessage(text)
if type(lexmsg[0]) is not mecmd: if type(lexmsg[0]) is not mecmd:
if self.applyquirks: if self.applyquirks and not (self.ooc or oocDetected):
lexmsg = quirks.apply(lexmsg) lexmsg = quirks.apply(lexmsg)
initials = self.mainwindow.profile().initials() initials = self.mainwindow.profile().initials()
colorcmd = self.mainwindow.profile().colorcmd() colorcmd = self.mainwindow.profile().colorcmd()

View file

@ -17,6 +17,7 @@ _memore = re.compile(r"(\s|^)(#[A-Za-z0-9_]+)")
_handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)") _handlere = re.compile(r"(\s|^)(@[A-Za-z0-9_]+)")
_imgre = re.compile(r"""(?i)<img src=['"](\S+)['"]\s*/>""") _imgre = re.compile(r"""(?i)<img src=['"](\S+)['"]\s*/>""")
_mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)") _mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)")
oocre = re.compile(r"[\[(][\[(].*[\])][\])]")
quirkloader = PythonQuirks() quirkloader = PythonQuirks()
_functionre = re.compile(r"%s" % quirkloader.funcre()) _functionre = re.compile(r"%s" % quirkloader.funcre())

View file

@ -57,6 +57,7 @@
"voiceuser": "GIVE VOICE", "voiceuser": "GIVE VOICE",
"quirkkill": "KILL QUIRK", "quirkkill": "KILL QUIRK",
"quirksoff": "QUIRKS OFF", "quirksoff": "QUIRKS OFF",
"ooc": "OOC",
"invitechum": "INVITE CHUM", "invitechum": "INVITE CHUM",
"memosetting": "MEMO SETTINGS", "memosetting": "MEMO SETTINGS",
"memonoquirk": "DISABLE QUIRKS", "memonoquirk": "DISABLE QUIRKS",