merges, bugfixes
This commit is contained in:
parent
764018fe2f
commit
a19e5d1df5
15 changed files with 449 additions and 788 deletions
|
@ -7,12 +7,16 @@ Visit https://github.com/illuminatedwax/pesterchum for git access and source cod
|
||||||
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
---------
|
---------
|
||||||
### 3.14b (idk on version number scheme)
|
### 3.14.2
|
||||||
* Pesterchum 3.14 - illuminatedwax [ghostDunk]
|
* Pesterchum 3.14 - illuminatedwax [ghostDunk]
|
||||||
* Art - Grimlive [aquaMarinist]
|
* Art - Grimlive [aquaMarinist]
|
||||||
* Quirks lower() function - Kiooeht [evacipatedBox]
|
* Quirks lower() function - Kiooeht [evacipatedBox]
|
||||||
* Quirks scrabble() function - Kiooeht [evacipatedBox]
|
* Quirks scrabble() function - Kiooeht [evacipatedBox]
|
||||||
* Timestamps - Kiooeht [evacipatedBox]
|
* Timestamps - Kiooeht [evacipatedBox]
|
||||||
* Logviewer - Kiooeht [evacipatedBox]
|
* Logviewer - Kiooeht [evacipatedBox]
|
||||||
* Chum list groups - Kiooeht [evacipatedBox]
|
* Quirk ordering - alGore
|
||||||
* Chum list bug fixes - Kiooeht [evacipatedBox]
|
* # of users in a memo
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
* incorrect characters in memos no longer break log file names
|
||||||
|
* memos now do not break on case-sensitivity
|
||||||
|
|
24
TODO
24
TODO
|
@ -2,14 +2,22 @@ Bugs:
|
||||||
* multiline msgs breaks shit
|
* multiline msgs breaks shit
|
||||||
* REGEXP: \b(\S)(\S*)(\S)\b REPLACE WITH: upper(\1)\2upper(\3) <--
|
* REGEXP: \b(\S)(\S*)(\S)\b REPLACE WITH: upper(\1)\2upper(\3) <--
|
||||||
this regexp, when used as a quirk and then typed in breaks
|
this regexp, when used as a quirk and then typed in breaks
|
||||||
* import modified.tar
|
|
||||||
* channels aren't case sensitive! get the real name of a channel
|
* channels aren't case sensitive! get the real name of a channel
|
||||||
* Windows doesn't show style sheet sometimes?? Maybe related to themes.
|
* Windows doesn't show style sheet sometimes?? Maybe related to themes.
|
||||||
* Issues with connecting? Client not closing connection right? People keep getting "nick taken" messages
|
* Issues with connecting? Client not closing connection right? People keep getting "nick taken" messages
|
||||||
* Windows XP SP2: sometimes mouse clicks dont register? must be some kinda crash
|
* Windows XP SP2: sometimes mouse clicks dont register? must be some kinda crash
|
||||||
* don't save pesterClientXXX names
|
|
||||||
* enamel doesnt have time arrows
|
* enamel doesnt have time arrows
|
||||||
* need to make it so "/" in a memo doesn't mess up the logs
|
|
||||||
|
Features:
|
||||||
|
* OOC
|
||||||
|
* log viewer needs to have BBCode/HTML/Text copy modes
|
||||||
|
* random pesters
|
||||||
|
* copy quirks between profiles?
|
||||||
|
* chum list groups
|
||||||
|
* More complex quirks: by-sound
|
||||||
|
* Theme checking
|
||||||
|
* Spy mode
|
||||||
|
* Animated
|
||||||
|
|
||||||
Mac Bugs:
|
Mac Bugs:
|
||||||
* Mac doesn't show tabs right, display gifs, highlighting thing?
|
* Mac doesn't show tabs right, display gifs, highlighting thing?
|
||||||
|
@ -18,13 +26,3 @@ SS: in the one-on-one pester it resizes with the window
|
||||||
SS: but the memo one doesn't resize
|
SS: but the memo one doesn't resize
|
||||||
SS: and the arrows next to the time thing overlap the CLOSE button
|
SS: and the arrows next to the time thing overlap the CLOSE button
|
||||||
|
|
||||||
Features:
|
|
||||||
* OOC
|
|
||||||
* random pesters
|
|
||||||
* # of users in each memo
|
|
||||||
* copy quirks between profiles?
|
|
||||||
* help button on quirks menu?
|
|
||||||
* More complex quirks: by-sound
|
|
||||||
* Theme checking
|
|
||||||
* Spy mode
|
|
||||||
* Animated
|
|
||||||
|
|
15
dataobjs.py
15
dataobjs.py
|
@ -10,6 +10,7 @@ from mispeller import mispeller
|
||||||
_upperre = re.compile(r"upper\(([\w\\]+)\)")
|
_upperre = re.compile(r"upper\(([\w\\]+)\)")
|
||||||
_lowerre = re.compile(r"lower\(([\w\\]+)\)")
|
_lowerre = re.compile(r"lower\(([\w\\]+)\)")
|
||||||
_scramblere = re.compile(r"scramble\(([\w\\]+)\)")
|
_scramblere = re.compile(r"scramble\(([\w\\]+)\)")
|
||||||
|
_reversere = re.compile(r"reverse\(([\w\\]+)\)")
|
||||||
|
|
||||||
class Mood(object):
|
class Mood(object):
|
||||||
moods = ["chummy", "rancorous", "offline", "pleasant", "distraught",
|
moods = ["chummy", "rancorous", "offline", "pleasant", "distraught",
|
||||||
|
@ -68,9 +69,12 @@ class pesterQuirk(object):
|
||||||
return mo.expand(m.group(1)).lower()
|
return mo.expand(m.group(1)).lower()
|
||||||
def scramblerep(m):
|
def scramblerep(m):
|
||||||
return "".join(random.sample(mo.expand(m.group(1)), len(mo.expand(m.group(1)))))
|
return "".join(random.sample(mo.expand(m.group(1)), len(mo.expand(m.group(1)))))
|
||||||
|
def reverserep(m):
|
||||||
|
return mo.expand(m.group(1))[::-1]
|
||||||
to = _upperre.sub(upperrep, to)
|
to = _upperre.sub(upperrep, to)
|
||||||
to = _lowerre.sub(lowerrep, to)
|
to = _lowerre.sub(lowerrep, to)
|
||||||
to = _scramblere.sub(scramblerep, to)
|
to = _scramblere.sub(scramblerep, to)
|
||||||
|
to = _reversere.sub(reverserep, to)
|
||||||
return mo.expand(to)
|
return mo.expand(to)
|
||||||
return re.sub(fr, regexprep, string)
|
return re.sub(fr, regexprep, string)
|
||||||
elif self.type == "random":
|
elif self.type == "random":
|
||||||
|
@ -181,7 +185,7 @@ class pesterQuirks(object):
|
||||||
yield q
|
yield q
|
||||||
|
|
||||||
class PesterProfile(object):
|
class PesterProfile(object):
|
||||||
def __init__(self, handle, color=None, mood=Mood("offline"), group=None, chumdb=None):
|
def __init__(self, handle, color=None, mood=Mood("offline"), chumdb=None):
|
||||||
self.handle = handle
|
self.handle = handle
|
||||||
if color is None:
|
if color is None:
|
||||||
if chumdb:
|
if chumdb:
|
||||||
|
@ -190,12 +194,6 @@ class PesterProfile(object):
|
||||||
color = QtGui.QColor("black")
|
color = QtGui.QColor("black")
|
||||||
self.color = color
|
self.color = color
|
||||||
self.mood = mood
|
self.mood = mood
|
||||||
if group is None:
|
|
||||||
if chumdb:
|
|
||||||
group = chumdb.getGroup(handle, "Chums")
|
|
||||||
else:
|
|
||||||
group = "Chums"
|
|
||||||
self.group = group
|
|
||||||
def initials(self, time=None):
|
def initials(self, time=None):
|
||||||
handle = self.handle
|
handle = self.handle
|
||||||
caps = [l for l in handle if l.isupper()]
|
caps = [l for l in handle if l.isupper()]
|
||||||
|
@ -225,8 +223,7 @@ class PesterProfile(object):
|
||||||
def plaindict(self):
|
def plaindict(self):
|
||||||
return (self.handle, {"handle": self.handle,
|
return (self.handle, {"handle": self.handle,
|
||||||
"mood": self.mood.name(),
|
"mood": self.mood.name(),
|
||||||
"color": unicode(self.color.name()),
|
"color": unicode(self.color.name())})
|
||||||
"group": unicode(self.group)})
|
|
||||||
def blocked(self, config):
|
def blocked(self, config):
|
||||||
return self.handle in config.getBlocklist()
|
return self.handle in config.getBlocklist()
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,6 @@ class RightClickList(QtGui.QListWidget):
|
||||||
self.setCurrentItem(listing)
|
self.setCurrentItem(listing)
|
||||||
self.optionsMenu.popup(event.globalPos())
|
self.optionsMenu.popup(event.globalPos())
|
||||||
|
|
||||||
class RightClickTree(QtGui.QTreeWidget):
|
|
||||||
def contextMenuEvent(self, event):
|
|
||||||
if event.reason() == QtGui.QContextMenuEvent.Mouse:
|
|
||||||
listing = self.itemAt(event.pos())
|
|
||||||
self.setCurrentItem(listing)
|
|
||||||
self.optionsMenu.popup(event.globalPos())
|
|
||||||
|
|
||||||
class MultiTextDialog(QtGui.QDialog):
|
class MultiTextDialog(QtGui.QDialog):
|
||||||
def __init__(self, title, parent, *queries):
|
def __init__(self, title, parent, *queries):
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
|
|
|
@ -3,7 +3,7 @@ import codecs
|
||||||
import re
|
import re
|
||||||
from time import strftime, strptime
|
from time import strftime, strptime
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
from generic import RightClickList, RightClickTree
|
from generic import RightClickList
|
||||||
from parsetools import convertTags
|
from parsetools import convertTags
|
||||||
from convo import PesterText
|
from convo import PesterText
|
||||||
|
|
||||||
|
@ -138,8 +138,7 @@ class PesterLogViewer(QtGui.QDialog):
|
||||||
self.logList.sort()
|
self.logList.sort()
|
||||||
self.logList.reverse()
|
self.logList.reverse()
|
||||||
|
|
||||||
self.tree = RightClickTree()
|
self.tree = QtGui.QTreeWidget()
|
||||||
self.tree.optionsMenu = QtGui.QMenu(self)
|
|
||||||
self.tree.setFixedSize(260, 300)
|
self.tree.setFixedSize(260, 300)
|
||||||
self.tree.header().hide()
|
self.tree.header().hide()
|
||||||
if theme.has_key("convo/scrollbar"):
|
if theme.has_key("convo/scrollbar"):
|
||||||
|
@ -149,7 +148,6 @@ class PesterLogViewer(QtGui.QDialog):
|
||||||
self.connect(self.tree, QtCore.SIGNAL('itemSelectionChanged()'),
|
self.connect(self.tree, QtCore.SIGNAL('itemSelectionChanged()'),
|
||||||
self, QtCore.SLOT('loadSelectedLog()'))
|
self, QtCore.SLOT('loadSelectedLog()'))
|
||||||
self.tree.setSortingEnabled(False)
|
self.tree.setSortingEnabled(False)
|
||||||
|
|
||||||
child_1 = None
|
child_1 = None
|
||||||
last = ["",""]
|
last = ["",""]
|
||||||
for (i,l) in enumerate(self.logList):
|
for (i,l) in enumerate(self.logList):
|
||||||
|
|
30
memos.py
30
memos.py
|
@ -218,10 +218,10 @@ class MemoTabWindow(PesterTabWindow):
|
||||||
def __init__(self, mainwindow, parent=None):
|
def __init__(self, mainwindow, parent=None):
|
||||||
PesterTabWindow.__init__(self, mainwindow, parent, "memos")
|
PesterTabWindow.__init__(self, mainwindow, parent, "memos")
|
||||||
def addChat(self, convo):
|
def addChat(self, convo):
|
||||||
self.convos[convo.channel] = convo
|
self.convos[convo.channel.upper()] = convo
|
||||||
# either addTab or setCurrentIndex will trigger changed()
|
# either addTab or setCurrentIndex will trigger changed()
|
||||||
newindex = self.tabs.addTab(convo.channel)
|
newindex = self.tabs.addTab(convo.channel.upper())
|
||||||
self.tabIndices[convo.channel] = newindex
|
self.tabIndices[convo.channel.upper()] = newindex
|
||||||
self.tabs.setCurrentIndex(newindex)
|
self.tabs.setCurrentIndex(newindex)
|
||||||
self.tabs.setTabIcon(newindex, PesterIcon(self.mainwindow.theme["memos/memoicon"]))
|
self.tabs.setTabIcon(newindex, PesterIcon(self.mainwindow.theme["memos/memoicon"]))
|
||||||
def updateBlocked(self):
|
def updateBlocked(self):
|
||||||
|
@ -291,16 +291,16 @@ class MemoText(PesterText):
|
||||||
grammar = time.getGrammar()
|
grammar = time.getGrammar()
|
||||||
joinmsg = chum.memojoinmsg(systemColor, time.getTime(), grammar, window.theme["convo/text/joinmemo"])
|
joinmsg = chum.memojoinmsg(systemColor, time.getTime(), grammar, window.theme["convo/text/joinmemo"])
|
||||||
self.append(convertTags(joinmsg))
|
self.append(convertTags(joinmsg))
|
||||||
parent.mainwindow.chatlog.log(parent.channel, joinmsg)
|
parent.mainwindow.chatlog.log(parent.channel.upper(), joinmsg)
|
||||||
time.openCurrentTime()
|
time.openCurrentTime()
|
||||||
|
|
||||||
if type(lexmsg[0]) is mecmd:
|
if type(lexmsg[0]) is mecmd:
|
||||||
memsg = chum.memsg(systemColor, lexmsg, time=time.getGrammar())
|
memsg = chum.memsg(systemColor, lexmsg, time=time.getGrammar())
|
||||||
window.chatlog.log(parent.channel, memsg)
|
window.chatlog.log(parent.channel.upper(), memsg)
|
||||||
self.append(convertTags(memsg))
|
self.append(convertTags(memsg))
|
||||||
else:
|
else:
|
||||||
self.append(convertTags(lexmsg))
|
self.append(convertTags(lexmsg))
|
||||||
window.chatlog.log(parent.channel, lexmsg)
|
window.chatlog.log(parent.channel.upper(), lexmsg)
|
||||||
|
|
||||||
def changeTheme(self, theme):
|
def changeTheme(self, theme):
|
||||||
self.initTheme(theme)
|
self.initTheme(theme)
|
||||||
|
@ -417,7 +417,7 @@ class PesterMemo(PesterConvo):
|
||||||
msg = p.memoopenmsg(systemColor, self.time.getTime(), timeGrammar, self.mainwindow.theme["convo/text/openmemo"], self.channel)
|
msg = p.memoopenmsg(systemColor, self.time.getTime(), timeGrammar, self.mainwindow.theme["convo/text/openmemo"], self.channel)
|
||||||
self.time.openCurrentTime()
|
self.time.openCurrentTime()
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
|
|
||||||
self.op = False
|
self.op = False
|
||||||
self.newmessage = False
|
self.newmessage = False
|
||||||
|
@ -425,7 +425,7 @@ class PesterMemo(PesterConvo):
|
||||||
self.applyquirks = True
|
self.applyquirks = True
|
||||||
|
|
||||||
def title(self):
|
def title(self):
|
||||||
return self.channel
|
return self.channel.upper()
|
||||||
def icon(self):
|
def icon(self):
|
||||||
return PesterIcon(self.mainwindow.theme["memos/memoicon"])
|
return PesterIcon(self.mainwindow.theme["memos/memoicon"])
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ class PesterMemo(PesterConvo):
|
||||||
self.times[handle].removeTime(close)
|
self.times[handle].removeTime(close)
|
||||||
msg = chum.memoclosemsg(systemColor, grammar, window.theme["convo/text/closememo"])
|
msg = chum.memoclosemsg(systemColor, grammar, window.theme["convo/text/closememo"])
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
elif timed not in self.times[handle]:
|
elif timed not in self.times[handle]:
|
||||||
self.times[handle].addTime(timed)
|
self.times[handle].addTime(timed)
|
||||||
else:
|
else:
|
||||||
|
@ -601,7 +601,7 @@ class PesterMemo(PesterConvo):
|
||||||
namesdb = self.mainwindow.namesdb
|
namesdb = self.mainwindow.namesdb
|
||||||
# reload names
|
# reload names
|
||||||
self.userlist.clear()
|
self.userlist.clear()
|
||||||
for n in self.mainwindow.namesdb[self.channel]:
|
for n in self.mainwindow.namesdb[self.channel.upper()]:
|
||||||
self.addUser(n)
|
self.addUser(n)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
||||||
|
@ -635,7 +635,7 @@ class PesterMemo(PesterConvo):
|
||||||
grammar = t.getGrammar()
|
grammar = t.getGrammar()
|
||||||
msg = chum.memoclosemsg(systemColor, grammar, self.mainwindow.theme["convo/text/closememo"])
|
msg = chum.memoclosemsg(systemColor, grammar, self.mainwindow.theme["convo/text/closememo"])
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
self.times[h].removeTime(t.getTime())
|
self.times[h].removeTime(t.getTime())
|
||||||
if update == "nick":
|
if update == "nick":
|
||||||
self.addUser(newnick)
|
self.addUser(newnick)
|
||||||
|
@ -663,7 +663,7 @@ class PesterMemo(PesterConvo):
|
||||||
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
|
opgrammar = TimeGrammar("CURRENT", "C", "RIGHT NOW")
|
||||||
msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar)
|
msg = chum.memobanmsg(opchum, opgrammar, systemColor, grammar)
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
ttracker.removeTime(ttracker.getTime())
|
ttracker.removeTime(ttracker.getTime())
|
||||||
|
|
||||||
if chum is self.mainwindow.profile():
|
if chum is self.mainwindow.profile():
|
||||||
|
@ -682,10 +682,10 @@ class PesterMemo(PesterConvo):
|
||||||
self.time.openCurrentTime()
|
self.time.openCurrentTime()
|
||||||
msg = me.memoopenmsg(systemColor, self.time.getTime(), self.time.getGrammar(), self.mainwindow.theme["convo/text/openmemo"], self.channel)
|
msg = me.memoopenmsg(systemColor, self.time.getTime(), self.time.getGrammar(), self.mainwindow.theme["convo/text/openmemo"], self.channel)
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
elif ret == QtGui.QMessageBox.Cancel:
|
elif ret == QtGui.QMessageBox.Cancel:
|
||||||
if self.parent():
|
if self.parent():
|
||||||
i = self.parent().tabIndices[self.channel]
|
i = self.parent().tabIndices[self.channel.upper()]
|
||||||
self.parent().tabClose(i)
|
self.parent().tabClose(i)
|
||||||
else:
|
else:
|
||||||
self.close()
|
self.close()
|
||||||
|
@ -749,7 +749,7 @@ class PesterMemo(PesterConvo):
|
||||||
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
|
systemColor = QtGui.QColor(self.mainwindow.theme["memos/systemMsgColor"])
|
||||||
msg = me.memoclosemsg(systemColor, grammar, self.mainwindow.theme["convo/text/closememo"])
|
msg = me.memoclosemsg(systemColor, grammar, self.mainwindow.theme["convo/text/closememo"])
|
||||||
self.textArea.append(convertTags(msg))
|
self.textArea.append(convertTags(msg))
|
||||||
self.mainwindow.chatlog.log(self.channel, msg)
|
self.mainwindow.chatlog.log(self.channel.upper(), msg)
|
||||||
|
|
||||||
newtime = self.time.getTime()
|
newtime = self.time.getTime()
|
||||||
if newtime is None:
|
if newtime is None:
|
||||||
|
|
13
menus.py
13
menus.py
|
@ -544,10 +544,6 @@ class PesterOptions(QtGui.QDialog):
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
self.setStyleSheet(self.theme["main/defaultwindow/style"])
|
||||||
|
|
||||||
hr = QtGui.QFrame()
|
|
||||||
hr.setFrameShape(QtGui.QFrame.HLine)
|
|
||||||
hr.setFrameShadow(QtGui.QFrame.Sunken)
|
|
||||||
|
|
||||||
self.tabcheck = QtGui.QCheckBox("Tabbed Conversations", self)
|
self.tabcheck = QtGui.QCheckBox("Tabbed Conversations", self)
|
||||||
if self.config.tabs():
|
if self.config.tabs():
|
||||||
self.tabcheck.setChecked(True)
|
self.tabcheck.setChecked(True)
|
||||||
|
@ -574,12 +570,6 @@ class PesterOptions(QtGui.QDialog):
|
||||||
if self.config.showSeconds():
|
if self.config.showSeconds():
|
||||||
self.secondscheck.setChecked(True)
|
self.secondscheck.setChecked(True)
|
||||||
|
|
||||||
# Will add ability to turn off groups later
|
|
||||||
#self.groupscheck = QtGui.QCheckBox("Use Groups", self)
|
|
||||||
#self.groupscheck.setChecked(self.config.useGroups())
|
|
||||||
self.showemptycheck = QtGui.QCheckBox("Show Empty Groups", self)
|
|
||||||
self.showemptycheck.setChecked(self.config.showEmptyGroups())
|
|
||||||
|
|
||||||
self.ok = QtGui.QPushButton("OK", self)
|
self.ok = QtGui.QPushButton("OK", self)
|
||||||
self.ok.setDefault(True)
|
self.ok.setDefault(True)
|
||||||
self.connect(self.ok, QtCore.SIGNAL('clicked()'),
|
self.connect(self.ok, QtCore.SIGNAL('clicked()'),
|
||||||
|
@ -595,9 +585,6 @@ class PesterOptions(QtGui.QDialog):
|
||||||
layout_0.addWidget(self.tabcheck)
|
layout_0.addWidget(self.tabcheck)
|
||||||
layout_0.addWidget(self.soundcheck)
|
layout_0.addWidget(self.soundcheck)
|
||||||
layout_0.addWidget(self.hideOffline)
|
layout_0.addWidget(self.hideOffline)
|
||||||
#layout_0.addWidget(self.groupscheck)
|
|
||||||
layout_0.addWidget(self.showemptycheck)
|
|
||||||
layout_0.addWidget(hr)
|
|
||||||
layout_0.addWidget(self.timestampcheck)
|
layout_0.addWidget(self.timestampcheck)
|
||||||
layout_0.addWidget(self.timestampBox)
|
layout_0.addWidget(self.timestampBox)
|
||||||
layout_0.addWidget(self.secondscheck)
|
layout_0.addWidget(self.secondscheck)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"hideOfflineChums": false, "tabs": true, "soundon": true, "server": "irc.mindfang.org", "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "grayscaleVisionary", "corruptedInsanity", "stupidlyBrilliant", "artsyGyarados", "obliviousCrafter", "sporadicAgent", "subtleChaotician", "nareSolee", "apostateCourier", "nocturnalTherapist", "herpaDerp", "clockworkUtopia", "digitalSamurai", "astronomicalMaster", "slipshodBrisant", "genialDustbuster", "hyperdriveTyphoon", "magnificentMiser", "gentleRuffian", "riskRepeats", "globalsoftPrika", "globalsoftPirka", "devonianCritter", "lethargicSerpent", "laughingShisa", "bluntInstrument", "sunilaSeed", "bluntInstrument", "nickServ", "ghostBinoculars", "alGore"], "defaultprofile": "ghostDunk", "block": []}
|
{"hideOfflineChums": false, "time12Format": true, "tabs": true, "showSeconds": false, "server": "irc.mindfang.org", "soundon": true, "showTimeStamps": false, "chums": ["unknownTraveler", "tentacleTherapist", "vaginalEngineer", "mechanicalSpectacle", "carcinoGeneticist", "schlagzeugGator", "gamblingGenocider", "gardenGnostic", "centaursTesticle", "arachnidsGrip", "grimAuxiliatrix", "remoteBloodbath", "nitroZealist", "greenZephyr", "arsenicCatnip", "cuttlefishCuller", "rageInducer", "gallowsCalibrator", "caligulasAquarium", "terminallyCapricious", "illuminatedWax", "aquaMarinist", "elegantDiversion", "moirailBunp", "uroborosUnbound", "androidTechnician", "midnightSparrow", "apocalypseArisen", "anguillaNuntia", "oilslickOrchid", "pretentiousFantasia", "aquaticMarinist", "lyricalKeraunoscopic", "counterRealist", "ectoBiologist", "percipientPedestrian", "asceticClinician", "doctectiveMiracles", "noSense", "ircMonster", "twinArmageddons", "cannabisHero", "jetRocket", "adiosToreador", "turntechGodhead", "magmaExploiter", "hannaSongstress", "endlessVoid", "grayscaleVisionary", "corruptedInsanity", "stupidlyBrilliant", "artsyGyarados", "obliviousCrafter", "sporadicAgent", "subtleChaotician", "nareSolee", "apostateCourier", "nocturnalTherapist", "herpaDerp", "clockworkUtopia", "digitalSamurai", "astronomicalMaster", "slipshodBrisant", "genialDustbuster", "hyperdriveTyphoon", "magnificentMiser", "gentleRuffian", "riskRepeats", "globalsoftPrika", "globalsoftPirka", "devonianCritter", "lethargicSerpent", "laughingShisa", "bluntInstrument", "sunilaSeed", "bluntInstrument", "nickServ", "ghostBinoculars", "alGore"], "defaultprofile": "ghostDunk", "block": []}
|
417
pesterchum.py
417
pesterchum.py
|
@ -18,7 +18,7 @@ from menus import PesterChooseQuirks, PesterChooseTheme, \
|
||||||
PesterChooseProfile, PesterOptions, PesterUserlist, PesterMemoList, \
|
PesterChooseProfile, PesterOptions, PesterUserlist, PesterMemoList, \
|
||||||
LoadingScreen, AboutPesterchum
|
LoadingScreen, AboutPesterchum
|
||||||
from dataobjs import PesterProfile, Mood, pesterQuirk, pesterQuirks
|
from dataobjs import PesterProfile, Mood, pesterQuirk, pesterQuirks
|
||||||
from generic import PesterIcon, RightClickList, RightClickTree, MultiTextDialog, PesterList
|
from generic import PesterIcon, RightClickList, MultiTextDialog, PesterList
|
||||||
from convo import PesterTabWindow, PesterText, PesterInput, PesterConvo
|
from convo import PesterTabWindow, PesterText, PesterInput, PesterConvo
|
||||||
from parsetools import convertTags, addTimeInitial
|
from parsetools import convertTags, addTimeInitial
|
||||||
from memos import PesterMemo, MemoTabWindow, TimeTracker
|
from memos import PesterMemo, MemoTabWindow, TimeTracker
|
||||||
|
@ -78,10 +78,13 @@ class PesterLog(object):
|
||||||
self.logpath = _datadir+"logs"
|
self.logpath = _datadir+"logs"
|
||||||
|
|
||||||
def log(self, handle, msg):
|
def log(self, handle, msg):
|
||||||
time = strftime("[%H:%M:%S] ")
|
#watch out for illegal characters
|
||||||
bbcodemsg = time + convertTags(msg, "bbcode")
|
handle = re.sub(r'[<>:"/\\|?*]', "_", handle)
|
||||||
html = time + convertTags(msg, "html")+"<br />"
|
#time = strftime("[%H:%M:%S] ")
|
||||||
msg = time + convertTags(msg, "text")
|
# no time codes in logs
|
||||||
|
bbcodemsg = convertTags(msg, "bbcode")
|
||||||
|
html = convertTags(msg, "html")+"<br />"
|
||||||
|
msg = convertTags(msg, "text")
|
||||||
modes = {"bbcode": bbcodemsg, "html": html, "text": msg}
|
modes = {"bbcode": bbcodemsg, "html": html, "text": msg}
|
||||||
if not self.convos.has_key(handle):
|
if not self.convos.has_key(handle):
|
||||||
time = datetime.now().strftime("%Y-%m-%d.%H.%M")
|
time = datetime.now().strftime("%Y-%m-%d.%H.%M")
|
||||||
|
@ -131,14 +134,7 @@ class PesterProfileDB(dict):
|
||||||
json.dump(chumdict, fp)
|
json.dump(chumdict, fp)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
u = []
|
converted = dict([(handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']))) for (handle, c) in chumdict.iteritems()])
|
||||||
for (handle, c) in chumdict.iteritems():
|
|
||||||
try:
|
|
||||||
g = c['group']
|
|
||||||
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']), group=g)))
|
|
||||||
except KeyError:
|
|
||||||
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']))))
|
|
||||||
converted = dict(u)
|
|
||||||
self.update(converted)
|
self.update(converted)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
@ -159,17 +155,6 @@ class PesterProfileDB(dict):
|
||||||
self[handle].color = color
|
self[handle].color = color
|
||||||
else:
|
else:
|
||||||
self[handle] = PesterProfile(handle, color)
|
self[handle] = PesterProfile(handle, color)
|
||||||
def getGroup(self, handle, default="Chums"):
|
|
||||||
if not self.has_key(handle):
|
|
||||||
return default
|
|
||||||
else:
|
|
||||||
return self[handle].group
|
|
||||||
def setGroup(self, handle, theGroup):
|
|
||||||
if self.has_key(handle):
|
|
||||||
self[handle].group = theGroup
|
|
||||||
else:
|
|
||||||
self[handle] = PesterProfile(handle, group=theGroup)
|
|
||||||
self.save()
|
|
||||||
def __setitem__(self, key, val):
|
def __setitem__(self, key, val):
|
||||||
dict.__setitem__(self, key, val)
|
dict.__setitem__(self, key, val)
|
||||||
self.save()
|
self.save()
|
||||||
|
@ -282,18 +267,6 @@ class userConfig(object):
|
||||||
if not self.config.has_key('showSeconds'):
|
if not self.config.has_key('showSeconds'):
|
||||||
self.set("showSeconds", False)
|
self.set("showSeconds", False)
|
||||||
return self.config.get('showSeconds', False)
|
return self.config.get('showSeconds', False)
|
||||||
def useGroups(self):
|
|
||||||
if not self.config.has_key('useGroups'):
|
|
||||||
self.set("useGroups", False)
|
|
||||||
return self.config.get('useGroups', False)
|
|
||||||
def openDefaultGroup(self):
|
|
||||||
if not self.config.has_key('openDefaultGroup'):
|
|
||||||
self.set("openDefaultGroup", True)
|
|
||||||
return self.config.get('openDefaultGroup', True)
|
|
||||||
def showEmptyGroups(self):
|
|
||||||
if not self.config.has_key('emptyGroups'):
|
|
||||||
self.set("emptyGroups", False)
|
|
||||||
return self.config.get('emptyGroups', False)
|
|
||||||
def addChum(self, chum):
|
def addChum(self, chum):
|
||||||
if chum.handle not in self.chums():
|
if chum.handle not in self.chums():
|
||||||
fp = open(self.filename) # what if we have two clients open??
|
fp = open(self.filename) # what if we have two clients open??
|
||||||
|
@ -321,25 +294,6 @@ class userConfig(object):
|
||||||
l = self.getBlocklist()
|
l = self.getBlocklist()
|
||||||
l.pop(l.index(handle))
|
l.pop(l.index(handle))
|
||||||
self.set('block', l)
|
self.set('block', l)
|
||||||
def getGroups(self):
|
|
||||||
if not self.config.has_key('groups'):
|
|
||||||
self.set('groups', [])
|
|
||||||
return self.config.get('groups', [])
|
|
||||||
def addGroup(self, group, open=False):
|
|
||||||
l = self.getGroups()
|
|
||||||
if group not in l:
|
|
||||||
l.append([group,open])
|
|
||||||
l.sort()
|
|
||||||
self.set('groups', l)
|
|
||||||
def delGroup(self, group):
|
|
||||||
l = self.getGroups()
|
|
||||||
i = 0
|
|
||||||
for g in l:
|
|
||||||
if g[0] == group: break
|
|
||||||
i = i+1
|
|
||||||
l.pop(i)
|
|
||||||
l.sort()
|
|
||||||
self.set('groups', l)
|
|
||||||
def server(self):
|
def server(self):
|
||||||
return self.config.get('server', 'irc.mindfang.org')
|
return self.config.get('server', 'irc.mindfang.org')
|
||||||
def port(self):
|
def port(self):
|
||||||
|
@ -428,6 +382,9 @@ class userProfile(object):
|
||||||
return self.theme
|
return self.theme
|
||||||
def save(self):
|
def save(self):
|
||||||
handle = self.chat.handle
|
handle = self.chat.handle
|
||||||
|
if handle[0:12] == "pesterClient":
|
||||||
|
# dont save temp profiles
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
jsonoutput = json.dumps(self.userprofile)
|
jsonoutput = json.dumps(self.userprofile)
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
|
@ -453,9 +410,9 @@ class WMButton(QtGui.QPushButton):
|
||||||
self.setStyleSheet("QPushButton { padding: 0px; }")
|
self.setStyleSheet("QPushButton { padding: 0px; }")
|
||||||
self.setAutoDefault(False)
|
self.setAutoDefault(False)
|
||||||
|
|
||||||
class chumListing(QtGui.QTreeWidgetItem):
|
class chumListing(QtGui.QListWidgetItem):
|
||||||
def __init__(self, chum, window):
|
def __init__(self, chum, window):
|
||||||
QtGui.QTreeWidgetItem.__init__(self, [chum.handle])
|
QtGui.QListWidgetItem.__init__(self, chum.handle)
|
||||||
self.mainwindow = window
|
self.mainwindow = window
|
||||||
self.chum = chum
|
self.chum = chum
|
||||||
self.handle = chum.handle
|
self.handle = chum.handle
|
||||||
|
@ -469,44 +426,32 @@ class chumListing(QtGui.QTreeWidgetItem):
|
||||||
mood = self.chum.mood
|
mood = self.chum.mood
|
||||||
self.mood = mood
|
self.mood = mood
|
||||||
icon = self.mood.icon(self.mainwindow.theme)
|
icon = self.mood.icon(self.mainwindow.theme)
|
||||||
self.setIcon(0, icon)
|
self.setIcon(icon)
|
||||||
try:
|
try:
|
||||||
self.setTextColor(0, QtGui.QColor(self.mainwindow.theme["main/chums/moods"][self.mood.name()]["color"]))
|
self.setTextColor(QtGui.QColor(self.mainwindow.theme["main/chums/moods"][self.mood.name()]["color"]))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.setTextColor(0, QtGui.QColor(self.mainwindow.theme["main/chums/moods/chummy/color"]))
|
self.setTextColor(QtGui.QColor(self.mainwindow.theme["main/chums/moods/chummy/color"]))
|
||||||
def changeTheme(self, theme):
|
def changeTheme(self, theme):
|
||||||
icon = self.mood.icon(theme)
|
icon = self.mood.icon(theme)
|
||||||
self.setIcon(0, icon)
|
self.setIcon(icon)
|
||||||
try:
|
try:
|
||||||
self.setTextColor(0, QtGui.QColor(self.mainwindow.theme["main/chums/moods"][self.mood.name()]["color"]))
|
self.setTextColor(QtGui.QColor(self.mainwindow.theme["main/chums/moods"][self.mood.name()]["color"]))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.setTextColor(0, QtGui.QColor(self.mainwindow.theme["main/chums/moods/chummy/color"]))
|
self.setTextColor(QtGui.QColor(self.mainwindow.theme["main/chums/moods/chummy/color"]))
|
||||||
def __lt__(self, cl):
|
def __lt__(self, cl):
|
||||||
h1 = self.handle.lower()
|
h1 = self.handle.lower()
|
||||||
h2 = cl.handle.lower()
|
h2 = cl.handle.lower()
|
||||||
return (h1 < h2)
|
return (h1 < h2)
|
||||||
|
|
||||||
class chumArea(RightClickTree):
|
class chumArea(RightClickList):
|
||||||
def __init__(self, chums, parent=None):
|
def __init__(self, chums, parent=None):
|
||||||
QtGui.QTreeWidget.__init__(self, parent)
|
QtGui.QListWidget.__init__(self, parent)
|
||||||
self.mainwindow = parent
|
self.mainwindow = parent
|
||||||
theme = self.mainwindow.theme
|
theme = self.mainwindow.theme
|
||||||
self.chums = chums
|
self.chums = chums
|
||||||
gTemp = self.mainwindow.config.getGroups()
|
|
||||||
self.groups = [g[0] for g in gTemp]
|
|
||||||
self.openGroups = [g[1] for g in gTemp]
|
|
||||||
# quick hack to sort saved groups
|
|
||||||
self.mainwindow.config.addGroup("f3rskv9dssag[%3ffvsla09iv34G#$v")
|
|
||||||
self.mainwindow.config.delGroup("f3rskv9dssag[%3ffvsla09iv34G#$v")
|
|
||||||
# end quick hack
|
|
||||||
self.showAllGroups()
|
|
||||||
if not self.mainwindow.config.hideOfflineChums():
|
if not self.mainwindow.config.hideOfflineChums():
|
||||||
self.showAllChums()
|
self.showAllChums()
|
||||||
if not self.mainwindow.config.showEmptyGroups():
|
self.optionsMenu = QtGui.QMenu(self)
|
||||||
self.hideEmptyGroups()
|
|
||||||
self.chumoptions = QtGui.QMenu(self)
|
|
||||||
self.groupoptions = QtGui.QMenu(self)
|
|
||||||
self.optionsMenu = self.chumoptions
|
|
||||||
self.pester = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/pester"], self)
|
self.pester = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/pester"], self)
|
||||||
self.connect(self.pester, QtCore.SIGNAL('triggered()'),
|
self.connect(self.pester, QtCore.SIGNAL('triggered()'),
|
||||||
self, QtCore.SLOT('activateChum()'))
|
self, QtCore.SLOT('activateChum()'))
|
||||||
|
@ -519,83 +464,13 @@ class chumArea(RightClickTree):
|
||||||
self.logchum = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/viewlog"], self)
|
self.logchum = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/viewlog"], self)
|
||||||
self.connect(self.logchum, QtCore.SIGNAL('triggered()'),
|
self.connect(self.logchum, QtCore.SIGNAL('triggered()'),
|
||||||
self, QtCore.SLOT('openChumLogs()'))
|
self, QtCore.SLOT('openChumLogs()'))
|
||||||
|
self.optionsMenu.addAction(self.pester)
|
||||||
self.removegroup = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/removegroup"], self)
|
self.optionsMenu.addAction(self.logchum)
|
||||||
self.connect(self.removegroup, QtCore.SIGNAL('triggered()'),
|
self.optionsMenu.addAction(self.blockchum)
|
||||||
self, QtCore.SLOT('removeGroup()'))
|
self.optionsMenu.addAction(self.removechum)
|
||||||
self.renamegroup = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/renamegroup"], self)
|
|
||||||
self.connect(self.renamegroup, QtCore.SIGNAL('triggered()'),
|
|
||||||
self, QtCore.SLOT('renameGroup()'))
|
|
||||||
self.chumoptions.addAction(self.pester)
|
|
||||||
self.chumoptions.addAction(self.logchum)
|
|
||||||
self.chumoptions.addAction(self.blockchum)
|
|
||||||
self.chumoptions.addAction(self.removechum)
|
|
||||||
self.moveMenu = QtGui.QMenu(self.mainwindow.theme["main/menus/rclickchumlist/movechum"], self)
|
|
||||||
self.chumoptions.addMenu(self.moveMenu)
|
|
||||||
self.moveGroupMenu()
|
|
||||||
|
|
||||||
self.groupoptions.addAction(self.renamegroup)
|
|
||||||
self.groupoptions.addAction(self.removegroup)
|
|
||||||
|
|
||||||
self.initTheme(theme)
|
self.initTheme(theme)
|
||||||
#self.sortItems()
|
self.sortItems()
|
||||||
#self.sortItems(1, QtCore.Qt.AscendingOrder)
|
|
||||||
self.setSortingEnabled(False)
|
|
||||||
self.header().hide()
|
|
||||||
self.setDropIndicatorShown(False)
|
|
||||||
self.setIndentation(0)
|
|
||||||
self.setDragEnabled(True)
|
|
||||||
self.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
|
|
||||||
|
|
||||||
self.connect(self, QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem *, int)'),
|
|
||||||
self, QtCore.SLOT('expandGroup()'))
|
|
||||||
|
|
||||||
def dropEvent(self, event):
|
|
||||||
item = self.itemAt(event.pos())
|
|
||||||
if item:
|
|
||||||
if item.text(0) == "Chums" or item.text(0) in self.groups:
|
|
||||||
group = item.text(0)
|
|
||||||
else:
|
|
||||||
group = item.parent().text(0)
|
|
||||||
chumLabel = event.source().currentItem()
|
|
||||||
chumLabel.chum.group = group
|
|
||||||
self.mainwindow.chumdb.setGroup(chumLabel.chum.handle, group)
|
|
||||||
self.takeItem(chumLabel)
|
|
||||||
self.addItem(chumLabel)
|
|
||||||
|
|
||||||
def chumoptionsmenu(self):
|
|
||||||
self.optionsMenu = self.chumoptions
|
|
||||||
def groupoptionsmenu(self):
|
|
||||||
self.optionsMenu = self.groupoptions
|
|
||||||
def moveGroupMenu(self):
|
|
||||||
currentGroup = self.currentItem()
|
|
||||||
if currentGroup:
|
|
||||||
currentGroup = currentGroup.parent().text(0)
|
|
||||||
self.moveMenu.clear()
|
|
||||||
actGroup = QtGui.QActionGroup(self)
|
|
||||||
|
|
||||||
groups = self.groups[:]
|
|
||||||
groups.insert(0, "Chums")
|
|
||||||
for gtext in groups:
|
|
||||||
if gtext == currentGroup:
|
|
||||||
continue
|
|
||||||
movegroup = self.moveMenu.addAction(gtext)
|
|
||||||
actGroup.addAction(movegroup)
|
|
||||||
self.connect(actGroup, QtCore.SIGNAL('triggered(QAction *)'),
|
|
||||||
self, QtCore.SLOT('moveToGroup(QAction *)'))
|
|
||||||
def contextMenuEvent(self, event):
|
|
||||||
#fuckin Qt
|
|
||||||
if event.reason() == QtGui.QContextMenuEvent.Mouse:
|
|
||||||
listing = self.itemAt(event.pos())
|
|
||||||
self.setCurrentItem(listing)
|
|
||||||
if self.currentItem().text(0) == "Chums" or \
|
|
||||||
self.currentItem().text(0) in self.groups:
|
|
||||||
self.groupoptionsmenu()
|
|
||||||
else:
|
|
||||||
self.chumoptionsmenu()
|
|
||||||
self.moveGroupMenu()
|
|
||||||
self.optionsMenu.popup(event.globalPos())
|
|
||||||
|
|
||||||
def addChum(self, chum):
|
def addChum(self, chum):
|
||||||
if len([c for c in self.chums if c.handle == chum.handle]) != 0:
|
if len([c for c in self.chums if c.handle == chum.handle]) != 0:
|
||||||
return
|
return
|
||||||
|
@ -604,95 +479,29 @@ class chumArea(RightClickTree):
|
||||||
chum.mood.name() == "offline"):
|
chum.mood.name() == "offline"):
|
||||||
chumLabel = chumListing(chum, self.mainwindow)
|
chumLabel = chumListing(chum, self.mainwindow)
|
||||||
self.addItem(chumLabel)
|
self.addItem(chumLabel)
|
||||||
#self.topLevelItem(0).addChild(chumLabel)
|
self.sortItems()
|
||||||
#self.topLevelItem(0).sortChildren(0, QtCore.Qt.AscendingOrder)
|
|
||||||
|
|
||||||
def getChums(self, handle):
|
def getChums(self, handle):
|
||||||
chums = self.findItems(handle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive)
|
chums = self.findItems(handle, QtCore.Qt.MatchFlags(0))
|
||||||
return chums
|
return chums
|
||||||
|
|
||||||
def showAllChums(self):
|
def showAllChums(self):
|
||||||
for c in self.chums:
|
for c in self.chums:
|
||||||
chandle = c.handle
|
chandle = c.handle
|
||||||
if not len(self.findItems(chandle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive)):
|
if not self.findItems(chandle, QtCore.Qt.MatchFlags(0)):
|
||||||
chumLabel = chumListing(c, self.mainwindow)
|
chumLabel = chumListing(c, self.mainwindow)
|
||||||
self.addItem(chumLabel)
|
self.addItem(chumLabel)
|
||||||
#self.sortItems()
|
self.sortItems()
|
||||||
def hideOfflineChums(self):
|
def hideOfflineChums(self):
|
||||||
for j in range(self.topLevelItemCount()):
|
|
||||||
i = 0
|
i = 0
|
||||||
listing = self.topLevelItem(j).child(i)
|
listing = self.item(i)
|
||||||
while listing is not None:
|
while listing is not None:
|
||||||
if listing.chum.mood.name() == "offline":
|
if listing.chum.mood.name() == "offline":
|
||||||
self.topLevelItem(j).takeChild(i)
|
self.takeItem(i)
|
||||||
else:
|
else:
|
||||||
i += 1
|
i += 1
|
||||||
listing = self.topLevelItem(j).child(i)
|
listing = self.item(i)
|
||||||
self.topLevelItem(j).sortChildren(0, QtCore.Qt.AscendingOrder)
|
self.sortItems()
|
||||||
def showAllGroups(self):
|
|
||||||
curgroups = []
|
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
curgroups.append(self.topLevelItem(i).text(0))
|
|
||||||
if "Chums" not in curgroups:
|
|
||||||
child_1 = QtGui.QTreeWidgetItem(["Chums"])
|
|
||||||
self.addTopLevelItem(child_1)
|
|
||||||
if self.mainwindow.config.openDefaultGroup():
|
|
||||||
child_1.setExpanded(True)
|
|
||||||
for i,g in enumerate(self.groups):
|
|
||||||
if g not in curgroups:
|
|
||||||
child_1 = QtGui.QTreeWidgetItem(["%s" % (g)])
|
|
||||||
self.addTopLevelItem(child_1)
|
|
||||||
if self.openGroups[i]:
|
|
||||||
child_1.setExpanded(True)
|
|
||||||
def hideEmptyGroups(self):
|
|
||||||
i = 0
|
|
||||||
listing = self.topLevelItem(i)
|
|
||||||
while listing is not None:
|
|
||||||
if listing.childCount() == 0:
|
|
||||||
self.takeTopLevelItem(i)
|
|
||||||
else:
|
|
||||||
i += 1
|
|
||||||
listing = self.topLevelItem(i)
|
|
||||||
@QtCore.pyqtSlot()
|
|
||||||
def expandGroup(self):
|
|
||||||
item = self.currentItem()
|
|
||||||
if item.text(0) in self.groups:
|
|
||||||
self.mainwindow.config.delGroup(str(item.text(0)))
|
|
||||||
expand = item.isExpanded()
|
|
||||||
self.mainwindow.config.addGroup(str(item.text(0)), not expand)
|
|
||||||
elif item.text(0) == "Chums":
|
|
||||||
self.mainwindow.config.set("openDefaultGroup", not item.isExpanded())
|
|
||||||
def addItem(self, chumLabel):
|
|
||||||
if hasattr(self, 'groups'):
|
|
||||||
if chumLabel.chum.group not in self.groups:
|
|
||||||
self.topLevelItem(0).addChild(chumLabel)
|
|
||||||
self.topLevelItem(0).sortChildren(0, QtCore.Qt.AscendingOrder)
|
|
||||||
else:
|
|
||||||
if not self.findItems(chumLabel.handle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive):
|
|
||||||
if not self.findItems(chumLabel.chum.group, QtCore.Qt.MatchFlags(0)):
|
|
||||||
child_1 = QtGui.QTreeWidgetItem(["%s" % (chumLabel.chum.group)])
|
|
||||||
self.addTopLevelItem(child_1)
|
|
||||||
if self.openGroups[self.groups.index("%s" % (chumLabel.chum.group))]:
|
|
||||||
child_1.setExpanded(True)
|
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
if self.topLevelItem(i).text(0) == chumLabel.chum.group:
|
|
||||||
break
|
|
||||||
self.topLevelItem(i).addChild(chumLabel)
|
|
||||||
self.topLevelItem(i).sortChildren(0, QtCore.Qt.AscendingOrder)
|
|
||||||
else: # usually means this is now the trollslum
|
|
||||||
if not self.findItems(chumLabel.handle, QtCore.Qt.MatchContains | QtCore.Qt.MatchRecursive):
|
|
||||||
self.topLevelItem(0).addChild(chumLabel)
|
|
||||||
self.topLevelItem(0).sortChildren(0, QtCore.Qt.AscendingOrder)
|
|
||||||
def takeItem(self, chumLabel):
|
|
||||||
r = None
|
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
for j in range(self.topLevelItem(i).childCount()):
|
|
||||||
if self.topLevelItem(i).child(j).text(0) == chumLabel.chum.handle:
|
|
||||||
r = self.topLevelItem(i).takeChild(j)
|
|
||||||
break
|
|
||||||
if not self.mainwindow.config.showEmptyGroups():
|
|
||||||
self.hideEmptyGroups()
|
|
||||||
return r
|
|
||||||
def updateMood(self, handle, mood):
|
def updateMood(self, handle, mood):
|
||||||
hideoff = self.mainwindow.config.hideOfflineChums()
|
hideoff = self.mainwindow.config.hideOfflineChums()
|
||||||
chums = self.getChums(handle)
|
chums = self.getChums(handle)
|
||||||
|
@ -703,7 +512,7 @@ class chumArea(RightClickTree):
|
||||||
handle in [p.handle for p in self.chums]:
|
handle in [p.handle for p in self.chums]:
|
||||||
newLabel = chumListing([p for p in self.chums if p.handle == handle][0], self.mainwindow)
|
newLabel = chumListing([p for p in self.chums if p.handle == handle][0], self.mainwindow)
|
||||||
self.addItem(newLabel)
|
self.addItem(newLabel)
|
||||||
#self.sortItems()
|
self.sortItems()
|
||||||
chums = [newLabel]
|
chums = [newLabel]
|
||||||
elif mood.name() == "offline" and \
|
elif mood.name() == "offline" and \
|
||||||
len(chums) > 0:
|
len(chums) > 0:
|
||||||
|
@ -729,27 +538,14 @@ class chumArea(RightClickTree):
|
||||||
self.removechum.setText(theme["main/menus/rclickchumlist/removechum"])
|
self.removechum.setText(theme["main/menus/rclickchumlist/removechum"])
|
||||||
self.blockchum.setText(theme["main/menus/rclickchumlist/blockchum"])
|
self.blockchum.setText(theme["main/menus/rclickchumlist/blockchum"])
|
||||||
self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"])
|
self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"])
|
||||||
self.removegroup.setText(theme["main/menus/rclickchumlist/removegroup"])
|
|
||||||
self.renamegroup.setText(theme["main/menus/rclickchumlist/renamegroup"])
|
|
||||||
self.moveMenu.setTitle(theme["main/menus/rclickchumlist/movechum"])
|
|
||||||
def changeTheme(self, theme):
|
def changeTheme(self, theme):
|
||||||
self.initTheme(theme)
|
self.initTheme(theme)
|
||||||
chumlistings = []
|
chumlistings = [self.item(i) for i in range(0, self.count())]
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
for j in range(self.topLevelItem(i).childCount()):
|
|
||||||
chumlistings.append(self.topLevelItem(i).child(j))
|
|
||||||
#chumlistings = [self.item(i) for i in range(0, self.count())]
|
|
||||||
for c in chumlistings:
|
for c in chumlistings:
|
||||||
c.changeTheme(theme)
|
c.changeTheme(theme)
|
||||||
|
|
||||||
def count(self):
|
|
||||||
c = 0
|
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
c = c + self.topLevelItem(i).childCount()
|
|
||||||
return c
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def activateChum(self):
|
def activateChum(self):
|
||||||
self.itemActivated.emit(self.currentItem(), 0)
|
self.itemActivated.emit(self.currentItem())
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def removeChum(self, handle = None):
|
def removeChum(self, handle = None):
|
||||||
if handle:
|
if handle:
|
||||||
|
@ -761,7 +557,7 @@ class chumArea(RightClickTree):
|
||||||
currentChum = self.currentItem().chum
|
currentChum = self.currentItem().chum
|
||||||
self.chums = [c for c in self.chums if c.handle != currentChum.handle]
|
self.chums = [c for c in self.chums if c.handle != currentChum.handle]
|
||||||
self.removeChumSignal.emit(self.currentItem().chum.handle)
|
self.removeChumSignal.emit(self.currentItem().chum.handle)
|
||||||
oldlist = self.takeItem(self.currentItem())
|
oldlist = self.takeItem(self.currentRow())
|
||||||
del oldlist
|
del oldlist
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def blockChum(self):
|
def blockChum(self):
|
||||||
|
@ -771,7 +567,7 @@ class chumArea(RightClickTree):
|
||||||
self.blockChumSignal.emit(self.currentItem().chum.handle)
|
self.blockChumSignal.emit(self.currentItem().chum.handle)
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def openChumLogs(self):
|
def openChumLogs(self):
|
||||||
currentChum = self.currentItem().text(0)
|
currentChum = self.currentItem().text()
|
||||||
if not currentChum:
|
if not currentChum:
|
||||||
return
|
return
|
||||||
self.pesterlogviewer = PesterLogViewer(currentChum, self.mainwindow.config, self.mainwindow.theme, self.mainwindow)
|
self.pesterlogviewer = PesterLogViewer(currentChum, self.mainwindow.config, self.mainwindow.theme, self.mainwindow)
|
||||||
|
@ -786,59 +582,20 @@ class chumArea(RightClickTree):
|
||||||
self.pesterlogviewer = None
|
self.pesterlogviewer = None
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def renameGroup(self):
|
def renameGroup(self):
|
||||||
if not hasattr(self, 'renamegroupdialog'):
|
|
||||||
self.renamegroupdialog = None
|
|
||||||
if not self.renamegroupdialog:
|
|
||||||
(gname, ok) = QtGui.QInputDialog.getText(self, "Rename Group", "Enter a new name for the group:")
|
(gname, ok) = QtGui.QInputDialog.getText(self, "Rename Group", "Enter a new name for the group:")
|
||||||
if ok:
|
if ok:
|
||||||
gname = unicode(gname)
|
pass
|
||||||
currentGroup = self.currentItem()
|
#rename group
|
||||||
if not currentGroup:
|
|
||||||
return
|
|
||||||
index = self.indexOfTopLevelItem(currentGroup)
|
|
||||||
if index != -1:
|
|
||||||
expanded = currentGroup.isExpanded()
|
|
||||||
self.mainwindow.config.delGroup(str(currentGroup.text(0)))
|
|
||||||
self.mainwindow.config.addGroup(gname, expanded)
|
|
||||||
gTemp = self.mainwindow.config.getGroups()
|
|
||||||
self.groups = [g[0] for g in gTemp]
|
|
||||||
self.openGroups = [g[1] for g in gTemp]
|
|
||||||
for i in range(currentGroup.childCount()):
|
|
||||||
currentGroup.child(i).chum.group = gname
|
|
||||||
self.mainwindow.chumdb.setGroup(currentGroup.child(i).chum.handle, gname)
|
|
||||||
currentGroup.setText(0, gname)
|
|
||||||
self.renamegroupdialog = None
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def removeGroup(self):
|
def removeGroup(self):
|
||||||
currentGroup = self.currentItem()
|
pass
|
||||||
if not currentGroup:
|
#remove group
|
||||||
return
|
|
||||||
self.mainwindow.config.delGroup(currentGroup.text(0))
|
|
||||||
gTemp = self.mainwindow.config.getGroups()
|
|
||||||
self.groups = [g[0] for g in gTemp]
|
|
||||||
self.openGroups = [g[1] for g in gTemp]
|
|
||||||
for i in range(self.topLevelItemCount()):
|
|
||||||
if self.topLevelItem(i).text(0) == currentGroup.text(0):
|
|
||||||
break
|
|
||||||
while self.topLevelItem(i) and self.topLevelItem(i).child(0):
|
|
||||||
chumLabel = self.topLevelItem(i).child(0)
|
|
||||||
chumLabel.chum.group = "Chums"
|
|
||||||
self.mainwindow.chumdb.setGroup(chumLabel.chum.handle, "Chums")
|
|
||||||
self.takeItem(chumLabel)
|
|
||||||
self.addItem(chumLabel)
|
|
||||||
self.takeTopLevelItem(i)
|
|
||||||
@QtCore.pyqtSlot(QtGui.QAction)
|
@QtCore.pyqtSlot(QtGui.QAction)
|
||||||
def moveToGroup(self, item):
|
def moveToGroup(self, item):
|
||||||
if not item:
|
pass
|
||||||
return
|
#move to group
|
||||||
group = str(item.text())
|
|
||||||
chumLabel = self.currentItem()
|
|
||||||
if not chumLabel:
|
|
||||||
return
|
|
||||||
chumLabel.chum.group = group
|
|
||||||
self.mainwindow.chumdb.setGroup(chumLabel.chum.handle, group)
|
|
||||||
self.takeItem(chumLabel)
|
|
||||||
self.addItem(chumLabel)
|
|
||||||
|
|
||||||
removeChumSignal = QtCore.pyqtSignal(QtCore.QString)
|
removeChumSignal = QtCore.pyqtSignal(QtCore.QString)
|
||||||
blockChumSignal = QtCore.pyqtSignal(QtCore.QString)
|
blockChumSignal = QtCore.pyqtSignal(QtCore.QString)
|
||||||
|
@ -850,34 +607,19 @@ class trollSlum(chumArea):
|
||||||
theme = self.mainwindow.theme
|
theme = self.mainwindow.theme
|
||||||
self.setStyleSheet(theme["main/trollslum/chumroll/style"])
|
self.setStyleSheet(theme["main/trollslum/chumroll/style"])
|
||||||
self.chums = trolls
|
self.chums = trolls
|
||||||
child_1 = QtGui.QTreeWidgetItem([""])
|
|
||||||
self.addTopLevelItem(child_1)
|
|
||||||
child_1.setExpanded(True)
|
|
||||||
for c in self.chums:
|
for c in self.chums:
|
||||||
chandle = c.handle
|
chandle = c.handle
|
||||||
if not self.findItems(chandle, QtCore.Qt.MatchFlags(0)):
|
if not self.findItems(chandle, QtCore.Qt.MatchFlags(0)):
|
||||||
chumLabel = chumListing(c, self.mainwindow)
|
chumLabel = chumListing(c, self.mainwindow)
|
||||||
self.addItem(chumLabel)
|
self.addItem(chumLabel)
|
||||||
|
|
||||||
self.setSortingEnabled(False)
|
|
||||||
self.header().hide()
|
|
||||||
self.setDropIndicatorShown(False)
|
|
||||||
self.setIndentation(0)
|
|
||||||
|
|
||||||
self.optionsMenu = QtGui.QMenu(self)
|
self.optionsMenu = QtGui.QMenu(self)
|
||||||
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.SIGNAL('unblockChumSignal()'))
|
self, QtCore.SIGNAL('unblockChumSignal()'))
|
||||||
self.optionsMenu.addAction(self.unblockchum)
|
self.optionsMenu.addAction(self.unblockchum)
|
||||||
|
|
||||||
#self.sortItems()
|
self.sortItems()
|
||||||
def contextMenuEvent(self, event):
|
|
||||||
#fuckin Qt
|
|
||||||
if event.reason() == QtGui.QContextMenuEvent.Mouse:
|
|
||||||
listing = self.itemAt(event.pos())
|
|
||||||
self.setCurrentItem(listing)
|
|
||||||
if self.currentItem().text(0) != "":
|
|
||||||
self.optionsMenu.popup(event.globalPos())
|
|
||||||
def changeTheme(self, theme):
|
def changeTheme(self, theme):
|
||||||
self.setStyleSheet(theme["main/trollslum/chumroll/style"])
|
self.setStyleSheet(theme["main/trollslum/chumroll/style"])
|
||||||
self.removechum.setText(theme["main/menus/rclickchumlist/removechum"])
|
self.removechum.setText(theme["main/menus/rclickchumlist/removechum"])
|
||||||
|
@ -1094,10 +836,6 @@ class PesterWindow(MovingWindow):
|
||||||
self.logv = logv
|
self.logv = logv
|
||||||
self.connect(logv, QtCore.SIGNAL('triggered()'),
|
self.connect(logv, QtCore.SIGNAL('triggered()'),
|
||||||
self, QtCore.SLOT('openLogv()'))
|
self, QtCore.SLOT('openLogv()'))
|
||||||
grps = QtGui.QAction(self.theme["main/menus/client/addgroup"], self)
|
|
||||||
self.grps = grps
|
|
||||||
self.connect(grps, QtCore.SIGNAL('triggered()'),
|
|
||||||
self, QtCore.SLOT('addGroupWindow()'))
|
|
||||||
opts = QtGui.QAction(self.theme["main/menus/client/options"], self)
|
opts = QtGui.QAction(self.theme["main/menus/client/options"], self)
|
||||||
self.opts = opts
|
self.opts = opts
|
||||||
self.connect(opts, QtCore.SIGNAL('triggered()'),
|
self.connect(opts, QtCore.SIGNAL('triggered()'),
|
||||||
|
@ -1134,7 +872,6 @@ class PesterWindow(MovingWindow):
|
||||||
filemenu.addAction(logv)
|
filemenu.addAction(logv)
|
||||||
filemenu.addAction(userlistaction)
|
filemenu.addAction(userlistaction)
|
||||||
filemenu.addAction(self.idleaction)
|
filemenu.addAction(self.idleaction)
|
||||||
filemenu.addAction(grps)
|
|
||||||
filemenu.addAction(self.importaction)
|
filemenu.addAction(self.importaction)
|
||||||
filemenu.addAction(self.reconnectAction)
|
filemenu.addAction(self.reconnectAction)
|
||||||
filemenu.addAction(exitaction)
|
filemenu.addAction(exitaction)
|
||||||
|
@ -1195,7 +932,7 @@ class PesterWindow(MovingWindow):
|
||||||
chums = [PesterProfile(c, chumdb=self.chumdb) for c in set(self.config.chums())]
|
chums = [PesterProfile(c, chumdb=self.chumdb) for c in set(self.config.chums())]
|
||||||
self.chumList = chumArea(chums, self)
|
self.chumList = chumArea(chums, self)
|
||||||
self.connect(self.chumList,
|
self.connect(self.chumList,
|
||||||
QtCore.SIGNAL('itemActivated(QTreeWidgetItem *, int)'),
|
QtCore.SIGNAL('itemActivated(QListWidgetItem *)'),
|
||||||
self,
|
self,
|
||||||
QtCore.SLOT('pesterSelectedChum()'))
|
QtCore.SLOT('pesterSelectedChum()'))
|
||||||
self.connect(self.chumList,
|
self.connect(self.chumList,
|
||||||
|
@ -1301,10 +1038,10 @@ class PesterWindow(MovingWindow):
|
||||||
else:
|
else:
|
||||||
self.alarm.play()
|
self.alarm.play()
|
||||||
def newMemoMsg(self, chan, handle, msg):
|
def newMemoMsg(self, chan, handle, msg):
|
||||||
if not self.memos.has_key(chan):
|
if not self.memos.has_key(chan.upper()):
|
||||||
# silently ignore in case we forgot to /part
|
# silently ignore in case we forgot to /part
|
||||||
return
|
return
|
||||||
memo = self.memos[chan]
|
memo = self.memos[chan.upper()]
|
||||||
msg = unicode(msg)
|
msg = unicode(msg)
|
||||||
if not memo.times.has_key(handle):
|
if not memo.times.has_key(handle):
|
||||||
# new chum! time current
|
# new chum! time current
|
||||||
|
@ -1362,8 +1099,8 @@ class PesterWindow(MovingWindow):
|
||||||
def newMemo(self, channel, timestr, secret=False):
|
def newMemo(self, channel, timestr, secret=False):
|
||||||
if channel == "#pesterchum":
|
if channel == "#pesterchum":
|
||||||
return
|
return
|
||||||
if self.memos.has_key(channel):
|
if self.memos.has_key(channel.upper()):
|
||||||
self.memos[channel].showChat()
|
self.memos[channel.upper()].showChat()
|
||||||
return
|
return
|
||||||
# do slider dialog then set
|
# do slider dialog then set
|
||||||
if self.config.tabs():
|
if self.config.tabs():
|
||||||
|
@ -1384,7 +1121,7 @@ class PesterWindow(MovingWindow):
|
||||||
QtCore.SIGNAL('userPresentSignal(QString, QString, QString)'),
|
QtCore.SIGNAL('userPresentSignal(QString, QString, QString)'),
|
||||||
memoWindow, QtCore.SLOT('userPresentChange(QString, QString, QString)'))
|
memoWindow, QtCore.SLOT('userPresentChange(QString, QString, QString)'))
|
||||||
# chat client send memo open
|
# chat client send memo open
|
||||||
self.memos[channel] = memoWindow
|
self.memos[channel.upper()] = memoWindow
|
||||||
self.joinChannel.emit(channel) # race condition?
|
self.joinChannel.emit(channel) # race condition?
|
||||||
self.secret = secret
|
self.secret = secret
|
||||||
if self.secret:
|
if self.secret:
|
||||||
|
@ -1431,7 +1168,6 @@ class PesterWindow(MovingWindow):
|
||||||
# menus
|
# menus
|
||||||
self.menu.move(*theme["main/menu/loc"])
|
self.menu.move(*theme["main/menu/loc"])
|
||||||
self.logv.setText(theme["main/menus/client/logviewer"])
|
self.logv.setText(theme["main/menus/client/logviewer"])
|
||||||
self.grps.setText(theme["main/menus/client/addgroup"])
|
|
||||||
self.opts.setText(theme["main/menus/client/options"])
|
self.opts.setText(theme["main/menus/client/options"])
|
||||||
self.exitaction.setText(theme["main/menus/client/exit"])
|
self.exitaction.setText(theme["main/menus/client/exit"])
|
||||||
self.userlistaction.setText(theme["main/menus/client/userlist"])
|
self.userlistaction.setText(theme["main/menus/client/userlist"])
|
||||||
|
@ -1586,8 +1322,6 @@ class PesterWindow(MovingWindow):
|
||||||
def pesterSelectedChum(self):
|
def pesterSelectedChum(self):
|
||||||
curChum = self.chumList.currentItem()
|
curChum = self.chumList.currentItem()
|
||||||
if curChum:
|
if curChum:
|
||||||
if curChum.text(0) not in self.chumList.groups and \
|
|
||||||
curChum.text(0) != "Chums":
|
|
||||||
self.newConversationWindow(curChum)
|
self.newConversationWindow(curChum)
|
||||||
@QtCore.pyqtSlot(QtGui.QListWidgetItem)
|
@QtCore.pyqtSlot(QtGui.QListWidgetItem)
|
||||||
def newConversationWindow(self, chumlisting):
|
def newConversationWindow(self, chumlisting):
|
||||||
|
@ -1612,7 +1346,7 @@ class PesterWindow(MovingWindow):
|
||||||
c = unicode(channel)
|
c = unicode(channel)
|
||||||
self.chatlog.finish(c)
|
self.chatlog.finish(c)
|
||||||
self.leftChannel.emit(channel)
|
self.leftChannel.emit(channel)
|
||||||
del self.memos[c]
|
del self.memos[c.upper()]
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def tabsClosed(self):
|
def tabsClosed(self):
|
||||||
del self.tabconvo
|
del self.tabconvo
|
||||||
|
@ -1644,19 +1378,19 @@ class PesterWindow(MovingWindow):
|
||||||
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
||||||
def timeCommand(self, chan, handle, command):
|
def timeCommand(self, chan, handle, command):
|
||||||
(c, h, cmd) = (unicode(chan), unicode(handle), unicode(command))
|
(c, h, cmd) = (unicode(chan), unicode(handle), unicode(command))
|
||||||
if self.memos[c]:
|
if self.memos[c.upper()]:
|
||||||
self.memos[c].timeUpdate(h, cmd)
|
self.memos[c.upper()].timeUpdate(h, cmd)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(QtCore.QString, PesterList)
|
@QtCore.pyqtSlot(QtCore.QString, PesterList)
|
||||||
def updateNames(self, channel, names):
|
def updateNames(self, channel, names):
|
||||||
c = unicode(channel)
|
c = unicode(channel).upper()
|
||||||
# update name DB
|
# update name DB
|
||||||
self.namesdb[c] = names
|
self.namesdb[c] = names
|
||||||
# warn interested party of names
|
# warn interested party of names
|
||||||
self.namesUpdated.emit()
|
self.namesUpdated.emit()
|
||||||
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
@QtCore.pyqtSlot(QtCore.QString, QtCore.QString, QtCore.QString)
|
||||||
def userPresentUpdate(self, handle, channel, update):
|
def userPresentUpdate(self, handle, channel, update):
|
||||||
c = unicode(channel)
|
c = unicode(channel).upper()
|
||||||
n = unicode(handle)
|
n = unicode(handle)
|
||||||
if update == "nick":
|
if update == "nick":
|
||||||
l = n.split(":")
|
l = n.split(":")
|
||||||
|
@ -1929,25 +1663,6 @@ class PesterWindow(MovingWindow):
|
||||||
def closeLogUsers(self):
|
def closeLogUsers(self):
|
||||||
self.logusermenu.close()
|
self.logusermenu.close()
|
||||||
self.logusermenu = None
|
self.logusermenu = None
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
|
||||||
def addGroupWindow(self):
|
|
||||||
if not hasattr(self, 'addgroupdialog'):
|
|
||||||
self.addgroupdialog = None
|
|
||||||
if not self.addgroupdialog:
|
|
||||||
(gname, ok) = QtGui.QInputDialog.getText(self, "Add Group", "Enter a name for the new group:")
|
|
||||||
if ok:
|
|
||||||
gname = unicode(gname)
|
|
||||||
self.config.addGroup(gname)
|
|
||||||
gTemp = self.config.getGroups()
|
|
||||||
self.chumList.groups = [g[0] for g in gTemp]
|
|
||||||
self.chumList.openGroups = [g[1] for g in gTemp]
|
|
||||||
self.chumList.showAllGroups()
|
|
||||||
if not self.config.showEmptyGroups():
|
|
||||||
self.chumList.hideEmptyGroups()
|
|
||||||
|
|
||||||
self.addgroupdialog = None
|
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def openOpts(self):
|
def openOpts(self):
|
||||||
if not hasattr(self, 'optionmenu'):
|
if not hasattr(self, 'optionmenu'):
|
||||||
|
@ -2029,16 +1744,6 @@ class PesterWindow(MovingWindow):
|
||||||
self.config.set("time12Format", False)
|
self.config.set("time12Format", False)
|
||||||
secondssetting = self.optionmenu.secondscheck.isChecked()
|
secondssetting = self.optionmenu.secondscheck.isChecked()
|
||||||
self.config.set("showSeconds", secondssetting)
|
self.config.set("showSeconds", secondssetting)
|
||||||
# groups
|
|
||||||
#groupssetting = self.optionmenu.groupscheck.isChecked()
|
|
||||||
#self.config.set("useGroups", groupssetting)
|
|
||||||
emptygroupssetting = self.optionmenu.showemptycheck.isChecked()
|
|
||||||
curemptygroup = self.config.showEmptyGroups()
|
|
||||||
if curemptygroup and not emptygroupssetting:
|
|
||||||
self.chumList.hideEmptyGroups()
|
|
||||||
elif emptygroupssetting and not curemptygroup:
|
|
||||||
self.chumList.showAllGroups()
|
|
||||||
self.config.set("emptyGroups", emptygroupssetting)
|
|
||||||
self.optionmenu = None
|
self.optionmenu = None
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
"memos": "Memos",
|
"memos": "Memos",
|
||||||
"logviewer": "Pesterlogs",
|
"logviewer": "Pesterlogs",
|
||||||
"userlist": "Userlist",
|
"userlist": "Userlist",
|
||||||
"addgroup": "Add Group",
|
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
"reconnect": "Reconnect",
|
"reconnect": "Reconnect",
|
||||||
"idle": "Idle",
|
"idle": "Idle",
|
||||||
|
@ -39,9 +38,6 @@
|
||||||
"addchum": "Add Chum",
|
"addchum": "Add Chum",
|
||||||
"viewlog": "View Pesterlog",
|
"viewlog": "View Pesterlog",
|
||||||
"unblockchum": "Unblock",
|
"unblockchum": "Unblock",
|
||||||
"removegroup": "Remove Group",
|
|
||||||
"renamegroup": "Rename Group",
|
|
||||||
"movechum": "Move To",
|
|
||||||
"banuser": "Ban User",
|
"banuser": "Ban User",
|
||||||
"opuser": "Make OP",
|
"opuser": "Make OP",
|
||||||
"quirksoff": "Quirks Off"
|
"quirksoff": "Quirks Off"
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
"memos": "Memos",
|
"memos": "Memos",
|
||||||
"logviewer": "Pesterlogs",
|
"logviewer": "Pesterlogs",
|
||||||
"userlist": "Userlist",
|
"userlist": "Userlist",
|
||||||
"addgroup": "Add Group",
|
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
"reconnect": "Reconnect",
|
"reconnect": "Reconnect",
|
||||||
"idle": "Idle",
|
"idle": "Idle",
|
||||||
|
@ -41,9 +40,6 @@
|
||||||
"addchum": "Add Chum",
|
"addchum": "Add Chum",
|
||||||
"viewlog": "View Pesterlog",
|
"viewlog": "View Pesterlog",
|
||||||
"unblockchum": "Unblock",
|
"unblockchum": "Unblock",
|
||||||
"removegroup": "Remove Group",
|
|
||||||
"renamegroup": "Rename Group",
|
|
||||||
"movechum": "Move To",
|
|
||||||
"banuser": "Ban User",
|
"banuser": "Ban User",
|
||||||
"opuser": "Make OP",
|
"opuser": "Make OP",
|
||||||
"quirksoff": "Quirks Off"
|
"quirksoff": "Quirks Off"
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
"memos": "MEMOS",
|
"memos": "MEMOS",
|
||||||
"logviewer": "PESTERLOGS",
|
"logviewer": "PESTERLOGS",
|
||||||
"userlist": "USERLIST",
|
"userlist": "USERLIST",
|
||||||
"addgroup": "ADD GROUP",
|
|
||||||
"import": "IMPORT",
|
"import": "IMPORT",
|
||||||
"reconnect": "RECONNECT",
|
"reconnect": "RECONNECT",
|
||||||
"idle": "IDLE",
|
"idle": "IDLE",
|
||||||
|
@ -41,9 +40,6 @@
|
||||||
"addchum": "ADD CHUM",
|
"addchum": "ADD CHUM",
|
||||||
"viewlog": "VIEW PESTERLOG",
|
"viewlog": "VIEW PESTERLOG",
|
||||||
"unblockchum": "UNBLOCK",
|
"unblockchum": "UNBLOCK",
|
||||||
"removegroup": "REMOVE GROUP",
|
|
||||||
"renamegroup": "RENAME GROUP",
|
|
||||||
"movechum": "MOVE TO",
|
|
||||||
"banuser": "BAN USER",
|
"banuser": "BAN USER",
|
||||||
"opuser": "MAKE OP",
|
"opuser": "MAKE OP",
|
||||||
"quirksoff": "QUIRKS OFF"
|
"quirksoff": "QUIRKS OFF"
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
"memos": "Memos",
|
"memos": "Memos",
|
||||||
"logviewer": "Pesterlogs",
|
"logviewer": "Pesterlogs",
|
||||||
"userlist": "Fresh Targets",
|
"userlist": "Fresh Targets",
|
||||||
"addgroup": "Add Group",
|
|
||||||
"import": "import U2;",
|
"import": "import U2;",
|
||||||
"reconnect": "Reconnect",
|
|
||||||
"idle": "Idle",
|
"idle": "Idle",
|
||||||
"exit": "Abscond"},
|
"exit": "Abscond"},
|
||||||
"profile": {"_name": "View",
|
"profile": {"_name": "View",
|
||||||
|
@ -40,9 +38,6 @@
|
||||||
"addchum": "Add Chump",
|
"addchum": "Add Chump",
|
||||||
"viewlog": "View Pesterlog",
|
"viewlog": "View Pesterlog",
|
||||||
"unblockchum": "Mercy",
|
"unblockchum": "Mercy",
|
||||||
"removegroup": "Remove Group",
|
|
||||||
"renamegroup": "Rename Group",
|
|
||||||
"movechum": "Move To",
|
|
||||||
"banuser": "Ban",
|
"banuser": "Ban",
|
||||||
"opuser": "Promote",
|
"opuser": "Promote",
|
||||||
"quirksoff": "Quirks Off" }
|
"quirksoff": "Quirks Off" }
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
"memos": "Bulletin Boards",
|
"memos": "Bulletin Boards",
|
||||||
"logviewer": "Pesterlogs",
|
"logviewer": "Pesterlogs",
|
||||||
"userlist": "Userlist",
|
"userlist": "Userlist",
|
||||||
"addgroup": "Add Group",
|
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
"idle": "Idle",
|
"idle": "Idle",
|
||||||
"reconnect": "Reconnect",
|
"reconnect": "Reconnect",
|
||||||
|
@ -41,9 +40,6 @@
|
||||||
"addchum": "Add User",
|
"addchum": "Add User",
|
||||||
"viewlog": "View Pesterlog",
|
"viewlog": "View Pesterlog",
|
||||||
"unblockchum": "Forgive",
|
"unblockchum": "Forgive",
|
||||||
"removegroup": "Remove Group",
|
|
||||||
"renamegroup": "Rename Group",
|
|
||||||
"movechum": "Move To",
|
|
||||||
"banuser": "Expel User",
|
"banuser": "Expel User",
|
||||||
"opuser": "Promote",
|
"opuser": "Promote",
|
||||||
"quirksoff": "Quirks Off"
|
"quirksoff": "Quirks Off"
|
||||||
|
|
Loading…
Reference in a new issue