Update the file info dialog box

This commit is contained in:
Veronica Berglyd Olsen
2023-08-30 18:57:48 +02:00
parent f41e71199c
commit 9bf43aa40f
5 changed files with 42 additions and 21 deletions
+20 -8
View File
@@ -85,6 +85,26 @@ class NWDocument:
"""Check if the file hash has changed outside of novelWriter."""
return self._hashError
@property
def fileLocation(self) -> str:
"""Return the file location of the current document."""
return str(self._fileLoc)
@property
def createdDate(self) -> str:
"""Return the document creation date."""
return self._docMeta.get("created", "Unknown")
@property
def updatedDate(self) -> str:
"""Return the document creation date."""
return self._docMeta.get("updated", "Unknown")
@property
def nwItem(self) -> NWItem | None:
"""Return a pointer to the currently open NWItem."""
return self._item
##
# Class Methods
##
@@ -264,14 +284,6 @@ class NWDocument:
# Getters
##
def getFileLocation(self) -> str:
"""Return the file location of the current document."""
return str(self._fileLoc)
def getCurrentItem(self) -> NWItem | None:
"""Return a pointer to the currently open NWItem."""
return self._item
def getMeta(self) -> tuple[str, str | None, nwItemClass | None, nwItemLayout | None]:
"""Parse the document meta tag and return the name, parent,
class and layout meta values.