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
@@ -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
@@ -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
43
  from novelwriter.constants import nwConst, nwLabels, 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
 
@@ -349,7 +349,7 @@ def fuzzyTime(seconds: int) -> str:
349
349
  elif seconds < 3300: # 55 minutes
350
350
  return QCoreApplication.translate(
351
351
  "Common", "{0} minutes ago"
352
- ).format(int(round(seconds/60)))
352
+ ).format(round(seconds/60))
353
353
  elif seconds < 5400: # 90 minutes
354
354
  return QCoreApplication.translate(
355
355
  "Common", "an hour ago"
@@ -357,7 +357,7 @@ def fuzzyTime(seconds: int) -> str:
357
357
  elif seconds < 84600: # 23.5 hours
358
358
  return QCoreApplication.translate(
359
359
  "Common", "{0} hours ago"
360
- ).format(int(round(seconds/3600)))
360
+ ).format(round(seconds/3600))
361
361
  elif seconds < 129600: # 1.5 days
362
362
  return QCoreApplication.translate(
363
363
  "Common", "a day ago"
@@ -365,7 +365,7 @@ def fuzzyTime(seconds: int) -> str:
365
365
  elif seconds < 561600: # 6.5 days
366
366
  return QCoreApplication.translate(
367
367
  "Common", "{0} days ago"
368
- ).format(int(round(seconds/86400)))
368
+ ).format(round(seconds/86400))
369
369
  elif seconds < 907200: # 10.5 days
370
370
  return QCoreApplication.translate(
371
371
  "Common", "a week ago"
@@ -373,7 +373,7 @@ def fuzzyTime(seconds: int) -> str:
373
373
  elif seconds < 2419200: # 28 days
374
374
  return QCoreApplication.translate(
375
375
  "Common", "{0} weeks ago"
376
- ).format(int(round(seconds/604800)))
376
+ ).format(round(seconds/604800))
377
377
  elif seconds < 3888000: # 45 days
378
378
  return QCoreApplication.translate(
379
379
  "Common", "a month ago"
@@ -381,7 +381,7 @@ def fuzzyTime(seconds: int) -> str:
381
381
  elif seconds < 29808000: # 345 days
382
382
  return QCoreApplication.translate(
383
383
  "Common", "{0} months ago"
384
- ).format(int(round(seconds/2592000)))
384
+ ).format(round(seconds/2592000))
385
385
  elif seconds < 47336400: # 1.5 years
386
386
  return QCoreApplication.translate(
387
387
  "Common", "a year ago"
@@ -389,7 +389,7 @@ def fuzzyTime(seconds: int) -> str:
389
389
  else:
390
390
  return QCoreApplication.translate(
391
391
  "Common", "{0} years ago"
392
- ).format(int(round(seconds/31557600)))
392
+ ).format(round(seconds/31557600))
393
393
 
394
394
 
395
395
  def numberToRoman(value: int, toLower: bool = False) -> str:
@@ -419,35 +419,29 @@ def numberToRoman(value: int, toLower: bool = False) -> str:
419
419
  # Qt Helpers
420
420
  ##
421
421
 
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
422
  def describeFont(font: QFont) -> str:
428
423
  """Describe a font in a way that can be displayed on the GUI."""
429
424
  if isinstance(font, QFont):
430
425
  info = QFontInfo(font)
431
426
  family = info.family()
432
427
  styles = [v for v in info.styleName().split() if v not in family]
433
- return " ".join([f"{info.pointSize()} pt", family] + styles)
428
+ return " ".join([f"{info.pointSize()} pt", family, *styles])
434
429
  return "Error"
435
430
 
436
431
 
437
432
  def fontMatcher(font: QFont) -> QFont:
438
433
  """Make sure the font is the correct family, if possible. This
439
434
  ensures that Qt doesn't re-use another font under the hood. The
440
- default Qt5 font matching algorithm doesn't handle well changing
435
+ default Qt font matching algorithm doesn't handle well changing
441
436
  application fonts at runtime.
442
437
  """
443
438
  info = QFontInfo(font)
444
439
  if (famRequest := font.family()) != (famActual := info.family()):
445
440
  logger.warning("Font mismatch: Requested '%s', but got '%s'", famRequest, famActual)
446
- db = QFontDatabase()
447
- if famRequest in db.families():
441
+ if famRequest in QFontDatabase.families():
448
442
  styleRequest, sizeRequest = font.styleName(), font.pointSize()
449
443
  logger.info("Lookup: %s, %s, %d pt", famRequest, styleRequest, sizeRequest)
450
- temp = db.font(famRequest, styleRequest, sizeRequest)
444
+ temp = QFontDatabase.font(famRequest, styleRequest, sizeRequest)
451
445
  temp.setPointSize(sizeRequest) # Make sure it isn't changed
452
446
  famFound, styleFound, sizeFound = temp.family(), temp.styleName(), temp.pointSize()
453
447
  if famFound == famRequest:
@@ -465,6 +459,20 @@ def qtLambda(func: Callable, *args: Any, **kwargs: Any) -> Callable:
465
459
  return wrapper
466
460
 
467
461
 
462
+ def qtAddAction(parent: QWidget, label: str) -> QAction:
463
+ """Helper to add action to widget and always return the action."""
464
+ action = QAction(label, parent)
465
+ parent.addAction(action)
466
+ return action
467
+
468
+
469
+ def qtAddMenu(parent: QMenuBar | QMenu, label: str) -> QMenu:
470
+ """Helper to add menu to menu and always return the menu."""
471
+ menu = QMenu(label, parent)
472
+ parent.addMenu(menu)
473
+ return menu
474
+
475
+
468
476
  def encodeMimeHandles(mimeData: QMimeData, handles: list[str]) -> None:
469
477
  """Encode handles into a mime data object."""
470
478
  mimeData.setData(nwConst.MIME_HANDLE, b"|".join(h.encode() for h in handles))
@@ -484,7 +492,7 @@ def jsonEncode(data: dict | list | tuple, n: int = 0, nmax: int = 0) -> str:
484
492
  """Encode a dictionary, list or tuple as a json object or array, and
485
493
  indent from level n up to a max level nmax if nmax is larger than 0.
486
494
  """
487
- if not isinstance(data, (dict, list, tuple)):
495
+ if not isinstance(data, dict | list | tuple):
488
496
  return "[]"
489
497
 
490
498
  buffer = []
@@ -531,12 +539,11 @@ def jsonEncode(data: dict | list | tuple, n: int = 0, nmax: int = 0) -> str:
531
539
  # XML Helpers
532
540
  ##
533
541
 
534
- def xmlIndent(tree: ET.Element | ET.ElementTree) -> None:
542
+ def xmlIndent(xml: ET.Element | ET.ElementTree) -> None:
535
543
  """A modified version of the XML indent function in the standard
536
544
  library. It behaves more closely to how the one from lxml does.
537
545
  """
538
- if isinstance(tree, ET.ElementTree):
539
- tree = tree.getroot()
546
+ tree = xml.getroot() if isinstance(xml, ET.ElementTree) else xml
540
547
  if not isinstance(tree, ET.Element):
541
548
  return
542
549