novelWriter 2.6.3__py3-none-any.whl → 2.7rc1__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 (325) hide show
  1. novelwriter/__init__.py +98 -75
  2. novelwriter/assets/i18n/project_en_GB.json +2 -0
  3. novelwriter/assets/icons/font_awesome.icons +109 -0
  4. novelwriter/assets/icons/material_filled_bold.icons +109 -0
  5. novelwriter/assets/icons/material_filled_normal.icons +109 -0
  6. novelwriter/assets/icons/material_filled_thin.icons +109 -0
  7. novelwriter/assets/icons/material_rounded_bold.icons +109 -0
  8. novelwriter/assets/icons/material_rounded_normal.icons +109 -0
  9. novelwriter/assets/icons/material_rounded_thin.icons +109 -0
  10. novelwriter/assets/icons/remix_filled.icons +109 -0
  11. novelwriter/assets/icons/remix_outline.icons +109 -0
  12. novelwriter/assets/images/splash.png +0 -0
  13. novelwriter/assets/manual.pdf +0 -0
  14. novelwriter/assets/{manual_fr_FR.pdf → manual_fr.pdf} +0 -0
  15. novelwriter/assets/sample.zip +0 -0
  16. novelwriter/assets/syntax/cyberpunk_night.conf +1 -1
  17. novelwriter/assets/syntax/snazzy.conf +3 -3
  18. novelwriter/assets/text/credits_en.htm +6 -6
  19. novelwriter/assets/themes/cyberpunk_night.conf +23 -7
  20. novelwriter/assets/themes/default_dark.conf +20 -4
  21. novelwriter/assets/themes/default_light.conf +21 -5
  22. novelwriter/assets/themes/dracula.conf +20 -4
  23. novelwriter/assets/themes/snazzy.conf +48 -0
  24. novelwriter/assets/themes/solarized_dark.conf +24 -8
  25. novelwriter/assets/themes/solarized_light.conf +22 -6
  26. novelwriter/common.py +43 -27
  27. novelwriter/config.py +201 -139
  28. novelwriter/constants.py +67 -36
  29. novelwriter/core/buildsettings.py +25 -16
  30. novelwriter/core/coretools.py +52 -41
  31. novelwriter/core/docbuild.py +20 -13
  32. novelwriter/core/document.py +2 -2
  33. novelwriter/core/index.py +166 -432
  34. novelwriter/core/indexdata.py +406 -0
  35. novelwriter/core/item.py +50 -32
  36. novelwriter/core/itemmodel.py +43 -38
  37. novelwriter/core/novelmodel.py +225 -0
  38. novelwriter/core/options.py +1 -1
  39. novelwriter/core/project.py +24 -25
  40. novelwriter/core/projectdata.py +47 -29
  41. novelwriter/core/projectxml.py +18 -8
  42. novelwriter/core/sessions.py +32 -15
  43. novelwriter/core/spellcheck.py +4 -3
  44. novelwriter/core/status.py +12 -15
  45. novelwriter/core/storage.py +1 -1
  46. novelwriter/core/tree.py +55 -13
  47. novelwriter/dialogs/about.py +19 -22
  48. novelwriter/dialogs/docmerge.py +23 -24
  49. novelwriter/dialogs/docsplit.py +26 -26
  50. novelwriter/dialogs/editlabel.py +19 -20
  51. novelwriter/dialogs/preferences.py +143 -69
  52. novelwriter/dialogs/projectsettings.py +51 -54
  53. novelwriter/dialogs/quotes.py +14 -19
  54. novelwriter/dialogs/wordlist.py +25 -30
  55. novelwriter/enum.py +8 -0
  56. novelwriter/error.py +16 -16
  57. novelwriter/extensions/configlayout.py +24 -20
  58. novelwriter/extensions/eventfilters.py +9 -5
  59. novelwriter/extensions/modified.py +34 -15
  60. novelwriter/extensions/novelselector.py +18 -5
  61. novelwriter/extensions/pagedsidebar.py +39 -49
  62. novelwriter/extensions/progressbars.py +10 -8
  63. novelwriter/extensions/statusled.py +6 -13
  64. novelwriter/extensions/switch.py +31 -41
  65. novelwriter/extensions/switchbox.py +8 -3
  66. novelwriter/extensions/versioninfo.py +4 -4
  67. novelwriter/formats/shared.py +1 -1
  68. novelwriter/formats/todocx.py +14 -10
  69. novelwriter/formats/tohtml.py +7 -5
  70. novelwriter/formats/tokenizer.py +37 -33
  71. novelwriter/formats/tomarkdown.py +6 -2
  72. novelwriter/formats/toodt.py +27 -22
  73. novelwriter/formats/toqdoc.py +19 -14
  74. novelwriter/formats/toraw.py +6 -2
  75. novelwriter/gui/doceditor.py +314 -305
  76. novelwriter/gui/dochighlight.py +46 -45
  77. novelwriter/gui/docviewer.py +102 -104
  78. novelwriter/gui/docviewerpanel.py +47 -51
  79. novelwriter/gui/editordocument.py +8 -5
  80. novelwriter/gui/itemdetails.py +11 -14
  81. novelwriter/gui/mainmenu.py +146 -145
  82. novelwriter/gui/noveltree.py +246 -406
  83. novelwriter/gui/outline.py +141 -72
  84. novelwriter/gui/projtree.py +139 -132
  85. novelwriter/gui/search.py +34 -31
  86. novelwriter/gui/sidebar.py +13 -18
  87. novelwriter/gui/statusbar.py +27 -21
  88. novelwriter/gui/theme.py +554 -436
  89. novelwriter/guimain.py +56 -38
  90. novelwriter/shared.py +32 -23
  91. novelwriter/splash.py +74 -0
  92. novelwriter/text/comments.py +70 -0
  93. novelwriter/text/patterns.py +4 -4
  94. novelwriter/tools/dictionaries.py +20 -29
  95. novelwriter/tools/lipsum.py +18 -18
  96. novelwriter/tools/manusbuild.py +39 -42
  97. novelwriter/tools/manuscript.py +102 -115
  98. novelwriter/tools/manussettings.py +116 -96
  99. novelwriter/tools/noveldetails.py +60 -72
  100. novelwriter/tools/welcome.py +57 -75
  101. novelwriter/tools/writingstats.py +112 -102
  102. novelwriter/types.py +5 -7
  103. {novelWriter-2.6.3.dist-info → novelwriter-2.7rc1.dist-info}/METADATA +6 -6
  104. novelwriter-2.7rc1.dist-info/RECORD +162 -0
  105. {novelWriter-2.6.3.dist-info → novelwriter-2.7rc1.dist-info}/WHEEL +1 -1
  106. novelWriter-2.6.3.dist-info/RECORD +0 -363
  107. novelwriter/assets/icons/typicons_dark/README.md +0 -29
  108. novelwriter/assets/icons/typicons_dark/icons.conf +0 -134
  109. novelwriter/assets/icons/typicons_dark/mixed_copy.svg +0 -4
  110. novelwriter/assets/icons/typicons_dark/mixed_document-chapter.svg +0 -12
  111. novelwriter/assets/icons/typicons_dark/mixed_document-new.svg +0 -6
  112. novelwriter/assets/icons/typicons_dark/mixed_document-note.svg +0 -12
  113. novelwriter/assets/icons/typicons_dark/mixed_document-scene.svg +0 -12
  114. novelwriter/assets/icons/typicons_dark/mixed_document-section.svg +0 -12
  115. novelwriter/assets/icons/typicons_dark/mixed_document-title.svg +0 -12
  116. novelwriter/assets/icons/typicons_dark/mixed_edit.svg +0 -4
  117. novelwriter/assets/icons/typicons_dark/mixed_import.svg +0 -5
  118. novelwriter/assets/icons/typicons_dark/mixed_input-checked.svg +0 -5
  119. novelwriter/assets/icons/typicons_dark/mixed_input-none.svg +0 -5
  120. novelwriter/assets/icons/typicons_dark/mixed_input-unchecked.svg +0 -5
  121. novelwriter/assets/icons/typicons_dark/mixed_margin-bottom.svg +0 -6
  122. novelwriter/assets/icons/typicons_dark/mixed_margin-left.svg +0 -6
  123. novelwriter/assets/icons/typicons_dark/mixed_margin-right.svg +0 -6
  124. novelwriter/assets/icons/typicons_dark/mixed_margin-top.svg +0 -6
  125. novelwriter/assets/icons/typicons_dark/mixed_search-replace.svg +0 -6
  126. novelwriter/assets/icons/typicons_dark/mixed_size-height.svg +0 -6
  127. novelwriter/assets/icons/typicons_dark/mixed_size-width.svg +0 -6
  128. novelwriter/assets/icons/typicons_dark/nw_deco-h0.svg +0 -4
  129. novelwriter/assets/icons/typicons_dark/nw_deco-h1.svg +0 -4
  130. novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +0 -4
  131. novelwriter/assets/icons/typicons_dark/nw_deco-h2.svg +0 -4
  132. novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +0 -4
  133. novelwriter/assets/icons/typicons_dark/nw_deco-h3.svg +0 -4
  134. novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +0 -4
  135. novelwriter/assets/icons/typicons_dark/nw_deco-h4.svg +0 -4
  136. novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +0 -4
  137. novelwriter/assets/icons/typicons_dark/nw_deco-noveltree-more.svg +0 -4
  138. novelwriter/assets/icons/typicons_dark/nw_font.svg +0 -4
  139. novelwriter/assets/icons/typicons_dark/nw_panel.svg +0 -4
  140. novelwriter/assets/icons/typicons_dark/nw_quote.svg +0 -4
  141. novelwriter/assets/icons/typicons_dark/nw_search-case.svg +0 -4
  142. novelwriter/assets/icons/typicons_dark/nw_search-preserve.svg +0 -4
  143. novelwriter/assets/icons/typicons_dark/nw_search-regex.svg +0 -4
  144. novelwriter/assets/icons/typicons_dark/nw_search-word.svg +0 -4
  145. novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +0 -4
  146. novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +0 -6
  147. novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +0 -4
  148. novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +0 -6
  149. novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +0 -7
  150. novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +0 -4
  151. novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +0 -6
  152. novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +0 -7
  153. novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +0 -7
  154. novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +0 -7
  155. novelwriter/assets/icons/typicons_dark/nw_toolbar.svg +0 -5
  156. novelwriter/assets/icons/typicons_dark/typ_arrow-down-thick-grey.svg +0 -4
  157. novelwriter/assets/icons/typicons_dark/typ_arrow-forward.svg +0 -4
  158. novelwriter/assets/icons/typicons_dark/typ_arrow-maximise.svg +0 -4
  159. novelwriter/assets/icons/typicons_dark/typ_arrow-minimise.svg +0 -4
  160. novelwriter/assets/icons/typicons_dark/typ_arrow-repeat-grey.svg +0 -4
  161. novelwriter/assets/icons/typicons_dark/typ_book-grey.svg +0 -4
  162. novelwriter/assets/icons/typicons_dark/typ_book.svg +0 -6
  163. novelwriter/assets/icons/typicons_dark/typ_bookmark.svg +0 -4
  164. novelwriter/assets/icons/typicons_dark/typ_calendar.svg +0 -4
  165. novelwriter/assets/icons/typicons_dark/typ_cancel-grey.svg +0 -4
  166. novelwriter/assets/icons/typicons_dark/typ_cancel.svg +0 -4
  167. novelwriter/assets/icons/typicons_dark/typ_chart-bar-grey.svg +0 -4
  168. novelwriter/assets/icons/typicons_dark/typ_chevron-down.svg +0 -4
  169. novelwriter/assets/icons/typicons_dark/typ_chevron-left.svg +0 -4
  170. novelwriter/assets/icons/typicons_dark/typ_chevron-right.svg +0 -4
  171. novelwriter/assets/icons/typicons_dark/typ_chevron-up.svg +0 -4
  172. novelwriter/assets/icons/typicons_dark/typ_cog.svg +0 -4
  173. novelwriter/assets/icons/typicons_dark/typ_delete-full.svg +0 -4
  174. novelwriter/assets/icons/typicons_dark/typ_delete.svg +0 -4
  175. novelwriter/assets/icons/typicons_dark/typ_directions-full.svg +0 -4
  176. novelwriter/assets/icons/typicons_dark/typ_document-add.svg +0 -4
  177. novelwriter/assets/icons/typicons_dark/typ_document-text.svg +0 -8
  178. novelwriter/assets/icons/typicons_dark/typ_document.svg +0 -4
  179. novelwriter/assets/icons/typicons_dark/typ_export-grey.svg +0 -4
  180. novelwriter/assets/icons/typicons_dark/typ_export.svg +0 -4
  181. novelwriter/assets/icons/typicons_dark/typ_eye.svg +0 -4
  182. novelwriter/assets/icons/typicons_dark/typ_flag.svg +0 -4
  183. novelwriter/assets/icons/typicons_dark/typ_folder-open.svg +0 -4
  184. novelwriter/assets/icons/typicons_dark/typ_folder.svg +0 -5
  185. novelwriter/assets/icons/typicons_dark/typ_globe-grey.svg +0 -4
  186. novelwriter/assets/icons/typicons_dark/typ_key.svg +0 -4
  187. novelwriter/assets/icons/typicons_dark/typ_lightbulb-full.svg +0 -4
  188. novelwriter/assets/icons/typicons_dark/typ_location.svg +0 -4
  189. novelwriter/assets/icons/typicons_dark/typ_media-pause-grey.svg +0 -4
  190. novelwriter/assets/icons/typicons_dark/typ_media-record-outline.svg +0 -4
  191. novelwriter/assets/icons/typicons_dark/typ_media-record.svg +0 -4
  192. novelwriter/assets/icons/typicons_dark/typ_minus.svg +0 -4
  193. novelwriter/assets/icons/typicons_dark/typ_pencil.svg +0 -5
  194. novelwriter/assets/icons/typicons_dark/typ_pin-outline.svg +0 -4
  195. novelwriter/assets/icons/typicons_dark/typ_pin.svg +0 -4
  196. novelwriter/assets/icons/typicons_dark/typ_plus.svg +0 -4
  197. novelwriter/assets/icons/typicons_dark/typ_puzzle-outline.svg +0 -4
  198. novelwriter/assets/icons/typicons_dark/typ_puzzle.svg +0 -4
  199. novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +0 -4
  200. novelwriter/assets/icons/typicons_dark/typ_refresh.svg +0 -4
  201. novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +0 -4
  202. novelwriter/assets/icons/typicons_dark/typ_search.svg +0 -4
  203. novelwriter/assets/icons/typicons_dark/typ_star.svg +0 -4
  204. novelwriter/assets/icons/typicons_dark/typ_stopwatch-grey.svg +0 -4
  205. novelwriter/assets/icons/typicons_dark/typ_th-dot-menu.svg +0 -4
  206. novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +0 -4
  207. novelwriter/assets/icons/typicons_dark/typ_th-list-grey.svg +0 -4
  208. novelwriter/assets/icons/typicons_dark/typ_th-list.svg +0 -9
  209. novelwriter/assets/icons/typicons_dark/typ_times.svg +0 -4
  210. novelwriter/assets/icons/typicons_dark/typ_trash.svg +0 -5
  211. novelwriter/assets/icons/typicons_dark/typ_unfold-hidden.svg +0 -4
  212. novelwriter/assets/icons/typicons_dark/typ_unfold-visible.svg +0 -4
  213. novelwriter/assets/icons/typicons_dark/typ_user.svg +0 -5
  214. novelwriter/assets/icons/typicons_dark/typ_warning-full.svg +0 -4
  215. novelwriter/assets/icons/typicons_light/README.md +0 -29
  216. novelwriter/assets/icons/typicons_light/icons.conf +0 -134
  217. novelwriter/assets/icons/typicons_light/mixed_copy.svg +0 -4
  218. novelwriter/assets/icons/typicons_light/mixed_document-chapter.svg +0 -12
  219. novelwriter/assets/icons/typicons_light/mixed_document-new.svg +0 -6
  220. novelwriter/assets/icons/typicons_light/mixed_document-note.svg +0 -12
  221. novelwriter/assets/icons/typicons_light/mixed_document-scene.svg +0 -12
  222. novelwriter/assets/icons/typicons_light/mixed_document-section.svg +0 -12
  223. novelwriter/assets/icons/typicons_light/mixed_document-title.svg +0 -12
  224. novelwriter/assets/icons/typicons_light/mixed_edit.svg +0 -4
  225. novelwriter/assets/icons/typicons_light/mixed_import.svg +0 -5
  226. novelwriter/assets/icons/typicons_light/mixed_input-checked.svg +0 -5
  227. novelwriter/assets/icons/typicons_light/mixed_input-none.svg +0 -5
  228. novelwriter/assets/icons/typicons_light/mixed_input-unchecked.svg +0 -5
  229. novelwriter/assets/icons/typicons_light/mixed_margin-bottom.svg +0 -6
  230. novelwriter/assets/icons/typicons_light/mixed_margin-left.svg +0 -6
  231. novelwriter/assets/icons/typicons_light/mixed_margin-right.svg +0 -6
  232. novelwriter/assets/icons/typicons_light/mixed_margin-top.svg +0 -6
  233. novelwriter/assets/icons/typicons_light/mixed_search-replace.svg +0 -6
  234. novelwriter/assets/icons/typicons_light/mixed_size-height.svg +0 -6
  235. novelwriter/assets/icons/typicons_light/mixed_size-width.svg +0 -6
  236. novelwriter/assets/icons/typicons_light/nw_deco-h0.svg +0 -4
  237. novelwriter/assets/icons/typicons_light/nw_deco-h1.svg +0 -4
  238. novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +0 -4
  239. novelwriter/assets/icons/typicons_light/nw_deco-h2.svg +0 -4
  240. novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +0 -4
  241. novelwriter/assets/icons/typicons_light/nw_deco-h3.svg +0 -4
  242. novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +0 -4
  243. novelwriter/assets/icons/typicons_light/nw_deco-h4.svg +0 -4
  244. novelwriter/assets/icons/typicons_light/nw_deco-note.svg +0 -4
  245. novelwriter/assets/icons/typicons_light/nw_deco-noveltree-more.svg +0 -4
  246. novelwriter/assets/icons/typicons_light/nw_font.svg +0 -4
  247. novelwriter/assets/icons/typicons_light/nw_panel.svg +0 -4
  248. novelwriter/assets/icons/typicons_light/nw_quote.svg +0 -4
  249. novelwriter/assets/icons/typicons_light/nw_search-case.svg +0 -4
  250. novelwriter/assets/icons/typicons_light/nw_search-preserve.svg +0 -4
  251. novelwriter/assets/icons/typicons_light/nw_search-regex.svg +0 -4
  252. novelwriter/assets/icons/typicons_light/nw_search-word.svg +0 -4
  253. novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +0 -4
  254. novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +0 -6
  255. novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +0 -4
  256. novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +0 -6
  257. novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +0 -7
  258. novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +0 -4
  259. novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +0 -6
  260. novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +0 -7
  261. novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +0 -7
  262. novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +0 -7
  263. novelwriter/assets/icons/typicons_light/nw_toolbar.svg +0 -5
  264. novelwriter/assets/icons/typicons_light/typ_arrow-down-thick-grey.svg +0 -4
  265. novelwriter/assets/icons/typicons_light/typ_arrow-forward.svg +0 -4
  266. novelwriter/assets/icons/typicons_light/typ_arrow-maximise.svg +0 -4
  267. novelwriter/assets/icons/typicons_light/typ_arrow-minimise.svg +0 -4
  268. novelwriter/assets/icons/typicons_light/typ_arrow-repeat-grey.svg +0 -4
  269. novelwriter/assets/icons/typicons_light/typ_book-grey.svg +0 -4
  270. novelwriter/assets/icons/typicons_light/typ_book.svg +0 -6
  271. novelwriter/assets/icons/typicons_light/typ_bookmark.svg +0 -4
  272. novelwriter/assets/icons/typicons_light/typ_calendar.svg +0 -4
  273. novelwriter/assets/icons/typicons_light/typ_cancel-grey.svg +0 -4
  274. novelwriter/assets/icons/typicons_light/typ_cancel.svg +0 -4
  275. novelwriter/assets/icons/typicons_light/typ_chart-bar-grey.svg +0 -4
  276. novelwriter/assets/icons/typicons_light/typ_chevron-down.svg +0 -4
  277. novelwriter/assets/icons/typicons_light/typ_chevron-left.svg +0 -4
  278. novelwriter/assets/icons/typicons_light/typ_chevron-right.svg +0 -4
  279. novelwriter/assets/icons/typicons_light/typ_chevron-up.svg +0 -4
  280. novelwriter/assets/icons/typicons_light/typ_cog.svg +0 -4
  281. novelwriter/assets/icons/typicons_light/typ_delete-full.svg +0 -4
  282. novelwriter/assets/icons/typicons_light/typ_delete.svg +0 -4
  283. novelwriter/assets/icons/typicons_light/typ_directions-full.svg +0 -4
  284. novelwriter/assets/icons/typicons_light/typ_document-add.svg +0 -4
  285. novelwriter/assets/icons/typicons_light/typ_document-text.svg +0 -5
  286. novelwriter/assets/icons/typicons_light/typ_document.svg +0 -4
  287. novelwriter/assets/icons/typicons_light/typ_export-grey.svg +0 -4
  288. novelwriter/assets/icons/typicons_light/typ_export.svg +0 -4
  289. novelwriter/assets/icons/typicons_light/typ_eye.svg +0 -4
  290. novelwriter/assets/icons/typicons_light/typ_flag.svg +0 -4
  291. novelwriter/assets/icons/typicons_light/typ_folder-open.svg +0 -4
  292. novelwriter/assets/icons/typicons_light/typ_folder.svg +0 -5
  293. novelwriter/assets/icons/typicons_light/typ_globe-grey.svg +0 -4
  294. novelwriter/assets/icons/typicons_light/typ_key.svg +0 -4
  295. novelwriter/assets/icons/typicons_light/typ_lightbulb-full.svg +0 -4
  296. novelwriter/assets/icons/typicons_light/typ_location.svg +0 -4
  297. novelwriter/assets/icons/typicons_light/typ_media-pause-grey.svg +0 -4
  298. novelwriter/assets/icons/typicons_light/typ_media-record-outline.svg +0 -4
  299. novelwriter/assets/icons/typicons_light/typ_media-record.svg +0 -4
  300. novelwriter/assets/icons/typicons_light/typ_minus.svg +0 -4
  301. novelwriter/assets/icons/typicons_light/typ_pencil.svg +0 -5
  302. novelwriter/assets/icons/typicons_light/typ_pin-outline.svg +0 -4
  303. novelwriter/assets/icons/typicons_light/typ_pin.svg +0 -4
  304. novelwriter/assets/icons/typicons_light/typ_plus.svg +0 -4
  305. novelwriter/assets/icons/typicons_light/typ_puzzle-outline.svg +0 -4
  306. novelwriter/assets/icons/typicons_light/typ_puzzle.svg +0 -4
  307. novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +0 -4
  308. novelwriter/assets/icons/typicons_light/typ_refresh.svg +0 -4
  309. novelwriter/assets/icons/typicons_light/typ_search-grey.svg +0 -4
  310. novelwriter/assets/icons/typicons_light/typ_search.svg +0 -4
  311. novelwriter/assets/icons/typicons_light/typ_star.svg +0 -4
  312. novelwriter/assets/icons/typicons_light/typ_stopwatch-grey.svg +0 -4
  313. novelwriter/assets/icons/typicons_light/typ_th-dot-menu.svg +0 -4
  314. novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +0 -4
  315. novelwriter/assets/icons/typicons_light/typ_th-list-grey.svg +0 -4
  316. novelwriter/assets/icons/typicons_light/typ_th-list.svg +0 -9
  317. novelwriter/assets/icons/typicons_light/typ_times.svg +0 -4
  318. novelwriter/assets/icons/typicons_light/typ_trash.svg +0 -5
  319. novelwriter/assets/icons/typicons_light/typ_unfold-hidden.svg +0 -4
  320. novelwriter/assets/icons/typicons_light/typ_unfold-visible.svg +0 -4
  321. novelwriter/assets/icons/typicons_light/typ_user.svg +0 -5
  322. novelwriter/assets/icons/typicons_light/typ_warning-full.svg +0 -4
  323. {novelWriter-2.6.3.dist-info → novelwriter-2.7rc1.dist-info}/entry_points.txt +0 -0
  324. {novelWriter-2.6.3.dist-info → novelwriter-2.7rc1.dist-info/licenses}/LICENSE.md +0 -0
  325. {novelWriter-2.6.3.dist-info → novelwriter-2.7rc1.dist-info}/top_level.txt +0 -0
@@ -6,13 +6,32 @@ credit = Veronica Berglyd Olsen
6
6
  url = https://github.com/vkbo/novelWriter
7
7
  license = CC BY-SA 4.0
8
8
  licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
9
- icontheme = typicons_light
9
+
10
+ [Icons]
11
+ default = 72, 72, 72
12
+ faded = 108, 108, 108
13
+ red = 240, 40, 41
14
+ orange = 245, 135, 31
15
+ yellow = 234, 183, 0
16
+ green = 113, 140, 0
17
+ aqua = 62, 153, 159
18
+ blue = 66, 113, 174
19
+ purple = 137, 89, 168
20
+
21
+ [Project]
22
+ root = 66, 113, 174
23
+ folder = 234, 183, 0
24
+ file = 72, 72, 72
25
+ title = 113, 140, 0
26
+ chapter = 240, 40, 41
27
+ scene = 66, 113, 174
28
+ note = 234, 183, 0
10
29
 
11
30
  [Palette]
12
31
  window = 239, 239, 239
13
32
  windowtext = 0, 0, 0
14
33
  base = 255, 255, 255
15
- alternatebase = 239, 239, 239
34
+ alternatebase = 224, 224, 224
16
35
  text = 0, 0, 0
17
36
  tooltipbase = 255, 255, 220
