Bug fix: Highlight correct tab after moving tabs around

This commit is contained in:
Kiooeht 2011-05-06 02:07:44 -07:00
parent 35d0273d68
commit 602e4c741f

View file

@ -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):