Mainwindow tab indexes

This commit is contained in:
Olivier Keshavjee 2015-07-09 15:30:59 +02:00
parent a022a1d1b4
commit 4e4be8e0c9
2 changed files with 6 additions and 5 deletions

View file

@ -31,7 +31,8 @@ except ImportError:
class MainWindow(QMainWindow, Ui_MainWindow):
dictChanged = pyqtSignal(str)
# Tab indexes
TabInfos = 0
TabSummary = 1
TabPersos = 2

View file

@ -504,7 +504,7 @@ def open(ref):
item = mw.lstPersos.getItemByID(_ref)
if item:
mw.tabMain.setCurrentIndex(2)
mw.tabMain.setCurrentIndex(mw.TabPersos)
mw.lstPersos.setCurrentItem(item)
return True
@ -516,7 +516,7 @@ def open(ref):
index = mw.mdlOutline.getIndexByID(_ref)
if index.isValid():
mw.tabMain.setCurrentIndex(6)
mw.tabMain.setCurrentIndex(mw.TabRedac)
mw.mainEditor.setCurrentModelIndex(index, newTab=True)
return True
else:
@ -528,7 +528,7 @@ def open(ref):
item = mw.lstPlots.getItemByID(_ref)
if item:
mw.tabMain.setCurrentIndex(3)
mw.tabMain.setCurrentIndex(mw.TabPlots)
mw.lstPlots.setCurrentItem(item)
return True
@ -540,7 +540,7 @@ def open(ref):
item = mw.mdlWorld.itemByID(_ref)
if item:
mw.tabMain.setCurrentIndex(4)
mw.tabMain.setCurrentIndex(mw.TabWorld)
mw.treeWorld.setCurrentIndex(
mw.mdlWorld.indexFromItem(item))
return True