Backup options and settings complete

This commit is contained in:
Veronica K. B. Olsen
2019-06-26 18:13:02 +02:00
parent fba7987104
commit f11cc452d8
7 changed files with 100 additions and 43 deletions
+22 -4
View File
@@ -207,15 +207,28 @@ class GuiMain(QMainWindow):
if msgRes != QMessageBox.Yes:
return False
self.closeDocument()
if self.docEditor.docChanged:
self.saveDocument()
if self.theProject.projChanged:
saveOK = self.saveProject()
theBackup = NWBackup(self, self.theProject)
theBackup.zipIt()
saveOK = self.saveProject()
doBackup = False
if self.theProject.doBackup and self.mainConf.backupOnClose:
doBackup = True
if self.mainConf.showGUI and self.mainConf.askBeforeBackup:
msgBox = QMessageBox()
msgRes = msgBox.question(
self, "Backup Project", "Backup current project?"
)
if msgRes != QMessageBox.Yes:
doBackup = False
if doBackup:
self.backupProject()
else:
saveOK = True
if saveOK:
self.closeDocument()
self.theProject.closeProject()
self.theIndex.clearIndex()
self.clearGUI()
@@ -282,6 +295,11 @@ class GuiMain(QMainWindow):
return True
def backupProject(self):
theBackup = NWBackup(self, self.theProject)
theBackup.zipIt()
return True
##
# Document Actions
##