novelWriter 2.6.2__py3-none-any.whl → 2.7b1__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 (334) hide show
  1. novelwriter/__init__.py +84 -74
  2. novelwriter/assets/i18n/nw_cs_CZ.qm +0 -0
  3. novelwriter/assets/i18n/nw_de_DE.qm +0 -0
  4. novelwriter/assets/i18n/nw_en_US.qm +0 -0
  5. novelwriter/assets/i18n/nw_es_419.qm +0 -0
  6. novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
  7. novelwriter/assets/i18n/nw_it_IT.qm +0 -0
  8. novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
  9. novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
  10. novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
  11. novelwriter/assets/i18n/nw_pl_PL.qm +0 -0
  12. novelwriter/assets/i18n/nw_pt_BR.qm +0 -0
  13. novelwriter/assets/i18n/nw_ru_RU.qm +0 -0
  14. novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
  15. novelwriter/assets/i18n/project_en_GB.json +1 -0
  16. novelwriter/assets/icons/font_awesome.icons +109 -0
  17. novelwriter/assets/icons/material_filled_bold.icons +109 -0
  18. novelwriter/assets/icons/material_filled_normal.icons +109 -0
  19. novelwriter/assets/icons/material_filled_thin.icons +109 -0
  20. novelwriter/assets/icons/material_rounded_bold.icons +109 -0
  21. novelwriter/assets/icons/material_rounded_normal.icons +109 -0
  22. novelwriter/assets/icons/material_rounded_thin.icons +109 -0
  23. novelwriter/assets/icons/remix_filled.icons +108 -0
  24. novelwriter/assets/icons/remix_outline.icons +108 -0
  25. novelwriter/assets/manual.pdf +0 -0
  26. novelwriter/assets/{manual_fr_FR.pdf → manual_fr.pdf} +0 -0
  27. novelwriter/assets/sample.zip +0 -0
  28. novelwriter/assets/syntax/cyberpunk_night.conf +1 -1
  29. novelwriter/assets/text/credits_en.htm +6 -6
  30. novelwriter/assets/themes/cyberpunk_night.conf +23 -7
  31. novelwriter/assets/themes/default_dark.conf +20 -4
  32. novelwriter/assets/themes/default_light.conf +21 -5
  33. novelwriter/assets/themes/dracula.conf +20 -4
  34. novelwriter/assets/themes/solarized_dark.conf +24 -8
  35. novelwriter/assets/themes/solarized_light.conf +22 -6
  36. novelwriter/common.py +33 -26
  37. novelwriter/config.py +118 -127
  38. novelwriter/constants.py +75 -56
  39. novelwriter/core/buildsettings.py +23 -16
  40. novelwriter/core/coretools.py +11 -7
  41. novelwriter/core/docbuild.py +19 -13
  42. novelwriter/core/document.py +2 -2
  43. novelwriter/core/index.py +142 -432
  44. novelwriter/core/indexdata.py +403 -0
  45. novelwriter/core/item.py +35 -28
  46. novelwriter/core/itemmodel.py +27 -26
  47. novelwriter/core/novelmodel.py +223 -0
  48. novelwriter/core/options.py +1 -1
  49. novelwriter/core/project.py +10 -11
  50. novelwriter/core/projectdata.py +5 -5
  51. novelwriter/core/projectxml.py +1 -1
  52. novelwriter/core/sessions.py +3 -2
  53. novelwriter/core/spellcheck.py +4 -3
  54. novelwriter/core/status.py +12 -15
  55. novelwriter/core/storage.py +1 -1
  56. novelwriter/core/tree.py +46 -8
  57. novelwriter/dialogs/about.py +19 -22
  58. novelwriter/dialogs/docmerge.py +21 -23
  59. novelwriter/dialogs/docsplit.py +20 -23
  60. novelwriter/dialogs/editlabel.py +9 -13
  61. novelwriter/dialogs/preferences.py +111 -48
  62. novelwriter/dialogs/projectsettings.py +48 -54
  63. novelwriter/dialogs/quotes.py +14 -19
  64. novelwriter/dialogs/wordlist.py +25 -30
  65. novelwriter/enum.py +8 -0
  66. novelwriter/error.py +16 -16
  67. novelwriter/extensions/configlayout.py +18 -18
  68. novelwriter/extensions/eventfilters.py +9 -5
  69. novelwriter/extensions/modified.py +34 -15
  70. novelwriter/extensions/novelselector.py +18 -5
  71. novelwriter/extensions/pagedsidebar.py +39 -49
  72. novelwriter/extensions/progressbars.py +10 -8
  73. novelwriter/extensions/statusled.py +6 -13
  74. novelwriter/extensions/switch.py +19 -30
  75. novelwriter/extensions/switchbox.py +7 -3
  76. novelwriter/extensions/versioninfo.py +4 -4
  77. novelwriter/formats/shared.py +1 -1
  78. novelwriter/formats/todocx.py +14 -10
  79. novelwriter/formats/tohtml.py +7 -5
  80. novelwriter/formats/tokenizer.py +36 -33
  81. novelwriter/formats/tomarkdown.py +6 -2
  82. novelwriter/formats/toodt.py +27 -22
  83. novelwriter/formats/toqdoc.py +19 -14
  84. novelwriter/formats/toraw.py +6 -2
  85. novelwriter/gui/doceditor.py +216 -265
  86. novelwriter/gui/dochighlight.py +46 -45
  87. novelwriter/gui/docviewer.py +102 -104
  88. novelwriter/gui/docviewerpanel.py +47 -51
  89. novelwriter/gui/editordocument.py +8 -5
  90. novelwriter/gui/itemdetails.py +15 -18
  91. novelwriter/gui/mainmenu.py +147 -146
  92. novelwriter/gui/noveltree.py +239 -405
  93. novelwriter/gui/outline.py +137 -76
  94. novelwriter/gui/projtree.py +138 -132
  95. novelwriter/gui/search.py +33 -31
  96. novelwriter/gui/sidebar.py +13 -18
  97. novelwriter/gui/statusbar.py +13 -15
  98. novelwriter/gui/theme.py +533 -430
  99. novelwriter/guimain.py +27 -29
  100. novelwriter/shared.py +32 -23
  101. novelwriter/text/comments.py +70 -0
  102. novelwriter/text/patterns.py +4 -4
  103. novelwriter/tools/dictionaries.py +20 -29
  104. novelwriter/tools/lipsum.py +16 -17
  105. novelwriter/tools/manusbuild.py +39 -42
  106. novelwriter/tools/manuscript.py +113 -126
  107. novelwriter/tools/manussettings.py +78 -83
  108. novelwriter/tools/noveldetails.py +51 -64
  109. novelwriter/tools/welcome.py +56 -75
  110. novelwriter/tools/writingstats.py +44 -57
  111. novelwriter/types.py +5 -7
  112. {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/METADATA +6 -6
  113. novelwriter-2.7b1.dist-info/RECORD +159 -0
  114. {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/WHEEL +1 -1
  115. novelWriter-2.6.2.dist-info/RECORD +0 -363
  116. novelwriter/assets/icons/typicons_dark/README.md +0 -29
  117. novelwriter/assets/icons/typicons_dark/icons.conf +0 -134
  118. novelwriter/assets/icons/typicons_dark/mixed_copy.svg +0 -4
  119. novelwriter/assets/icons/typicons_dark/mixed_document-chapter.svg +0 -12
  120. novelwriter/assets/icons/typicons_dark/mixed_document-new.svg +0 -6
  121. novelwriter/assets/icons/typicons_dark/mixed_document-note.svg +0 -12
  122. novelwriter/assets/icons/typicons_dark/mixed_document-scene.svg +0 -12
  123. novelwriter/assets/icons/typicons_dark/mixed_document-section.svg +0 -12
  124. novelwriter/assets/icons/typicons_dark/mixed_document-title.svg +0 -12
  125. novelwriter/assets/icons/typicons_dark/mixed_edit.svg +0 -4
  126. novelwriter/assets/icons/typicons_dark/mixed_import.svg +0 -5
  127. novelwriter/assets/icons/typicons_dark/mixed_input-checked.svg +0 -5
  128. novelwriter/assets/icons/typicons_dark/mixed_input-none.svg +0 -5
  129. novelwriter/assets/icons/typicons_dark/mixed_input-unchecked.svg +0 -5
  130. novelwriter/assets/icons/typicons_dark/mixed_margin-bottom.svg +0 -6
  131. novelwriter/assets/icons/typicons_dark/mixed_margin-left.svg +0 -6
  132. novelwriter/assets/icons/typicons_dark/mixed_margin-right.svg +0 -6
  133. novelwriter/assets/icons/typicons_dark/mixed_margin-top.svg +0 -6
  134. novelwriter/assets/icons/typicons_dark/mixed_search-replace.svg +0 -6
  135. novelwriter/assets/icons/typicons_dark/mixed_size-height.svg +0 -6
  136. novelwriter/assets/icons/typicons_dark/mixed_size-width.svg +0 -6
  137. novelwriter/assets/icons/typicons_dark/nw_deco-h0.svg +0 -4
  138. novelwriter/assets/icons/typicons_dark/nw_deco-h1.svg +0 -4
  139. novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +0 -4
  140. novelwriter/assets/icons/typicons_dark/nw_deco-h2.svg +0 -4
  141. novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +0 -4
  142. novelwriter/assets/icons/typicons_dark/nw_deco-h3.svg +0 -4
  143. novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +0 -4
  144. novelwriter/assets/icons/typicons_dark/nw_deco-h4.svg +0 -4
  145. novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +0 -4
  146. novelwriter/assets/icons/typicons_dark/nw_deco-noveltree-more.svg +0 -4
  147. novelwriter/assets/icons/typicons_dark/nw_font.svg +0 -4
  148. novelwriter/assets/icons/typicons_dark/nw_panel.svg +0 -4
  149. novelwriter/assets/icons/typicons_dark/nw_quote.svg +0 -4
  150. novelwriter/assets/icons/typicons_dark/nw_search-case.svg +0 -4
  151. novelwriter/assets/icons/typicons_dark/nw_search-preserve.svg +0 -4
  152. novelwriter/assets/icons/typicons_dark/nw_search-regex.svg +0 -4
  153. novelwriter/assets/icons/typicons_dark/nw_search-word.svg +0 -4
  154. novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +0 -4
  155. novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +0 -6
  156. novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +0 -4
  157. novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +0 -6
  158. novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +0 -7
  159. novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +0 -4
  160. novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +0 -6
  161. novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +0 -7
  162. novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +0 -7
  163. novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +0 -7
  164. novelwriter/assets/icons/typicons_dark/nw_toolbar.svg +0 -5
  165. novelwriter/assets/icons/typicons_dark/typ_arrow-down-thick-grey.svg +0 -4
  166. novelwriter/assets/icons/typicons_dark/typ_arrow-forward.svg +0 -4
  167. novelwriter/assets/icons/typicons_dark/typ_arrow-maximise.svg +0 -4
  168. novelwriter/assets/icons/typicons_dark/typ_arrow-minimise.svg +0 -4
  169. novelwriter/assets/icons/typicons_dark/typ_arrow-repeat-grey.svg +0 -4
  170. novelwriter/assets/icons/typicons_dark/typ_book-grey.svg +0 -4
  171. novelwriter/assets/icons/typicons_dark/typ_book.svg +0 -6
  172. novelwriter/assets/icons/typicons_dark/typ_bookmark.svg +0 -4
  173. novelwriter/assets/icons/typicons_dark/typ_calendar.svg +0 -4
  174. novelwriter/assets/icons/typicons_dark/typ_cancel-grey.svg +0 -4
  175. novelwriter/assets/icons/typicons_dark/typ_cancel.svg +0 -4
  176. novelwriter/assets/icons/typicons_dark/typ_chart-bar-grey.svg +0 -4
  177. novelwriter/assets/icons/typicons_dark/typ_chevron-down.svg +0 -4
  178. novelwriter/assets/icons/typicons_dark/typ_chevron-left.svg +0 -4
  179. novelwriter/assets/icons/typicons_dark/typ_chevron-right.svg +0 -4
  180. novelwriter/assets/icons/typicons_dark/typ_chevron-up.svg +0 -4
  181. novelwriter/assets/icons/typicons_dark/typ_cog.svg +0 -4
  182. novelwriter/assets/icons/typicons_dark/typ_delete-full.svg +0 -4
  183. novelwriter/assets/icons/typicons_dark/typ_delete.svg +0 -4
  184. novelwriter/assets/icons/typicons_dark/typ_directions-full.svg +0 -4
  185. novelwriter/assets/icons/typicons_dark/typ_document-add.svg +0 -4
  186. novelwriter/assets/icons/typicons_dark/typ_document-text.svg +0 -8
  187. novelwriter/assets/icons/typicons_dark/typ_document.svg +0 -4
  188. novelwriter/assets/icons/typicons_dark/typ_export-grey.svg +0 -4
  189. novelwriter/assets/icons/typicons_dark/typ_export.svg +0 -4
  190. novelwriter/assets/icons/typicons_dark/typ_eye.svg +0 -4
  191. novelwriter/assets/icons/typicons_dark/typ_flag.svg +0 -4
  192. novelwriter/assets/icons/typicons_dark/typ_folder-open.svg +0 -4
  193. novelwriter/assets/icons/typicons_dark/typ_folder.svg +0 -5
  194. novelwriter/assets/icons/typicons_dark/typ_globe-grey.svg +0 -4
  195. novelwriter/assets/icons/typicons_dark/typ_key.svg +0 -4
  196. novelwriter/assets/icons/typicons_dark/typ_lightbulb-full.svg +0 -4
  197. novelwriter/assets/icons/typicons_dark/typ_location.svg +0 -4
  198. novelwriter/assets/icons/typicons_dark/typ_media-pause-grey.svg +0 -4
  199. novelwriter/assets/icons/typicons_dark/typ_media-record-outline.svg +0 -4
  200. novelwriter/assets/icons/typicons_dark/typ_media-record.svg +0 -4
  201. novelwriter/assets/icons/typicons_dark/typ_minus.svg +0 -4
  202. novelwriter/assets/icons/typicons_dark/typ_pencil.svg +0 -5
  203. novelwriter/assets/icons/typicons_dark/typ_pin-outline.svg +0 -4
  204. novelwriter/assets/icons/typicons_dark/typ_pin.svg +0 -4
  205. novelwriter/assets/icons/typicons_dark/typ_plus.svg +0 -4
  206. novelwriter/assets/icons/typicons_dark/typ_puzzle-outline.svg +0 -4
  207. novelwriter/assets/icons/typicons_dark/typ_puzzle.svg +0 -4
  208. novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +0 -4
  209. novelwriter/assets/icons/typicons_dark/typ_refresh.svg +0 -4
  210. novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +0 -4
  211. novelwriter/assets/icons/typicons_dark/typ_search.svg +0 -4
  212. novelwriter/assets/icons/typicons_dark/typ_star.svg +0 -4
  213. novelwriter/assets/icons/typicons_dark/typ_stopwatch-grey.svg +0 -4
  214. novelwriter/assets/icons/typicons_dark/typ_th-dot-menu.svg +0 -4
  215. novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +0 -4
  216. novelwriter/assets/icons/typicons_dark/typ_th-list-grey.svg +0 -4
  217. novelwriter/assets/icons/typicons_dark/typ_th-list.svg +0 -9
  218. novelwriter/assets/icons/typicons_dark/typ_times.svg +0 -4
  219. novelwriter/assets/icons/typicons_dark/typ_trash.svg +0 -5
  220. novelwriter/assets/icons/typicons_dark/typ_unfold-hidden.svg +0 -4
  221. novelwriter/assets/icons/typicons_dark/typ_unfold-visible.svg +0 -4
  222. novelwriter/assets/icons/typicons_dark/typ_user.svg +0 -5
  223. novelwriter/assets/icons/typicons_dark/typ_warning-full.svg +0 -4
  224. novelwriter/assets/icons/typicons_light/README.md +0 -29
  225. novelwriter/assets/icons/typicons_light/icons.conf +0 -134
  226. novelwriter/assets/icons/typicons_light/mixed_copy.svg +0 -4
  227. novelwriter/assets/icons/typicons_light/mixed_document-chapter.svg +0 -12
  228. novelwriter/assets/icons/typicons_light/mixed_document-new.svg +0 -6
  229. novelwriter/assets/icons/typicons_light/mixed_document-note.svg +0 -12
  230. novelwriter/assets/icons/typicons_light/mixed_document-scene.svg +0 -12
  231. novelwriter/assets/icons/typicons_light/mixed_document-section.svg +0 -12
  232. novelwriter/assets/icons/typicons_light/mixed_document-title.svg +0 -12
  233. novelwriter/assets/icons/typicons_light/mixed_edit.svg +0 -4
  234. novelwriter/assets/icons/typicons_light/mixed_import.svg +0 -5
  235. novelwriter/assets/icons/typicons_light/mixed_input-checked.svg +0 -5
  236. novelwriter/assets/icons/typicons_light/mixed_input-none.svg +0 -5
  237. novelwriter/assets/icons/typicons_light/mixed_input-unchecked.svg +0 -5
  238. novelwriter/assets/icons/typicons_light/mixed_margin-bottom.svg +0 -6
  239. novelwriter/assets/icons/typicons_light/mixed_margin-left.svg +0 -6
  240. novelwriter/assets/icons/typicons_light/mixed_margin-right.svg +0 -6
  241. novelwriter/assets/icons/typicons_light/mixed_margin-top.svg +0 -6
  242. novelwriter/assets/icons/typicons_light/mixed_search-replace.svg +0 -6
  243. novelwriter/assets/icons/typicons_light/mixed_size-height.svg +0 -6
  244. novelwriter/assets/icons/typicons_light/mixed_size-width.svg +0 -6
  245. novelwriter/assets/icons/typicons_light/nw_deco-h0.svg +0 -4
  246. novelwriter/assets/icons/typicons_light/nw_deco-h1.svg +0 -4
  247. novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +0 -4
  248. novelwriter/assets/icons/typicons_light/nw_deco-h2.svg +0 -4
  249. novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +0 -4
  250. novelwriter/assets/icons/typicons_light/nw_deco-h3.svg +0 -4
  251. novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +0 -4
  252. novelwriter/assets/icons/typicons_light/nw_deco-h4.svg +0 -4
  253. novelwriter/assets/icons/typicons_light/nw_deco-note.svg +0 -4
  254. novelwriter/assets/icons/typicons_light/nw_deco-noveltree-more.svg +0 -4
  255. novelwriter/assets/icons/typicons_light/nw_font.svg +0 -4
  256. novelwriter/assets/icons/typicons_light/nw_panel.svg +0 -4
  257. novelwriter/assets/icons/typicons_light/nw_quote.svg +0 -4
  258. novelwriter/assets/icons/typicons_light/nw_search-case.svg +0 -4
  259. novelwriter/assets/icons/typicons_light/nw_search-preserve.svg +0 -4
  260. novelwriter/assets/icons/typicons_light/nw_search-regex.svg +0 -4
  261. novelwriter/assets/icons/typicons_light/nw_search-word.svg +0 -4
  262. novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +0 -4
  263. novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +0 -6
  264. novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +0 -4
  265. novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +0 -6
  266. novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +0 -7
  267. novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +0 -4
  268. novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +0 -6
  269. novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +0 -7
  270. novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +0 -7
  271. novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +0 -7
  272. novelwriter/assets/icons/typicons_light/nw_toolbar.svg +0 -5
  273. novelwriter/assets/icons/typicons_light/typ_arrow-down-thick-grey.svg +0 -4
  274. novelwriter/assets/icons/typicons_light/typ_arrow-forward.svg +0 -4
  275. novelwriter/assets/icons/typicons_light/typ_arrow-maximise.svg +0 -4
  276. novelwriter/assets/icons/typicons_light/typ_arrow-minimise.svg +0 -4
  277. novelwriter/assets/icons/typicons_light/typ_arrow-repeat-grey.svg +0 -4
  278. novelwriter/assets/icons/typicons_light/typ_book-grey.svg +0 -4
  279. novelwriter/assets/icons/typicons_light/typ_book.svg +0 -6
  280. novelwriter/assets/icons/typicons_light/typ_bookmark.svg +0 -4
  281. novelwriter/assets/icons/typicons_light/typ_calendar.svg +0 -4
  282. novelwriter/assets/icons/typicons_light/typ_cancel-grey.svg +0 -4
  283. novelwriter/assets/icons/typicons_light/typ_cancel.svg +0 -4
  284. novelwriter/assets/icons/typicons_light/typ_chart-bar-grey.svg +0 -4
  285. novelwriter/assets/icons/typicons_light/typ_chevron-down.svg +0 -4
  286. novelwriter/assets/icons/typicons_light/typ_chevron-left.svg +0 -4
  287. novelwriter/assets/icons/typicons_light/typ_chevron-right.svg +0 -4
  288. novelwriter/assets/icons/typicons_light/typ_chevron-up.svg +0 -4
  289. novelwriter/assets/icons/typicons_light/typ_cog.svg +0 -4
  290. novelwriter/assets/icons/typicons_light/typ_delete-full.svg +0 -4
  291. novelwriter/assets/icons/typicons_light/typ_delete.svg +0 -4
  292. novelwriter/assets/icons/typicons_light/typ_directions-full.svg +0 -4
  293. novelwriter/assets/icons/typicons_light/typ_document-add.svg +0 -4
  294. novelwriter/assets/icons/typicons_light/typ_document-text.svg +0 -5
  295. novelwriter/assets/icons/typicons_light/typ_document.svg +0 -4
  296. novelwriter/assets/icons/typicons_light/typ_export-grey.svg +0 -4
  297. novelwriter/assets/icons/typicons_light/typ_export.svg +0 -4
  298. novelwriter/assets/icons/typicons_light/typ_eye.svg +0 -4
  299. novelwriter/assets/icons/typicons_light/typ_flag.svg +0 -4
  300. novelwriter/assets/icons/typicons_light/typ_folder-open.svg +0 -4
  301. novelwriter/assets/icons/typicons_light/typ_folder.svg +0 -5
  302. novelwriter/assets/icons/typicons_light/typ_globe-grey.svg +0 -4
  303. novelwriter/assets/icons/typicons_light/typ_key.svg +0 -4
  304. novelwriter/assets/icons/typicons_light/typ_lightbulb-full.svg +0 -4
  305. novelwriter/assets/icons/typicons_light/typ_location.svg +0 -4
  306. novelwriter/assets/icons/typicons_light/typ_media-pause-grey.svg +0 -4
  307. novelwriter/assets/icons/typicons_light/typ_media-record-outline.svg +0 -4
  308. novelwriter/assets/icons/typicons_light/typ_media-record.svg +0 -4
  309. novelwriter/assets/icons/typicons_light/typ_minus.svg +0 -4
  310. novelwriter/assets/icons/typicons_light/typ_pencil.svg +0 -5
  311. novelwriter/assets/icons/typicons_light/typ_pin-outline.svg +0 -4
  312. novelwriter/assets/icons/typicons_light/typ_pin.svg +0 -4
  313. novelwriter/assets/icons/typicons_light/typ_plus.svg +0 -4
  314. novelwriter/assets/icons/typicons_light/typ_puzzle-outline.svg +0 -4
  315. novelwriter/assets/icons/typicons_light/typ_puzzle.svg +0 -4
  316. novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +0 -4
  317. novelwriter/assets/icons/typicons_light/typ_refresh.svg +0 -4
  318. novelwriter/assets/icons/typicons_light/typ_search-grey.svg +0 -4
  319. novelwriter/assets/icons/typicons_light/typ_search.svg +0 -4
  320. novelwriter/assets/icons/typicons_light/typ_star.svg +0 -4
  321. novelwriter/assets/icons/typicons_light/typ_stopwatch-grey.svg +0 -4
  322. novelwriter/assets/icons/typicons_light/typ_th-dot-menu.svg +0 -4
  323. novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +0 -4
  324. novelwriter/assets/icons/typicons_light/typ_th-list-grey.svg +0 -4
  325. novelwriter/assets/icons/typicons_light/typ_th-list.svg +0 -9
  326. novelwriter/assets/icons/typicons_light/typ_times.svg +0 -4
  327. novelwriter/assets/icons/typicons_light/typ_trash.svg +0 -5
  328. novelwriter/assets/icons/typicons_light/typ_unfold-hidden.svg +0 -4
  329. novelwriter/assets/icons/typicons_light/typ_unfold-visible.svg +0 -4
  330. novelwriter/assets/icons/typicons_light/typ_user.svg +0 -5
  331. novelwriter/assets/icons/typicons_light/typ_warning-full.svg +0 -4
  332. {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/entry_points.txt +0 -0
  333. {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info/licenses}/LICENSE.md +0 -0
  334. {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/top_level.txt +0 -0
@@ -29,20 +29,20 @@ import logging
29
29
 
30
30
  from pathlib import Path
31
31
 
32
- from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
33
- from PyQt5.QtGui import QCloseEvent, QColor
34
- from PyQt5.QtWidgets import (
32
+ from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
33
+ from PyQt6.QtGui import QCloseEvent, QColor
34
+ from PyQt6.QtWidgets import (
35
35
  QAbstractItemView, QApplication, QColorDialog, QDialogButtonBox,
36
36
  QFileDialog, QGridLayout, QHBoxLayout, QLineEdit, QMenu, QStackedWidget,
37
37
  QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget
38
38
  )
39
39
 
40
40
  from novelwriter import CONFIG, SHARED
41
- from novelwriter.common import formatFileFilter, qtLambda, simplified
41
+ from novelwriter.common import formatFileFilter, qtAddAction, qtLambda, simplified
42
42
  from novelwriter.constants import nwLabels, trConst
43
43
  from novelwriter.core.status import NWStatus, StatusEntry
44
44
  from novelwriter.enum import nwStatusShape
45
- from novelwriter.extensions.configlayout import NColourLabel, NFixedPage, NScrollableForm
45
+ from novelwriter.extensions.configlayout import NColorLabel, NFixedPage, NScrollableForm
46
46
  from novelwriter.extensions.modified import NComboBox, NDialog, NIconToolButton
47
47
  from novelwriter.extensions.pagedsidebar import NPagedSideBar
48
48
  from novelwriter.extensions.switch import NSwitch
@@ -71,16 +71,16 @@ class GuiProjectSettings(NDialog):
71
71
  self.setWindowTitle(self.tr("Project Settings"))
72
72
 
73
73
  options = SHARED.project.options
74
- self.setMinimumSize(CONFIG.pxInt(500), CONFIG.pxInt(400))
74
+ self.setMinimumSize(500, 400)
75
75
  self.resize(
76
- CONFIG.pxInt(options.getInt("GuiProjectSettings", "winWidth", CONFIG.pxInt(650))),
77
- CONFIG.pxInt(options.getInt("GuiProjectSettings", "winHeight", CONFIG.pxInt(500)))
76
+ options.getInt("GuiProjectSettings", "winWidth", 650),
77
+ options.getInt("GuiProjectSettings", "winHeight", 500),
78
78
  )
79
79
 
80
80
  # Title
81
- self.titleLabel = NColourLabel(
81
+ self.titleLabel = NColorLabel(
82
82
  self.tr("Project Settings"), self, color=SHARED.theme.helpText,
83
- scale=NColourLabel.HEADER_SCALE, indent=CONFIG.pxInt(4)
83
+ scale=NColorLabel.HEADER_SCALE, indent=4,
84
84
  )
85
85
 
86
86
  # SideBar
@@ -125,7 +125,7 @@ class GuiProjectSettings(NDialog):
125
125
  self.outerBox.addLayout(self.topBox)
126
126
  self.outerBox.addLayout(self.mainBox)
127
127
  self.outerBox.addWidget(self.buttonBox)
128
- self.outerBox.setSpacing(CONFIG.pxInt(8))
128
+ self.outerBox.setSpacing(8)
129
129
 
130
130
  self.setLayout(self.outerBox)
131
131
  self.setSizeGripEnabled(True)
@@ -210,16 +210,14 @@ class GuiProjectSettings(NDialog):
210
210
 
211
211
  def _saveSettings(self) -> None:
212
212
  """Save GUI settings."""
213
- winWidth = CONFIG.rpxInt(self.width())
214
- winHeight = CONFIG.rpxInt(self.height())
215
- statusColW = CONFIG.rpxInt(self.statusPage.columnWidth())
216
- importColW = CONFIG.rpxInt(self.importPage.columnWidth())
217
- replaceColW = CONFIG.rpxInt(self.replacePage.columnWidth())
213
+ statusColW = self.statusPage.columnWidth()
214
+ importColW = self.importPage.columnWidth()
215
+ replaceColW = self.replacePage.columnWidth()
218
216
 
219
217
  logger.debug("Saving State: GuiProjectSettings")
220
218
  options = SHARED.project.options
221
- options.setValue("GuiProjectSettings", "winWidth", winWidth)
222
- options.setValue("GuiProjectSettings", "winHeight", winHeight)
219
+ options.setValue("GuiProjectSettings", "winWidth", self.width())
220
+ options.setValue("GuiProjectSettings", "winHeight", self.height())
223
221
  options.setValue("GuiProjectSettings", "statusColW", statusColW)
224
222
  options.setValue("GuiProjectSettings", "importColW", importColW)
225
223
  options.setValue("GuiProjectSettings", "replaceColW", replaceColW)
@@ -232,7 +230,6 @@ class _SettingsPage(NScrollableForm):
232
230
  def __init__(self, parent: QWidget) -> None:
233
231
  super().__init__(parent=parent)
234
232
 
235
- xW = CONFIG.pxInt(200)
236
233
  data = SHARED.project.data
237
234
  self.setHelpTextStyle(SHARED.theme.helpText)
238
235
  self.setRowIndent(0)
@@ -240,7 +237,7 @@ class _SettingsPage(NScrollableForm):
240
237
  # Project Name
241
238
  self.projName = QLineEdit(self)
242
239
  self.projName.setMaxLength(200)
243
- self.projName.setMinimumWidth(xW)
240
+ self.projName.setMinimumWidth(200)
244
241
  self.projName.setText(data.name)
245
242
  self.addRow(
246
243
  self.tr("Project name"), self.projName,
@@ -251,7 +248,7 @@ class _SettingsPage(NScrollableForm):
251
248
  # Project Author
252
249
  self.projAuthor = QLineEdit(self)
253
250
  self.projAuthor.setMaxLength(200)
254
- self.projAuthor.setMinimumWidth(xW)
251
+ self.projAuthor.setMinimumWidth(200)
255
252
  self.projAuthor.setText(data.author)
256
253
  self.addRow(
257
254
  self.tr("Author(s)"), self.projAuthor,
@@ -262,7 +259,7 @@ class _SettingsPage(NScrollableForm):
262
259
  # Project Language
263
260
  projLang = data.language or CONFIG.guiLocale
264
261
  self.projLang = NComboBox(self)
265
- self.projLang.setMinimumWidth(xW)
262
+ self.projLang.setMinimumWidth(200)
266
263
  for tag, language in CONFIG.listLanguages(CONFIG.LANG_PROJ):
267
264
  self.projLang.addItem(language, tag)
268
265
  self.projLang.setCurrentData(projLang, projLang)
@@ -274,7 +271,7 @@ class _SettingsPage(NScrollableForm):
274
271
 
275
272
  # Spell Check Language
276
273
  self.spellLang = NComboBox(self)
277
- self.spellLang.setMinimumWidth(xW)
274
+ self.spellLang.setMinimumWidth(200)
278
275
  self.spellLang.addItem(self.tr("Default"), "None")
279
276
  if CONFIG.hasEnchant:
280
277
  for tag, language in SHARED.spelling.listDictionaries():
@@ -323,9 +320,7 @@ class _StatusPage(NFixedPage):
323
320
  pageLabel = self.tr("Project Note Importance Levels")
324
321
  colSetting = "importColW"
325
322
 
326
- wCol0 = CONFIG.pxInt(
327
- SHARED.project.options.getInt("GuiProjectSettings", colSetting, 130)
328
- )
323
+ wCol0 = SHARED.project.options.getInt("GuiProjectSettings", colSetting, 130)
329
324
 
330
325
  self._changed = False
331
326
  self._color = QColor(100, 100, 100)
@@ -334,7 +329,6 @@ class _StatusPage(NFixedPage):
334
329
 
335
330
  self._iPx = SHARED.theme.baseIconHeight
336
331
  iSz = SHARED.theme.baseIconSize
337
- bPd = CONFIG.pxInt(4)
338
332
 
339
333
  iColor = self.palette().text().color()
340
334
 
@@ -345,9 +339,9 @@ class _StatusPage(NFixedPage):
345
339
  self.trSelColor = self.tr("Select Colour")
346
340
 
347
341
  # Title
348
- self.pageTitle = NColourLabel(
342
+ self.pageTitle = NColorLabel(
349
343
  pageLabel, self, color=SHARED.theme.helpText,
350
- scale=NColourLabel.HEADER_SCALE
344
+ scale=NColorLabel.HEADER_SCALE
351
345
  )
352
346
 
353
347
  # List Box
@@ -363,27 +357,27 @@ class _StatusPage(NFixedPage):
363
357
  self._addItem(key, StatusEntry.duplicate(entry))
364
358
 
365
359
  # List Controls
366
- self.addButton = NIconToolButton(self, iSz, "add")
360
+ self.addButton = NIconToolButton(self, iSz, "add", "green")
367
361
  self.addButton.setToolTip(self.tr("Add Label"))
368
362
  self.addButton.clicked.connect(self._onItemCreate)
369
363
 
370
- self.delButton = NIconToolButton(self, iSz, "remove")
364
+ self.delButton = NIconToolButton(self, iSz, "remove", "red")
371
365
  self.delButton.setToolTip(self.tr("Delete Label"))
372
366
  self.delButton.clicked.connect(self._onItemDelete)
373
367
 
374
- self.upButton = NIconToolButton(self, iSz, "up")
368
+ self.upButton = NIconToolButton(self, iSz, "chevron_up", "blue")
375
369
  self.upButton.setToolTip(self.tr("Move Up"))
376
370
  self.upButton.clicked.connect(qtLambda(self._moveItem, -1))
377
371
 
378
- self.downButton = NIconToolButton(self, iSz, "down")
372
+ self.downButton = NIconToolButton(self, iSz, "chevron_down", "blue")
379
373
  self.downButton.setToolTip(self.tr("Move Down"))
380
374
  self.downButton.clicked.connect(qtLambda(self._moveItem, 1))
381
375
 
382
- self.importButton = NIconToolButton(self, iSz, "import")
376
+ self.importButton = NIconToolButton(self, iSz, "import", "green")
383
377
  self.importButton.setToolTip(self.tr("Import Labels"))
384
378
  self.importButton.clicked.connect(self._importLabels)
385
379
 
386
- self.exportButton = NIconToolButton(self, iSz, "export")
380
+ self.exportButton = NIconToolButton(self, iSz, "export", "blue")
387
381
  self.exportButton.setToolTip(self.tr("Export Labels"))
388
382
  self.exportButton.clicked.connect(self._exportLabels)
389
383
 
@@ -395,7 +389,7 @@ class _StatusPage(NFixedPage):
395
389
  self.labelText.textEdited.connect(self._onNameEdit)
396
390
 
397
391
  buttonStyle = (
398
- f"QToolButton {{padding: 0 {bPd}px;}} "
392
+ "QToolButton {padding: 0 4px;} "
399
393
  "QToolButton::menu-indicator {image: none;}"
400
394
  )
401
395
 
@@ -404,14 +398,17 @@ class _StatusPage(NFixedPage):
404
398
  self.colorButton.setSizePolicy(QtSizeMinimum, QtSizeMinimumExpanding)
405
399
  self.colorButton.setStyleSheet(buttonStyle)
406
400
  self.colorButton.setEnabled(False)
407
- self.colorButton.clicked.connect(self._onColourSelect)
408
-
409
- def buildMenu(menu: QMenu, items: dict[nwStatusShape, str]) -> None:
410
- for shape, label in items.items():
411
- icon = NWStatus.createIcon(self._iPx, iColor, shape)
412
- action = menu.addAction(icon, trConst(label))
413
- action.triggered.connect(qtLambda(self._selectShape, shape))
414
- self._icons[shape] = icon
401
+ self.colorButton.clicked.connect(self._onColorSelect)
402
+
403
+ def buildMenu(menu: QMenu | None, items: dict[nwStatusShape, str]) -> None:
404
+ if menu is not None:
405
+ for shape, label in items.items():
406
+ icon = NWStatus.createIcon(self._iPx, iColor, shape)
407
+ action = qtAddAction(menu, trConst(label))
408
+ action.setIcon(icon)
409
+ action.triggered.connect(qtLambda(self._selectShape, shape))
410
+ menu.addAction(action)
411
+ self._icons[shape] = icon
415
412
 
416
413
  self.shapeMenu = QMenu(self)
417
414
  buildMenu(self.shapeMenu, nwLabels.SHAPES_PLAIN)
@@ -498,7 +495,7 @@ class _StatusPage(NFixedPage):
498
495
  return
499
496
 
500
497
  @pyqtSlot()
501
- def _onColourSelect(self) -> None:
498
+ def _onColorSelect(self) -> None:
502
499
  """Open a dialog to select the status icon colour."""
503
500
  if (color := QColorDialog.getColor(self._color, self, self.trSelColor)).isValid():
504
501
  self._color = color
@@ -676,15 +673,12 @@ class _ReplacePage(NFixedPage):
676
673
  self._changed = False
677
674
 
678
675
  iSz = SHARED.theme.baseIconSize
679
-
680
- wCol0 = CONFIG.pxInt(
681
- SHARED.project.options.getInt("GuiProjectSettings", "replaceColW", 130)
682
- )
676
+ wCol0 = SHARED.project.options.getInt("GuiProjectSettings", "replaceColW", 130)
683
677
 
684
678
  # Title
685
- self.pageTitle = NColourLabel(
679
+ self.pageTitle = NColorLabel(
686
680
  self.tr("Text Auto-Replace for Preview and Build"), self,
687
- color=SHARED.theme.helpText, scale=NColourLabel.HEADER_SCALE
681
+ color=SHARED.theme.helpText, scale=NColorLabel.HEADER_SCALE
688
682
  )
689
683
 
690
684
  # List Box
@@ -697,17 +691,17 @@ class _ReplacePage(NFixedPage):
697
691
  self.listBox.itemSelectionChanged.connect(self._onSelectionChanged)
698
692
 
699
693
  for aKey, aVal in SHARED.project.data.autoReplace.items():
700
- newItem = QTreeWidgetItem(["<%s>" % aKey, aVal])
694
+ newItem = QTreeWidgetItem([f"<{aKey}>", aVal])
701
695
  self.listBox.addTopLevelItem(newItem)
702
696
 
703
697
  self.listBox.sortByColumn(self.C_KEY, Qt.SortOrder.AscendingOrder)
704
698
  self.listBox.setSortingEnabled(True)
705
699
 
706
700
  # List Controls
707
- self.addButton = NIconToolButton(self, iSz, "add")
701
+ self.addButton = NIconToolButton(self, iSz, "add", "green")
708
702
  self.addButton.clicked.connect(self._onEntryCreated)
709
703
 
710
- self.delButton = NIconToolButton(self, iSz, "remove")
704
+ self.delButton = NIconToolButton(self, iSz, "remove", "red")
711
705
  self.delButton.clicked.connect(self._onEntryDeleted)
712
706
 
713
707
  # Edit Form
@@ -25,14 +25,13 @@ from __future__ import annotations
25
25
 
26
26
  import logging
27
27
 
28
- from PyQt5.QtCore import QSize, pyqtSlot
29
- from PyQt5.QtGui import QFontMetrics
30
- from PyQt5.QtWidgets import (
28
+ from PyQt6.QtCore import QSize, pyqtSlot
29
+ from PyQt6.QtGui import QFontMetrics
30
+ from PyQt6.QtWidgets import (
31
31
  QDialogButtonBox, QFrame, QHBoxLayout, QLabel, QListWidget,
32
32
  QListWidgetItem, QVBoxLayout, QWidget
33
33
  )
34
34
 
35
- from novelwriter import CONFIG
36
35
  from novelwriter.constants import nwQuotes, trConst
37
36
  from novelwriter.extensions.modified import NDialog
38
37
  from novelwriter.types import (
@@ -62,18 +61,14 @@ class GuiQuoteSelect(NDialog):
62
61
 
63
62
  self._selected = current
64
63
 
65
- qMetrics = QFontMetrics(self.font())
66
- pxW = 7*qMetrics.boundingRectChar("M").width()
67
- pxH = 7*qMetrics.boundingRectChar("M").height()
68
- pxH = 7*qMetrics.boundingRectChar("M").height()
69
-
70
64
  lblFont = self.font()
71
65
  lblFont.setPointSizeF(4*lblFont.pointSizeF())
66
+ metrics = QFontMetrics(self.font())
72
67
 
73
68
  # Preview Label
74
69
  self.previewLabel = QLabel(current, self)
75
70
  self.previewLabel.setFont(lblFont)
76
- self.previewLabel.setFixedSize(QSize(pxW, pxH))
71
+ self.previewLabel.setFixedSize(QSize(4*metrics.maxWidth(), 5*metrics.height()))
77
72
  self.previewLabel.setAlignment(QtAlignCenter)
78
73
  self.previewLabel.setFrameStyle(QFrame.Shape.Box | QFrame.Shadow.Plain)
79
74
 
@@ -83,16 +78,16 @@ class GuiQuoteSelect(NDialog):
83
78
 
84
79
  minSize = 100
85
80
  for sKey, sLabel in nwQuotes.SYMBOLS.items():
86
- text = "[ %s ] %s" % (sKey, trConst(sLabel))
87
- minSize = max(minSize, qMetrics.boundingRect(text).width())
81
+ text = f"[ {sKey} ] {trConst(sLabel)}"
82
+ minSize = max(minSize, metrics.boundingRect(text).width())
88
83
  qtItem = QListWidgetItem(text)
89
84
  qtItem.setData(self.D_KEY, sKey)
90
85
  self.listBox.addItem(qtItem)
91
86
  if sKey == current:
92
87
  self.listBox.setCurrentItem(qtItem)
93
88
 
94
- self.listBox.setMinimumWidth(minSize + CONFIG.pxInt(40))
95
- self.listBox.setMinimumHeight(CONFIG.pxInt(150))
89
+ self.listBox.setMinimumWidth(minSize + 40)
90
+ self.listBox.setMinimumHeight(150)
96
91
 
97
92
  # Buttons
98
93
  self.buttonBox = QDialogButtonBox(QtDialogOk | QtDialogCancel, self)
@@ -127,11 +122,11 @@ class GuiQuoteSelect(NDialog):
127
122
  @classmethod
128
123
  def getQuote(cls, parent: QWidget, current: str = "") -> tuple[str, bool]:
129
124
  """Pop the dialog and return the result."""
130
- cls = GuiQuoteSelect(parent, current=current)
131
- cls.exec()
132
- quote = cls._selected
133
- accepted = cls.result() == QtAccepted
134
- cls.softDelete()
125
+ dialog = cls(parent, current=current)
126
+ dialog.exec()
127
+ quote = dialog._selected
128
+ accepted = dialog.result() == QtAccepted
129
+ dialog.softDelete()
135
130
  return quote, accepted
136
131
 
137
132
  ##
@@ -26,10 +26,10 @@ from __future__ import annotations
26
26
  import logging
27
27
 
28
28
  from pathlib import Path
29
+ from typing import TYPE_CHECKING
29
30
 
30
- from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
31
- from PyQt5.QtGui import QCloseEvent
32
- from PyQt5.QtWidgets import (
31
+ from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
32
+ from PyQt6.QtWidgets import (
33
33
  QAbstractItemView, QApplication, QDialogButtonBox, QFileDialog,
34
34
  QHBoxLayout, QLineEdit, QListWidget, QVBoxLayout, QWidget
35
35
  )
@@ -37,10 +37,13 @@ from PyQt5.QtWidgets import (
37
37
  from novelwriter import CONFIG, SHARED
38
38
  from novelwriter.common import formatFileFilter
39
39
  from novelwriter.core.spellcheck import UserDictionary
40
- from novelwriter.extensions.configlayout import NColourLabel
40
+ from novelwriter.extensions.configlayout import NColorLabel
41
41
  from novelwriter.extensions.modified import NDialog, NIconToolButton
42
42
  from novelwriter.types import QtDialogClose, QtDialogSave
43
43
 
44
+ if TYPE_CHECKING:
45
+ from PyQt6.QtGui import QCloseEvent
46
+
44
47
  logger = logging.getLogger(__name__)
45
48
 
46
49
 
@@ -56,28 +59,25 @@ class GuiWordList(NDialog):
56
59
  self.setWindowTitle(self.tr("Project Word List"))
57
60
 
58
61
  iSz = SHARED.theme.baseIconSize
59
- mS = CONFIG.pxInt(250)
60
- wW = CONFIG.pxInt(320)
61
- wH = CONFIG.pxInt(340)
62
62
 
63
- self.setMinimumWidth(mS)
64
- self.setMinimumHeight(mS)
63
+ self.setMinimumWidth(250)
64
+ self.setMinimumHeight(250)
65
65
  self.resize(
66
- CONFIG.pxInt(SHARED.project.options.getInt("GuiWordList", "winWidth", wW)),
67
- CONFIG.pxInt(SHARED.project.options.getInt("GuiWordList", "winHeight", wH))
66
+ SHARED.project.options.getInt("GuiWordList", "winWidth", 320),
67
+ SHARED.project.options.getInt("GuiWordList", "winHeight", 340),
68
68
  )
69
69
 
70
70
  # Header
71
- self.headLabel = NColourLabel(
71
+ self.headLabel = NColorLabel(
72
72
  self.tr("Project Word List"), self, color=SHARED.theme.helpText,
73
- scale=NColourLabel.HEADER_SCALE
73
+ scale=NColorLabel.HEADER_SCALE
74
74
  )
75
75
 
76
- self.importButton = NIconToolButton(self, iSz, "import")
76
+ self.importButton = NIconToolButton(self, iSz, "import", "green")
77
77
  self.importButton.setToolTip(self.tr("Import words from text file"))
78
78
  self.importButton.clicked.connect(self._importWords)
79
79
 
80
- self.exportButton = NIconToolButton(self, iSz, "export")
80
+ self.exportButton = NIconToolButton(self, iSz, "export", "blue")
81
81
  self.exportButton.setToolTip(self.tr("Export words to text file"))
82
82
  self.exportButton.clicked.connect(self._exportWords)
83
83
 
@@ -95,11 +95,11 @@ class GuiWordList(NDialog):
95
95
  # Add/Remove Form
96
96
  self.newEntry = QLineEdit(self)
97
97
 
98
- self.addButton = NIconToolButton(self, iSz, "add")
98
+ self.addButton = NIconToolButton(self, iSz, "add", "green")
99
99
  self.addButton.setToolTip(self.tr("Add Word"))
100
100
  self.addButton.clicked.connect(self._doAdd)
101
101
 
102
- self.delButton = NIconToolButton(self, iSz, "remove")
102
+ self.delButton = NIconToolButton(self, iSz, "remove", "red")
103
103
  self.delButton.setToolTip(self.tr("Remove Word"))
104
104
  self.delButton.clicked.connect(self._doDelete)
105
105
 
@@ -118,9 +118,9 @@ class GuiWordList(NDialog):
118
118
  self.outerBox.addLayout(self.headerBox, 0)
119
119
  self.outerBox.addWidget(self.listBox, 1)
120
120
  self.outerBox.addLayout(self.editBox, 0)
121
- self.outerBox.addSpacing(CONFIG.pxInt(12))
121
+ self.outerBox.addSpacing(12)
122
122
  self.outerBox.addWidget(self.buttonBox, 0)
123
- self.outerBox.setSpacing(CONFIG.pxInt(4))
123
+ self.outerBox.setSpacing(4)
124
124
 
125
125
  self.setLayout(self.outerBox)
126
126
 
@@ -230,14 +230,10 @@ class GuiWordList(NDialog):
230
230
 
231
231
  def _saveGuiSettings(self) -> None:
232
232
  """Save GUI settings."""
233
- winWidth = CONFIG.rpxInt(self.width())
234
- winHeight = CONFIG.rpxInt(self.height())
235
-
236
233
  logger.debug("Saving State: GuiWordList")
237
234
  pOptions = SHARED.project.options
238
- pOptions.setValue("GuiWordList", "winWidth", winWidth)
239
- pOptions.setValue("GuiWordList", "winHeight", winHeight)
240
-
235
+ pOptions.setValue("GuiWordList", "winWidth", self.width())
236
+ pOptions.setValue("GuiWordList", "winHeight", self.height())
241
237
  return
242
238
 
243
239
  def _addWord(self, word: str) -> None:
@@ -249,8 +245,7 @@ class GuiWordList(NDialog):
249
245
 
250
246
  def _listWords(self) -> list[str]:
251
247
  """List all words in the list box."""
252
- result = []
253
- for i in range(self.listBox.count()):
254
- if (item := self.listBox.item(i)) and (word := item.text().strip()):
255
- result.append(word)
256
- return result
248
+ return [
249
+ word for i in range(self.listBox.count())
250
+ if (item := self.listBox.item(i)) and (word := item.text().strip())
251
+ ]
novelwriter/enum.py CHANGED
@@ -180,6 +180,14 @@ class nwOutline(Enum):
180
180
  SYNOP = 19
181
181
 
182
182
 
183
+ class nwNovelExtra(Enum):
184
+
185
+ HIDDEN = 0
186
+ POV = 1
187
+ FOCUS = 2
188
+ PLOT = 3
189
+
190
+
183
191
  class nwBuildFmt(Enum):
184
192
 
185
193
  ODT = 0
novelwriter/error.py CHANGED
@@ -29,14 +29,14 @@ import sys
29
29
 
30
30
  from typing import TYPE_CHECKING
31
31
 
32
- from PyQt5.QtCore import Qt, pyqtSlot
33
- from PyQt5.QtGui import QFont, QFontDatabase
34
- from PyQt5.QtWidgets import (
32
+ from PyQt6.QtCore import Qt, pyqtSlot
33
+ from PyQt6.QtGui import QFont, QFontDatabase
34
+ from PyQt6.QtWidgets import (
35
35
  QApplication, QDialog, QDialogButtonBox, QGridLayout, QLabel,
36
36
  QPlainTextEdit, QStyle, QWidget
37
37
  )
38
38
 
39
- if TYPE_CHECKING: # pragma: no cover
39
+ if TYPE_CHECKING:
40
40
  from types import TracebackType
41
41
 
42
42
  logger = logging.getLogger(__name__)
@@ -46,7 +46,7 @@ def logException() -> None:
46
46
  """Log the content of an exception message."""
47
47
  exType, exValue, _ = sys.exc_info()
48
48
  if exType is not None:
49
- logger.error(f"{exType.__name__}: {str(exValue)}", stacklevel=2)
49
+ logger.error(f"{exType.__name__}: {exValue!s}", stacklevel=2)
50
50
  return
51
51
 
52
52
 
@@ -54,7 +54,7 @@ def formatException(exc: BaseException) -> str:
54
54
  """Format an exception as a string the same way the default
55
55
  exception handler does.
56
56
  """
57
- return f"{type(exc).__name__}: {str(exc)}"
57
+ return f"{type(exc).__name__}: {exc!s}"
58
58
 
59
59
 
60
60
  class NWErrorMessage(QDialog):
@@ -65,11 +65,11 @@ class NWErrorMessage(QDialog):
65
65
 
66
66
  # Widgets
67
67
  self.msgIcon = QLabel()
68
- self.msgIcon.setPixmap(
69
- QApplication.style().standardIcon(
70
- QStyle.StandardPixmap.SP_MessageBoxCritical
71
- ).pixmap(64, 64)
72
- )
68
+ if style := QApplication.style():
69
+ self.msgIcon.setPixmap(
70
+ style.standardIcon(QStyle.StandardPixmap.SP_MessageBoxCritical).pixmap(64, 64)
71
+ )
72
+
73
73
  self.msgHead = QLabel()
74
74
  self.msgHead.setOpenExternalLinks(True)
75
75
  self.msgHead.setWordWrap(True)
@@ -118,7 +118,7 @@ class NWErrorMessage(QDialog):
118
118
  """
119
119
  from traceback import format_tb
120
120
 
121
- from PyQt5.QtCore import PYQT_VERSION_STR, QT_VERSION_STR, QSysInfo
121
+ from PyQt6.QtCore import PYQT_VERSION_STR, QT_VERSION_STR, QSysInfo
122
122
 
123
123
  from novelwriter import __version__
124
124
  from novelwriter.constants import nwConst
@@ -144,16 +144,16 @@ class NWErrorMessage(QDialog):
144
144
 
145
145
  try:
146
146
  txtTrace = "\n".join(format_tb(exTrace))
147
- self.msgBody.setPlainText((
147
+ self.msgBody.setPlainText(
148
148
  "Environment:\n"
149
149
  f"novelWriter Version: {__version__}\n"
150
150
  f"Host OS: {sys.platform} ({kernelVersion})\n"
151
151
  f"Python: {sys.version.split()[0]} ({sys.hexversion:#x})\n"
152
152
  f"Qt: {QT_VERSION_STR}, PyQt: {PYQT_VERSION_STR}\n"
153
153
  f"enchant: {enchantVersion}\n\n"
154
- f"{exType.__name__}:\n{str(exValue)}\n\n"
154
+ f"{exType.__name__}:\n{exValue!s}\n\n"
155
155
  f"Traceback:\n{txtTrace}\n"
156
- ))
156
+ )
157
157
  except Exception:
158
158
  self.msgBody.setPlainText("Failed to generate error report ...")
159
159
 
@@ -174,7 +174,7 @@ def exceptionHandler(exType: type, exValue: BaseException, exTrace: TracebackTyp
174
174
  """Function to catch unhandled global exceptions."""
175
175
  from traceback import print_tb
176
176
 
177
- from PyQt5.QtWidgets import QApplication
177
+ from PyQt6.QtWidgets import QApplication
178
178
 
179
179
  logger.critical("%s: %s", exType.__name__, str(exValue))
180
180
  print_tb(exTrace)