Merge pull request #519 from vkbo/issue517_new_files_in_outtakes

Allow creating files in the 'Outtakes' root folder
This commit is contained in:
Veronica K. Berglyd Olsen
2020-12-09 09:43:52 +01:00
committed by GitHub
+4 -5
View File
@@ -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