Fix bug in update available root list when deleting root item
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user