diff --git a/nw/core/project.py b/nw/core/project.py index d7ab3c2d..132066b3 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -69,6 +69,7 @@ class NWProject(): self.lockedBy = None # Data on which computer has the project open self.saveCount = 0 # Meta data: number of saves self.autoCount = 0 # Meta data: number of automatic saves + self.editTime = 0 # The accumulated edit time read from the project file # Class Settings self.projPath = None # The full path to where the currently open project is saved @@ -206,7 +207,7 @@ class NWProject(): self.autoReplace = {} self.titleFormat = { "title" : r"%title%", - "chapter" : r"Chapter %num%\\%title%", + "chapter" : r"Chapter %ch%: %title%", "unnumbered" : r"%title%", "scene" : r"* * *", "section" : r"", @@ -330,6 +331,8 @@ class NWProject(): self.saveCount = checkInt(xRoot.attrib["saveCount"], 0, False) if "autoCount" in xRoot.attrib: self.autoCount = checkInt(xRoot.attrib["autoCount"], 0, False) + if "editTime" in xRoot.attrib: + self.editTime = checkInt(xRoot.attrib["editTime"], 0, False) logger.verbose("XML root is %s" % nwxRoot) logger.verbose("File version is %s" % fileVersion) @@ -486,6 +489,7 @@ class NWProject(): "saveCount" : str(self.saveCount), "autoCount" : str(self.autoCount), "timeStamp" : formatTimeStamp(saveTime), + "editTime" : str(int(self.editTime + saveTime - self.projOpened)), }) # Save Project Meta @@ -535,7 +539,7 @@ class NWProject(): xml_declaration = True )) except Exception as e: - self.makeAlert(["Failed to save project.",str(e)], nwAlert.ERROR) + self.makeAlert(["Failed to save project.", str(e)], nwAlert.ERROR) return False # If we're here, the file was successfully saved, diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index a0d7f3ce..b70706eb 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project diff --git a/tests/reference/gui/0_nwProject.nwx b/tests/reference/gui/0_nwProject.nwx index 6d2bf739..dcf46837 100644 --- a/tests/reference/gui/0_nwProject.nwx +++ b/tests/reference/gui/0_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/gui/1_nwProject.nwx b/tests/reference/gui/1_nwProject.nwx index 112a4be0..a09a089f 100644 --- a/tests/reference/gui/1_nwProject.nwx +++ b/tests/reference/gui/1_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/gui/2_nwProject.nwx b/tests/reference/gui/2_nwProject.nwx index c4668fe4..11fc5dbe 100644 --- a/tests/reference/gui/2_nwProject.nwx +++ b/tests/reference/gui/2_nwProject.nwx @@ -18,7 +18,7 @@
%title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/gui/3_nwProject.nwx b/tests/reference/gui/3_nwProject.nwx index 35e1b8df..e7f9e514 100644 --- a/tests/reference/gui/3_nwProject.nwx +++ b/tests/reference/gui/3_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/proj/1_nwProject.nwx b/tests/reference/proj/1_nwProject.nwx index 53499ddc..5ba28cae 100644 --- a/tests/reference/proj/1_nwProject.nwx +++ b/tests/reference/proj/1_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/proj/2_nwProject.nwx b/tests/reference/proj/2_nwProject.nwx index 22a9e0fb..fe5bf878 100644 --- a/tests/reference/proj/2_nwProject.nwx +++ b/tests/reference/proj/2_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *
diff --git a/tests/reference/proj/3_nwProject.nwx b/tests/reference/proj/3_nwProject.nwx index ee8f6e1a..2e3cb6c0 100644 --- a/tests/reference/proj/3_nwProject.nwx +++ b/tests/reference/proj/3_nwProject.nwx @@ -14,7 +14,7 @@ %title% - Chapter %num%\\%title% + Chapter %ch%: %title% %title% * * *