Connected the make root menu options.
This commit is contained in:
+2
-1
@@ -35,13 +35,14 @@ class NWItem():
|
||||
nwItemClass.CUSTOM : "Custom",
|
||||
}
|
||||
CLASS_FLAG = {
|
||||
nwItemClass.NO_CLASS : "X",
|
||||
nwItemClass.NO_CLASS : "0",
|
||||
nwItemClass.NOVEL : "N",
|
||||
nwItemClass.PLOT : "P",
|
||||
nwItemClass.CHARACTER : "C",
|
||||
nwItemClass.WORLD : "L",
|
||||
nwItemClass.TIMELINE : "T",
|
||||
nwItemClass.OBJECT : "O",
|
||||
nwItemClass.CUSTOM : "X",
|
||||
}
|
||||
LAYOUT_NAME = {
|
||||
nwItemLayout.NO_LAYOUT : "None",
|
||||
|
||||
@@ -281,7 +281,7 @@ class NWProject():
|
||||
if tHandle is None:
|
||||
validActions[nwItemAction.ADD_ROOT] = {
|
||||
"Type" : nwItemType.ROOT,
|
||||
"Class" : [x for x in nwItemClass if self._checkRootUnique(x)]
|
||||
"Class" : [x for x in nwItemClass if self.checkRootUnique(x)]
|
||||
}
|
||||
return validActions
|
||||
|
||||
@@ -343,11 +343,7 @@ class NWProject():
|
||||
|
||||
return validActions
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
##
|
||||
|
||||
def _checkRootUnique(self, theClass):
|
||||
def checkRootUnique(self, theClass):
|
||||
"""Checks if there already is a root entry of class 'theClass' in the
|
||||
root of the project tree.
|
||||
"""
|
||||
@@ -358,6 +354,10 @@ class NWProject():
|
||||
return False
|
||||
return True
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
##
|
||||
|
||||
def _countItemDepth(self, tHandle):
|
||||
theDepth = 0
|
||||
nwItem = self.getItem(tHandle)
|
||||
|
||||
Reference in New Issue
Block a user