Separate convo and memo tabbed/untabbed

This commit is contained in:
Kiooeht 2011-11-07 19:44:17 -08:00
parent 6dacc4c4de
commit d525790897
5 changed files with 45 additions and 12 deletions

View file

@ -38,6 +38,7 @@ CHANGELOG
* Low-bandwidth mode - Kiooeht [evacipatedBox] (Idea: [canLover])
* New smilies - Kiooeht [evacipatedBox]
* Refresh theme in options - Kiooeht [evacipatedBox]
* Separate tabbed/untabbed windows for conversaions and memos - Kiooeht [evacipatedBox]
* Bug fixes
* Don't delete random chum when blocking someone not on chumroll - Kiooeht [evacipatedBox]
* Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox]

View file

@ -24,7 +24,6 @@ Features
* "Pester" menu option to just pester a handle
* Auto-login Nickserv
* Make toast notifications only on certain chums
* Separate tabbed/untabbed memos and convos
Bugs
----

View file

@ -1021,6 +1021,9 @@ class PesterOptions(QtGui.QDialog):
self.tabcheck = QtGui.QCheckBox("Tabbed Conversations", self)
if self.config.tabs():
self.tabcheck.setChecked(True)
self.tabmemocheck = QtGui.QCheckBox("Tabbed Memos", self)
if self.config.tabMemos():
self.tabmemocheck.setChecked(True)
self.hideOffline = QtGui.QCheckBox("Hide Offline Chums", self)
if self.config.hideOfflineChums():
self.hideOffline.setChecked(True)
@ -1278,6 +1281,7 @@ class PesterOptions(QtGui.QDialog):
layout_interface = QtGui.QVBoxLayout(widget)
layout_interface.setAlignment(QtCore.Qt.AlignTop)
layout_interface.addWidget(self.tabcheck)
layout_interface.addWidget(self.tabmemocheck)
layout_interface.addLayout(layout_mini)
layout_interface.addLayout(layout_close)
layout_interface.addWidget(self.pesterBlink)

View file

@ -1349,7 +1349,7 @@ class PesterWindow(MovingWindow):
self.memos[channel].showChat()
return
# do slider dialog then set
if self.config.tabs():
if self.config.tabMemos():
if not self.tabmemo:
self.createMemoTabWindow()
memoWindow = PesterMemo(channel, timestr, self, self.tabmemo)
@ -1388,7 +1388,6 @@ class PesterWindow(MovingWindow):
self.moodRequest.emit(chum)
def addGroup(self, gname):
print gname
self.config.addGroup(gname)
gTemp = self.config.getGroups()
self.chumList.groups = [g[0] for g in gTemp]
@ -1638,8 +1637,14 @@ class PesterWindow(MovingWindow):
@QtCore.pyqtSlot(QtCore.QString)
def closeConvo(self, handle):
h = unicode(handle)
chum = self.convos[h].chum
chumopen = self.convos[h].chumopen
try:
chum = self.convos[h].chum
except KeyError:
chum = self.convos[h.lower()].chum
try:
chumopen = self.convos[h].chumopen
except KeyError:
chumopen = self.convos[h.lower()].chumopen
if chumopen:
self.chatlog.log(chum.handle, self.profile().pestermsg(chum, QtGui.QColor(self.theme["convo/systemMsgColor"]), self.theme["convo/text/ceasepester"]))
self.convoClosed.emit(handle)
@ -1650,7 +1655,10 @@ class PesterWindow(MovingWindow):
c = unicode(channel)
self.chatlog.finish(c)
self.leftChannel.emit(channel)
del self.memos[c]
try:
del self.memos[c]
except KeyError:
del self.memos[c.lower()]
@QtCore.pyqtSlot()
def tabsClosed(self):
del self.tabconvo
@ -1792,7 +1800,6 @@ class PesterWindow(MovingWindow):
group = newgroup if newgroup else selectedGroup
if ok:
handle = unicode(handle)
print self.chumList.chums
if handle in [h.handle for h in self.chumList.chums]:
return
if not (PesterProfile.checkLength(handle) and
@ -2093,8 +2100,6 @@ class PesterWindow(MovingWindow):
windows = []
if self.tabconvo:
windows = list(self.tabconvo.convos.values())
if self.tabmemo:
windows += list(self.tabmemo.convos.values())
for w in windows:
w.setParent(None)
@ -2102,8 +2107,6 @@ class PesterWindow(MovingWindow):
w.raiseChat()
if self.tabconvo:
self.tabconvo.closeSoft()
if self.tabmemo:
self.tabmemo.closeSoft()
# save options
self.config.set("tabs", tabsetting)
elif tabsetting and not curtab:
@ -2116,6 +2119,28 @@ class PesterWindow(MovingWindow):
self.tabconvo.show()
newconvos[h] = c
self.convos = newconvos
# save options
self.config.set("tabs", tabsetting)
# tabs memos
curtabmemo = self.config.tabMemos()
tabmemosetting = self.optionmenu.tabmemocheck.isChecked()
if curtabmemo and not tabmemosetting:
# split tabs into windows
windows = []
if self.tabmemo:
windows = list(self.tabmemo.convos.values())
for w in windows:
w.setParent(None)
w.show()
w.raiseChat()
if self.tabmemo:
self.tabmemo.closeSoft()
# save options
self.config.set("tabmemos", tabmemosetting)
elif tabmemosetting and not curtabmemo:
# combine
newmemos = {}
self.createMemoTabWindow()
for (h,m) in self.memos.iteritems():
@ -2125,7 +2150,7 @@ class PesterWindow(MovingWindow):
newmemos[h] = m
self.memos = newmemos
# save options
self.config.set("tabs", tabsetting)
self.config.set("tabmemos", tabmemosetting)
# hidden chums
chumsetting = self.optionmenu.hideOffline.isChecked()
curchum = self.config.hideOfflineChums()

View file

@ -130,6 +130,10 @@ class userConfig(object):
return None
def tabs(self):
return self.config.get("tabs", True)
def tabMemos(self):
if not self.config.has_key('tabmemos'):
self.set("tabmemos", self.tabs())
return self.config.get("tabmemos", True)
def showTimeStamps(self):
if not self.config.has_key('showTimeStamps'):
self.set("showTimeStamps", True)