Fix some widgets without parent, and update template file record keeping

This commit is contained in:
Veronica Berglyd Olsen
2024-02-07 20:37:53 +01:00
parent c420d8ae38
commit bbb23b4bc9
8 changed files with 33 additions and 17 deletions
+7 -3
View File
@@ -337,15 +337,19 @@ class NWItem:
return self._class in (
nwItemClass.NOVEL,
nwItemClass.ARCHIVE,
nwItemClass.TEMPLATES,
nwItemClass.TEMPLATE,
)
def isTemplateFile(self) -> bool:
"""Check if the item is a template file."""
return self._type == nwItemType.FILE and self._class == nwItemClass.TEMPLATE
def documentAllowed(self) -> bool:
"""Check if the item is allowed to be of document layout."""
return self._class in (
nwItemClass.NOVEL,
nwItemClass.ARCHIVE,
nwItemClass.TEMPLATES,
nwItemClass.TEMPLATE,
nwItemClass.TRASH,
)
@@ -354,7 +358,7 @@ class NWItem:
return self._class in (
nwItemClass.NO_CLASS,
nwItemClass.ARCHIVE,
nwItemClass.TEMPLATES,
nwItemClass.TEMPLATE,
nwItemClass.TRASH,
)