Add ask before exit setting in Preferences

This commit is contained in:
Veronica Berglyd Olsen
2025-01-29 18:17:50 +01:00
parent 36d8ad4d8c
commit fd4fa68553
2 changed files with 18 additions and 7 deletions
+13 -5
View File
@@ -271,10 +271,10 @@ class GuiPreferences(NDialog):
self.tr("Include project notes in status bar word count"), self.incNotesWCount
)
# Auto Save
# Behaviour
# =========
title = self.tr("Auto Save")
title = self.tr("Behaviour")
section += 1
self.sidebar.addButton(title, section)
self.mainForm.addGroupLabel(title, section)
@@ -301,6 +301,13 @@ class GuiPreferences(NDialog):
self.tr("How often the project is automatically saved."), unit=self.tr("seconds")
)
# Ask before exiting novelWriter
self.askBeforeExit = NSwitch(self)
self.askBeforeExit.setChecked(CONFIG.askBeforeExit)
self.mainForm.addRow(
self.tr("Ask before exiting novelWriter"), self.askBeforeExit
)
# Project Backup
# ==============
@@ -927,9 +934,10 @@ class GuiPreferences(NDialog):
CONFIG.incNotesWCount = self.incNotesWCount.isChecked()
CONFIG.setTextFont(self._textFont)
# Auto Save
CONFIG.autoSaveDoc = self.autoSaveDoc.value()
CONFIG.autoSaveProj = self.autoSaveProj.value()
# Behaviour
CONFIG.autoSaveDoc = self.autoSaveDoc.value()
CONFIG.autoSaveProj = self.autoSaveProj.value()
CONFIG.askBeforeExit = self.askBeforeExit.isChecked()
# Project Backup
CONFIG.setBackupPath(self.backupPath)