This commit is contained in:
Olivier Keshavjee 2015-06-22 21:07:38 +02:00
parent 8d0e83a3b3
commit eeff279deb
5 changed files with 17 additions and 14 deletions

View file

@ -51,4 +51,4 @@ def launch():
if __name__ == "__main__":
run()
run()

View file

@ -207,8 +207,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
return str(k)
def checkPersosID(self):
"Checks whether some persos ID (row 1) are empty, if so, assign an ID"
empty = []
"""Checks whether some persos ID (row 1) are empty, if so, assign an ID"""
for i in range(self.mdlPersos.rowCount()):
item = self.mdlPersos.item(i, Perso.ID.value)
if not item:
@ -309,7 +308,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.lstSubPlots.setRootIndex(index.sibling(index.row(), Plot.subplots.value))
#self.txtSubPlotSummary.setCurrentModelIndex(QModelIndex())
self.txtSubPlotSummary.setEnabled(False)
self._updatingSubPlot = True
self.txtSubPlotSummary.setPlainText("")
self._updatingSubPlot = False
def changeCurrentSubPlot(self, index):
# Got segfaults when using my textEditView model system, so ad hoc stuff.
@ -323,7 +324,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self._updatingSubPlot = True
self.txtSubPlotSummary.setPlainText(txt)
self._updatingSubPlot = False
self.txtSubPlotSummary.document().contentsChanged.connect(self.updateSubPlotSummary)
def updateSubPlotSummary(self):
if self._updatingSubPlot:
@ -479,9 +479,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.lstPlots.currentItemChanged.connect(self.changeCurrentPlot)
self.lstPlotPerso.setModel(self.mdlPlots)
self.lstSubPlots.setModel(self.mdlPlots)
#self.txtSubPlotSummary.setModel(self.mdlPlots)
#self.txtSubPlotSummary.setColumn(1)
self.lstSubPlots.selectionModel().currentChanged.connect(self.changeCurrentSubPlot)
self._updatingSubPlot = False
self.txtSubPlotSummary.document().contentsChanged.connect(self.updateSubPlotSummary)
self.lstSubPlots.activated.connect(self.changeCurrentSubPlot)
self.btnAddPlot.clicked.connect(self.mdlPlots.addPlot)
self.btnRmPlot.clicked.connect(lambda: self.mdlPlots.removePlot(self.lstPlots.currentPlotIndex()))
self.btnAddSubPlot.clicked.connect(self.mdlPlots.addSubPlot)

View file

@ -114,6 +114,9 @@ class plotModel(QStandardItemModel):
# Don't know why, if summary is in third position, then drag/drop deletes it...
parentItem.appendRow([p, _id, QStandardItem(), summary])
# Select last index
self.mw.lstSubPlots.setCurrentIndex(parent.child(self.rowCount(parent)-1, 0))
def removeSubPlot(self):
index = self.mw.lstSubPlots.currentIndex()

View file

@ -1111,7 +1111,7 @@ class Ui_MainWindow(object):
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MainWindow)
self.tabMain.setCurrentIndex(5)
self.tabMain.setCurrentIndex(3)
self.tabSummary.setCurrentIndex(0)
self.tabPersos.setCurrentIndex(0)
self.tabPlot.setCurrentIndex(0)
@ -1258,12 +1258,12 @@ class Ui_MainWindow(object):
self.actSettings.setText(_translate("MainWindow", "Settings"))
self.actSettings.setShortcut(_translate("MainWindow", "F8"))
from ui.views.outlineView import outlineView
from ui.editors.editorWidget import editorWidget
from ui.views.metadataView import metadataView
from ui.views.plotTreeView import plotTreeView
from ui.views.treeView import treeView
from ui.editors.editorWidget import editorWidget
from ui.views.outlineView import outlineView
from ui.sldImportance import sldImportance
from ui.views.lineEditView import lineEditView
from ui.views.basicItemView import basicItemView
from ui.views.treeView import treeView
from ui.views.plotTreeView import plotTreeView
from ui.views.textEditView import textEditView
from ui.sldImportance import sldImportance

View file

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabMain">
<property name="currentIndex">
<number>5</number>
<number>3</number>
</property>
<property name="documentMode">
<bool>true</bool>