diff --git a/nw/gui/doctree.py b/nw/gui/doctree.py index 7c994aae..8844866c 100644 --- a/nw/gui/doctree.py +++ b/nw/gui/doctree.py @@ -92,11 +92,8 @@ class GuiDocTree(QTreeWidget): def newTreeItem(self, itemType, itemClass): pHandle = self.getSelectedHandle() - if pHandle is None: - self.makeAlert("No valid parent item selected", nwAlert.ERROR) - return False - if itemClass is None: + if itemClass is None and pHandle is not None: itemClass = self.theProject.getItem(pHandle).itemClass if itemClass is None: self.makeAlert("Failed to find an appropriate item class for item %s" % pHandle, nwAlert.BUG) diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 1d9004e7..0d421f0e 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -8,10 +8,10 @@ True - 636b6aa9b697b + 4cd0bd12b087d 636b6aa9b697b - + Novel ROOT @@ -112,55 +112,43 @@ 1 0 - + Locations ROOT WORLD 0 True - + Earth FILE WORLD 0 False NOTE - 66 - 13 - 1 + 0 + 0 + 0 0 - + Trash TRASH TRASH 0 True - - Orphaned File 1 + + Orphaned File 2 FILE NO_CLASS 0 False NO_LAYOUT - 0 - 0 + 14 + 3 0 - 0 - - - New File - FILE - CHARACTER - 0 - False - NOTE - 0 - 0 - 0 - 0 + 1