Fix bug in update available root list when deleting root item

This commit is contained in:
Veronica K. B. Olsen
2020-08-16 17:58:40 +02:00
parent 7b39bc0780
commit 00f3909e19
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -401,7 +401,12 @@ class NWTree():
return False
self._treeOrder.remove(tHandle)
self._theLength = len(self._treeOrder)
if tHandle in self._treeRoots:
self._treeRoots.remove(tHandle)
self._setTreeChanged(True)
return True
def __contains__(self, tHandle):
+3
View File
@@ -75,6 +75,9 @@ class GuiMainMenu(QMenuBar):
##
def setAvailableRoot(self):
"""Update the list of available root folders and set the ones
that are active.
"""
for itemClass in nwItemClass:
if itemClass == nwItemClass.NO_CLASS:
continue
+1
View File
@@ -469,6 +469,7 @@ class GuiProjectTree(QTreeWidget):
tIndex = self.indexOfTopLevelItem(trItemS)
if trItemS.childCount() == 0:
self.takeTopLevelItem(tIndex)
del self.theProject.projTree[tHandle]
self.theParent.mainMenu.setAvailableRoot()
self._setTreeChanged(True)
else: