Add a flag to disable asking before exit
This commit is contained in:
@@ -135,6 +135,7 @@ class Config:
|
|||||||
self.emphLabels = True # Add emphasis to H1 and H2 item labels
|
self.emphLabels = True # Add emphasis to H1 and H2 item labels
|
||||||
self.backupOnClose = False # Flag for running automatic backups
|
self.backupOnClose = False # Flag for running automatic backups
|
||||||
self.askBeforeBackup = True # Flag for asking before running automatic backup
|
self.askBeforeBackup = True # Flag for asking before running automatic backup
|
||||||
|
self.askBeforeExit = True # Flag for asking before exiting the app
|
||||||
|
|
||||||
# Text Editor Settings
|
# Text Editor Settings
|
||||||
self.textFont = QFont() # Editor font
|
self.textFont = QFont() # Editor font
|
||||||
@@ -628,6 +629,7 @@ class Config:
|
|||||||
self._backupPath = conf.rdPath(sec, "backuppath", self._backupPath)
|
self._backupPath = conf.rdPath(sec, "backuppath", self._backupPath)
|
||||||
self.backupOnClose = conf.rdBool(sec, "backuponclose", self.backupOnClose)
|
self.backupOnClose = conf.rdBool(sec, "backuponclose", self.backupOnClose)
|
||||||
self.askBeforeBackup = conf.rdBool(sec, "askbeforebackup", self.askBeforeBackup)
|
self.askBeforeBackup = conf.rdBool(sec, "askbeforebackup", self.askBeforeBackup)
|
||||||
|
self.askBeforeExit = conf.rdBool(sec, "askbeforeexit", self.askBeforeExit)
|
||||||
|
|
||||||
# Editor
|
# Editor
|
||||||
sec = "Editor"
|
sec = "Editor"
|
||||||
@@ -739,6 +741,7 @@ class Config:
|
|||||||
"backuppath": str(self._backupPath),
|
"backuppath": str(self._backupPath),
|
||||||
"backuponclose": str(self.backupOnClose),
|
"backuponclose": str(self.backupOnClose),
|
||||||
"askbeforebackup": str(self.askBeforeBackup),
|
"askbeforebackup": str(self.askBeforeBackup),
|
||||||
|
"askbeforeexit": str(self.askBeforeExit),
|
||||||
}
|
}
|
||||||
|
|
||||||
conf["Editor"] = {
|
conf["Editor"] = {
|
||||||
|
|||||||
@@ -852,7 +852,7 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
def closeMain(self) -> bool:
|
def closeMain(self) -> bool:
|
||||||
"""Save everything, and close novelWriter."""
|
"""Save everything, and close novelWriter."""
|
||||||
if SHARED.hasProject and not SHARED.question("%s<br>%s" % (
|
if SHARED.hasProject and CONFIG.askBeforeExit and not SHARED.question("%s<br>%s" % (
|
||||||
self.tr("Do you want to exit novelWriter?"),
|
self.tr("Do you want to exit novelWriter?"),
|
||||||
self.tr("Changes are saved automatically.")
|
self.tr("Changes are saved automatically.")
|
||||||
)):
|
)):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[Meta]
|
[Meta]
|
||||||
timestamp = 2025-01-26 18:17:44
|
timestamp = 2025-01-29 11:56:34
|
||||||
|
|
||||||
[Main]
|
[Main]
|
||||||
font =
|
font =
|
||||||
@@ -26,6 +26,7 @@ emphlabels = True
|
|||||||
backuppath =
|
backuppath =
|
||||||
backuponclose = False
|
backuponclose = False
|
||||||
askbeforebackup = True
|
askbeforebackup = True
|
||||||
|
askbeforeexit = True
|
||||||
|
|
||||||
[Editor]
|
[Editor]
|
||||||
textfont =
|
textfont =
|
||||||
|
|||||||
Reference in New Issue
Block a user