Fixed a bug where outline header state from previous seession was restored on outline update
This commit is contained in:
+18
-14
@@ -130,7 +130,7 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# If it's the first time, we always build
|
# If it's the first time, we always build
|
||||||
if self.firstView or overRide:
|
if self.firstView or self.firstView and overRide:
|
||||||
self._loadHeaderState()
|
self._loadHeaderState()
|
||||||
self._populateTree()
|
self._populateTree()
|
||||||
self.firstView = False
|
self.firstView = False
|
||||||
@@ -176,6 +176,7 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
of the columns.
|
of the columns.
|
||||||
"""
|
"""
|
||||||
self.treeOrder.insert(newVisualIdx, self.treeOrder.pop(oldVisualIdx))
|
self.treeOrder.insert(newVisualIdx, self.treeOrder.pop(oldVisualIdx))
|
||||||
|
self._saveHeaderState()
|
||||||
return
|
return
|
||||||
|
|
||||||
def _menuColumnToggled(self, isChecked, theItem):
|
def _menuColumnToggled(self, isChecked, theItem):
|
||||||
@@ -185,6 +186,7 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
logger.verbose("User toggled Outline column '%s'" % theItem.name)
|
logger.verbose("User toggled Outline column '%s'" % theItem.name)
|
||||||
if theItem in self.colIndex:
|
if theItem in self.colIndex:
|
||||||
self.setColumnHidden(self.colIndex[theItem], not isChecked)
|
self.setColumnHidden(self.colIndex[theItem], not isChecked)
|
||||||
|
self._saveHeaderState()
|
||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -282,21 +284,23 @@ class GuiProjectOutline(QTreeWidget):
|
|||||||
"""Build the tree based on the project index.
|
"""Build the tree based on the project index.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
theLabels = []
|
|
||||||
for i, hItem in enumerate(self.treeOrder):
|
|
||||||
theLabels.append(nwLabels.OUTLINE_COLS[hItem])
|
|
||||||
self.colIndex[hItem] = i
|
|
||||||
|
|
||||||
self.clear()
|
self.clear()
|
||||||
self.setHeaderLabels(theLabels)
|
|
||||||
for hItem in self.treeOrder:
|
|
||||||
self.setColumnWidth(self.colIndex[hItem], self.colWidth[hItem])
|
|
||||||
self.setColumnHidden(self.colIndex[hItem], self.colHidden[hItem])
|
|
||||||
|
|
||||||
headItem = self.headerItem()
|
if self.firstView:
|
||||||
headItem.setTextAlignment(self.colIndex[nwOutline.CCOUNT], Qt.AlignRight)
|
theLabels = []
|
||||||
headItem.setTextAlignment(self.colIndex[nwOutline.WCOUNT], Qt.AlignRight)
|
for i, hItem in enumerate(self.treeOrder):
|
||||||
headItem.setTextAlignment(self.colIndex[nwOutline.PCOUNT], Qt.AlignRight)
|
theLabels.append(nwLabels.OUTLINE_COLS[hItem])
|
||||||
|
self.colIndex[hItem] = i
|
||||||
|
|
||||||
|
self.setHeaderLabels(theLabels)
|
||||||
|
for hItem in self.treeOrder:
|
||||||
|
self.setColumnWidth(self.colIndex[hItem], self.colWidth[hItem])
|
||||||
|
self.setColumnHidden(self.colIndex[hItem], self.colHidden[hItem])
|
||||||
|
|
||||||
|
headItem = self.headerItem()
|
||||||
|
headItem.setTextAlignment(self.colIndex[nwOutline.CCOUNT], Qt.AlignRight)
|
||||||
|
headItem.setTextAlignment(self.colIndex[nwOutline.WCOUNT], Qt.AlignRight)
|
||||||
|
headItem.setTextAlignment(self.colIndex[nwOutline.PCOUNT], Qt.AlignRight)
|
||||||
|
|
||||||
currTitle = None
|
currTitle = None
|
||||||
currChapter = None
|
currChapter = None
|
||||||
|
|||||||
@@ -4,3 +4,4 @@
|
|||||||
@location: Earth
|
@location: Earth
|
||||||
|
|
||||||
%synopsis: We can add a chapter file, but keep the scene files separate. In the chapter file we can set the meta data that applies to the whole chapter if we wish to.
|
%synopsis: We can add a chapter file, but keep the scene files separate. In the chapter file we can set the meta data that applies to the whole chapter if we wish to.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<novelWriterXML appVersion="0.4.5" fileVersion="1.0" saveCount="31" autoCount="5" timeStamp="2020-04-13 15:55:18">
|
<novelWriterXML appVersion="0.4.5" fileVersion="1.0" saveCount="38" autoCount="8" timeStamp="2020-04-13 16:55:55">
|
||||||
<project>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<charCount>12</charCount>
|
<charCount>12</charCount>
|
||||||
<wordCount>3</wordCount>
|
<wordCount>3</wordCount>
|
||||||
<paraCount>0</paraCount>
|
<paraCount>0</paraCount>
|
||||||
<cursorPos>15</cursorPos>
|
<cursorPos>214</cursorPos>
|
||||||
</item>
|
</item>
|
||||||
<item handle="636b6aa9b697b" order="1" parent="e7ded148d6e4a">
|
<item handle="636b6aa9b697b" order="1" parent="e7ded148d6e4a">
|
||||||
<name>Making a Scene</name>
|
<name>Making a Scene</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user