18
37
  tooltiptext = 0, 0, 0
@@ -28,6 +47,3 @@ linkvisited = 66, 113, 174
28
47
  helptext = 92, 92, 92
29
48
  fadedtext = 108, 108, 108
30
49
  errortext = 255, 92, 92
31
- statusnone = 120, 120, 120
32
- statussaved = 2, 133, 37
33
- statusunsaved = 200, 15, 39
@@ -6,7 +6,6 @@ credit = Zeno Rocha
6
6
  url = https://draculatheme.com
7
7
  license = MIT
8
8
  licenseurl = https://github.com/dracula/dracula-theme/blob/main/LICENSE
9
- icontheme = typicons_dark
10
9
 
11
10
  ##
12
11
  # Colours:
@@ -23,6 +22,26 @@ icontheme = typicons_dark
23
22
  # Yellow = f1fa8c : 241, 250, 140
24
23
  ##
25
24
 
25
+ [Icons]
26
+ default = 230, 230, 224
27
+ faded = 98, 114, 164
28
+ red = 255, 85, 85
29
+ orange = 255, 184, 108
30
+ yellow = 241, 250, 140
31
+ green = 80, 250, 123
32
+ aqua = 139, 233, 253
33
+ blue = 147, 207, 249
34
+ purple = 189, 147, 249
35
+
36
+ [Project]
37
+ root = 189, 147, 249
38
+ folder = 241, 250, 140
39
+ file = 230, 230, 224
40
+ title = 80, 250, 123
41
+ chapter = 255, 85, 85
42
+ scene = 139, 233, 253
43
+ note = 241, 250, 140
44
+
26
45
  [Palette]
