novelWriter 2.2rc1__py3-none-any.whl → 2.3b1__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.
Files changed (153) hide show
  1. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.dist-info}/METADATA +1 -1
  2. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.dist-info}/RECORD +141 -129
  3. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.dist-info}/WHEEL +1 -1
  4. novelwriter/__init__.py +11 -6
  5. novelwriter/assets/i18n/nw_de_DE.qm +0 -0
  6. novelwriter/assets/i18n/nw_en_US.qm +0 -0
  7. novelwriter/assets/i18n/nw_es_419.qm +0 -0
  8. novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
  9. novelwriter/assets/i18n/nw_it_IT.qm +0 -0
  10. novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
  11. novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
  12. novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
  13. novelwriter/assets/i18n/project_de_DE.json +1 -0
  14. novelwriter/assets/i18n/project_en_US.json +1 -0
  15. novelwriter/assets/i18n/project_es_419.json +11 -0
  16. novelwriter/assets/i18n/project_fr_FR.json +11 -0
  17. novelwriter/assets/i18n/project_it_IT.json +11 -0
  18. novelwriter/assets/i18n/project_ja_JP.json +2 -1
  19. novelwriter/assets/i18n/project_nb_NO.json +1 -0
  20. novelwriter/assets/i18n/project_zh_CN.json +11 -0
  21. novelwriter/assets/icons/typicons_dark/icons.conf +9 -2
  22. novelwriter/assets/icons/typicons_dark/mixed_import.svg +5 -0
  23. novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +4 -0
  24. novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +3 -1
  25. novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +4 -0
  26. novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +3 -1
  27. novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +4 -0
  28. novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +3 -1
  29. novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +4 -2
  30. novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +4 -2
  31. novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +4 -2
  32. novelwriter/assets/icons/typicons_dark/typ_document-add-col.svg +8 -0
  33. novelwriter/assets/icons/typicons_dark/typ_document-add.svg +4 -0
  34. novelwriter/assets/icons/typicons_dark/typ_document.svg +4 -0
  35. novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +4 -0
  36. novelwriter/assets/icons/typicons_light/icons.conf +9 -2
  37. novelwriter/assets/icons/typicons_light/mixed_import.svg +5 -0
  38. novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +4 -0
  39. novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +3 -1
  40. novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +4 -0
  41. novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +3 -1
  42. novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +4 -0
  43. novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +3 -1
  44. novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +4 -2
  45. novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +4 -2
  46. novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +4 -2
  47. novelwriter/assets/icons/typicons_light/typ_document-add-col.svg +8 -0
  48. novelwriter/assets/icons/typicons_light/typ_document-add.svg +4 -0
  49. novelwriter/assets/icons/typicons_light/typ_document.svg +4 -0
  50. novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +4 -0
  51. novelwriter/assets/images/novelwriter-text-dark.svg +4 -0
  52. novelwriter/assets/images/novelwriter-text-light.svg +4 -0
  53. novelwriter/assets/images/welcome-dark.jpg +0 -0
  54. novelwriter/assets/images/welcome-light.jpg +0 -0
  55. novelwriter/assets/manual.pdf +0 -0
  56. novelwriter/assets/sample.zip +0 -0
  57. novelwriter/assets/syntax/default_dark.conf +1 -0
  58. novelwriter/assets/syntax/default_light.conf +1 -0
  59. novelwriter/assets/syntax/grey_dark.conf +1 -0
  60. novelwriter/assets/syntax/grey_light.conf +1 -0
  61. novelwriter/assets/syntax/light_owl.conf +1 -0
  62. novelwriter/assets/syntax/night_owl.conf +1 -0
  63. novelwriter/assets/syntax/solarized_dark.conf +1 -0
  64. novelwriter/assets/syntax/solarized_light.conf +1 -0
  65. novelwriter/assets/syntax/tomorrow.conf +1 -0
  66. novelwriter/assets/syntax/tomorrow_night.conf +1 -0
  67. novelwriter/assets/syntax/tomorrow_night_blue.conf +1 -0
  68. novelwriter/assets/syntax/tomorrow_night_bright.conf +1 -0
  69. novelwriter/assets/syntax/tomorrow_night_eighties.conf +1 -0
  70. novelwriter/assets/text/credits_en.htm +4 -2
  71. novelwriter/assets/themes/default_dark.conf +2 -2
  72. novelwriter/assets/themes/default_light.conf +2 -2
  73. novelwriter/common.py +64 -66
  74. novelwriter/config.py +39 -44
  75. novelwriter/constants.py +39 -17
  76. novelwriter/core/buildsettings.py +8 -8
  77. novelwriter/core/coretools.py +194 -155
  78. novelwriter/core/docbuild.py +7 -4
  79. novelwriter/core/document.py +7 -7
  80. novelwriter/core/index.py +90 -57
  81. novelwriter/core/item.py +23 -5
  82. novelwriter/core/options.py +11 -10
  83. novelwriter/core/project.py +72 -47
  84. novelwriter/core/projectdata.py +3 -16
  85. novelwriter/core/projectxml.py +14 -42
  86. novelwriter/core/sessions.py +4 -3
  87. novelwriter/core/spellcheck.py +6 -4
  88. novelwriter/core/status.py +5 -4
  89. novelwriter/core/storage.py +179 -141
  90. novelwriter/core/tohtml.py +6 -4
  91. novelwriter/core/tokenizer.py +74 -46
  92. novelwriter/core/tomd.py +2 -2
  93. novelwriter/core/toodt.py +41 -31
  94. novelwriter/core/tree.py +5 -4
  95. novelwriter/dialogs/about.py +88 -179
  96. novelwriter/dialogs/docmerge.py +30 -20
  97. novelwriter/dialogs/docsplit.py +33 -22
  98. novelwriter/dialogs/editlabel.py +20 -8
  99. novelwriter/dialogs/preferences.py +562 -725
  100. novelwriter/dialogs/{projsettings.py → projectsettings.py} +301 -270
  101. novelwriter/dialogs/quotes.py +47 -36
  102. novelwriter/dialogs/wordlist.py +128 -59
  103. novelwriter/enum.py +25 -22
  104. novelwriter/error.py +2 -2
  105. novelwriter/extensions/circularprogress.py +12 -12
  106. novelwriter/extensions/configlayout.py +185 -146
  107. novelwriter/extensions/{wheeleventfilter.py → eventfilters.py} +15 -5
  108. novelwriter/extensions/modified.py +81 -0
  109. novelwriter/extensions/novelselector.py +27 -13
  110. novelwriter/extensions/pagedsidebar.py +15 -20
  111. novelwriter/extensions/simpleprogress.py +8 -9
  112. novelwriter/extensions/statusled.py +9 -9
  113. novelwriter/extensions/switch.py +32 -64
  114. novelwriter/extensions/switchbox.py +2 -7
  115. novelwriter/extensions/versioninfo.py +153 -0
  116. novelwriter/gui/doceditor.py +250 -214
  117. novelwriter/gui/dochighlight.py +66 -94
  118. novelwriter/gui/docviewer.py +71 -98
  119. novelwriter/gui/docviewerpanel.py +140 -47
  120. novelwriter/gui/editordocument.py +3 -3
  121. novelwriter/gui/itemdetails.py +9 -9
  122. novelwriter/gui/mainmenu.py +47 -46
  123. novelwriter/gui/noveltree.py +53 -61
  124. novelwriter/gui/outline.py +100 -76
  125. novelwriter/gui/projtree.py +193 -67
  126. novelwriter/gui/sidebar.py +9 -8
  127. novelwriter/gui/statusbar.py +49 -7
  128. novelwriter/gui/theme.py +65 -74
  129. novelwriter/guimain.py +173 -330
  130. novelwriter/shared.py +68 -30
  131. novelwriter/tools/dictionaries.py +7 -8
  132. novelwriter/tools/lipsum.py +34 -28
  133. novelwriter/tools/manusbuild.py +3 -4
  134. novelwriter/tools/manuscript.py +25 -32
  135. novelwriter/tools/manussettings.py +194 -225
  136. novelwriter/tools/noveldetails.py +525 -0
  137. novelwriter/tools/welcome.py +802 -0
  138. novelwriter/tools/writingstats.py +26 -13
  139. novelwriter/assets/icons/typicons_dark/nw_tb-markdown.svg +0 -8
  140. novelwriter/assets/icons/typicons_dark/nw_tb-shortcode.svg +0 -8
  141. novelwriter/assets/icons/typicons_light/nw_tb-markdown.svg +0 -8
  142. novelwriter/assets/icons/typicons_light/nw_tb-shortcode.svg +0 -8
  143. novelwriter/assets/images/wizard-back.jpg +0 -0
  144. novelwriter/assets/text/gplv3_en.htm +0 -641
  145. novelwriter/assets/text/release_notes.htm +0 -17
  146. novelwriter/dialogs/projdetails.py +0 -525
  147. novelwriter/dialogs/projload.py +0 -298
  148. novelwriter/dialogs/updates.py +0 -182
  149. novelwriter/extensions/pageddialog.py +0 -130
  150. novelwriter/tools/projwizard.py +0 -478
  151. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.dist-info}/LICENSE.md +0 -0
  152. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.dist-info}/entry_points.txt +0 -0
  153. {novelWriter-2.2rc1.dist-info → novelWriter-2.3b1.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–2023, Veronica Berglyd Olsen
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, QComboBox, QDialog, QDialogButtonBox,
36
- QDoubleSpinBox, QFontDialog, QFrame, QGridLayout, QHBoxLayout, QHeaderView,
37
- QLabel, QLineEdit, QMenu, QPlainTextEdit, QPushButton, QSpinBox, QSplitter,
38
- QStackedWidget, QToolButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout,
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 NConfigLayout, NSimpleLayout
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.setMinimumWidth(CONFIG.pxInt(700))
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
- pOptions = SHARED.project.options
88
+ options = SHARED.project.options
90
89
  self.resize(
91
- CONFIG.pxInt(pOptions.getInt("GuiBuildSettings", "winWidth", wWin)),
92
- CONFIG.pxInt(pOptions.getInt("GuiBuildSettings", "winHeight", hWin))
90
+ CONFIG.pxInt(options.getInt("GuiBuildSettings", "winWidth", wWin)),
91
+ CONFIG.pxInt(options.getInt("GuiBuildSettings", "winHeight", hWin))
93
92
  )
94
93
 
95
- # Options SideBar
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
- self.optSideBar = NPagedSideBar(self)
99
- self.optSideBar.setMinimumWidth(mPx)
100
- self.optSideBar.setMaximumWidth(mPx)
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
- self.optSideBar.addLabel(self.tr("Options"))
104
- self.optSideBar.addButton(self.tr("Selection"), self.OPT_FILTERS)
105
- self.optSideBar.addButton(self.tr("Headings"), self.OPT_HEADINGS)
106
- self.optSideBar.addButton(self.tr("Content"), self.OPT_CONTENT)
107
- self.optSideBar.addButton(self.tr("Format"), self.OPT_FORMAT)
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.optSideBar.buttonClicked.connect(self._stackPageSelected)
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
- # Options Area
113
- # ============
116
+ self.sidebar.buttonClicked.connect(self._stackPageSelected)
114
117
 
115
- # Create Tabs
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
- # Main Settings + Buttons
131
- # =======================
132
-
133
- self.lblBuildName = QLabel(self.tr("Name"))
134
- self.editBuildName = QLineEdit()
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.dlgButtons.clicked.connect(self._dialogButtonClicked)
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 GUI
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.optSideBar)
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.addLayout(self.buttonBox)
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.optSideBar.setSelected(self.OPT_FILTERS)
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.dlgButtons.buttonRole(button)
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(QWidget):
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.outerBox = QHBoxLayout()
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(QWidget):
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, width=2*iPx, height=iPx)
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, width=2*iPx, height=iPx)
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.setLayout(self.outerBox)
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(QColor(*SHARED.theme.colHead))
866
+ self._fmtSymbol.setForeground(SHARED.theme.colHead)
868
867
  self._fmtFormat = QTextCharFormat()
