When closing a project, it should ask for backup even if the project is saved.

This commit is contained in:
Veronica K. B. Olsen
2019-10-20 13:56:21 +02:00
parent 6638c5187e
commit 77c6caacee
2 changed files with 19 additions and 13 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ class GuiMain(QMainWindow):
if self.docEditor.docChanged:
self.saveDocument()
if self.theProject.projChanged:
if self.theProject.projAltered:
saveOK = self.saveProject()
doBackup = False
if self.theProject.doBackup and self.mainConf.backupOnClose:
+18 -12
View File
@@ -34,22 +34,23 @@ class NWProject():
# Internal
self.theParent = theParent
self.mainConf = self.theParent.mainConf
self.projChanged = None
self.projOpened = None
self.projOpened = None # The time stamp of when the project file was opened
self.projChanged = None # The project has unsaved changes
self.projAltered = None # The project has been altered this session (used to trigger backup)
# Debug
self.handleSeed = None
# Class Settings
self.projTree = None
self.treeOrder = None
self.treeRoots = None
self.trashRoot = None
self.projPath = None
self.projMeta = None
self.projCache = None
self.projDict = None
self.projFile = None
self.projTree = None # Holds all the items of the project
self.treeOrder = None # The order of the tree items on the tree view
self.treeRoots = None # The root items of the tree
self.trashRoot = None # The handle of the trash root folder
self.projPath = None # The full path to where the currently open project is saved
self.projMeta = None # The full path to the project's meta data folder
self.projCache = None # The full path to the project's cache folder
self.projDict = None # The spell check dictionary
self.projFile = None # The file name of the project main xml file
# Project Meta
self.projName = None
@@ -140,8 +141,9 @@ class NWProject():
def clearProject(self):
self.projChanged = None
self.projOpened = None
self.projChanged = None
self.projAltered = False
# Project Settings
self.projTree = {}
@@ -267,6 +269,7 @@ class NWProject():
self._scanProjectFolder()
self.setProjectChanged(False)
self.projOpened = time()
self.projAltered = False
return True
@@ -458,6 +461,9 @@ class NWProject():
def setProjectChanged(self, bValue):
self.projChanged = bValue
self.theParent.setProjectStatus(self.projChanged)
if bValue:
# If we've changed the project at all, this should be True
self.projAltered = True
return self.projChanged
##