Allow hiding scene and section titles in export builds (#974)
This commit is contained in:
committed by
GitHub
parent
ec07cebb51
commit
1a9efa4e1e
@@ -42,10 +42,11 @@ VALID_MAP = {
|
|||||||
},
|
},
|
||||||
"GuiDocSplit": {"spLevel"},
|
"GuiDocSplit": {"spLevel"},
|
||||||
"GuiBuildNovel": {
|
"GuiBuildNovel": {
|
||||||
"winWidth", "winHeight", "boxWidth", "docWidth", "addNovel",
|
"winWidth", "winHeight", "boxWidth", "docWidth", "hideScene",
|
||||||
"addNotes", "ignoreFlag", "justifyText", "excludeBody", "textFont",
|
"hideSection", "addNovel", "addNotes", "ignoreFlag", "justifyText",
|
||||||
"textSize", "lineHeight", "noStyling", "incSynopsis", "incComments",
|
"excludeBody", "textFont", "textSize", "lineHeight", "noStyling",
|
||||||
"incKeywords", "incBodyText", "replaceTabs", "replaceUCode"
|
"incSynopsis", "incComments", "incKeywords", "incBodyText",
|
||||||
|
"replaceTabs", "replaceUCode"
|
||||||
},
|
},
|
||||||
"GuiOutline": {"headerOrder", "columnWidth", "columnHidden"},
|
"GuiOutline": {"headerOrder", "columnWidth", "columnHidden"},
|
||||||
"GuiProjectSettings": {
|
"GuiProjectSettings": {
|
||||||
|
|||||||
+42
-20
@@ -172,6 +172,16 @@ class GuiBuildNovel(QDialog):
|
|||||||
if langIdx != -1:
|
if langIdx != -1:
|
||||||
self.buildLang.setCurrentIndex(langIdx)
|
self.buildLang.setCurrentIndex(langIdx)
|
||||||
|
|
||||||
|
self.hideScene = QSwitch(width=wS, height=hS)
|
||||||
|
self.hideScene.setChecked(
|
||||||
|
self.optState.getBool("GuiBuildNovel", "hideScene", False)
|
||||||
|
)
|
||||||
|
|
||||||
|
self.hideSection = QSwitch(width=wS, height=hS)
|
||||||
|
self.hideSection.setChecked(
|
||||||
|
self.optState.getBool("GuiBuildNovel", "hideSection", True)
|
||||||
|
)
|
||||||
|
|
||||||
# Wrapper boxes due to QGridView and QLineEdit expand bug
|
# Wrapper boxes due to QGridView and QLineEdit expand bug
|
||||||
self.boxTitle = QHBoxLayout()
|
self.boxTitle = QHBoxLayout()
|
||||||
self.boxTitle.addWidget(self.fmtTitle)
|
self.boxTitle.addWidget(self.fmtTitle)
|
||||||
@@ -184,25 +194,31 @@ class GuiBuildNovel(QDialog):
|
|||||||
self.boxSection = QHBoxLayout()
|
self.boxSection = QHBoxLayout()
|
||||||
self.boxSection.addWidget(self.fmtSection)
|
self.boxSection.addWidget(self.fmtSection)
|
||||||
|
|
||||||
titleLabel = QLabel(self.tr("Title"))
|
titleLabel = QLabel(self.tr("Title"))
|
||||||
chapterLabel = QLabel(self.tr("Chapter"))
|
chapterLabel = QLabel(self.tr("Chapter"))
|
||||||
unnumbLabel = QLabel(self.tr("Unnumbered"))
|
unnumbLabel = QLabel(self.tr("Unnumbered"))
|
||||||
sceneLabel = QLabel(self.tr("Scene"))
|
sceneLabel = QLabel(self.tr("Scene"))
|
||||||
sectionLabel = QLabel(self.tr("Section"))
|
sectionLabel = QLabel(self.tr("Section"))
|
||||||
langLabel = QLabel(self.tr("Language"))
|
langLabel = QLabel(self.tr("Language"))
|
||||||
|
hSceneLabel = QLabel(self.tr("Hide scene"))
|
||||||
|
hSectionLabel = QLabel(self.tr("Hide section"))
|
||||||
|
|
||||||
self.titleForm.addWidget(titleLabel, 0, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(titleLabel, 0, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addLayout(self.boxTitle, 0, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addLayout(self.boxTitle, 0, 1, 1, 1, Qt.AlignRight)
|
||||||
self.titleForm.addWidget(chapterLabel, 1, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(chapterLabel, 1, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addLayout(self.boxChapter, 1, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addLayout(self.boxChapter, 1, 1, 1, 1, Qt.AlignRight)
|
||||||
self.titleForm.addWidget(unnumbLabel, 2, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(unnumbLabel, 2, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addLayout(self.boxUnnumb, 2, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addLayout(self.boxUnnumb, 2, 1, 1, 1, Qt.AlignRight)
|
||||||
self.titleForm.addWidget(sceneLabel, 3, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(sceneLabel, 3, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addLayout(self.boxScene, 3, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addLayout(self.boxScene, 3, 1, 1, 1, Qt.AlignRight)
|
||||||
self.titleForm.addWidget(sectionLabel, 4, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(sectionLabel, 4, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addLayout(self.boxSection, 4, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addLayout(self.boxSection, 4, 1, 1, 1, Qt.AlignRight)
|
||||||
self.titleForm.addWidget(langLabel, 5, 0, 1, 1, Qt.AlignLeft)
|
self.titleForm.addWidget(langLabel, 5, 0, 1, 1, Qt.AlignLeft)
|
||||||
self.titleForm.addWidget(self.buildLang, 5, 1, 1, 1, Qt.AlignRight)
|
self.titleForm.addWidget(self.buildLang, 5, 1, 1, 1, Qt.AlignRight)
|
||||||
|
self.titleForm.addWidget(hSceneLabel, 6, 0, 1, 1, Qt.AlignLeft)
|
||||||
|
self.titleForm.addWidget(self.hideScene, 6, 1, 1, 1, Qt.AlignRight)
|
||||||
|
self.titleForm.addWidget(hSectionLabel, 7, 0, 1, 1, Qt.AlignLeft)
|
||||||
|
self.titleForm.addWidget(self.hideSection, 7, 1, 1, 1, Qt.AlignRight)
|
||||||
|
|
||||||
self.titleForm.setColumnStretch(0, 0)
|
self.titleForm.setColumnStretch(0, 0)
|
||||||
self.titleForm.setColumnStretch(1, 1)
|
self.titleForm.setColumnStretch(1, 1)
|
||||||
@@ -643,6 +659,8 @@ class GuiBuildNovel(QDialog):
|
|||||||
fmtUnnumbered = self.fmtUnnumbered.text()
|
fmtUnnumbered = self.fmtUnnumbered.text()
|
||||||
fmtScene = self.fmtScene.text()
|
fmtScene = self.fmtScene.text()
|
||||||
fmtSection = self.fmtSection.text()
|
fmtSection = self.fmtSection.text()
|
||||||
|
hideScene = self.hideScene.isChecked()
|
||||||
|
hideSection = self.hideSection.isChecked()
|
||||||
textFont = self.textFont.text()
|
textFont = self.textFont.text()
|
||||||
textSize = self.textSize.value()
|
textSize = self.textSize.value()
|
||||||
lineHeight = self.lineHeight.value()
|
lineHeight = self.lineHeight.value()
|
||||||
@@ -670,8 +688,8 @@ class GuiBuildNovel(QDialog):
|
|||||||
bldObj.setTitleFormat(fmtTitle)
|
bldObj.setTitleFormat(fmtTitle)
|
||||||
bldObj.setChapterFormat(fmtChapter)
|
bldObj.setChapterFormat(fmtChapter)
|
||||||
bldObj.setUnNumberedFormat(fmtUnnumbered)
|
bldObj.setUnNumberedFormat(fmtUnnumbered)
|
||||||
bldObj.setSceneFormat(fmtScene, False)
|
bldObj.setSceneFormat(fmtScene, hideScene)
|
||||||
bldObj.setSectionFormat(fmtSection, fmtSection == "")
|
bldObj.setSectionFormat(fmtSection, hideSection)
|
||||||
|
|
||||||
bldObj.setFont(textFont, textSize, textFixed)
|
bldObj.setFont(textFont, textSize, textFixed)
|
||||||
bldObj.setJustify(justifyText)
|
bldObj.setJustify(justifyText)
|
||||||
@@ -1115,6 +1133,8 @@ class GuiBuildNovel(QDialog):
|
|||||||
})
|
})
|
||||||
|
|
||||||
buildLang = self.buildLang.currentData()
|
buildLang = self.buildLang.currentData()
|
||||||
|
hideScene = self.hideScene.isChecked()
|
||||||
|
hideSection = self.hideSection.isChecked()
|
||||||
winWidth = self.mainConf.rpxInt(self.width())
|
winWidth = self.mainConf.rpxInt(self.width())
|
||||||
winHeight = self.mainConf.rpxInt(self.height())
|
winHeight = self.mainConf.rpxInt(self.height())
|
||||||
justifyText = self.justifyText.isChecked()
|
justifyText = self.justifyText.isChecked()
|
||||||
@@ -1139,6 +1159,8 @@ class GuiBuildNovel(QDialog):
|
|||||||
self.theProject.setProjectLang(buildLang)
|
self.theProject.setProjectLang(buildLang)
|
||||||
|
|
||||||
# GUI Settings
|
# GUI Settings
|
||||||
|
self.optState.setValue("GuiBuildNovel", "hideScene", hideScene)
|
||||||
|
self.optState.setValue("GuiBuildNovel", "hideSection", hideSection)
|
||||||
self.optState.setValue("GuiBuildNovel", "winWidth", winWidth)
|
self.optState.setValue("GuiBuildNovel", "winWidth", winWidth)
|
||||||
self.optState.setValue("GuiBuildNovel", "winHeight", winHeight)
|
self.optState.setValue("GuiBuildNovel", "winHeight", winHeight)
|
||||||
self.optState.setValue("GuiBuildNovel", "boxWidth", boxWidth)
|
self.optState.setValue("GuiBuildNovel", "boxWidth", boxWidth)
|
||||||
|
|||||||
Reference in New Issue
Block a user