27
46
  window = 68, 71, 90
28
47
  windowtext = 248, 248, 242
@@ -43,6 +62,3 @@ linkvisited = 139, 233, 253
43
62
  helptext = 204, 172, 249
44
63
  fadedtext = 98, 114, 164
45
64
  errortext = 255, 85, 85
46
- statusnone = 98, 114, 164
47
- statussaved = 80, 250, 123
48
- statusunsaved = 255, 85, 85
@@ -0,0 +1,48 @@
1
+ [Main]
2
+ name = Snazzy Light
3
+ author = Veronica Berglyd Olsen (adaptation)
4
+ credit = Florian Reuschel (color theme)
5
+ url = https://github.com/loilo/vscode-snazzy-light
6
+ license = MIT License
7
+ licenseurl = https://github.com/loilo/vscode-snazzy-light/blob/master/LICENSE
8
+
9
+ [Icons]
10
+ default = 86, 88, 105
11
+ faded = 84, 85, 84
12
+ red = 255, 92, 87
13
+ orange = 245, 185, 0
14
+ yellow = 207, 156, 0
15
+ green = 45, 174, 88
16
+ aqua = 19, 187, 183
17
+ blue = 9, 161, 237
18
+ purple = 247, 103, 187
19
+
20
+ [Project]
21
+ root = 9, 161, 237
22
+ folder = 207, 156, 0
23
+ file = 84, 85, 84
24
+ title = 45, 174, 88
25
+ chapter = 255, 92, 87
26
+ scene = 9, 161, 237
27
+ note = 207, 156, 0
28
+
29
+ [Palette]
30
+ window = 243, 244, 245
31
+ windowtext = 86, 88, 105
32
+ base = 250, 251, 252
33
+ alternatebase = 234, 234, 235
34
+ text = 86, 88, 105
35
+ tooltipbase = 245, 233, 194
36
+ tooltiptext = 86, 88, 105
37
+ button = 250, 251, 252
38
+ buttontext = 86, 88, 105
39
+ brighttext = 255, 255, 255
40
+ highlight = 9, 161, 237
41
+ highlightedtext = 255, 255, 255
42
+ link = 9, 161, 237
43
+ linkvisited = 9, 161, 237
44
+
45
+ [GUI]
46
+ helptext = 9, 161, 237
47
+ fadedtext = 84, 85, 84
48
+ errortext = 255, 92, 87
@@ -5,13 +5,32 @@ credit = Ethan Schoonover
5
5
  url = https://ethanschoonover.com/solarized/
