Bump the version of the project XML file to prevent data loss if going back to an older version of novelWriter
This commit is contained in:
+13
-4
@@ -356,6 +356,15 @@ class NWProject():
|
|||||||
# Check Project Storage Version
|
# Check Project Storage Version
|
||||||
# =============================
|
# =============================
|
||||||
|
|
||||||
|
# Changes:
|
||||||
|
# 1.0 : Original file format.
|
||||||
|
# 1.1 : Changes the way documents are structure in the project
|
||||||
|
# folder from data_X, where X is the first hex value of
|
||||||
|
# the handle, to a single content folder.
|
||||||
|
# 1.2 : Changes the way autoReplace entries are stored. The 1.1
|
||||||
|
# parser will lose the autoReplace settings if allowed to
|
||||||
|
# read the file. Introduced in version 0.10.
|
||||||
|
|
||||||
if fileVersion == "1.0":
|
if fileVersion == "1.0":
|
||||||
msgBox = QMessageBox()
|
msgBox = QMessageBox()
|
||||||
msgRes = msgBox.question(self.theParent, "Old Project Version", (
|
msgRes = msgBox.question(self.theParent, "Old Project Version", (
|
||||||
@@ -369,10 +378,10 @@ class NWProject():
|
|||||||
if msgRes != QMessageBox.Yes:
|
if msgRes != QMessageBox.Yes:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
elif fileVersion != "1.1":
|
elif fileVersion != "1.1" and fileVersion != "1.2":
|
||||||
self.makeAlert((
|
self.makeAlert((
|
||||||
"Unknown or unsupported %s project format. "
|
"Unknown or unsupported %s project file format. "
|
||||||
"The project cannot be opened by this version of %s."
|
"The project cannot be opened by this version of %s. "
|
||||||
) % (
|
) % (
|
||||||
nw.__package__, nw.__package__
|
nw.__package__, nw.__package__
|
||||||
), nwAlert.ERROR)
|
), nwAlert.ERROR)
|
||||||
@@ -512,7 +521,7 @@ class NWProject():
|
|||||||
nwXML = etree.Element("novelWriterXML", attrib={
|
nwXML = etree.Element("novelWriterXML", attrib={
|
||||||
"appVersion" : str(nw.__version__),
|
"appVersion" : str(nw.__version__),
|
||||||
"hexVersion" : str(nw.__hexversion__),
|
"hexVersion" : str(nw.__hexversion__),
|
||||||
"fileVersion" : "1.1",
|
"fileVersion" : "1.2",
|
||||||
"timeStamp" : formatTimeStamp(saveTime),
|
"timeStamp" : formatTimeStamp(saveTime),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user