novelWriter 2.7.4__py3-none-any.whl → 2.8b1__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 (196) hide show
  1. novelwriter/__init__.py +8 -7
  2. novelwriter/assets/icons/font_awesome.icons +22 -4
  3. novelwriter/assets/icons/material_filled_normal.icons +20 -2
  4. novelwriter/assets/icons/material_filled_thin.icons +20 -2
  5. novelwriter/assets/icons/material_rounded_normal.icons +20 -2
  6. novelwriter/assets/icons/material_rounded_thin.icons +20 -2
  7. novelwriter/assets/icons/material_sharp_normal.icons +20 -2
  8. novelwriter/assets/icons/material_sharp_thin.icons +20 -2
  9. novelwriter/assets/icons/remix_filled.icons +20 -2
  10. novelwriter/assets/icons/remix_outline.icons +20 -2
  11. novelwriter/assets/images/welcome.webp +0 -0
  12. novelwriter/assets/manual.pdf +0 -0
  13. novelwriter/assets/manual_fr.pdf +0 -0
  14. novelwriter/assets/sample.zip +0 -0
  15. novelwriter/assets/text/credits_en.htm +61 -11
  16. novelwriter/assets/themes/aura.conf +97 -0
  17. novelwriter/assets/themes/aura_bright.conf +95 -0
  18. novelwriter/assets/themes/aura_soft.conf +97 -0
  19. novelwriter/assets/themes/b2t_garden_dark.conf +97 -0
  20. novelwriter/assets/themes/b2t_garden_light.conf +97 -0
  21. novelwriter/assets/themes/b2t_suburb_dark.conf +97 -0
  22. novelwriter/assets/themes/b2t_suburb_light.conf +97 -0
  23. novelwriter/assets/themes/b4t_classic_o_dark.conf +97 -0
  24. novelwriter/assets/themes/b4t_classic_o_light.conf +97 -0
  25. novelwriter/assets/themes/b4t_modern_c_dark.conf +97 -0
  26. novelwriter/assets/themes/b4t_modern_c_light.conf +97 -0
  27. novelwriter/assets/themes/blue_streak_dark.conf +97 -0
  28. novelwriter/assets/themes/blue_streak_light.conf +97 -0
  29. novelwriter/assets/themes/castle_day.conf +95 -0
  30. novelwriter/assets/themes/castle_night.conf +95 -0
  31. novelwriter/assets/themes/catppuccin_latte.conf +97 -0
  32. novelwriter/assets/themes/catppuccin_mocha.conf +97 -0
  33. novelwriter/assets/themes/chalky_soil.conf +95 -0
  34. novelwriter/assets/themes/chernozem.conf +95 -0
  35. novelwriter/assets/themes/cyberpunk_night.conf +88 -40
  36. novelwriter/assets/themes/default_dark.conf +89 -41
  37. novelwriter/assets/themes/default_light.conf +89 -41
  38. novelwriter/assets/themes/dracula.conf +91 -42
  39. novelwriter/assets/themes/espresso.conf +97 -0
  40. novelwriter/assets/themes/everforest_dark.conf +97 -0
  41. novelwriter/assets/themes/everforest_light.conf +97 -0
  42. novelwriter/assets/themes/floral_daydream.conf +95 -0
  43. novelwriter/assets/themes/floral_midnight.conf +95 -0
  44. novelwriter/assets/themes/full_moon.conf +95 -0
  45. novelwriter/assets/themes/grey_dark.conf +97 -0
  46. novelwriter/assets/themes/grey_light.conf +97 -0
  47. novelwriter/assets/themes/horizon_dark.conf +97 -0
  48. novelwriter/assets/themes/horizon_light.conf +97 -0
  49. novelwriter/assets/themes/jewel_case_dark.conf +95 -0
  50. novelwriter/assets/themes/jewel_case_light.conf +95 -0
  51. novelwriter/assets/themes/lcars.conf +97 -0
  52. novelwriter/assets/themes/light_owl.conf +117 -0
  53. novelwriter/assets/themes/new_moon.conf +97 -0
  54. novelwriter/assets/themes/night_owl.conf +117 -0
  55. novelwriter/assets/themes/noctis.conf +129 -0
  56. novelwriter/assets/themes/noctis_lux.conf +129 -0
  57. novelwriter/assets/themes/nord.conf +97 -0
  58. novelwriter/assets/themes/nordlicht.conf +95 -0
  59. novelwriter/assets/themes/otium_dark.conf +95 -0
  60. novelwriter/assets/themes/otium_light.conf +95 -0
  61. novelwriter/assets/themes/paragon.conf +96 -0
  62. novelwriter/assets/themes/primer_light.conf +97 -0
  63. novelwriter/assets/themes/primer_night.conf +97 -0
  64. novelwriter/assets/themes/rose_pine.conf +97 -0
  65. novelwriter/assets/themes/rose_pine_dawn.conf +97 -0
  66. novelwriter/assets/themes/ruby_day.conf +95 -0
  67. novelwriter/assets/themes/ruby_night.conf +95 -0
  68. novelwriter/assets/themes/selenium_dark.conf +95 -0
  69. novelwriter/assets/themes/selenium_light.conf +95 -0
  70. novelwriter/assets/themes/sepia_dark.conf +95 -0
  71. novelwriter/assets/themes/sepia_light.conf +95 -0
  72. novelwriter/assets/themes/snazzy.conf +102 -40
  73. novelwriter/assets/themes/solarized_dark.conf +108 -40
  74. novelwriter/assets/themes/solarized_light.conf +108 -40
  75. novelwriter/assets/themes/sultana_light.conf +95 -0
  76. novelwriter/assets/themes/sultana_night.conf +95 -0
  77. novelwriter/assets/themes/tango_dark.conf +111 -0
  78. novelwriter/assets/themes/tango_light.conf +111 -0
  79. novelwriter/assets/themes/tomorrow.conf +117 -0
  80. novelwriter/assets/themes/tomorrow_night.conf +117 -0
  81. novelwriter/assets/themes/tomorrow_night_blue.conf +117 -0
  82. novelwriter/assets/themes/tomorrow_night_bright.conf +117 -0
  83. novelwriter/assets/themes/tomorrow_night_eighties.conf +117 -0
  84. novelwriter/assets/themes/vivid_black_green.conf +97 -0
  85. novelwriter/assets/themes/vivid_black_red.conf +97 -0
  86. novelwriter/assets/themes/vivid_white_green.conf +97 -0
  87. novelwriter/assets/themes/vivid_white_red.conf +97 -0
  88. novelwriter/assets/themes/warpgate.conf +96 -0
  89. novelwriter/assets/themes/waterlily_dark.conf +95 -0
  90. novelwriter/assets/themes/waterlily_light.conf +95 -0
  91. novelwriter/common.py +47 -17
  92. novelwriter/config.py +57 -62
  93. novelwriter/constants.py +32 -6
  94. novelwriter/core/buildsettings.py +3 -23
  95. novelwriter/core/coretools.py +21 -25
  96. novelwriter/core/docbuild.py +4 -9
  97. novelwriter/core/document.py +2 -6
  98. novelwriter/core/index.py +33 -53
  99. novelwriter/core/indexdata.py +17 -22
  100. novelwriter/core/item.py +11 -35
  101. novelwriter/core/itemmodel.py +5 -21
  102. novelwriter/core/novelmodel.py +3 -7
  103. novelwriter/core/options.py +3 -4
  104. novelwriter/core/project.py +31 -21
  105. novelwriter/core/projectdata.py +2 -21
  106. novelwriter/core/projectxml.py +13 -21
  107. novelwriter/core/sessions.py +2 -4
  108. novelwriter/core/spellcheck.py +12 -13
  109. novelwriter/core/status.py +27 -20
  110. novelwriter/core/storage.py +5 -10
  111. novelwriter/core/tree.py +6 -15
  112. novelwriter/dialogs/about.py +9 -10
  113. novelwriter/dialogs/docmerge.py +17 -14
  114. novelwriter/dialogs/docsplit.py +18 -14
  115. novelwriter/dialogs/editlabel.py +15 -9
  116. novelwriter/dialogs/preferences.py +69 -68
  117. novelwriter/dialogs/projectsettings.py +88 -67
  118. novelwriter/dialogs/quotes.py +15 -10
  119. novelwriter/dialogs/wordlist.py +18 -21
  120. novelwriter/enum.py +75 -30
  121. novelwriter/error.py +6 -11
  122. novelwriter/extensions/configlayout.py +8 -34
  123. novelwriter/extensions/eventfilters.py +3 -3
  124. novelwriter/extensions/modified.py +87 -32
  125. novelwriter/extensions/novelselector.py +13 -12
  126. novelwriter/extensions/pagedsidebar.py +10 -18
  127. novelwriter/extensions/progressbars.py +5 -11
  128. novelwriter/extensions/statusled.py +3 -6
  129. novelwriter/extensions/switch.py +8 -11
  130. novelwriter/extensions/switchbox.py +2 -11
  131. novelwriter/extensions/versioninfo.py +6 -7
  132. novelwriter/formats/shared.py +10 -2
  133. novelwriter/formats/todocx.py +15 -37
  134. novelwriter/formats/tohtml.py +52 -61
  135. novelwriter/formats/tokenizer.py +33 -64
  136. novelwriter/formats/tomarkdown.py +4 -11
  137. novelwriter/formats/toodt.py +12 -71
  138. novelwriter/formats/toqdoc.py +11 -21
  139. novelwriter/formats/toraw.py +2 -6
  140. novelwriter/gui/doceditor.py +207 -245
  141. novelwriter/gui/dochighlight.py +142 -101
  142. novelwriter/gui/docviewer.py +53 -84
  143. novelwriter/gui/docviewerpanel.py +18 -41
  144. novelwriter/gui/editordocument.py +12 -17
  145. novelwriter/gui/itemdetails.py +5 -14
  146. novelwriter/gui/mainmenu.py +24 -32
  147. novelwriter/gui/noveltree.py +13 -51
  148. novelwriter/gui/outline.py +20 -61
  149. novelwriter/gui/projtree.py +40 -96
  150. novelwriter/gui/search.py +9 -24
  151. novelwriter/gui/sidebar.py +54 -22
  152. novelwriter/gui/statusbar.py +7 -22
  153. novelwriter/gui/theme.py +482 -368
  154. novelwriter/guimain.py +87 -101
  155. novelwriter/shared.py +79 -48
  156. novelwriter/splash.py +9 -5
  157. novelwriter/text/comments.py +1 -1
  158. novelwriter/text/counting.py +9 -5
  159. novelwriter/text/patterns.py +20 -15
  160. novelwriter/tools/dictionaries.py +18 -16
  161. novelwriter/tools/lipsum.py +15 -17
  162. novelwriter/tools/manusbuild.py +25 -45
  163. novelwriter/tools/manuscript.py +94 -95
  164. novelwriter/tools/manussettings.py +149 -104
  165. novelwriter/tools/noveldetails.py +10 -24
  166. novelwriter/tools/welcome.py +24 -72
  167. novelwriter/tools/writingstats.py +17 -26
  168. novelwriter/types.py +25 -13
  169. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/METADATA +7 -7
  170. novelwriter-2.8b1.dist-info/RECORD +212 -0
  171. novelwriter/assets/images/welcome-dark.jpg +0 -0
  172. novelwriter/assets/images/welcome-light.jpg +0 -0
  173. novelwriter/assets/syntax/cyberpunk_night.conf +0 -28
  174. novelwriter/assets/syntax/default_dark.conf +0 -42
  175. novelwriter/assets/syntax/default_light.conf +0 -42
  176. novelwriter/assets/syntax/dracula.conf +0 -44
  177. novelwriter/assets/syntax/grey_dark.conf +0 -29
  178. novelwriter/assets/syntax/grey_light.conf +0 -29
  179. novelwriter/assets/syntax/light_owl.conf +0 -49
  180. novelwriter/assets/syntax/night_owl.conf +0 -49
  181. novelwriter/assets/syntax/snazzy.conf +0 -42
  182. novelwriter/assets/syntax/solarized_dark.conf +0 -29
  183. novelwriter/assets/syntax/solarized_light.conf +0 -29
  184. novelwriter/assets/syntax/tango.conf +0 -39
  185. novelwriter/assets/syntax/tomorrow.conf +0 -49
  186. novelwriter/assets/syntax/tomorrow_night.conf +0 -49
  187. novelwriter/assets/syntax/tomorrow_night_blue.conf +0 -49
  188. novelwriter/assets/syntax/tomorrow_night_bright.conf +0 -49
  189. novelwriter/assets/syntax/tomorrow_night_eighties.conf +0 -49
  190. novelwriter/assets/themes/default.conf +0 -3
  191. novelwriter-2.7.4.dist-info/RECORD +0 -163
  192. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/WHEEL +0 -0
  193. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/entry_points.txt +0 -0
  194. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/licenses/LICENSE.md +0 -0
  195. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/licenses/setup/LICENSE-Apache-2.0.txt +0 -0
  196. {novelwriter-2.7.4.dist-info → novelwriter-2.8b1.dist-info}/top_level.txt +0 -0
