Merge branch 'fixes' into compile_novel
This commit is contained in:
@@ -41,6 +41,7 @@ __author__ = "Veronica Berglyd Olsen"
|
|||||||
__copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen"
|
__copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen"
|
||||||
__license__ = "GPLv3"
|
__license__ = "GPLv3"
|
||||||
__version__ = "0.5"
|
__version__ = "0.5"
|
||||||
|
__hexversion__ = "0x000500f0"
|
||||||
__date__ = "2020-05-09"
|
__date__ = "2020-05-09"
|
||||||
__maintainer__ = "Veronica Berglyd Olsen"
|
__maintainer__ = "Veronica Berglyd Olsen"
|
||||||
__email__ = "code@vkbo.net"
|
__email__ = "code@vkbo.net"
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ from hashlib import sha256
|
|||||||
from time import time
|
from time import time
|
||||||
from shutil import make_archive
|
from shutil import make_archive
|
||||||
|
|
||||||
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
|
||||||
from nw.gui.tools import OptionState
|
from nw.gui.tools import OptionState
|
||||||
from nw.core.tools import projectMaintenance
|
from nw.core.tools import projectMaintenance
|
||||||
from nw.core.document import NWDoc
|
from nw.core.document import NWDoc
|
||||||
@@ -294,12 +296,15 @@ class NWProject():
|
|||||||
nwxRoot = xRoot.tag
|
nwxRoot = xRoot.tag
|
||||||
|
|
||||||
appVersion = "Unknown"
|
appVersion = "Unknown"
|
||||||
|
hexVersion = "0x0"
|
||||||
fileVersion = "Unknown"
|
fileVersion = "Unknown"
|
||||||
self.saveCount = 0
|
self.saveCount = 0
|
||||||
self.autoCount = 0
|
self.autoCount = 0
|
||||||
|
|
||||||
if "appVersion" in xRoot.attrib:
|
if "appVersion" in xRoot.attrib:
|
||||||
appVersion = xRoot.attrib["appVersion"]
|
appVersion = xRoot.attrib["appVersion"]
|
||||||
|
if "hexVersion" in xRoot.attrib:
|
||||||
|
hexVersion = xRoot.attrib["hexVersion"]
|
||||||
if "fileVersion" in xRoot.attrib:
|
if "fileVersion" in xRoot.attrib:
|
||||||
fileVersion = xRoot.attrib["fileVersion"]
|
fileVersion = xRoot.attrib["fileVersion"]
|
||||||
if "saveCount" in xRoot.attrib:
|
if "saveCount" in xRoot.attrib:
|
||||||
@@ -317,6 +322,18 @@ class NWProject():
|
|||||||
)
|
)
|
||||||
return False
|
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:
|
for xChild in xRoot:
|
||||||
if xChild.tag == "project":
|
if xChild.tag == "project":
|
||||||
logger.debug("Found project meta")
|
logger.debug("Found project meta")
|
||||||
@@ -411,6 +428,7 @@ class NWProject():
|
|||||||
logger.debug("Writing project meta")
|
logger.debug("Writing project meta")
|
||||||
nwXML = etree.Element("novelWriterXML",attrib={
|
nwXML = etree.Element("novelWriterXML",attrib={
|
||||||
"appVersion" : str(nw.__version__),
|
"appVersion" : str(nw.__version__),
|
||||||
|
"hexVersion" : str(nw.__hexversion__),
|
||||||
"fileVersion" : "1.0",
|
"fileVersion" : "1.0",
|
||||||
"saveCount" : str(self.saveCount),
|
"saveCount" : str(self.saveCount),
|
||||||
"autoCount" : str(self.autoCount),
|
"autoCount" : str(self.autoCount),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?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>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user