Clean up build settings and update tests
This commit is contained in:
@@ -64,7 +64,6 @@ SETTINGS_TEMPLATE = {
|
||||
"text.includeKeywords": (bool, False),
|
||||
"text.includeBodyText": (bool, True),
|
||||
"text.addNoteHeadings": (bool, True),
|
||||
"format.buildLang": (str, "en_GB"),
|
||||
"format.textFont": (str, CONFIG.textFont),
|
||||
"format.textSize": (int, 12),
|
||||
"format.lineHeight": (float, 1.15, 0.75, 3.0),
|
||||
@@ -107,7 +106,6 @@ SETTINGS_LABELS = {
|
||||
"text.addNoteHeadings": QT_TRANSLATE_NOOP("Builds", "Add Titles for Notes"),
|
||||
|
||||
"format.grpFormat": QT_TRANSLATE_NOOP("Builds", "Text Format"),
|
||||
"format.buildLang": QT_TRANSLATE_NOOP("Builds", "Language"),
|
||||
"format.textFont": QT_TRANSLATE_NOOP("Builds", "Font Family"),
|
||||
"format.textSize": QT_TRANSLATE_NOOP("Builds", "Font Size"),
|
||||
"format.lineHeight": QT_TRANSLATE_NOOP("Builds", "Line Height"),
|
||||
|
||||
@@ -457,7 +457,10 @@ class ToHtml(Tokenizer):
|
||||
def _formatSynopsis(self, text: str) -> str:
|
||||
"""Apply HTML formatting to synopsis."""
|
||||
sSynop = self._localLookup("Synopsis")
|
||||
return f"<p class='comment'><span class='synopsis'>{sSynop}:</span> {text}</p>\n"
|
||||
if self._genMode == self.M_PREVIEW:
|
||||
return f"<p class='comment'><span class='synopsis'>{sSynop}:</span> {text}</p>\n"
|
||||
else:
|
||||
return f"<p class='synopsis'><strong>{sSynop}:</strong> {text}</p>\n"
|
||||
|
||||
def _formatComments(self, text: str) -> str:
|
||||
"""Apply HTML formatting to comments."""
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</project>
|
||||
<settings>
|
||||
<doBackup>yes</doBackup>
|
||||
<language>None</language>
|
||||
<language>en_GB</language>
|
||||
<spellChecking auto="no">None</spellChecking>
|
||||
<lastHandle>
|
||||
<entry key="editor">None</entry>
|
||||
|
||||
@@ -446,6 +446,7 @@ def testCoreTools_NewCustomA(monkeypatch, fncPath, tstPaths, mockRnd):
|
||||
"projName": "Test Custom",
|
||||
"projTitle": "Test Novel",
|
||||
"projAuthor": "Jane Doe",
|
||||
"projLang": -1,
|
||||
"projPath": fncPath,
|
||||
"popSample": False,
|
||||
"popMinimal": False,
|
||||
@@ -484,6 +485,7 @@ def testCoreTools_NewCustomB(monkeypatch, fncPath, tstPaths, mockRnd):
|
||||
"projName": "Test Custom",
|
||||
"projTitle": "Test Novel",
|
||||
"projAuthor": "Jane Doe",
|
||||
"projLang": -1,
|
||||
"projPath": fncPath,
|
||||
"popSample": False,
|
||||
"popMinimal": False,
|
||||
|
||||
@@ -562,7 +562,6 @@ def testBuildSettings_Format(monkeypatch, qtbot: QtBot, nwGUI: GuiMain):
|
||||
assert bSettings.toolStack.currentWidget() is fmtTab
|
||||
|
||||
# Check initial values
|
||||
assert fmtTab.buildLang.currentData() == "en_US"
|
||||
assert fmtTab.textFont.text() == textFont
|
||||
assert fmtTab.textSize.value() == 12
|
||||
assert fmtTab.lineHeight.value() == 1.2
|
||||
@@ -581,7 +580,6 @@ def testBuildSettings_Format(monkeypatch, qtbot: QtBot, nwGUI: GuiMain):
|
||||
assert fmtTab.rightMargin.value() == 15.0
|
||||
|
||||
# Change values
|
||||
fmtTab.buildLang.setCurrentIndex(fmtTab.buildLang.findData("en_GB"))
|
||||
fmtTab.textFont.setText("Arial")
|
||||
fmtTab.textSize.setValue(11)
|
||||
fmtTab.lineHeight.setValue(1.15)
|
||||
@@ -596,7 +594,6 @@ def testBuildSettings_Format(monkeypatch, qtbot: QtBot, nwGUI: GuiMain):
|
||||
# Save values
|
||||
fmtTab.saveContent()
|
||||
|
||||
assert build.getStr("format.buildLang") == "en_GB"
|
||||
assert build.getStr("format.textFont") == "Arial"
|
||||
assert build.getInt("format.textSize") == 11
|
||||
assert build.getFloat("format.lineHeight") == 1.15
|
||||
|
||||
Reference in New Issue
Block a user