6
6
  license = MIT
7
7
  licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
8
- icontheme = typicons_dark
8
+
9
+ [Icons]
10
+ default = 230, 223, 206
11
+ faded = 166, 161, 149
12
+ red = 220, 50, 47
13
+ orange = 203, 75, 22
14
+ yellow = 181, 137, 0
15
+ green = 133, 153, 0
16
+ aqua = 42, 161, 152
17
+ blue = 38, 139, 210
18
+ purple = 211, 54, 130
19
+
20
+ [Project]
21
+ root = 42, 161, 152
22
+ folder = 42, 161, 152
23
+ file = 230, 223, 206
24
+ title = 133, 153, 0
25
+ chapter = 220, 50, 47
26
+ scene = 38, 139, 210
27
+ note = 181, 137, 0
9
28
 
10
29
  [Palette]
11
30
  window = 0, 43, 54
12
31
  windowtext = 253, 246, 227
13
32
  base = 7, 54, 66
14
- alternatebase = 0, 43, 54
33
+ alternatebase = 88, 110, 117
15
34
  text = 253, 246, 227
16
35
  tooltipbase = 133, 153, 0
17
36
  tooltiptext = 0, 43, 54
@@ -24,9 +43,6 @@ link = 38, 139, 210
24
43
  linkvisited = 38, 139, 210
