From 8ea153da54b0f18fd9c39fb83dcf7f026cc71d6c Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 9 Dec 2020 09:21:37 +0100 Subject: [PATCH 1/2] Allow creating files in the 'Outtakes' root folder --- nw/gui/projtree.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 4116a863..60bcbf88 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -1027,9 +1027,8 @@ class GuiProjectTreeMenu(QMenu): """Update item settings from the nwItem. """ 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 +1037,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 From e12c41d7e70a4dd44949ebff2e6ba3a13af9b910 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 9 Dec 2020 09:26:21 +0100 Subject: [PATCH 2/2] Clarify docstring of project tree context menu filterAction --- nw/gui/projtree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 60bcbf88..dcd7e448 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -1024,7 +1024,8 @@ 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