Added more info to the forst tab of the Project Details dialog

This commit is contained in:
Veronica K. B. Olsen
2021-01-11 19:47:42 +01:00
parent 8d218db35f
commit b5e11f2303
4 changed files with 102 additions and 24 deletions
+21
View File
@@ -1112,11 +1112,32 @@ class NWProject():
# Getters
##
def getAuthors(self):
"""Returns a formatted string of authors.
"""
nAuth = len(self.bookAuthors)
authString = ""
if nAuth == 1:
authString = self.bookAuthors[0]
elif nAuth > 1:
authString = "%s and %s" % (
", ".join(self.bookAuthors[0:-1]), self.bookAuthors[-1]
)
return authString
def getSessionWordCount(self):
"""Returns the number of words added or removed this session.
"""
return self.currWCount - self.lastWCount
def getCurrentEditTime(self):
"""Get the total project edit time, including the time spent in
the current session.
"""
return round(self.editTime + time() - self.projOpened)
def getProjectItems(self):
"""This function ensures that the item tree loaded is sent to
the GUI tree view in such a way that the tree can be built. That