25
44
 
26
45
  [GUI]
27
- helptext = 166, 161, 149
28
- fadedtext = 166, 161, 149
29
- errortext = 255, 161, 149
30
- statusnone = 88, 110, 117
31
- statussaved = 42, 161, 152
32
- statusunsaved = 203, 75, 22
46
+ helptext = 101, 123, 131
47
+ fadedtext = 101, 123, 131
48
+ errortext = 220, 50, 47
@@ -5,13 +5,32 @@ credit = Ethan Schoonover
5
5
  url = https://ethanschoonover.com/solarized/
6
6
  license = MIT
7
7
  licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
8
- icontheme = typicons_light
8
+
9
+ [Icons]
10
+ default = 59, 68, 71
11
+ faded = 78, 91, 95
12
+ red = 220, 50, 47
13
+ orange = 203, 75, 22
14
+ yellow = 181, 137, 0
15
+ green = 133, 153, 0
16
+ aqua = 42, 161, 152
17
+ blue = 38, 139, 210
18
+ purple = 211, 54, 130
19
+
20
+ [Project]
21
+ root = 42, 161, 152
22
+ folder = 42, 161, 152
23
+ file = 59, 68, 71
24
+ title = 133, 153, 0
25
+ chapter = 220, 50, 47
26
+ scene = 38, 139, 210
27
+ note = 181, 137, 0
9
28
 
