Merged the indices so we have a minimum of dictionaries

This commit is contained in:
Veronica K. B. Olsen
2019-11-17 15:45:38 +01:00
parent 6500d23bd7
commit 612c2ef328
3 changed files with 120 additions and 104 deletions
+9 -8
View File
@@ -83,9 +83,9 @@ class GuiProjectOutline(QWidget):
self.showSynopsis = True
self.showFilePath = False
self.outerBox = QVBoxLayout()
self.mainTree = QTreeWidget()
self.treeOrder = self.COL_ORDER
self.outerBox = QVBoxLayout()
self.mainTree = QTreeWidget()
self.treeCols = self.COL_ORDER
self.outerBox.addWidget(self.mainTree)
self.outerBox.setContentsMargins(0,0,0,0)
@@ -98,7 +98,7 @@ class GuiProjectOutline(QWidget):
def populateTree(self):
theLabels = []
for n in self.treeOrder:
for n in self.treeCols:
theLabels.append(self.COL_LABELS[n])
self.mainTree.clear()
@@ -113,16 +113,18 @@ class GuiProjectOutline(QWidget):
currChapter = None
currScene = None
theTitles = self.theIndex.getNovelStructure()
for tHandle in self.theProject.treeOrder:
if tHandle not in self.theIndex.novelIndex:
continue
for sTitle in self.theIndex.novelIndex[tHandle]:
nwItem = self.theProject.getItem(tHandle)
tTitle = self.theIndex.novelIndex[tHandle][sTitle][1]
tLevel = self.theIndex.novelIndex[tHandle][sTitle][0]
tTitle = self.theIndex.novelIndex[tHandle][sTitle]["title"]
tLevel = self.theIndex.novelIndex[tHandle][sTitle]["level"]
tLabel = nwItem.itemName
tItem = self._createTreeItem(tHandle, sTitle, tTitle, tLevel, tLabel)
@@ -217,5 +219,4 @@ class GuiProjectOutline(QWidget):
return newItem
# END Class GuiProjectOutline