Clear the outline header between projects

This commit is contained in:
Veronica K. B. Olsen
2020-04-14 22:20:40 +02:00
parent 6a9ff4c46b
commit 5e90b1ff77
3 changed files with 17 additions and 5 deletions
+10 -5
View File
@@ -97,24 +97,29 @@ class GuiProjectOutline(QTreeWidget):
self.colIndex = {}
self.treeNCols = 0
self.initOutline()
self.clearOutline()
self.headerMenu.setHiddenState(self.colHidden)
logger.debug("ProjectOutline initialisation complete")
return
def initOutline(self):
"""Set the default values for the Outline tree.
def clearOutline(self):
"""Clear the tree and header and set the default values for the
columns arrays.
"""
self.clear()
self.setColumnCount(1)
self.setHeaderLabel(nwLabels.OUTLINE_COLS[nwOutline.TITLE])
self.treeOrder = []
self.colWidth = {}
self.colHidden = {}
self.colIndex = {}
self.treeNCols = 0
for hItem in nwOutline:
for i, hItem in enumerate(nwOutline):
self.treeOrder.append(hItem)
self.colWidth[hItem] = self.DEF_WIDTH[hItem]
self.colHidden[hItem] = self.DEF_HIDDEN[hItem]
@@ -153,7 +158,7 @@ class GuiProjectOutline(QTreeWidget):
"""Called before a project is closed.
"""
self._saveHeaderState()
self.clear()
self.clearOutline()
self.firstView = True
return