@@ -24,7 +24,7 @@ General Public License for more details.
24
24
 
25
25
  You should have received a copy of the GNU General Public License
26
26
  along with this program. If not, see <https://www.gnu.org/licenses/>.
27
- """
27
+ """ # noqa
28
28
  from __future__ import annotations
29
29
 
30
30
  import logging
@@ -55,6 +55,7 @@ logger = logging.getLogger(__name__)
55
55
 
56
56
 
57
57
  class GuiNovelView(QWidget):
58
+ """GUI: Novel View Panel."""
58
59
 
59
60
  # Signals for user interaction with the novel tree
60
61
  selectedItemChanged = pyqtSignal(str)
@@ -82,28 +83,24 @@ class GuiNovelView(QWidget):
82
83
  self.getSelectedHandle = self.novelTree.getSelectedHandle
83
84
  self.refreshCurrentTree = self.novelBar.forceRefreshNovelTree
84
85
 
85
- return
86
-
87
86
  ##
88
87
  # Methods
89
88
  ##
90
89
 
91
90
  def updateTheme(self) -> None:
92
91
  """Update theme elements."""
92
+ logger.debug("Theme Update: GuiNovelView")
93
93
  self.novelBar.updateTheme()
94
- return
95
94
 
96
95
  def initSettings(self) -> None:
97
96
  """Initialise GUI elements that depend on specific settings."""
98
97
  self.novelTree.initSettings()
99
- return
100
98
 
101
99
  def clearNovelView(self) -> None:
102
100
  """Clear project-related GUI content."""
103
101
  self.novelBar.clearContent()
104
102
  self.novelBar.setEnabled(False)
105
103
  self.novelTree.clearContent()
106
- return
107
104
 
108
105
  def openProjectTasks(self) -> None:
109
106
  """Run open project tasks."""
@@ -125,8 +122,6 @@ class GuiNovelView(QWidget):
125
122
 
126
123
  self.novelTree.setLastColSize(lastColSize)
127
124
 
128
- return
129
-
130
125
  def closeProjectTasks(self) -> None:
131
126
  """Run closing project tasks."""
132
127
  logger.debug("Saving State: GuiNovelView")
@@ -140,12 +135,9 @@ class GuiNovelView(QWidget):
140
135
 
141
136
  self.clearNovelView()
142
137
 
143
- return
144
-
145
138
  def setTreeFocus(self) -> None:
146
139
  """Set the focus to the tree widget."""
147
140
  self.novelTree.setFocus()
148
- return
149
141
 
150
142
  def treeHasFocus(self) -> bool:
151
143
  """Check if the novel tree has focus."""
@@ -159,22 +151,20 @@ class GuiNovelView(QWidget):
159
151
  def setCurrentNovel(self, rootHandle: str | None) -> None:
160
152
  """Set the current novel to display."""
161
153
  self.novelTree.setNovelModel(rootHandle)
162
- return
163
154
 
164
155
  @pyqtSlot(str)
165
156
  def setActiveHandle(self, tHandle: str) -> None:
166
157
  """Highlight the rows associated with a given handle."""
167
158
  self.novelTree.setActiveHandle(tHandle)
168
- return
169
159
 
170
160
  @pyqtSlot(str, Enum)
171
161
  def updateRootItem(self, tHandle: str, change: nwChange) -> None:
172
162
  """If any root item changes, rebuild the novel root menu."""
173
163
  self.novelBar.buildNovelRootMenu()
174
- return
175
164
 
176
165
 
177
166
  class GuiNovelToolBar(QWidget):
167
+ """GUI: Novel View Panel ToolBar."""
178
168
 
179
169
  def __init__(self, novelView: GuiNovelView) -> None:
180
170
  super().__init__(parent=novelView)
@@ -249,20 +239,18 @@ class GuiNovelToolBar(QWidget):
249
239
 
250
240
  logger.debug("Ready: GuiNovelToolBar")
251
241
 
252
- return
253
-
254
242
  ##
255
243
  # Methods
256
244
  ##
257
245
 
258
246
  def updateTheme(self) -> None:
259
247
  """Update theme elements."""
260
- # Icons
261
- self.tbNovel.setThemeIcon("cls_novel", "red")
262
- self.tbRefresh.setThemeIcon("refresh", "green")
263
- self.tbMore.setThemeIcon("more_vertical")
248
+ logger.debug("Theme Update: GuiNovelToolBar")
249
+
250
+ self.tbNovel.setThemeIcon("cls_novel", "root")
251
+ self.tbRefresh.setThemeIcon("refresh", "change")
252
+ self.tbMore.setThemeIcon("more_vertical", "default")
264
253
 
265
- # StyleSheets
266
254
  buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
267
255
  self.tbNovel.setStyleSheet(buttonStyle)
268
256
  self.tbRefresh.setStyleSheet(buttonStyle)
@@ -277,20 +265,16 @@ class GuiNovelToolBar(QWidget):
277
265
 
278
266
  self.forceRefreshNovelTree()
279
267
 
280
- return
281
-
282
268
  def clearContent(self) -> None:
283
269
  """Run clearing project tasks."""
284
270
  self.novelValue.clear()
285
271
  self.novelValue.setToolTip("")
286
- return
287
272
 
288
273
  def buildNovelRootMenu(self) -> None:
289
274
  """Build the novel root menu."""
290
275
  self.novelValue.refreshNovelList()
291
276
  self.novelView.setCurrentNovel(self.novelValue.handle)
292
277
  self.tbNovel.setVisible(self.novelValue.count() > 1)
293
- return
294
278
 
295
279
  def setCurrentRoot(self, rootHandle: str | None) -> None:
296
280
  """Set the current active root handle."""
@@ -300,7 +284,6 @@ class GuiNovelToolBar(QWidget):
300
284
  SHARED.project.data.setLastHandle(rootHandle, "novel")
301
285
  self.novelView.setCurrentNovel(rootHandle)
302
286
  self.novelView.novelTree.setAccessibleName(self.novelValue.currentText())
303
- return
304
287
 
305
288
  def setLastColType(self, colType: nwNovelExtra, doRefresh: bool = True) -> None:
306
289
  """Set the last column type."""
@@ -309,7 +292,6 @@ class GuiNovelToolBar(QWidget):
309
292
  if doRefresh:
310
293
  self.forceRefreshNovelTree()
