Tree context menu can now add files, folders and roots.

This commit is contained in:
Veronica K. B. Olsen
2019-04-23 21:42:11 +02:00
parent 06d1d3c7cc
commit 30c1241488
6 changed files with 98 additions and 116 deletions
+3 -1
View File
@@ -245,7 +245,7 @@ class NWProject():
"""
validActions = {}
# If we're at root, or didn't select an utem, all we can add is root stuff
# If we're at root, or didn't select an item, all we can add is root stuff
if tHandle is None:
validActions[nwItemAction.ADD_ROOT] = {
"Type" : nwItemType.ROOT,
@@ -318,6 +318,8 @@ class NWProject():
"""Checks if there already is a root entry of class 'theClass' in the
root of the project tree.
"""
if theClass == nwItemClass.NO_CLASS:
return True
for aRoot in self.treeRoots:
if theClass == self.projTree[aRoot].itemClass:
return False