diff --git a/nw/core/tree.py b/nw/core/tree.py index aab0e563..7d1bef46 100644 --- a/nw/core/tree.py +++ b/nw/core/tree.py @@ -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): diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index d7a0a833..c462c748 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -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 diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index bcc81036..ab2fe52b 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -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: