From 381c77696dc804c559ca614f44a809a7e18fb76d Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Mon, 9 May 2011 09:32:30 -0700 Subject: [PATCH] Bug fix: Change nick in memos on profile switch --- TODO.mkdn | 1 - irc.py | 1 + memos.py | 2 -- menus.py | 2 +- pesterchum.py | 15 ++++++++++----- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/TODO.mkdn b/TODO.mkdn index 7d43f70..54219d8 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -19,7 +19,6 @@ Bugs * 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 * Leave memos on reconnect, needs to auto-rejoin memos -* Leave memos on profile change (should just change nick) * When using mood sort, scroll position jumps to last selected chum Mac Bugs diff --git a/irc.py b/irc.py index ff96e68..5f632ef 100644 --- a/irc.py +++ b/irc.py @@ -135,6 +135,7 @@ class PesterIRC(QtCore.QThread): helpers.nick(self.cli, handle) except socket.error: self.setConnectionBroken() + self.mainwindow.closeConversations(True) self.updateMood() @QtCore.pyqtSlot() def updateMood(self): diff --git a/memos.py b/memos.py index 9ebd64c..247a157 100644 --- a/memos.py +++ b/memos.py @@ -475,10 +475,8 @@ class PesterMemo(PesterConvo): self.userlist.optionsMenu.setStyleSheet(theme["main/defaultwindow/style"]) if theme.has_key("main/chums/scrollbar"): - print "yes scrollbars!" self.setStyleSheet("QListWidget { %s } QScrollBar { %s } QScrollBar::handle { %s } QScrollBar::add-line { %s } QScrollBar::sub-line { %s } QScrollBar:up-arrow { %s } QScrollBar:down-arrow { %s }" % (theme["memos/userlist/style"], theme["main/chums/scrollbar/style"], theme["main/chums/scrollbar/handle"], theme["main/chums/scrollbar/downarrow"], theme["main/chums/scrollbar/uparrow"], theme["main/chums/scrollbar/uarrowstyle"], theme["main/chums/scrollbar/darrowstyle"] )) else: - print "no scroll bars :(" self.userlist.setStyleSheet(theme["memos/userlist/style"]) self.userlist.setFixedWidth(theme["memos/userlist/width"]) self.addchumAction.setText(theme["main/menus/rclickchumlist/addchum"]) diff --git a/menus.py b/menus.py index a5398db..706ca44 100644 --- a/menus.py +++ b/menus.py @@ -751,7 +751,6 @@ class PesterOptions(QtGui.QDialog): widget = QtGui.QWidget() layout_chat = QtGui.QVBoxLayout(widget) layout_chat.setAlignment(QtCore.Qt.AlignTop) - layout_chat.addWidget(self.tabcheck) layout_chat.addWidget(self.timestampcheck) layout_chat.addWidget(self.timestampBox) layout_chat.addWidget(self.secondscheck) @@ -765,6 +764,7 @@ class PesterOptions(QtGui.QDialog): widget = QtGui.QWidget() layout_interface = QtGui.QVBoxLayout(widget) layout_interface.setAlignment(QtCore.Qt.AlignTop) + layout_interface.addWidget(self.tabcheck) layout_interface.addLayout(layout_mini) layout_interface.addLayout(layout_close) self.pages.addWidget(widget) diff --git a/pesterchum.py b/pesterchum.py index eca4859..b337b5e 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1489,7 +1489,7 @@ class PesterWindow(MovingWindow): def profile(self): return self.userprofile.chat - def closeConversations(self): + def closeConversations(self, switch=False): if not hasattr(self, 'tabconvo'): self.tabconvo = None if self.tabconvo: @@ -1498,10 +1498,17 @@ class PesterWindow(MovingWindow): for c in self.convos.values(): c.close() if self.tabmemo: - self.tabmemo.close() + if not switch: + self.tabmemo.close() + else: + for m in self.tabmemo.convos: + self.tabmemo.convos[m].sendtime() else: for m in self.memos.values(): - m.close() + if not switch: + m.close() + else: + m.sendtime() def paintEvent(self, event): palette = QtGui.QPalette() palette.setBrush(QtGui.QPalette.Window, QtGui.QBrush(self.backgroundImage)) @@ -2441,8 +2448,6 @@ class PesterWindow(MovingWindow): # is default? if self.chooseprofile.defaultcheck.isChecked(): self.config.set("defaultprofile", self.userprofile.chat.handle) - # this may have to be fixed - self.closeConversations() if hasattr(self, 'trollslum') and self.trollslum: self.trollslum.close() self.chooseprofile = None