10
29
  [Palette]
11
30
  window = 238, 232, 213
12
31
  windowtext = 0, 43, 54
13
32
  base = 253, 246, 227
14
- alternatebase = 238, 232, 213
33
+ alternatebase = 147, 161, 161
15
34
  text = 0, 43, 54
16
35
  tooltipbase = 133, 153, 0
17
36
  tooltiptext = 0, 43, 54
@@ -26,7 +45,4 @@ linkvisited = 38, 139, 210
26
45
  [GUI]
27
46
  helptext = 78, 91, 95
28
47
  fadedtext = 78, 91, 95
29
- errortext = 255, 91, 95
30
- statusnone = 88, 110, 117
31
- statussaved = 42, 161, 152
32
- statusunsaved = 203, 75, 22
48
+ errortext = 220, 50, 47
novelwriter/common.py CHANGED
@@ -29,23 +29,23 @@ import unicodedata
29
29
  import uuid
30
30
  import xml.etree.ElementTree as ET
31
31
 
32
- from collections.abc import Callable
33
32
  from configparser import ConfigParser
34
33
  from datetime import datetime
35
34
  from pathlib import Path
36
- from typing import TYPE_CHECKING, Any, Literal, TypeVar
35
+ from typing import TYPE_CHECKING, Any, Literal, TypeGuard, TypeVar
37
36
  from urllib.parse import urljoin
38
37
  from urllib.request import pathname2url
39
38
 
40
- from PyQt5.QtCore import QCoreApplication, QMimeData, QUrl
41
- from PyQt5.QtGui import QColor, QDesktopServices, QFont, QFontDatabase, QFontInfo
39
+ from PyQt6.QtCore import QCoreApplication, QMimeData, QUrl
40
+ from PyQt6.QtGui import QAction, QDesktopServices, QFont, QFontDatabase, QFontInfo
41
+ from PyQt6.QtWidgets import QMenu, QMenuBar, QWidget
42
42
 
43
- from novelwriter.constants import nwConst, nwLabels, nwUnicode, trConst
43
+ from novelwriter.constants import nwConst, nwLabels, nwQuotes, nwUnicode, trConst
44
44
  from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
45
45
  from novelwriter.error import logException
46
46
 
47
- if TYPE_CHECKING: # pragma: no cover
48
- from typing import TypeGuard # Requires Python 3.10
47
+ if TYPE_CHECKING:
48
+ from collections.abc import Callable
49
49
 
50
50
  logger = logging.getLogger(__name__)
51
51
 
@@ -298,6 +298,15 @@ def uniqueCompact(text: str) -> str:
298
298
  return "".join(sorted(set(compact(text))))
299
299
 
300
300
 
301
+ def processDialogSymbols(symbols: str) -> str:
302
+ """Process dialogue line symbols."""
303
+ result = ""
304
+ for c in uniqueCompact(symbols):
305
+ if c in nwQuotes.ALLOWED:
306
+ result += c
307
+ return result
308
+
309
+
301
310
  def elide(text: str, length: int) -> str:
302
311
  """Elide a piece of text to a maximum length."""
303
312
  if len(text) > (cut := max(4, length)):
@@ -349,7 +358,7 @@ def fuzzyTime(seconds: int) -> str:
349
358
  elif seconds < 3300: # 55 minutes
350
359
  return QCoreApplication.translate(
351
360
  "Common", "{0} minutes ago"
352
- ).format(int(round(seconds/60)))
361
+ ).format(round(seconds/60))
353
362
  elif seconds < 5400: # 90 minutes
354
363
  return QCoreApplication.translate(
355
364
  "Common", "an hour ago"
@@ -357,7 +366,7 @@ def fuzzyTime(seconds: int) -> str:
357
366
  elif seconds < 84600: # 23.5 hours
358
367
  return QCoreApplication.translate(
359
368
  "Common", "{0} hours ago"
360
- ).format(int(round(seconds/3600)))
369
+ ).format(round(seconds/3600))
361
370
  elif seconds < 129600: # 1.5 days
362
371
  return QCoreApplication.translate(
363
372
  "Common", "a day ago"
@@ -365,7 +374,7 @@ def fuzzyTime(seconds: int) -> str:
365
374
  elif seconds < 561600: # 6.5 days
366
375
  return QCoreApplication.translate(
367
376
  "Common", "{0} days ago"
368
- ).format(int(round(seconds/86400)))
377
+ ).format(round(seconds/86400))
369
378
  elif seconds < 907200: # 10.5 days
370
379
  return QCoreApplication.translate(
371
380
  "Common", "a week ago"
@@ -373,7 +382,7 @@ def fuzzyTime(seconds: int) -> str:
373
382
  elif seconds < 2419200: # 28 days
374
383
  return QCoreApplication.translate(
375
384
  "Common", "{0} weeks ago"
376
- ).format(int(round(seconds/604800)))
385
+ ).format(round(seconds/604800))
377
386
  elif seconds < 3888000: # 45 days
