novelWriter 2.2rc1__py3-none-any.whl → 2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {novelWriter-2.2rc1.dist-info → novelWriter-2.3.dist-info}/METADATA +1 -1
- {novelWriter-2.2rc1.dist-info → novelWriter-2.3.dist-info}/RECORD +149 -132
- {novelWriter-2.2rc1.dist-info → novelWriter-2.3.dist-info}/WHEEL +1 -1
- novelWriter-2.3.dist-info/entry_points.txt +2 -0
- novelwriter/__init__.py +11 -6
- novelwriter/assets/i18n/nw_de_DE.qm +0 -0
- novelwriter/assets/i18n/nw_en_US.qm +0 -0
- novelwriter/assets/i18n/nw_es_419.qm +0 -0
- novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
- novelwriter/assets/i18n/nw_it_IT.qm +0 -0
- novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
- novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
- novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
- novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
- novelwriter/assets/i18n/project_de_DE.json +1 -0
- novelwriter/assets/i18n/project_en_US.json +1 -0
- novelwriter/assets/i18n/project_es_419.json +11 -0
- novelwriter/assets/i18n/project_fr_FR.json +11 -0
- novelwriter/assets/i18n/project_it_IT.json +11 -0
- novelwriter/assets/i18n/project_ja_JP.json +2 -1
- novelwriter/assets/i18n/project_nb_NO.json +1 -0
- novelwriter/assets/i18n/project_nl_NL.json +11 -0
- novelwriter/assets/i18n/project_pt_BR.json +11 -0
- novelwriter/assets/i18n/project_zh_CN.json +11 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +11 -2
- novelwriter/assets/icons/typicons_dark/mixed_document-new.svg +6 -0
- novelwriter/assets/icons/typicons_dark/mixed_import.svg +5 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +3 -1
- novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +3 -1
- novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +3 -1
- novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +4 -2
- novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +4 -2
- novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +4 -2
- novelwriter/assets/icons/typicons_dark/typ_document-add.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_document.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_th-list.svg +9 -0
- novelwriter/assets/icons/typicons_light/icons.conf +11 -2
- novelwriter/assets/icons/typicons_light/mixed_document-new.svg +6 -0
- novelwriter/assets/icons/typicons_light/mixed_import.svg +5 -0
- novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +3 -1
- novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +3 -1
- novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +3 -1
- novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +4 -2
- novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +4 -2
- novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +4 -2
- novelwriter/assets/icons/typicons_light/typ_document-add.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_document.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_th-list.svg +9 -0
- novelwriter/assets/images/novelwriter-text-dark.svg +4 -0
- novelwriter/assets/images/novelwriter-text-light.svg +4 -0
- novelwriter/assets/images/welcome-dark.jpg +0 -0
- novelwriter/assets/images/welcome-light.jpg +0 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +26 -0
- novelwriter/assets/syntax/default_dark.conf +1 -0
- novelwriter/assets/syntax/default_light.conf +1 -0
- novelwriter/assets/syntax/grey_dark.conf +1 -0
- novelwriter/assets/syntax/grey_light.conf +1 -0
- novelwriter/assets/syntax/light_owl.conf +1 -0
- novelwriter/assets/syntax/night_owl.conf +1 -0
- novelwriter/assets/syntax/solarized_dark.conf +1 -0
- novelwriter/assets/syntax/solarized_light.conf +1 -0
- novelwriter/assets/syntax/tango.conf +23 -0
- novelwriter/assets/syntax/tomorrow.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_blue.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_bright.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +1 -0
- novelwriter/assets/text/credits_en.htm +4 -2
- novelwriter/assets/themes/cyberpunk_night.conf +29 -0
- novelwriter/assets/themes/default_dark.conf +2 -2
- novelwriter/assets/themes/default_light.conf +2 -2
- novelwriter/common.py +64 -66
- novelwriter/config.py +39 -44
- novelwriter/constants.py +39 -17
- novelwriter/core/buildsettings.py +8 -8
- novelwriter/core/coretools.py +198 -157
- novelwriter/core/docbuild.py +7 -4
- novelwriter/core/document.py +7 -7
- novelwriter/core/index.py +90 -57
- novelwriter/core/item.py +23 -5
- novelwriter/core/options.py +11 -10
- novelwriter/core/project.py +73 -47
- novelwriter/core/projectdata.py +3 -16
- novelwriter/core/projectxml.py +14 -42
- novelwriter/core/sessions.py +4 -3
- novelwriter/core/spellcheck.py +6 -4
- novelwriter/core/status.py +5 -4
- novelwriter/core/storage.py +183 -141
- novelwriter/core/tohtml.py +6 -4
- novelwriter/core/tokenizer.py +110 -83
- novelwriter/core/tomd.py +2 -2
- novelwriter/core/toodt.py +41 -31
- novelwriter/core/tree.py +5 -4
- novelwriter/dialogs/about.py +88 -179
- novelwriter/dialogs/docmerge.py +30 -20
- novelwriter/dialogs/docsplit.py +33 -22
- novelwriter/dialogs/editlabel.py +20 -8
- novelwriter/dialogs/preferences.py +562 -725
- novelwriter/dialogs/{projsettings.py → projectsettings.py} +301 -270
- novelwriter/dialogs/quotes.py +47 -36
- novelwriter/dialogs/wordlist.py +128 -59
- novelwriter/enum.py +25 -22
- novelwriter/error.py +2 -2
- novelwriter/extensions/circularprogress.py +12 -12
- novelwriter/extensions/configlayout.py +185 -146
- novelwriter/extensions/{wheeleventfilter.py → eventfilters.py} +15 -5
- novelwriter/extensions/modified.py +81 -0
- novelwriter/extensions/novelselector.py +27 -13
- novelwriter/extensions/pagedsidebar.py +15 -20
- novelwriter/extensions/simpleprogress.py +8 -9
- novelwriter/extensions/statusled.py +9 -9
- novelwriter/extensions/switch.py +32 -64
- novelwriter/extensions/switchbox.py +2 -7
- novelwriter/extensions/versioninfo.py +153 -0
- novelwriter/gui/doceditor.py +250 -214
- novelwriter/gui/dochighlight.py +66 -94
- novelwriter/gui/docviewer.py +71 -98
- novelwriter/gui/docviewerpanel.py +140 -47
- novelwriter/gui/editordocument.py +3 -3
- novelwriter/gui/itemdetails.py +9 -9
- novelwriter/gui/mainmenu.py +47 -47
- novelwriter/gui/noveltree.py +53 -61
- novelwriter/gui/outline.py +100 -76
- novelwriter/gui/projtree.py +246 -112
- novelwriter/gui/sidebar.py +9 -8
- novelwriter/gui/statusbar.py +49 -7
- novelwriter/gui/theme.py +74 -76
- novelwriter/guimain.py +175 -330
- novelwriter/shared.py +68 -30
- novelwriter/tools/dictionaries.py +7 -8
- novelwriter/tools/lipsum.py +34 -28
- novelwriter/tools/manusbuild.py +3 -4
- novelwriter/tools/manuscript.py +25 -32
- novelwriter/tools/manussettings.py +194 -225
- novelwriter/tools/noveldetails.py +525 -0
- novelwriter/tools/welcome.py +819 -0
- novelwriter/tools/writingstats.py +26 -13
- novelWriter-2.2rc1.dist-info/entry_points.txt +0 -5
- novelwriter/assets/icons/typicons_dark/nw_tb-markdown.svg +0 -8
- novelwriter/assets/icons/typicons_dark/nw_tb-shortcode.svg +0 -8
- novelwriter/assets/icons/typicons_light/nw_tb-markdown.svg +0 -8
- novelwriter/assets/icons/typicons_light/nw_tb-shortcode.svg +0 -8
- novelwriter/assets/images/wizard-back.jpg +0 -0
- novelwriter/assets/text/gplv3_en.htm +0 -641
- novelwriter/assets/text/release_notes.htm +0 -17
- novelwriter/dialogs/projdetails.py +0 -525
- novelwriter/dialogs/projload.py +0 -298
- novelwriter/dialogs/updates.py +0 -182
- novelwriter/extensions/pageddialog.py +0 -130
- novelwriter/tools/projwizard.py +0 -478
- {novelWriter-2.2rc1.dist-info → novelWriter-2.3.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.2rc1.dist-info → novelWriter-2.3.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@ File History:
|
|
6
6
|
Created: 2023-02-13 [2.1b1] GuiBuildSettings
|
7
7
|
|
8
8
|
This file is a part of novelWriter
|
9
|
-
Copyright 2018–
|
9
|
+
Copyright 2018–2024, Veronica Berglyd Olsen
|
10
10
|
|
11
11
|
This program is free software: you can redistribute it and/or modify
|
12
12
|
it under the terms of the GNU General Public License as published by
|
@@ -27,24 +27,24 @@ import logging
|
|
27
27
|
|
28
28
|
from typing import TYPE_CHECKING
|
29
29
|
|
30
|
-
from PyQt5.QtGui import
|
31
|
-
QColor, QFont, QIcon, QSyntaxHighlighter, QTextCharFormat, QTextDocument
|
32
|
-
)
|
30
|
+
from PyQt5.QtGui import QFont, QIcon, QSyntaxHighlighter, QTextCharFormat, QTextDocument
|
33
31
|
from PyQt5.QtCore import QEvent, QSize, Qt, pyqtSignal, pyqtSlot
|
34
32
|
from PyQt5.QtWidgets import (
|
35
|
-
QAbstractButton, QAbstractItemView,
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
QWidget
|
33
|
+
QAbstractButton, QAbstractItemView, QDialog, QDialogButtonBox,
|
34
|
+
QFontDialog, QFrame, QGridLayout, QHBoxLayout, QHeaderView, QLabel,
|
35
|
+
QLineEdit, QMenu, QPlainTextEdit, QPushButton, QSplitter, QStackedWidget,
|
36
|
+
QToolButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget
|
40
37
|
)
|
41
38
|
|
42
39
|
from novelwriter import CONFIG, SHARED
|
43
40
|
from novelwriter.constants import nwHeadFmt, nwLabels, trConst
|
44
41
|
from novelwriter.core.buildsettings import BuildSettings, FilterMode
|
45
42
|
from novelwriter.extensions.switch import NSwitch
|
43
|
+
from novelwriter.extensions.modified import NComboBox, NDoubleSpinBox, NSpinBox
|
46
44
|
from novelwriter.extensions.switchbox import NSwitchBox
|
47
|
-
from novelwriter.extensions.configlayout import
|
45
|
+
from novelwriter.extensions.configlayout import (
|
46
|
+
NColourLabel, NFixedPage, NScrollableForm, NScrollablePage
|
47
|
+
)
|
48
48
|
from novelwriter.extensions.pagedsidebar import NPagedSideBar
|
49
49
|
|
50
50
|
if TYPE_CHECKING: # pragma: no cover
|
@@ -79,47 +79,49 @@ class GuiBuildSettings(QDialog):
|
|
79
79
|
self._build = build
|
80
80
|
|
81
81
|
self.setWindowTitle(self.tr("Manuscript Build Settings"))
|
82
|
-
self.
|
83
|
-
self.setMinimumHeight(CONFIG.pxInt(400))
|
82
|
+
self.setMinimumSize(CONFIG.pxInt(700), CONFIG.pxInt(400))
|
84
83
|
|
85
84
|
mPx = CONFIG.pxInt(150)
|
86
85
|
wWin = CONFIG.pxInt(750)
|
87
86
|
hWin = CONFIG.pxInt(550)
|
88
87
|
|
89
|
-
|
88
|
+
options = SHARED.project.options
|
90
89
|
self.resize(
|
91
|
-
CONFIG.pxInt(
|
92
|
-
CONFIG.pxInt(
|
90
|
+
CONFIG.pxInt(options.getInt("GuiBuildSettings", "winWidth", wWin)),
|
91
|
+
CONFIG.pxInt(options.getInt("GuiBuildSettings", "winHeight", hWin))
|
93
92
|
)
|
94
93
|
|
95
|
-
#
|
96
|
-
|
94
|
+
# Title
|
95
|
+
self.titleLabel = NColourLabel(
|
96
|
+
self.tr("Manuscript Build Settings"), SHARED.theme.helpText,
|
97
|
+
parent=self, scale=NColourLabel.HEADER_SCALE, indent=CONFIG.pxInt(4)
|
98
|
+
)
|
97
99
|
|
98
|
-
|
99
|
-
self.
|
100
|
-
self.
|
101
|
-
self.optSideBar.setLabelColor(SHARED.theme.helpText)
|
100
|
+
# Settings Name
|
101
|
+
self.lblBuildName = QLabel(self.tr("Name"))
|
102
|
+
self.editBuildName = QLineEdit(self)
|
102
103
|
|
103
|
-
|
104
|
-
self.
|
105
|
-
self.
|
106
|
-
self.
|
107
|
-
self.
|
108
|
-
self.optSideBar.addButton(self.tr("Output"), self.OPT_OUTPUT)
|
104
|
+
# SideBar
|
105
|
+
self.sidebar = NPagedSideBar(self)
|
106
|
+
self.sidebar.setMinimumWidth(mPx)
|
107
|
+
self.sidebar.setMaximumWidth(mPx)
|
108
|
+
self.sidebar.setLabelColor(SHARED.theme.helpText)
|
109
109
|
|
110
|
-
self.
|
110
|
+
self.sidebar.addButton(self.tr("Selection"), self.OPT_FILTERS)
|
111
|
+
self.sidebar.addButton(self.tr("Headings"), self.OPT_HEADINGS)
|
112
|
+
self.sidebar.addButton(self.tr("Content"), self.OPT_CONTENT)
|
113
|
+
self.sidebar.addButton(self.tr("Format"), self.OPT_FORMAT)
|
114
|
+
self.sidebar.addButton(self.tr("Output"), self.OPT_OUTPUT)
|
111
115
|
|
112
|
-
|
113
|
-
# ============
|
116
|
+
self.sidebar.buttonClicked.connect(self._stackPageSelected)
|
114
117
|
|
115
|
-
#
|
118
|
+
# Content
|
116
119
|
self.optTabSelect = _FilterTab(self, self._build)
|
117
120
|
self.optTabHeadings = _HeadingsTab(self, self._build)
|
118
121
|
self.optTabContent = _ContentTab(self, self._build)
|
119
122
|
self.optTabFormat = _FormatTab(self, self._build)
|
120
123
|
self.optTabOutput = _OutputTab(self, self._build)
|
121
124
|
|
122
|
-
# Add Tabs
|
123
125
|
self.toolStack = QStackedWidget(self)
|
124
126
|
self.toolStack.addWidget(self.optTabSelect)
|
125
127
|
self.toolStack.addWidget(self.optTabHeadings)
|
@@ -127,38 +129,36 @@ class GuiBuildSettings(QDialog):
|
|
127
129
|
self.toolStack.addWidget(self.optTabContent)
|
128
130
|
self.toolStack.addWidget(self.optTabOutput)
|
129
131
|
|
130
|
-
#
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
self.dlgButtons = QDialogButtonBox(
|
136
|
-
QDialogButtonBox.Apply | QDialogButtonBox.Save | QDialogButtonBox.Close
|
132
|
+
# Buttons
|
133
|
+
self.buttonBox = QDialogButtonBox(
|
134
|
+
QDialogButtonBox.StandardButton.Apply
|
135
|
+
| QDialogButtonBox.StandardButton.Save
|
136
|
+
| QDialogButtonBox.StandardButton.Close
|
137
137
|
)
|
138
|
-
self.
|
139
|
-
|
140
|
-
self.buttonBox = QHBoxLayout()
|
141
|
-
self.buttonBox.addWidget(self.lblBuildName)
|
142
|
-
self.buttonBox.addWidget(self.editBuildName)
|
143
|
-
self.buttonBox.addWidget(self.dlgButtons)
|
138
|
+
self.buttonBox.clicked.connect(self._dialogButtonClicked)
|
144
139
|
|
145
|
-
# Assemble
|
146
|
-
|
140
|
+
# Assemble
|
141
|
+
self.topBox = QHBoxLayout()
|
142
|
+
self.topBox.addWidget(self.titleLabel)
|
143
|
+
self.topBox.addStretch(1)
|
144
|
+
self.topBox.addWidget(self.lblBuildName)
|
145
|
+
self.topBox.addWidget(self.editBuildName, 1)
|
147
146
|
|
148
147
|
self.mainBox = QHBoxLayout()
|
149
|
-
self.mainBox.addWidget(self.
|
148
|
+
self.mainBox.addWidget(self.sidebar)
|
150
149
|
self.mainBox.addWidget(self.toolStack)
|
151
150
|
self.mainBox.setContentsMargins(0, 0, 0, 0)
|
152
151
|
|
153
152
|
self.outerBox = QVBoxLayout()
|
153
|
+
self.outerBox.addLayout(self.topBox)
|
154
154
|
self.outerBox.addLayout(self.mainBox)
|
155
|
-
self.outerBox.
|
155
|
+
self.outerBox.addWidget(self.buttonBox)
|
156
156
|
self.outerBox.setSpacing(CONFIG.pxInt(12))
|
157
157
|
|
158
158
|
self.setLayout(self.outerBox)
|
159
159
|
|
160
160
|
# Set Default Tab
|
161
|
-
self.
|
161
|
+
self.sidebar.setSelected(self.OPT_FILTERS)
|
162
162
|
|
163
163
|
logger.debug("Ready: GuiBuildSettings")
|
164
164
|
|
@@ -187,6 +187,21 @@ class GuiBuildSettings(QDialog):
|
|
187
187
|
"""The build ID of the build of the dialog."""
|
188
188
|
return self._build.buildID
|
189
189
|
|
190
|
+
##
|
191
|
+
# Events
|
192
|
+
##
|
193
|
+
|
194
|
+
def closeEvent(self, event: QEvent) -> None:
|
195
|
+
"""Capture the user closing the window so we can save
|
196
|
+
settings.
|
197
|
+
"""
|
198
|
+
logger.debug("Closing: GuiBuildSettings")
|
199
|
+
self._askToSaveBuild()
|
200
|
+
self._saveSettings()
|
201
|
+
event.accept()
|
202
|
+
self.deleteLater()
|
203
|
+
return
|
204
|
+
|
190
205
|
##
|
191
206
|
# Private Slots
|
192
207
|
##
|
@@ -209,7 +224,7 @@ class GuiBuildSettings(QDialog):
|
|
209
224
|
@pyqtSlot("QAbstractButton*")
|
210
225
|
def _dialogButtonClicked(self, button: QAbstractButton) -> None:
|
211
226
|
"""Handle button clicks from the dialog button box."""
|
212
|
-
role = self.
|
227
|
+
role = self.buttonBox.buttonRole(button)
|
213
228
|
if role == QDialogButtonBox.ApplyRole:
|
214
229
|
self._emitBuildData()
|
215
230
|
elif role == QDialogButtonBox.AcceptRole:
|
@@ -219,21 +234,6 @@ class GuiBuildSettings(QDialog):
|
|
219
234
|
self.close()
|
220
235
|
return
|
221
236
|
|
222
|
-
##
|
223
|
-
# Events
|
224
|
-
##
|
225
|
-
|
226
|
-
def closeEvent(self, event: QEvent) -> None:
|
227
|
-
"""Capture the user closing the window so we can save
|
228
|
-
settings.
|
229
|
-
"""
|
230
|
-
logger.debug("Closing: GuiBuildSettings")
|
231
|
-
self._askToSaveBuild()
|
232
|
-
self._saveSettings()
|
233
|
-
event.accept()
|
234
|
-
self.deleteLater()
|
235
|
-
return
|
236
|
-
|
237
237
|
##
|
238
238
|
# Internal Functions
|
239
239
|
##
|
@@ -253,13 +253,11 @@ class GuiBuildSettings(QDialog):
|
|
253
253
|
|
254
254
|
def _saveSettings(self) -> None:
|
255
255
|
"""Save the various user settings."""
|
256
|
-
logger.debug("Saving GuiBuildSettings settings")
|
257
|
-
|
258
256
|
winWidth = CONFIG.rpxInt(self.width())
|
259
257
|
winHeight = CONFIG.rpxInt(self.height())
|
260
|
-
|
261
258
|
treeWidth, filterWidth = self.optTabSelect.mainSplitSizes()
|
262
259
|
|
260
|
+
logger.debug("Saving State: GuiBuildSettings")
|
263
261
|
pOptions = SHARED.project.options
|
264
262
|
pOptions.setValue("GuiBuildSettings", "winWidth", winWidth)
|
265
263
|
pOptions.setValue("GuiBuildSettings", "winHeight", winHeight)
|
@@ -283,7 +281,7 @@ class GuiBuildSettings(QDialog):
|
|
283
281
|
# END Class GuiBuildSettings
|
284
282
|
|
285
283
|
|
286
|
-
class _FilterTab(
|
284
|
+
class _FilterTab(NFixedPage):
|
287
285
|
|
288
286
|
C_DATA = 0
|
289
287
|
C_NAME = 0
|
@@ -399,11 +397,7 @@ class _FilterTab(QWidget):
|
|
399
397
|
CONFIG.pxInt(pOptions.getInt("GuiBuildSettings", "filterWidth", 300))
|
400
398
|
])
|
401
399
|
|
402
|
-
self.
|
403
|
-
self.outerBox.addWidget(self.mainSplit)
|
404
|
-
self.outerBox.setContentsMargins(0, 0, 0, 0)
|
405
|
-
|
406
|
-
self.setLayout(self.outerBox)
|
400
|
+
self.setCentralWidget(self.mainSplit)
|
407
401
|
|
408
402
|
return
|
409
403
|
|
@@ -584,7 +578,7 @@ class _FilterTab(QWidget):
|
|
584
578
|
# END Class _FilterTab
|
585
579
|
|
586
580
|
|
587
|
-
class _HeadingsTab(
|
581
|
+
class _HeadingsTab(NScrollablePage):
|
588
582
|
|
589
583
|
EDIT_TITLE = 1
|
590
584
|
EDIT_CHAPTER = 2
|
@@ -609,9 +603,9 @@ class _HeadingsTab(QWidget):
|
|
609
603
|
|
610
604
|
# Title Heading
|
611
605
|
self.lblTitle = QLabel(self._build.getLabel("headings.fmtTitle"))
|
612
|
-
self.fmtTitle = QLineEdit("")
|
606
|
+
self.fmtTitle = QLineEdit("", self)
|
613
607
|
self.fmtTitle.setReadOnly(True)
|
614
|
-
self.btnTitle = QToolButton()
|
608
|
+
self.btnTitle = QToolButton(self)
|
615
609
|
self.btnTitle.setIcon(SHARED.theme.getIcon("edit"))
|
616
610
|
self.btnTitle.clicked.connect(lambda: self._editHeading(self.EDIT_TITLE))
|
617
611
|
|
@@ -625,9 +619,9 @@ class _HeadingsTab(QWidget):
|
|
625
619
|
|
626
620
|
# Chapter Heading
|
627
621
|
self.lblChapter = QLabel(self._build.getLabel("headings.fmtChapter"))
|
628
|
-
self.fmtChapter = QLineEdit("")
|
622
|
+
self.fmtChapter = QLineEdit("", self)
|
629
623
|
self.fmtChapter.setReadOnly(True)
|
630
|
-
self.btnChapter = QToolButton()
|
624
|
+
self.btnChapter = QToolButton(self)
|
631
625
|
self.btnChapter.setIcon(SHARED.theme.getIcon("edit"))
|
632
626
|
self.btnChapter.clicked.connect(lambda: self._editHeading(self.EDIT_CHAPTER))
|
633
627
|
|
@@ -641,9 +635,9 @@ class _HeadingsTab(QWidget):
|
|
641
635
|
|
642
636
|
# Unnumbered Chapter Heading
|
643
637
|
self.lblUnnumbered = QLabel(self._build.getLabel("headings.fmtUnnumbered"))
|
644
|
-
self.fmtUnnumbered = QLineEdit("")
|
638
|
+
self.fmtUnnumbered = QLineEdit("", self)
|
645
639
|
self.fmtUnnumbered.setReadOnly(True)
|
646
|
-
self.btnUnnumbered = QToolButton()
|
640
|
+
self.btnUnnumbered = QToolButton(self)
|
647
641
|
self.btnUnnumbered.setIcon(SHARED.theme.getIcon("edit"))
|
648
642
|
self.btnUnnumbered.clicked.connect(lambda: self._editHeading(self.EDIT_UNNUM))
|
649
643
|
|
@@ -658,14 +652,14 @@ class _HeadingsTab(QWidget):
|
|
658
652
|
# Scene Heading
|
659
653
|
sceneHideTip = self._build.getLabel("headings.hideScene")
|
660
654
|
self.lblScene = QLabel(self._build.getLabel("headings.fmtScene"))
|
661
|
-
self.fmtScene = QLineEdit("")
|
655
|
+
self.fmtScene = QLineEdit("", self)
|
662
656
|
self.fmtScene.setReadOnly(True)
|
663
|
-
self.btnScene = QToolButton()
|
657
|
+
self.btnScene = QToolButton(self)
|
664
658
|
self.btnScene.setIcon(SHARED.theme.getIcon("edit"))
|
665
659
|
self.btnScene.clicked.connect(lambda: self._editHeading(self.EDIT_SCENE))
|
666
660
|
self.hdeScene = QLabel(self.tr("Hide"))
|
667
661
|
self.hdeScene.setToolTip(sceneHideTip)
|
668
|
-
self.swtScene = NSwitch(self,
|
662
|
+
self.swtScene = NSwitch(self, height=iPx)
|
669
663
|
self.swtScene.setToolTip(sceneHideTip)
|
670
664
|
|
671
665
|
wrapScene = QHBoxLayout()
|
@@ -685,14 +679,14 @@ class _HeadingsTab(QWidget):
|
|
685
679
|
# Section Heading
|
686
680
|
sectionHideTip = self._build.getLabel("headings.hideSection")
|
687
681
|
self.lblSection = QLabel(self._build.getLabel("headings.fmtSection"))
|
688
|
-
self.fmtSection = QLineEdit("")
|
682
|
+
self.fmtSection = QLineEdit("", self)
|
689
683
|
self.fmtSection.setReadOnly(True)
|
690
|
-
self.btnSection = QToolButton()
|
684
|
+
self.btnSection = QToolButton(self)
|
691
685
|
self.btnSection.setIcon(SHARED.theme.getIcon("edit"))
|
692
686
|
self.btnSection.clicked.connect(lambda: self._editHeading(self.EDIT_SECTION))
|
693
687
|
self.hdeSection = QLabel(self.tr("Hide"))
|
694
688
|
self.hdeSection.setToolTip(sectionHideTip)
|
695
|
-
self.swtSection = NSwitch(self,
|
689
|
+
self.swtSection = NSwitch(self, height=iPx)
|
696
690
|
self.swtSection.setToolTip(sectionHideTip)
|
697
691
|
|
698
692
|
wrapSection = QHBoxLayout()
|
@@ -728,6 +722,8 @@ class _HeadingsTab(QWidget):
|
|
728
722
|
self.aInsChRomL = self.menuInsert.addAction(self.tr("Chapter Number (Lower Case Roman)"))
|
729
723
|
self.aInsScNum = self.menuInsert.addAction(self.tr("Scene Number (In Chapter)"))
|
730
724
|
self.aInsScAbs = self.menuInsert.addAction(self.tr("Scene Number (Absolute)"))
|
725
|
+
self.aInsCharPOV = self.menuInsert.addAction(self.tr("Point of View Character"))
|
726
|
+
self.aInsCharFocus = self.menuInsert.addAction(self.tr("Focus Character"))
|
731
727
|
|
732
728
|
self.aInsTitle.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.TITLE))
|
733
729
|
self.aInsChNum.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.CH_NUM))
|
@@ -736,6 +732,8 @@ class _HeadingsTab(QWidget):
|
|
736
732
|
self.aInsChRomL.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.CH_ROML))
|
737
733
|
self.aInsScNum.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.SC_NUM))
|
738
734
|
self.aInsScAbs.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.SC_ABS))
|
735
|
+
self.aInsCharPOV.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.CHAR_POV))
|
736
|
+
self.aInsCharFocus.triggered.connect(lambda: self._insertIntoForm(nwHeadFmt.CHAR_FOCUS))
|
739
737
|
|
740
738
|
self.btnInsert = QPushButton(self.tr("Insert"))
|
741
739
|
self.btnInsert.setMenu(self.menuInsert)
|
@@ -762,7 +760,7 @@ class _HeadingsTab(QWidget):
|
|
762
760
|
self.outerBox.addLayout(self.editFormBox)
|
763
761
|
self.outerBox.addStretch(1)
|
764
762
|
|
765
|
-
self.
|
763
|
+
self.setCentralLayout(self.outerBox)
|
766
764
|
|
767
765
|
return
|
768
766
|
|
@@ -829,6 +827,7 @@ class _HeadingsTab(QWidget):
|
|
829
827
|
# Private Slots
|
830
828
|
##
|
831
829
|
|
830
|
+
@pyqtSlot()
|
832
831
|
def _saveFormat(self) -> None:
|
833
832
|
"""Save the format from the edit text box."""
|
834
833
|
heading = self._editing
|
@@ -864,14 +863,14 @@ class _HeadingSyntaxHighlighter(QSyntaxHighlighter):
|
|
864
863
|
def __init__(self, document: QTextDocument) -> None:
|
865
864
|
super().__init__(document)
|
866
865
|
self._fmtSymbol = QTextCharFormat()
|
867
|
-
self._fmtSymbol.setForeground(
|
866
|
+
self._fmtSymbol.setForeground(SHARED.theme.colHead)
|
868
867
|
self._fmtFormat = QTextCharFormat()
|
869
|
-
self._fmtFormat.setForeground(
|
868
|
+
self._fmtFormat.setForeground(SHARED.theme.colEmph)
|
870
869
|
return
|
871
870
|
|
872
871
|
def highlightBlock(self, text: str) -> None:
|
873
872
|
"""Add syntax highlighting to the text block."""
|
874
|
-
for heading in nwHeadFmt.
|
873
|
+
for heading in nwHeadFmt.PAGE_HEADERS:
|
875
874
|
pos = text.find(heading)
|
876
875
|
if pos >= 0:
|
877
876
|
chars = len(heading)
|
@@ -885,7 +884,7 @@ class _HeadingSyntaxHighlighter(QSyntaxHighlighter):
|
|
885
884
|
# END Class _HeadingSyntaxHighlighter
|
886
885
|
|
887
886
|
|
888
|
-
class _ContentTab(
|
887
|
+
class _ContentTab(NScrollableForm):
|
889
888
|
|
890
889
|
def __init__(self, buildMain: GuiBuildSettings, build: BuildSettings) -> None:
|
891
890
|
super().__init__(parent=buildMain)
|
@@ -894,42 +893,26 @@ class _ContentTab(QWidget):
|
|
894
893
|
|
895
894
|
iPx = SHARED.theme.baseIconSize
|
896
895
|
|
897
|
-
#
|
898
|
-
|
899
|
-
|
900
|
-
self.
|
901
|
-
self.
|
902
|
-
|
903
|
-
self.incSynopsis = NSwitch(self, width=2*iPx, height=iPx)
|
904
|
-
self.incComments = NSwitch(self, width=2*iPx, height=iPx)
|
905
|
-
self.incKeywords = NSwitch(self, width=2*iPx, height=iPx)
|
906
|
-
self.incBodyText = NSwitch(self, width=2*iPx, height=iPx)
|
907
|
-
|
908
|
-
self.formLeft.addRow(self._build.getLabel("text.includeSynopsis"), self.incSynopsis)
|
909
|
-
self.formLeft.addRow(self._build.getLabel("text.includeComments"), self.incComments)
|
910
|
-
self.formLeft.addRow(self._build.getLabel("text.includeKeywords"), self.incKeywords)
|
911
|
-
self.formLeft.addRow(self._build.getLabel("text.includeBodyText"), self.incBodyText)
|
896
|
+
# Text Content
|
897
|
+
self.incSynopsis = NSwitch(self, height=iPx)
|
898
|
+
self.incComments = NSwitch(self, height=iPx)
|
899
|
+
self.incKeywords = NSwitch(self, height=iPx)
|
900
|
+
self.incBodyText = NSwitch(self, height=iPx)
|
912
901
|
|
913
|
-
|
914
|
-
|
902
|
+
self.addGroupLabel(self._build.getLabel("text.grpContent"))
|
903
|
+
self.addRow(self._build.getLabel("text.includeSynopsis"), self.incSynopsis)
|
904
|
+
self.addRow(self._build.getLabel("text.includeComments"), self.incComments)
|
905
|
+
self.addRow(self._build.getLabel("text.includeKeywords"), self.incKeywords)
|
906
|
+
self.addRow(self._build.getLabel("text.includeBodyText"), self.incBodyText)
|
915
907
|
|
916
|
-
|
917
|
-
self.
|
908
|
+
# Insert Content
|
909
|
+
self.addNoteHead = NSwitch(self, height=iPx)
|
918
910
|
|
919
|
-
self.
|
911
|
+
self.addGroupLabel(self._build.getLabel("text.grpInsert"))
|
912
|
+
self.addRow(self._build.getLabel("text.addNoteHeadings"), self.addNoteHead)
|
920
913
|
|
921
|
-
|
922
|
-
|
923
|
-
# Assemble GUI
|
924
|
-
# ============
|
925
|
-
|
926
|
-
self.outerBox = QHBoxLayout()
|
927
|
-
self.outerBox.addLayout(self.formLeft, 1)
|
928
|
-
self.outerBox.addLayout(self.formRight, 1)
|
929
|
-
self.outerBox.setContentsMargins(0, 0, 0, 0)
|
930
|
-
self.outerBox.setSpacing(CONFIG.pxInt(16))
|
931
|
-
|
932
|
-
self.setLayout(self.outerBox)
|
914
|
+
# Finalise
|
915
|
+
self.finalise()
|
933
916
|
|
934
917
|
return
|
935
918
|
|
@@ -954,7 +937,7 @@ class _ContentTab(QWidget):
|
|
954
937
|
# END Class _ContentTab
|
955
938
|
|
956
939
|
|
957
|
-
class _FormatTab(
|
940
|
+
class _FormatTab(NScrollableForm):
|
958
941
|
|
959
942
|
def __init__(self, buildMain: GuiBuildSettings, build: BuildSettings) -> None:
|
960
943
|
super().__init__(parent=buildMain)
|
@@ -968,127 +951,98 @@ class _FormatTab(QWidget):
|
|
968
951
|
spW = 6*SHARED.theme.textNWidth
|
969
952
|
dbW = 8*SHARED.theme.textNWidth
|
970
953
|
|
971
|
-
# Text Format
|
972
|
-
#
|
954
|
+
# Text Format
|
955
|
+
# ===========
|
973
956
|
|
974
|
-
self.
|
975
|
-
self.formFormat.addGroupLabel(self._build.getLabel("format.grpFormat"))
|
957
|
+
self.addGroupLabel(self._build.getLabel("format.grpFormat"))
|
976
958
|
|
977
959
|
# Font Family
|
978
|
-
self.textFont = QLineEdit()
|
960
|
+
self.textFont = QLineEdit(self)
|
979
961
|
self.textFont.setReadOnly(True)
|
980
962
|
self.btnTextFont = QPushButton("...")
|
981
963
|
self.btnTextFont.setMaximumWidth(int(2.5*SHARED.theme.getTextWidth("...")))
|
982
964
|
self.btnTextFont.clicked.connect(self._selectFont)
|
983
|
-
self.
|
984
|
-
self._build.getLabel("format.textFont"), self.textFont,
|
965
|
+
self.addRow(
|
966
|
+
self._build.getLabel("format.textFont"), self.textFont,
|
967
|
+
button=self.btnTextFont, stretch=(3, 2)
|
985
968
|
)
|
986
969
|
|
987
970
|
# Font Size
|
988
|
-
self.textSize =
|
971
|
+
self.textSize = NSpinBox(self)
|
989
972
|
self.textSize.setMinimum(8)
|
990
973
|
self.textSize.setMaximum(60)
|
991
974
|
self.textSize.setSingleStep(1)
|
992
975
|
self.textSize.setMinimumWidth(spW)
|
993
|
-
self.
|
994
|
-
self._build.getLabel("format.textSize"), self.textSize, unit="pt"
|
995
|
-
)
|
976
|
+
self.addRow(self._build.getLabel("format.textSize"), self.textSize, unit="pt")
|
996
977
|
|
997
978
|
# Line Height
|
998
|
-
self.lineHeight =
|
979
|
+
self.lineHeight = NDoubleSpinBox(self)
|
999
980
|
self.lineHeight.setFixedWidth(spW)
|
1000
981
|
self.lineHeight.setMinimum(0.75)
|
1001
982
|
self.lineHeight.setMaximum(3.0)
|
1002
983
|
self.lineHeight.setSingleStep(0.05)
|
1003
984
|
self.lineHeight.setDecimals(2)
|
1004
|
-
self.
|
1005
|
-
self._build.getLabel("format.lineHeight"), self.lineHeight, unit="em"
|
1006
|
-
)
|
985
|
+
self.addRow(self._build.getLabel("format.lineHeight"), self.lineHeight, unit="em")
|
1007
986
|
|
1008
|
-
# Text Options
|
1009
|
-
#
|
987
|
+
# Text Options
|
988
|
+
# ============
|
1010
989
|
|
1011
|
-
self.
|
1012
|
-
self.formOptions.addGroupLabel(self._build.getLabel("format.grpOptions"))
|
1013
|
-
self.formOptions.setContentsMargins(0, 0, 0, 0)
|
990
|
+
self.addGroupLabel(self._build.getLabel("format.grpOptions"))
|
1014
991
|
|
1015
|
-
self.justifyText = NSwitch(self,
|
1016
|
-
self.stripUnicode = NSwitch(self,
|
1017
|
-
self.replaceTabs = NSwitch(self,
|
992
|
+
self.justifyText = NSwitch(self, height=iPx)
|
993
|
+
self.stripUnicode = NSwitch(self, height=iPx)
|
994
|
+
self.replaceTabs = NSwitch(self, height=iPx)
|
1018
995
|
|
1019
|
-
self.
|
1020
|
-
self.
|
1021
|
-
self.
|
996
|
+
self.addRow(self._build.getLabel("format.justifyText"), self.justifyText)
|
997
|
+
self.addRow(self._build.getLabel("format.stripUnicode"), self.stripUnicode)
|
998
|
+
self.addRow(self._build.getLabel("format.replaceTabs"), self.replaceTabs)
|
1022
999
|
|
1023
|
-
# Page Layout
|
1024
|
-
#
|
1000
|
+
# Page Layout
|
1001
|
+
# ===========
|
1025
1002
|
|
1026
|
-
self.
|
1027
|
-
self.formLayout.addGroupLabel(self._build.getLabel("format.grpPage"))
|
1028
|
-
self.formLayout.setContentsMargins(0, 0, 0, 0)
|
1003
|
+
self.addGroupLabel(self._build.getLabel("format.grpPage"))
|
1029
1004
|
|
1030
|
-
self.pageUnit =
|
1005
|
+
self.pageUnit = NComboBox(self)
|
1031
1006
|
for key, name in nwLabels.UNIT_NAME.items():
|
1032
1007
|
self.pageUnit.addItem(trConst(name), key)
|
1033
1008
|
|
1034
|
-
self.pageSize =
|
1009
|
+
self.pageSize = NComboBox(self)
|
1035
1010
|
for key, name in nwLabels.PAPER_NAME.items():
|
1036
1011
|
self.pageSize.addItem(trConst(name), key)
|
1037
1012
|
|
1038
|
-
self.pageWidth =
|
1013
|
+
self.pageWidth = NDoubleSpinBox(self)
|
1039
1014
|
self.pageWidth.setFixedWidth(dbW)
|
1040
1015
|
self.pageWidth.setMaximum(500.0)
|
1041
1016
|
self.pageWidth.valueChanged.connect(self._pageSizeValueChanged)
|
1042
1017
|
|
1043
|
-
self.pageHeight =
|
1018
|
+
self.pageHeight = NDoubleSpinBox(self)
|
1044
1019
|
self.pageHeight.setFixedWidth(dbW)
|
1045
1020
|
self.pageHeight.setMaximum(500.0)
|
1046
1021
|
self.pageHeight.valueChanged.connect(self._pageSizeValueChanged)
|
1047
1022
|
|
1048
|
-
self.topMargin =
|
1023
|
+
self.topMargin = NDoubleSpinBox(self)
|
1049
1024
|
self.topMargin.setFixedWidth(dbW)
|
1050
1025
|
|
1051
|
-
self.bottomMargin =
|
1026
|
+
self.bottomMargin = NDoubleSpinBox(self)
|
1052
1027
|
self.bottomMargin.setFixedWidth(dbW)
|
1053
1028
|
|
1054
|
-
self.leftMargin =
|
1029
|
+
self.leftMargin = NDoubleSpinBox(self)
|
1055
1030
|
self.leftMargin.setFixedWidth(dbW)
|
1056
1031
|
|
1057
|
-
self.rightMargin =
|
1032
|
+
self.rightMargin = NDoubleSpinBox(self)
|
1058
1033
|
self.rightMargin.setFixedWidth(dbW)
|
1059
1034
|
|
1060
|
-
self.
|
1061
|
-
self.
|
1062
|
-
self.
|
1063
|
-
self.
|
1064
|
-
self.
|
1065
|
-
self.
|
1066
|
-
self.
|
1067
|
-
self.
|
1035
|
+
self.addRow(self._build.getLabel("format.pageUnit"), self.pageUnit)
|
1036
|
+
self.addRow(self._build.getLabel("format.pageSize"), self.pageSize)
|
1037
|
+
self.addRow(self._build.getLabel("format.pageWidth"), self.pageWidth)
|
1038
|
+
self.addRow(self._build.getLabel("format.pageHeight"), self.pageHeight)
|
1039
|
+
self.addRow(self._build.getLabel("format.topMargin"), self.topMargin)
|
1040
|
+
self.addRow(self._build.getLabel("format.bottomMargin"), self.bottomMargin)
|
1041
|
+
self.addRow(self._build.getLabel("format.leftMargin"), self.leftMargin)
|
1042
|
+
self.addRow(self._build.getLabel("format.rightMargin"), self.rightMargin)
|
1068
1043
|
|
1069
|
-
#
|
1070
|
-
|
1071
|
-
|
1072
|
-
self.formLeft = QVBoxLayout()
|
1073
|
-
self.formLeft.addLayout(self.formFormat)
|
1074
|
-
self.formLeft.addLayout(self.formOptions)
|
1075
|
-
self.formLeft.addStretch(1)
|
1076
|
-
self.formLeft.setContentsMargins(0, 0, 0, 0)
|
1077
|
-
self.formLeft.setSpacing(CONFIG.pxInt(8))
|
1078
|
-
|
1079
|
-
self.formRight = QVBoxLayout()
|
1080
|
-
self.formRight.addLayout(self.formLayout)
|
1081
|
-
self.formRight.addStretch(1)
|
1082
|
-
self.formRight.setContentsMargins(0, 0, 0, 0)
|
1083
|
-
self.formRight.setSpacing(CONFIG.pxInt(8))
|
1084
|
-
|
1085
|
-
self.outerBox = QHBoxLayout()
|
1086
|
-
self.outerBox.addLayout(self.formLeft, 1)
|
1087
|
-
self.outerBox.addLayout(self.formRight, 1)
|
1088
|
-
self.outerBox.setContentsMargins(0, 0, 0, 0)
|
1089
|
-
self.outerBox.setSpacing(CONFIG.pxInt(16))
|
1090
|
-
|
1091
|
-
self.setLayout(self.outerBox)
|
1044
|
+
# Finalise
|
1045
|
+
self.finalise()
|
1092
1046
|
|
1093
1047
|
return
|
1094
1048
|
|
@@ -1161,10 +1115,10 @@ class _FormatTab(QWidget):
|
|
1161
1115
|
currFont = QFont()
|
1162
1116
|
currFont.setFamily(self.textFont.text())
|
1163
1117
|
currFont.setPointSize(self.textSize.value())
|
1164
|
-
|
1165
|
-
if
|
1166
|
-
self.textFont.setText(
|
1167
|
-
self.textSize.setValue(
|
1118
|
+
newFont, status = QFontDialog.getFont(currFont, self)
|
1119
|
+
if status:
|
1120
|
+
self.textFont.setText(newFont.family())
|
1121
|
+
self.textSize.setValue(newFont.pointSize())
|
1168
1122
|
return
|
1169
1123
|
|
1170
1124
|
@pyqtSlot(int)
|
@@ -1252,7 +1206,7 @@ class _FormatTab(QWidget):
|
|
1252
1206
|
# END Class _FormatTab
|
1253
1207
|
|
1254
1208
|
|
1255
|
-
class _OutputTab(
|
1209
|
+
class _OutputTab(NScrollableForm):
|
1256
1210
|
|
1257
1211
|
def __init__(self, buildMain: GuiBuildSettings, build: BuildSettings) -> None:
|
1258
1212
|
super().__init__(parent=buildMain)
|
@@ -1260,50 +1214,65 @@ class _OutputTab(QWidget):
|
|
1260
1214
|
self._build = build
|
1261
1215
|
|
1262
1216
|
iPx = SHARED.theme.baseIconSize
|
1217
|
+
spW = 6*SHARED.theme.textNWidth
|
1263
1218
|
|
1264
|
-
#
|
1265
|
-
|
1266
|
-
|
1267
|
-
self.formLeft = NSimpleLayout()
|
1268
|
-
self.formLeft.addGroupLabel(self._build.getLabel("odt"))
|
1269
|
-
|
1270
|
-
self.odtAddColours = NSwitch(self, width=2*iPx, height=iPx)
|
1271
|
-
|
1272
|
-
self.formLeft.addRow(self._build.getLabel("odt.addColours"), self.odtAddColours)
|
1273
|
-
|
1274
|
-
# Right Form
|
1275
|
-
# ==========
|
1219
|
+
# Open Document
|
1220
|
+
self.addGroupLabel(self._build.getLabel("odt"))
|
1276
1221
|
|
1277
|
-
self.
|
1278
|
-
self.
|
1222
|
+
self.odtAddColours = NSwitch(self, height=iPx)
|
1223
|
+
self.addRow(self._build.getLabel("odt.addColours"), self.odtAddColours)
|
1279
1224
|
|
1280
|
-
self.
|
1225
|
+
self.odtPageHeader = QLineEdit(self)
|
1226
|
+
self.odtPageHeader.setMinimumWidth(CONFIG.pxInt(200))
|
1227
|
+
self.btnPageHeader = QToolButton(self)
|
1228
|
+
self.btnPageHeader.setIcon(SHARED.theme.getIcon("revert"))
|
1229
|
+
self.btnPageHeader.clicked.connect(self._resetPageHeader)
|
1230
|
+
self.addRow(
|
1231
|
+
self._build.getLabel("odt.pageHeader"), self.odtPageHeader,
|
1232
|
+
button=self.btnPageHeader, stretch=(1, 1)
|
1233
|
+
)
|
1281
1234
|
|
1282
|
-
self.
|
1235
|
+
self.odtPageCountOffset = NSpinBox(self)
|
1236
|
+
self.odtPageCountOffset.setMinimum(0)
|
1237
|
+
self.odtPageCountOffset.setMaximum(999)
|
1238
|
+
self.odtPageCountOffset.setSingleStep(1)
|
1239
|
+
self.odtPageCountOffset.setMinimumWidth(spW)
|
1240
|
+
self.addRow(self._build.getLabel("odt.pageCountOffset"), self.odtPageCountOffset)
|
1283
1241
|
|
1284
|
-
#
|
1285
|
-
|
1242
|
+
# HTML Document
|
1243
|
+
self.addGroupLabel(self._build.getLabel("html"))
|
1286
1244
|
|
1287
|
-
self.
|
1288
|
-
self.
|
1289
|
-
self.outerBox.addLayout(self.formRight, 1)
|
1290
|
-
self.outerBox.setContentsMargins(0, 0, 0, 0)
|
1291
|
-
self.outerBox.setSpacing(CONFIG.pxInt(16))
|
1245
|
+
self.htmlAddStyles = NSwitch(self, height=iPx)
|
1246
|
+
self.addRow(self._build.getLabel("html.addStyles"), self.htmlAddStyles)
|
1292
1247
|
|
1293
|
-
|
1248
|
+
# Finalise
|
1249
|
+
self.finalise()
|
1294
1250
|
|
1295
1251
|
return
|
1296
1252
|
|
1297
1253
|
def loadContent(self) -> None:
|
1298
1254
|
"""Populate the widgets."""
|
1299
1255
|
self.odtAddColours.setChecked(self._build.getBool("odt.addColours"))
|
1256
|
+
self.odtPageHeader.setText(self._build.getStr("odt.pageHeader"))
|
1257
|
+
self.odtPageCountOffset.setValue(self._build.getInt("odt.pageCountOffset"))
|
1300
1258
|
self.htmlAddStyles.setChecked(self._build.getBool("html.addStyles"))
|
1301
1259
|
return
|
1302
1260
|
|
1303
1261
|
def saveContent(self) -> None:
|
1304
1262
|
"""Save choices back into build object."""
|
1305
1263
|
self._build.setValue("odt.addColours", self.odtAddColours.isChecked())
|
1264
|
+
self._build.setValue("odt.pageHeader", self.odtPageHeader.text())
|
1265
|
+
self._build.setValue("odt.pageCountOffset", self.odtPageCountOffset.value())
|
1306
1266
|
self._build.setValue("html.addStyles", self.htmlAddStyles.isChecked())
|
1307
1267
|
return
|
1308
1268
|
|
1269
|
+
##
|
1270
|
+
# Private Slots
|
1271
|
+
##
|
1272
|
+
|
1273
|
+
def _resetPageHeader(self) -> None:
|
1274
|
+
"""Reset the ODT header format to default."""
|
1275
|
+
self.odtPageHeader.setText(nwHeadFmt.ODT_AUTO)
|
1276
|
+
return
|
1277
|
+
|
1309
1278
|
# END Class _OutputTab
|