Merge branch 'fixes' into compile_novel

This commit is contained in:
Veronica K. B. Olsen
2020-05-11 19:30:47 +02:00
3 changed files with 20 additions and 1 deletions
+1
View File
@@ -41,6 +41,7 @@ __author__ = "Veronica Berglyd Olsen"
__copyright__ = "Copyright 20182020, Veronica Berglyd Olsen"
__license__ = "GPLv3"
__version__ = "0.5"
__hexversion__ = "0x000500f0"
__date__ = "2020-05-09"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
+18
View File
@@ -39,6 +39,8 @@ from hashlib import sha256
from time import time
from shutil import make_archive
from PyQt5.QtWidgets import QMessageBox
from nw.gui.tools import OptionState
from nw.core.tools import projectMaintenance
from nw.core.document import NWDoc
@@ -294,12 +296,15 @@ class NWProject():
nwxRoot = xRoot.tag
appVersion = "Unknown"
hexVersion = "0x0"
fileVersion = "Unknown"
self.saveCount = 0
self.autoCount = 0
if "appVersion" in xRoot.attrib:
appVersion = xRoot.attrib["appVersion"]
if "hexVersion" in xRoot.attrib:
hexVersion = xRoot.attrib["hexVersion"]
if "fileVersion" in xRoot.attrib:
fileVersion = xRoot.attrib["fileVersion"]
if "saveCount" in xRoot.attrib:
@@ -317,6 +322,18 @@ class NWProject():
)
return False
if int(hexVersion, 16) > int(nw.__hexversion__, 16) and self.mainConf.showGUI:
msgBox = QMessageBox()
msgRes = msgBox.question(self.theParent, "Version Conflict", (
"This project was saved by a newer version of %s, version %s. This is version %s. "
"If you continue to open the project, some attributes and settings may not be "
"preserved. Continue opening the project?"
) % (
nw.__package__, appVersion, nw.__version__
))
if msgRes != QMessageBox.Yes:
return False
for xChild in xRoot:
if xChild.tag == "project":
logger.debug("Found project meta")
@@ -411,6 +428,7 @@ class NWProject():
logger.debug("Writing project meta")
nwXML = etree.Element("novelWriterXML",attrib={
"appVersion" : str(nw.__version__),
"hexVersion" : str(nw.__hexversion__),
"fileVersion" : "1.0",
"saveCount" : str(self.saveCount),
"autoCount" : str(self.autoCount),
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="279" autoCount="37" timeStamp="2020-05-11 18:58:21">
<novelWriterXML appVersion="0.5" hexVersion="0x000500f0" fileVersion="1.0" saveCount="130" autoCount="17" timeStamp="2020-05-11 19:23:21">
<project>
<name>Sample Project</name>
<title>Sample Project</title>