311
294
  self.novelView.novelTree.resizeColumns()
312
- return
313
295
 
314
296
  def setActive(self, state: bool) -> None:
315
297
  """Set the widget active state, which enables automatic tree
@@ -322,7 +304,6 @@ class GuiNovelToolBar(QWidget):
322
304
  and self._refresh.get(handle, False)
323
305
  ):
324
306
  self._refreshNovelTree(self.novelValue.handle)
325
- return
326
307
 
327
308
  ##
328
309
  # Public Slots
@@ -335,7 +316,6 @@ class GuiNovelToolBar(QWidget):
335
316
  self.novelView.setCurrentNovel(tHandle)
336
317
  SHARED.project.index.refreshNovelModel(tHandle)
337
318
  self._refresh[tHandle] = False
338
- return
339
319
 
340
320
  ##
341
321
  # Private Slots
@@ -349,7 +329,6 @@ class GuiNovelToolBar(QWidget):
349
329
  self._refresh[tHandle] = False
350
330
  else:
351
331
  self._refresh[tHandle] = True
352
- return
353
332
 
354
333
  @pyqtSlot()
355
334
  def _selectLastColumnSize(self) -> None:
@@ -361,7 +340,6 @@ class GuiNovelToolBar(QWidget):
361
340
  if isOk:
362
341
  self.novelView.novelTree.setLastColSize(newSize)
363
342
  self.novelView.novelTree.resizeColumns()
364
- return
365
343
 
366
344
  ##
367
345
  # Internal Functions
@@ -374,10 +352,10 @@ class GuiNovelToolBar(QWidget):
374
352
  aLast.setActionGroup(self.gLastCol)
375
353
  aLast.triggered.connect(qtLambda(self.setLastColType, colType))
376
354
  self.aLastCol[colType] = aLast
377
- return
378
355
 
379
356
 
380
357
  class GuiNovelTree(NTreeView):
358
+ """GUI: Novel View Panel Tree."""
381
359
 
382
360
  def __init__(self, novelView: GuiNovelView) -> None:
383
361
  super().__init__(parent=novelView)
@@ -414,8 +392,6 @@ class GuiNovelTree(NTreeView):
414
392
 
415
393
  logger.debug("Ready: GuiNovelTree")
416
394
 
417
- return
418
-
419
395
  def initSettings(self) -> None:
420
396
  """Set or update tree widget settings."""
421
397
  if CONFIG.hideVScroll:
@@ -426,7 +402,6 @@ class GuiNovelTree(NTreeView):
426
402
  self.setHorizontalScrollBarPolicy(QtScrollAlwaysOff)
427
403
  else:
428
404
  self.setHorizontalScrollBarPolicy(QtScrollAsNeeded)
429
- return
430
405
 
431
406
  ##
432
407
  # Properties
@@ -466,25 +441,21 @@ class GuiNovelTree(NTreeView):
466
441
  self.resizeColumns()
467
442
  else:
468
443
  self.clearContent()
469
- return
470
444
 
471
445
  def setActiveHandle(self, tHandle: str | None) -> None:
472
446
  """Set the handle to be highlighted."""
473
447
  self._actHandle = tHandle
474
448
  if viewport := self.viewport():
475
449
  viewport.repaint()
476
- return
477
450
 
478
451
  def setLastColType(self, colType: nwNovelExtra) -> None:
479
452
  """Set the extra column type."""
480
453
  self._lastColType = colType
481
454
  SHARED.project.index.setNovelModelExtraColumn(colType)
482
- return
483
455
 
484
456
  def setLastColSize(self, colSize: int) -> None:
485
457
  """Set the extra column size between 15% and 75%."""
486
458
  self._lastColSize = minmax(colSize, 15, 75)/100.0
487
- return
488
459
 
489
460
  ##
490
461
  # Class Methods
@@ -493,7 +464,6 @@ class GuiNovelTree(NTreeView):
493
464
  def clearContent(self) -> None:
494
465
  """Clear the tree view."""
495
466
  self.setModel(None)
496
- return
497
467
 
498
468
  def resizeColumns(self) -> None:
499
469
  """Set the correct column sizes."""
@@ -506,7 +476,6 @@ class GuiNovelTree(NTreeView):
506
476
  if model.columns == 4:
507
477
  header.setSectionResizeMode(3, QtHeaderToContents)
508
478
  header.setMaximumSectionSize(int(self._lastColSize * vp.width()))
509
- return
510
479
 
511
480
  ##
512
481
  # Overloads
@@ -517,7 +486,6 @@ class GuiNovelTree(NTreeView):
517
486
  if (model := self._getModel()) and model.handle(index) == self._actHandle:
518
487
  painter.fillRect(opt.rect, self.palette().alternateBase())
519
488
  super().drawRow(painter, opt, index)
520
- return
521
489
 
522
490
  ##
523
491
  # Events
@@ -527,7 +495,6 @@ class GuiNovelTree(NTreeView):
527
495
  """Process size changed."""
528
496
  super().resizeEvent(event)
529
497
  self.resizeColumns()
530
- return
531
498
 
532
499
  ##
533
500
  # Private Slots
@@ -535,36 +502,33 @@ class GuiNovelTree(NTreeView):
535
502
 
536
503
  @pyqtSlot(QModelIndex)
537
504
  def _onSingleClick(self, index: QModelIndex) -> None:
538
- """The user single-clicked an index."""
505
+ """Process user single-click on an index."""
539
506
  if index.isValid() and (model := self._getModel()):
540
507
  if (tHandle := model.handle(index)) and (sTitle := model.key(index)):
541
508
  self.novelView.selectedItemChanged.emit(tHandle)
542
509
  if index.column() == model.columnCount(index) - 1:
543
510
  pos = self.mapToGlobal(self.visualRect(index).topRight())
544
511
  self._popMetaBox(pos, tHandle, sTitle)
545
- return
546
512
 
547
513
  @pyqtSlot(QModelIndex)
548
514
  def _onDoubleClick(self, index: QModelIndex) -> None:
549
- """The user double-clicked an index."""
515
+ """Process user double-click on an index."""
550
516
  if (
551
517
  (model := self._getModel())
552
518
  and (tHandle := model.handle(index))
553
519
  and (sTitle := model.key(index))
554
520
  ):
555
521
  self.novelView.openDocumentRequest.emit(tHandle, nwDocMode.EDIT, sTitle, False)
556
- return
557
522
 
558
523
  @pyqtSlot(QModelIndex)
559
524
  def _onMiddleClick(self, index: QModelIndex) -> None:
560
- """The user middle-clicked an index."""
525
+ """Process user middle-click on an index."""
561
526
  if (
562
527
  (model := self._getModel())
563
528
  and (tHandle := model.handle(index))
564
529
  and (sTitle := model.key(index))
565
530
  ):
566
531
  self.novelView.openDocumentRequest.emit(tHandle, nwDocMode.VIEW, sTitle, False)
567
- return
568
532
 
569
533
  ##
570
534
  # Internal Functions
@@ -582,7 +546,6 @@ class GuiNovelTree(NTreeView):
582
546
  """Generate a reference list for a given reference key."""
583
547
  if tags := ", ".join(refs.get(key, [])):
584
548
  lines.append(f"<b>{trConst(nwLabels.KEY_NAME[key])}:</b> {tags}")
585
- return
586
549
 
587
550
  if head := SHARED.project.index.getItemHeading(tHandle, sTitle):
588
551
  logger.debug("Generating meta data tooltip for '%s:%s'", tHandle, sTitle)
@@ -610,4 +573,3 @@ class GuiNovelTree(NTreeView):
610
573
  text = f"<p>{refs}</p>"
611
574
  if tooltip := (text + synopsis or self.tr("No meta data")):
612
575
  QToolTip.showText(qPos, tooltip)
613
- return