Beispiel #1
0
 def newFolder(self, folderName, folderClass, pHandle):
     newItem = NWItem(self)
     newItem.setName(folderName)
     newItem.setType(nwItemType.FOLDER)
     newItem.setClass(folderClass)
     newItem.setStatus(0)
     self._appendItem(None, pHandle, newItem)
     return newItem.itemHandle
Beispiel #2
0
 def newRoot(self, rootName, rootClass):
     if not self.checkRootUnique(rootClass):
         self.makeAlert("Duplicate root item detected!", nwAlert.ERROR)
         return None
     newItem = NWItem(self)
     newItem.setName(rootName)
     newItem.setType(nwItemType.ROOT)
     newItem.setClass(rootClass)
     newItem.setStatus(0)
     self._appendItem(None, None, newItem)
     return newItem.itemHandle
Beispiel #3
0
 def newFile(self, fileName, fileClass, pHandle):
     newItem = NWItem(self)
     newItem.setName(fileName)
     newItem.setType(nwItemType.FILE)
     if fileClass == nwItemClass.NOVEL:
         newItem.setLayout(nwItemLayout.SCENE)
     else:
         newItem.setLayout(nwItemLayout.NOTE)
     newItem.setClass(fileClass)
     newItem.setStatus(0)
     self._appendItem(None, pHandle, newItem)
     return newItem.itemHandle