added OOC mode, also fixed a small bug with animations that i made
This commit is contained in:
parent
efda266420
commit
f05f6c845b
5 changed files with 35 additions and 9 deletions
|
@ -3,7 +3,6 @@ Todo
|
|||
|
||||
Features
|
||||
--------
|
||||
* OOC
|
||||
* Log viewer needs to have BBCode/HTML/Text copy modes
|
||||
* Copy quirks between profiles?
|
||||
* More complex quirks: by-sound
|
||||
|
@ -17,11 +16,12 @@ Features
|
|||
* When 'banned' make impossible to connect using timestamp banned under
|
||||
* Auto download/install updates via Windows installer
|
||||
* 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 MemoServ to save profiles (Idea: ghostDunk)
|
||||
* Use web connection to send offline messages in email-like fashion (Idea: ghostDunk)
|
||||
* Use web connection to save profiles (Idea: ghostDunk)
|
||||
* Better NickServ registering
|
||||
* 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
|
||||
----
|
||||
|
|
20
convo.py
20
convo.py
|
@ -10,7 +10,8 @@ from PyQt4 import QtGui, QtCore
|
|||
from mood import Mood
|
||||
from dataobjs import PesterProfile, PesterHistory
|
||||
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):
|
||||
def __init__(self, mainwindow, parent=None, convo="convo"):
|
||||
|
@ -539,6 +540,10 @@ class PesterConvo(QtGui.QFrame):
|
|||
self.quirksOff.setCheckable(True)
|
||||
self.connect(self.quirksOff, QtCore.SIGNAL('toggled(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.connect(self.unblockchum, QtCore.SIGNAL('triggered()'),
|
||||
self, QtCore.SLOT('unblockChumSlot()'))
|
||||
|
@ -550,6 +555,7 @@ class PesterConvo(QtGui.QFrame):
|
|||
self, QtCore.SLOT('openChumLogs()'))
|
||||
|
||||
self.optionsMenu.addAction(self.quirksOff)
|
||||
self.optionsMenu.addAction(self.oocToggle)
|
||||
self.optionsMenu.addAction(self.logchum)
|
||||
self.optionsMenu.addAction(self.addChumAction)
|
||||
self.optionsMenu.addAction(self.blockAction)
|
||||
|
@ -557,6 +563,7 @@ class PesterConvo(QtGui.QFrame):
|
|||
|
||||
self.chumopen = False
|
||||
self.applyquirks = True
|
||||
self.ooc = False
|
||||
|
||||
if parent:
|
||||
parent.addChat(self)
|
||||
|
@ -679,6 +686,9 @@ class PesterConvo(QtGui.QFrame):
|
|||
self.optionsMenu.popup(event.globalPos())
|
||||
def closeEvent(self, event):
|
||||
self.mainwindow.waitingMessages.messageAnswered(self.title())
|
||||
for movie in self.textArea.urls:
|
||||
movie.stop()
|
||||
del movie
|
||||
self.windowClosed.emit(self.title())
|
||||
|
||||
def setChumOpen(self, o):
|
||||
|
@ -714,10 +724,13 @@ class PesterConvo(QtGui.QFrame):
|
|||
text = unicode(self.textInput.text())
|
||||
if text == "" or text[0:11] == "PESTERCHUM:":
|
||||
return
|
||||
oocDetected = oocre.match(text.strip())
|
||||
if self.ooc and not oocDetected:
|
||||
text = "(( %s ))" % (text)
|
||||
self.history.add(text)
|
||||
quirks = self.mainwindow.userprofile.quirks
|
||||
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:
|
||||
lexmsg = quirks.apply(lexmsg)
|
||||
except:
|
||||
|
@ -754,6 +767,9 @@ class PesterConvo(QtGui.QFrame):
|
|||
@QtCore.pyqtSlot(bool)
|
||||
def toggleQuirks(self, toggled):
|
||||
self.applyquirks = not toggled
|
||||
@QtCore.pyqtSlot(bool)
|
||||
def toggleOOC(self, toggled):
|
||||
self.ooc = toggled
|
||||
@QtCore.pyqtSlot()
|
||||
def openChumLogs(self):
|
||||
currentChum = self.chum.handle
|
||||
|
|
14
memos.py
14
memos.py
|
@ -9,10 +9,9 @@ from dataobjs import PesterProfile, PesterHistory
|
|||
from generic import PesterIcon, RightClickList, mysteryTime
|
||||
from convo import PesterConvo, PesterInput, PesterText, PesterTabWindow
|
||||
from parsetools import convertTags, addTimeInitial, timeProtocol, \
|
||||
lexMessage, colorBegin, colorEnd, mecmd, smiledict
|
||||
lexMessage, colorBegin, colorEnd, mecmd, smiledict, oocre
|
||||
from logviewer import PesterLogViewer
|
||||
|
||||
|
||||
def delta2txt(d, format="pc"):
|
||||
if type(d) is mysteryTime:
|
||||
return "?"
|
||||
|
@ -393,6 +392,10 @@ class PesterMemo(PesterConvo):
|
|||
# ban & op list added if we are op
|
||||
|
||||
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.setCheckable(True)
|
||||
self.connect(self.quirksOff, QtCore.SIGNAL('toggled(bool)'),
|
||||
|
@ -404,6 +407,7 @@ class PesterMemo(PesterConvo):
|
|||
self.connect(self.invitechum, QtCore.SIGNAL('triggered()'),
|
||||
self, QtCore.SLOT('inviteChums()'))
|
||||
self.optionsMenu.addAction(self.quirksOff)
|
||||
self.optionsMenu.addAction(self.oocToggle)
|
||||
self.optionsMenu.addAction(self.logchum)
|
||||
self.optionsMenu.addAction(self.invitechum)
|
||||
|
||||
|
@ -501,6 +505,7 @@ class PesterMemo(PesterConvo):
|
|||
self.newmessage = False
|
||||
self.history = PesterHistory()
|
||||
self.applyquirks = True
|
||||
self.ooc = False
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def toggleUserlist(self):
|
||||
|
@ -802,6 +807,9 @@ class PesterMemo(PesterConvo):
|
|||
text = unicode(self.textInput.text())
|
||||
if text == "" or text[0:11] == "PESTERCHUM:":
|
||||
return
|
||||
oocDetected = oocre.match(text.strip())
|
||||
if self.ooc and not oocDetected:
|
||||
text = "(( %s ))" % (text)
|
||||
self.history.add(text)
|
||||
if self.time.getTime() == None:
|
||||
self.sendtime()
|
||||
|
@ -809,7 +817,7 @@ class PesterMemo(PesterConvo):
|
|||
quirks = self.mainwindow.userprofile.quirks
|
||||
lexmsg = lexMessage(text)
|
||||
if type(lexmsg[0]) is not mecmd:
|
||||
if self.applyquirks:
|
||||
if self.applyquirks and not (self.ooc or oocDetected):
|
||||
lexmsg = quirks.apply(lexmsg)
|
||||
initials = self.mainwindow.profile().initials()
|
||||
colorcmd = self.mainwindow.profile().colorcmd()
|
||||
|
|
|
@ -17,6 +17,7 @@ _memore = 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*/>""")
|
||||
_mecmdre = re.compile(r"^(/me|PESTERCHUM:ME)(\S*)")
|
||||
oocre = re.compile(r"[\[(][\[(].*[\])][\])]")
|
||||
|
||||
quirkloader = PythonQuirks()
|
||||
_functionre = re.compile(r"%s" % quirkloader.funcre())
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
"voiceuser": "GIVE VOICE",
|
||||
"quirkkill": "KILL QUIRK",
|
||||
"quirksoff": "QUIRKS OFF",
|
||||
"ooc": "OOC",
|
||||
"invitechum": "INVITE CHUM",
|
||||
"memosetting": "MEMO SETTINGS",
|
||||
"memonoquirk": "DISABLE QUIRKS",
|
||||
|
|
Loading…
Reference in a new issue