+2
-1
@@ -669,7 +669,7 @@ class NWProject():
|
||||
by drag-and-drop. Forwarded to the NWTree class.
|
||||
"""
|
||||
if len(self.projTree) != len(newOrder):
|
||||
logger.warning("Size of new and old tree order does not match")
|
||||
logger.warning("Size of new and old tree order do not match")
|
||||
self.projTree.setOrder(newOrder)
|
||||
self.setProjectChanged(True)
|
||||
return True
|
||||
@@ -1217,6 +1217,7 @@ class NWTree():
|
||||
self._treeOrder = tmpOrder
|
||||
self._theLength = len(self._treeOrder)
|
||||
self._setTreeChanged(True)
|
||||
logger.verbose("Project tree order updated")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -314,6 +314,9 @@ class GuiBuildNovel(QDialog):
|
||||
makeHtml.setKeywords(incKeywords)
|
||||
makeHtml.setJustify(justifyText)
|
||||
|
||||
# Make sure the tree order is correct
|
||||
self.theParent.treeView.saveTreeOrder()
|
||||
|
||||
self.buildProgress.setMaximum(len(self.theProject.projTree))
|
||||
self.buildProgress.setValue(0)
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class GuiProjectLoad(QDialog):
|
||||
self.listBox.setHeaderLabels(["Working Title","Words","Last Opened","Path"])
|
||||
self.listBox.setRootIsDecorated(False)
|
||||
self.listBox.setColumnHidden(3, True)
|
||||
self.listBox.itemClicked.connect(self._doSelectRecent)
|
||||
self.listBox.itemSelectionChanged.connect(self._doSelectRecent)
|
||||
self.listBox.itemDoubleClicked.connect(self._doOpenRecent)
|
||||
|
||||
treeHead = self.listBox.headerItem()
|
||||
|
||||
@@ -235,11 +235,17 @@ class GuiDocTree(QTreeWidget):
|
||||
return True
|
||||
|
||||
def saveTreeOrder(self):
|
||||
"""Build a list of the items in the project tree and send them
|
||||
to the project class. This syncs up the two versions of the
|
||||
project structure, and must be called before any code that
|
||||
depends on this order to be up to date.
|
||||
"""
|
||||
theList = []
|
||||
for i in range(self.topLevelItemCount()):
|
||||
if self.topLevelItem(i) == self.orphRoot:
|
||||
continue
|
||||
theList = self._scanChildren(theList, self.topLevelItem(i), i)
|
||||
logger.debug("Saving project tree item order")
|
||||
self.theProject.setTreeOrder(theList)
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user