378
387
  return QCoreApplication.translate(
379
388
  "Common", "a month ago"
@@ -381,7 +390,7 @@ def fuzzyTime(seconds: int) -> str:
381
390
  elif seconds < 29808000: # 345 days
382
391
  return QCoreApplication.translate(
383
392
  "Common", "{0} months ago"
384
- ).format(int(round(seconds/2592000)))
393
+ ).format(round(seconds/2592000))
385
394
  elif seconds < 47336400: # 1.5 years
386
395
  return QCoreApplication.translate(
387
396
  "Common", "a year ago"
@@ -389,7 +398,7 @@ def fuzzyTime(seconds: int) -> str:
389
398
  else:
390
399
  return QCoreApplication.translate(
391
400
  "Common", "{0} years ago"
392
- ).format(int(round(seconds/31557600)))
401
+ ).format(round(seconds/31557600))
393
402
 
394
403
 
395
404
  def numberToRoman(value: int, toLower: bool = False) -> str:
@@ -419,35 +428,29 @@ def numberToRoman(value: int, toLower: bool = False) -> str:
419
428
  # Qt Helpers
420
429
  ##
421
430
 
422
- def cssCol(col: QColor, alpha: int | None = None) -> str:
423
- """Convert a QColor object to an rgba entry to use in CSS."""
424
- return f"rgba({col.red()}, {col.green()}, {col.blue()}, {alpha or col.alpha()})"
425
-
426
-
427
431
  def describeFont(font: QFont) -> str:
428
432
  """Describe a font in a way that can be displayed on the GUI."""
429
433
  if isinstance(font, QFont):
430
434
  info = QFontInfo(font)
431
435
  family = info.family()
432
436
  styles = [v for v in info.styleName().split() if v not in family]
433
- return " ".join([f"{info.pointSize()} pt", family] + styles)
437
+ return " ".join([f"{info.pointSize()} pt", family, *styles])
434
438
  return "Error"
435
439
 
436
440
 
437
441
  def fontMatcher(font: QFont) -> QFont:
438
442
  """Make sure the font is the correct family, if possible. This
439
443
  ensures that Qt doesn't re-use another font under the hood. The
440
- default Qt5 font matching algorithm doesn't handle well changing
444
+ default Qt font matching algorithm doesn't handle well changing
441
445
  application fonts at runtime.
442
446
  """
443
447
  info = QFontInfo(font)
444
448
  if (famRequest := font.family()) != (famActual := info.family()):
445
449
  logger.warning("Font mismatch: Requested '%s', but got '%s'", famRequest, famActual)
446
- db = QFontDatabase()
447
- if famRequest in db.families():
450
+ if famRequest in QFontDatabase.families():
448
451
  styleRequest, sizeRequest = font.styleName(), font.pointSize()
449
452
  logger.info("Lookup: %s, %s, %d pt", famRequest, styleRequest, sizeRequest)
450
- temp = db.font(famRequest, styleRequest, sizeRequest)
453
+ temp = QFontDatabase.font(famRequest, styleRequest, sizeRequest)
451
454
  temp.setPointSize(sizeRequest) # Make sure it isn't changed
452
455
  famFound, styleFound, sizeFound = temp.family(), temp.styleName(), temp.pointSize()
453
456
  if famFound == famRequest:
@@ -465,6 +468,20 @@ def qtLambda(func: Callable, *args: Any, **kwargs: Any) -> Callable:
465
468
  return wrapper
466
469
 
467
470
 
471
+ def qtAddAction(parent: QWidget, label: str) -> QAction:
472
+ """Helper to add action to widget and always return the action."""
473
+ action = QAction(label, parent)
474
+ parent.addAction(action)
475
+ return action
476
+
477
+
478
+ def qtAddMenu(parent: QMenuBar | QMenu, label: str) -> QMenu:
479
+ """Helper to add menu to menu and always return the menu."""
480
+ menu = QMenu(label, parent)
481
+ parent.addMenu(menu)
482
+ return menu
483
+
484
+
468
485
  def encodeMimeHandles(mimeData: QMimeData, handles: list[str]) -> None:
469
486
  """Encode handles into a mime data object."""
470
487
  mimeData.setData(nwConst.MIME_HANDLE, b"|".join(h.encode() for h in handles))
@@ -484,7 +501,7 @@ def jsonEncode(data: dict | list | tuple, n: int = 0, nmax: int = 0) -> str:
484
501
  """Encode a dictionary, list or tuple as a json object or array, and
485
502
  indent from level n up to a max level nmax if nmax is larger than 0.
486
503
  """
487
- if not isinstance(data, (dict, list, tuple)):
504
+ if not isinstance(data, dict | list | tuple):
488
505
  return "[]"
489
506
 
490
507
  buffer = []
@@ -531,12 +548,11 @@ def jsonEncode(data: dict | list | tuple, n: int = 0, nmax: int = 0) -> str:
531
548
  # XML Helpers
532
549
  ##
533
550
 
534
- def xmlIndent(tree: ET.Element | ET.ElementTree) -> None:
551
+ def xmlIndent(xml: ET.Element | ET.ElementTree) -> None:
535
552
  """A modified version of the XML indent function in the standard
536
553
  library. It behaves more closely to how the one from lxml does.
537
554
  """
538
- if isinstance(tree, ET.ElementTree):
539
- tree = tree.getroot()
555
+ tree = xml.getroot() if isinstance(xml, ET.ElementTree) else xml
540
556
  if not isinstance(tree, ET.Element):
541
557
  return
542
558