Add a Headings format edit form

This commit is contained in:
Veronica Berglyd Olsen
2023-05-18 19:30:42 +02:00
parent 79a28b9e43
commit a212900554
3 changed files with 244 additions and 25 deletions
+8 -7
View File
@@ -31,6 +31,7 @@ from enum import Enum
from PyQt5.QtCore import QT_TRANSLATE_NOOP
from novelwriter.common import checkUuid, isHandle
from novelwriter.constants import nwHeadingFormats
from novelwriter.core.item import NWItem
from novelwriter.core.project import NWProject
@@ -45,13 +46,13 @@ SETTINGS_TEMPLATE = {
"filter.includeNovel": (bool, True),
"filter.includeNotes": (bool, False),
"filter.includeInactive": (bool, False),
"headings.fmtTitle": (str, "%title%"),
"headings.fmtChapter": (str, "%title%"),
"headings.fmtUnnumbered": (str, "%title%"),
"headings.fmtScene": (str, "%title%"),
"headings.fmtSection": (str, "%title%"),
"headings.fmtTitle": (str, nwHeadingFormats.TITLE),
"headings.fmtChapter": (str, nwHeadingFormats.TITLE),
"headings.fmtUnnumbered": (str, nwHeadingFormats.TITLE),
"headings.fmtScene": (str, "* * *"),
"headings.fmtSection": (str, ""),
"headings.hideScene": (bool, False),
"headings.hideSection": (bool, False),
"headings.hideSection": (bool, True),
"text.includeSynopsis": (bool, False),
"text.includeComments": (bool, False),
"text.includeKeywords": (bool, False),
@@ -222,8 +223,8 @@ class BuildSettings:
return False
if len(definition) == 4:
value = min(max(value, definition[2]), definition[3])
self._changed = value != self._settings[key]
self._settings[key] = value
self._changed = True
logger.debug(f"Build Setting '{key}' set to: {value}")
return True