diff --git a/nw/gui/doctree.py b/nw/gui/doctree.py index 0c4b12ab..9d8b6b72 100644 --- a/nw/gui/doctree.py +++ b/nw/gui/doctree.py @@ -292,6 +292,7 @@ class GuiDocTree(QTreeWidget): return pHandle = trItemP.text(self.C_HANDLE) nwItemS.setParent(pHandle) + nwItemS.setDepth(self.theProject.countItemDepth(tHandle)) self.setTreeItemValues(tHandle) return diff --git a/nw/project/project.py b/nw/project/project.py index 992c969b..1a6b15ec 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -345,7 +345,7 @@ class NWProject(): # Report status if len(orphanFiles) > 0: - logger.warning("Found %d orphaned file(s) in project folder!" % len(orphanFiles)) + self.theParent.makeAlert("Found %d orphaned file(s) in project folder!" % len(orphanFiles),1) else: logger.verbose("File check OK") return @@ -363,7 +363,7 @@ class NWProject(): return - def _countItemDepth(self, tHandle): + def countItemDepth(self, tHandle): theDepth = 0 nwItem = self.getItem(tHandle) while nwItem.parHandle is not None: @@ -390,7 +390,7 @@ class NWProject(): logger.verbose("Entry %s is a root item" % str(tHandle)) self.treeRoots.append(tHandle) - itemDepth = self._countItemDepth(tHandle) + itemDepth = self.countItemDepth(tHandle) if itemDepth is None: logger.error("The depth of entry %s could not be determined" % tHandle) else: diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 0f0d0fb7..6c914cfc 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -47,7 +47,7 @@ False False SCENE - 2575 + 2571 377 5 @@ -69,7 +69,7 @@ FILE NOVEL 0 - 1 + 2 False False SCENE @@ -92,7 +92,7 @@ CHARACTER 0 1 - False + True True @@ -100,7 +100,7 @@ FILE CHARACTER 0 - 1 + 2 False False NOTE @@ -113,7 +113,7 @@ FILE CHARACTER 0 - 1 + 2 False False NOTE