From 602e4c741fdb5e3d9dde0965dcab1fcf22ab15d7 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Fri, 6 May 2011 02:07:44 -0700 Subject: [PATCH] Bug fix: Highlight correct tab after moving tabs around --- convo.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/convo.py b/convo.py index b6f748b..b2b09c8 100644 --- a/convo.py +++ b/convo.py @@ -25,6 +25,8 @@ class PesterTabWindow(QtGui.QFrame): self, QtCore.SLOT('changeTab(int)')) self.connect(self.tabs, QtCore.SIGNAL('tabCloseRequested(int)'), self, QtCore.SLOT('tabClose(int)')) + self.connect(self.tabs, QtCore.SIGNAL('tabMoved(int, int)'), + self, QtCore.SLOT('tabMoved(int, int)')) self.initTheme(self.mainwindow.theme) self.layout = QtGui.QVBoxLayout() @@ -195,6 +197,17 @@ class PesterTabWindow(QtGui.QFrame): self.raise_() convo.raiseChat() + @QtCore.pyqtSlot(int, int) + def tabMoved(self, to, fr): + l = self.tabIndices + for i in l: + if l[i] == fr: + oldpos = i + if l[i] == to: + newpos = i + l[oldpos] = to + l[newpos] = fr + windowClosed = QtCore.pyqtSignal() class PesterText(QtGui.QTextEdit):