diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 4116a863..dcd7e448 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -1024,12 +1024,12 @@ class GuiProjectTreeMenu(QMenu): return def filterActions(self, theItem): - """Update item settings from the nwItem. + """Filter the menu entries available based on the properties of + the item the menu was activated on. """ self.theItem = theItem - theRoot = self.theTree.theProject.projTree.getRootItem(theItem.itemHandle) - if theItem is None or theRoot is None: + if theItem is None: logger.error("Failed to extract information to build tree context menu") return False @@ -1038,14 +1038,13 @@ class GuiProjectTreeMenu(QMenu): inTrash = theItem.itemParent == trashHandle and trashHandle is not None isTrash = theItem.itemHandle == trashHandle and trashHandle is not None isFile = theItem.itemType == nwItemType.FILE - isArch = theRoot.itemClass == nwItemClass.ARCHIVE isOrph = isFile and theItem.itemParent is None showOpen = isFile showView = isFile showEdit = not isTrash and not isOrph showExport = isFile - showNewFile = not (isTrash or inTrash or isOrph or isArch) + showNewFile = not (isTrash or inTrash or isOrph) showNewFolder = not (isTrash or inTrash or isOrph) showDelete = not isTrash showEmpty = isTrash