869
- self._fmtFormat.setForeground(QColor(*SHARED.theme.colEmph))
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.ALL:
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(QWidget):
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
- # Left Form
898
- # =========
899
-
900
- self.formLeft = NSimpleLayout()
901
- self.formLeft.addGroupLabel(self._build.getLabel("text.grpContent"))
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
- # Right Form
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
- self.formRight = NSimpleLayout()
917
- self.formRight.addGroupLabel(self._build.getLabel("text.grpInsert"))
908
+ # Insert Content
909
+ self.addNoteHead = NSwitch(self, height=iPx)
918
910
 
919
- self.addNoteHead = NSwitch(self, width=2*iPx, height=iPx)
911
+ self.addGroupLabel(self._build.getLabel("text.grpInsert"))
912
+ self.addRow(self._build.getLabel("text.addNoteHeadings"), self.addNoteHead)
920
913
 
921
- self.formRight.addRow(self._build.getLabel("text.addNoteHeadings"), self.addNoteHead)
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(QWidget):
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 Form
972
- # ================
954
+ # Text Format
955
+ # ===========
973
956
 
974
- self.formFormat = NConfigLayout()
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.formFormat.addRow(
984
- self._build.getLabel("format.textFont"), self.textFont, button=self.btnTextFont
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 = QSpinBox(self)
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.formFormat.addRow(
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 = QDoubleSpinBox(self)
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.formFormat.addRow(
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 Form
1009
- # =================
987
+ # Text Options
988
+ # ============
1010
989
 
1011
- self.formOptions = NSimpleLayout()
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, width=2*iPx, height=iPx)
1016
- self.stripUnicode = NSwitch(self, width=2*iPx, height=iPx)
1017
- self.replaceTabs = NSwitch(self, width=2*iPx, height=iPx)
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.formOptions.addRow(self._build.getLabel("format.justifyText"), self.justifyText)
1020
- self.formOptions.addRow(self._build.getLabel("format.stripUnicode"), self.stripUnicode)
1021
- self.formOptions.addRow(self._build.getLabel("format.replaceTabs"), self.replaceTabs)
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 Form
1024
- # ================
1000
+ # Page Layout
1001
+ # ===========
1025
1002
 
1026
- self.formLayout = NSimpleLayout()
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 = QComboBox(self)
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 = QComboBox(self)
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 = QDoubleSpinBox(self)
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 = QDoubleSpinBox(self)
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 = QDoubleSpinBox(self)
1023
+ self.topMargin = NDoubleSpinBox(self)
1049
1024
  self.topMargin.setFixedWidth(dbW)
1050
1025
 
1051
- self.bottomMargin = QDoubleSpinBox(self)
1026
+ self.bottomMargin = NDoubleSpinBox(self)
1052
1027
  self.bottomMargin.setFixedWidth(dbW)
1053
1028
 
1054
- self.leftMargin = QDoubleSpinBox(self)
1029
+ self.leftMargin = NDoubleSpinBox(self)
1055
1030
  self.leftMargin.setFixedWidth(dbW)
1056
1031
 
1057
- self.rightMargin = QDoubleSpinBox(self)
1032
+ self.rightMargin = NDoubleSpinBox(self)
1058
1033
  self.rightMargin.setFixedWidth(dbW)
1059
1034
 
1060
- self.formLayout.addRow(self._build.getLabel("format.pageUnit"), self.pageUnit)
1061
- self.formLayout.addRow(self._build.getLabel("format.pageSize"), self.pageSize)
1062
- self.formLayout.addRow(self._build.getLabel("format.pageWidth"), self.pageWidth)
1063
- self.formLayout.addRow(self._build.getLabel("format.pageHeight"), self.pageHeight)
1064
- self.formLayout.addRow(self._build.getLabel("format.topMargin"), self.topMargin)
1065
- self.formLayout.addRow(self._build.getLabel("format.bottomMargin"), self.bottomMargin)
1066
- self.formLayout.addRow(self._build.getLabel("format.leftMargin"), self.leftMargin)
1067
- self.formLayout.addRow(self._build.getLabel("format.rightMargin"), self.rightMargin)
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
- # Assemble GUI
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
- theFont, theStatus = QFontDialog.getFont(currFont, self)
1165
- if theStatus:
1166
- self.textFont.setText(theFont.family())
1167
- self.textSize.setValue(theFont.pointSize())
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(QWidget):
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
- # Left Form
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.formRight = NSimpleLayout()
1278
- self.formRight.addGroupLabel(self._build.getLabel("html"))
1222
+ self.odtAddColours = NSwitch(self, height=iPx)
1223
+ self.addRow(self._build.getLabel("odt.addColours"), self.odtAddColours)
1279
1224
 
1280
- self.htmlAddStyles = NSwitch(self, width=2*iPx, height=iPx)
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.formRight.addRow(self._build.getLabel("html.addStyles"), self.htmlAddStyles)
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
- # Assemble GUI
1285
- # ============
1242
+ # HTML Document
1243
+ self.addGroupLabel(self._build.getLabel("html"))
1286
1244
 
1287
- self.outerBox = QHBoxLayout()
1288
- self.outerBox.addLayout(self.formLeft, 1)
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
- self.setLayout(self.outerBox)
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