Clear the outline header between projects
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -315,6 +315,7 @@ class GuiMain(QMainWindow):
|
||||
self.theIndex.clearIndex()
|
||||
self.clearGUI()
|
||||
self.hasProject = False
|
||||
self.tabWidget.setCurrentWidget(self.splitView)
|
||||
|
||||
return saveOK
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ class OptionState():
|
||||
"""Load the options dictionary from the project settings file.
|
||||
"""
|
||||
|
||||
if self.theProject.projMeta is None:
|
||||
return False
|
||||
|
||||
stateFile = path.join(self.theProject.projMeta, nwFiles.OPTS_FILE)
|
||||
theState = {}
|
||||
|
||||
@@ -60,6 +63,9 @@ class OptionState():
|
||||
"""Save the options dictionary to the project settings file.
|
||||
"""
|
||||
|
||||
if self.theProject.projMeta is None:
|
||||
return False
|
||||
|
||||
stateFile = path.join(self.theProject.projMeta, nwFiles.OPTS_FILE)
|
||||
logger.debug("Saving GUI options file")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user