novelWriter 2.6.2__py3-none-any.whl → 2.7__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.
- novelwriter/__init__.py +98 -75
- novelwriter/assets/i18n/nw_cs_CZ.qm +0 -0
- novelwriter/assets/i18n/nw_de_DE.qm +0 -0
- novelwriter/assets/i18n/nw_en_US.qm +0 -0
- novelwriter/assets/i18n/nw_es_419.qm +0 -0
- novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
- novelwriter/assets/i18n/nw_it_IT.qm +0 -0
- novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
- novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
- novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
- novelwriter/assets/i18n/nw_pl_PL.qm +0 -0
- novelwriter/assets/i18n/nw_pt_BR.qm +0 -0
- novelwriter/assets/i18n/nw_ru_RU.qm +0 -0
- novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
- novelwriter/assets/i18n/project_de_DE.json +3 -1
- novelwriter/assets/i18n/project_en_GB.json +2 -0
- novelwriter/assets/i18n/project_en_US.json +2 -0
- novelwriter/assets/i18n/project_it_IT.json +2 -0
- novelwriter/assets/i18n/project_ja_JP.json +2 -0
- novelwriter/assets/i18n/project_nb_NO.json +2 -0
- novelwriter/assets/i18n/project_nn_NO.json +5 -0
- novelwriter/assets/i18n/project_pl_PL.json +2 -0
- novelwriter/assets/i18n/project_pt_BR.json +2 -0
- novelwriter/assets/i18n/project_ru_RU.json +2 -0
- novelwriter/assets/i18n/project_zh_CN.json +2 -0
- novelwriter/assets/icons/font_awesome.icons +109 -0
- novelwriter/assets/icons/material_filled_bold.icons +109 -0
- novelwriter/assets/icons/material_filled_normal.icons +109 -0
- novelwriter/assets/icons/material_filled_thin.icons +109 -0
- novelwriter/assets/icons/material_rounded_bold.icons +109 -0
- novelwriter/assets/icons/material_rounded_normal.icons +109 -0
- novelwriter/assets/icons/material_rounded_thin.icons +109 -0
- novelwriter/assets/icons/remix_filled.icons +109 -0
- novelwriter/assets/icons/remix_outline.icons +109 -0
- novelwriter/assets/images/splash.png +0 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/{manual_fr_FR.pdf → manual_fr.pdf} +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +1 -1
- novelwriter/assets/syntax/snazzy.conf +3 -3
- novelwriter/assets/text/credits_en.htm +12 -6
- novelwriter/assets/themes/cyberpunk_night.conf +23 -7
- novelwriter/assets/themes/default_dark.conf +20 -4
- novelwriter/assets/themes/default_light.conf +21 -5
- novelwriter/assets/themes/dracula.conf +20 -4
- novelwriter/assets/themes/snazzy.conf +48 -0
- novelwriter/assets/themes/solarized_dark.conf +24 -8
- novelwriter/assets/themes/solarized_light.conf +22 -6
- novelwriter/common.py +43 -27
- novelwriter/config.py +201 -139
- novelwriter/constants.py +92 -56
- novelwriter/core/buildsettings.py +26 -17
- novelwriter/core/coretools.py +52 -41
- novelwriter/core/docbuild.py +20 -13
- novelwriter/core/document.py +2 -2
- novelwriter/core/index.py +166 -432
- novelwriter/core/indexdata.py +406 -0
- novelwriter/core/item.py +50 -32
- novelwriter/core/itemmodel.py +43 -38
- novelwriter/core/novelmodel.py +225 -0
- novelwriter/core/options.py +1 -1
- novelwriter/core/project.py +24 -25
- novelwriter/core/projectdata.py +47 -29
- novelwriter/core/projectxml.py +18 -8
- novelwriter/core/sessions.py +32 -15
- novelwriter/core/spellcheck.py +4 -3
- novelwriter/core/status.py +12 -15
- novelwriter/core/storage.py +1 -1
- novelwriter/core/tree.py +55 -13
- novelwriter/dialogs/about.py +19 -22
- novelwriter/dialogs/docmerge.py +23 -24
- novelwriter/dialogs/docsplit.py +26 -26
- novelwriter/dialogs/editlabel.py +19 -20
- novelwriter/dialogs/preferences.py +143 -69
- novelwriter/dialogs/projectsettings.py +51 -54
- novelwriter/dialogs/quotes.py +14 -19
- novelwriter/dialogs/wordlist.py +25 -30
- novelwriter/enum.py +8 -0
- novelwriter/error.py +16 -16
- novelwriter/extensions/configlayout.py +24 -20
- novelwriter/extensions/eventfilters.py +9 -5
- novelwriter/extensions/modified.py +34 -15
- novelwriter/extensions/novelselector.py +18 -5
- novelwriter/extensions/pagedsidebar.py +39 -49
- novelwriter/extensions/progressbars.py +10 -8
- novelwriter/extensions/statusled.py +6 -13
- novelwriter/extensions/switch.py +31 -41
- novelwriter/extensions/switchbox.py +8 -3
- novelwriter/extensions/versioninfo.py +4 -4
- novelwriter/formats/shared.py +1 -1
- novelwriter/formats/todocx.py +14 -10
- novelwriter/formats/tohtml.py +7 -5
- novelwriter/formats/tokenizer.py +37 -33
- novelwriter/formats/tomarkdown.py +6 -2
- novelwriter/formats/toodt.py +27 -22
- novelwriter/formats/toqdoc.py +19 -14
- novelwriter/formats/toraw.py +6 -2
- novelwriter/gui/doceditor.py +314 -305
- novelwriter/gui/dochighlight.py +46 -45
- novelwriter/gui/docviewer.py +102 -104
- novelwriter/gui/docviewerpanel.py +47 -51
- novelwriter/gui/editordocument.py +8 -5
- novelwriter/gui/itemdetails.py +15 -18
- novelwriter/gui/mainmenu.py +147 -146
- novelwriter/gui/noveltree.py +246 -406
- novelwriter/gui/outline.py +145 -76
- novelwriter/gui/projtree.py +139 -132
- novelwriter/gui/search.py +34 -31
- novelwriter/gui/sidebar.py +13 -18
- novelwriter/gui/statusbar.py +27 -21
- novelwriter/gui/theme.py +554 -436
- novelwriter/guimain.py +56 -38
- novelwriter/shared.py +32 -23
- novelwriter/splash.py +74 -0
- novelwriter/text/comments.py +70 -0
- novelwriter/text/patterns.py +4 -4
- novelwriter/tools/dictionaries.py +20 -29
- novelwriter/tools/lipsum.py +18 -18
- novelwriter/tools/manusbuild.py +39 -42
- novelwriter/tools/manuscript.py +114 -127
- novelwriter/tools/manussettings.py +129 -102
- novelwriter/tools/noveldetails.py +60 -72
- novelwriter/tools/welcome.py +57 -75
- novelwriter/tools/writingstats.py +112 -102
- novelwriter/types.py +5 -7
- {novelWriter-2.6.2.dist-info → novelwriter-2.7.dist-info}/METADATA +6 -6
- novelwriter-2.7.dist-info/RECORD +162 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7.dist-info}/WHEEL +1 -1
- novelWriter-2.6.2.dist-info/RECORD +0 -363
- novelwriter/assets/icons/typicons_dark/README.md +0 -29
- novelwriter/assets/icons/typicons_dark/icons.conf +0 -134
- novelwriter/assets/icons/typicons_dark/mixed_copy.svg +0 -4
- novelwriter/assets/icons/typicons_dark/mixed_document-chapter.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-new.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_document-note.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-scene.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-section.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-title.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_edit.svg +0 -4
- novelwriter/assets/icons/typicons_dark/mixed_import.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-checked.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-none.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-unchecked.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_margin-bottom.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-left.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-right.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-top.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_search-replace.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_size-height.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_size-width.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_deco-h0.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h1.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h2.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h3.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h4.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-noveltree-more.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_font.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_panel.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_quote.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-case.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-preserve.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-regex.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-word.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_toolbar.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_arrow-down-thick-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-forward.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-maximise.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-minimise.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-repeat-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_book-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_book.svg +0 -6
- novelwriter/assets/icons/typicons_dark/typ_bookmark.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_calendar.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cancel-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cancel.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chart-bar-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-down.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-left.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-right.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-up.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cog.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_delete-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_delete.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_directions-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_document-add.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_document-text.svg +0 -8
- novelwriter/assets/icons/typicons_dark/typ_document.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_export-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_export.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_eye.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_flag.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_folder-open.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_folder.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_globe-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_key.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_lightbulb-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_location.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-pause-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-record-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-record.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_minus.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_pencil.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_pin-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_pin.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_plus.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_puzzle-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_puzzle.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_refresh.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_search.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_star.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_stopwatch-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-dot-menu.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-list-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-list.svg +0 -9
- novelwriter/assets/icons/typicons_dark/typ_times.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_trash.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_unfold-hidden.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_unfold-visible.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_user.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_warning-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/README.md +0 -29
- novelwriter/assets/icons/typicons_light/icons.conf +0 -134
- novelwriter/assets/icons/typicons_light/mixed_copy.svg +0 -4
- novelwriter/assets/icons/typicons_light/mixed_document-chapter.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-new.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_document-note.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-scene.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-section.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-title.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_edit.svg +0 -4
- novelwriter/assets/icons/typicons_light/mixed_import.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-checked.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-none.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-unchecked.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_margin-bottom.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-left.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-right.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-top.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_search-replace.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_size-height.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_size-width.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_deco-h0.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h1.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h2.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h3.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h4.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-note.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-noveltree-more.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_font.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_panel.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_quote.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-case.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-preserve.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-regex.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-word.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_toolbar.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_arrow-down-thick-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-forward.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-maximise.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-minimise.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-repeat-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_book-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_book.svg +0 -6
- novelwriter/assets/icons/typicons_light/typ_bookmark.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_calendar.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cancel-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cancel.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chart-bar-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-down.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-left.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-right.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-up.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cog.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_delete-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_delete.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_directions-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_document-add.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_document-text.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_document.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_export-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_export.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_eye.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_flag.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_folder-open.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_folder.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_globe-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_key.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_lightbulb-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_location.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-pause-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-record-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-record.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_minus.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_pencil.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_pin-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_pin.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_plus.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_puzzle-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_puzzle.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_refresh.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_search-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_search.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_star.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_stopwatch-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-dot-menu.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-list-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-list.svg +0 -9
- novelwriter/assets/icons/typicons_light/typ_times.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_trash.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_unfold-hidden.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_unfold-visible.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_user.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_warning-full.svg +0 -4
- {novelWriter-2.6.2.dist-info → novelwriter-2.7.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7.dist-info/licenses}/LICENSE.md +0 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7.dist-info}/top_level.txt +0 -0
@@ -27,9 +27,9 @@ import logging
|
|
27
27
|
|
28
28
|
from typing import TYPE_CHECKING
|
29
29
|
|
30
|
-
from
|
31
|
-
from
|
32
|
-
from
|
30
|
+
from PyQt6.QtCore import QEvent, pyqtSignal, pyqtSlot
|
31
|
+
from PyQt6.QtGui import QFont, QIcon, QSyntaxHighlighter, QTextCharFormat, QTextDocument
|
32
|
+
from PyQt6.QtWidgets import (
|
33
33
|
QAbstractButton, QAbstractItemView, QDialogButtonBox, QFrame, QGridLayout,
|
34
34
|
QHBoxLayout, QLabel, QLineEdit, QMenu, QPlainTextEdit, QPushButton,
|
35
35
|
QSplitter, QStackedWidget, QTreeWidget, QTreeWidgetItem, QVBoxLayout,
|
@@ -37,11 +37,11 @@ from PyQt5.QtWidgets import (
|
|
37
37
|
)
|
38
38
|
|
39
39
|
from novelwriter import CONFIG, SHARED
|
40
|
-
from novelwriter.common import describeFont, fontMatcher, qtLambda
|
40
|
+
from novelwriter.common import describeFont, fontMatcher, qtAddAction, qtLambda
|
41
41
|
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, trConst
|
42
42
|
from novelwriter.core.buildsettings import BuildSettings, FilterMode
|
43
43
|
from novelwriter.extensions.configlayout import (
|
44
|
-
|
44
|
+
NColorLabel, NFixedPage, NScrollableForm, NScrollablePage
|
45
45
|
)
|
46
46
|
from novelwriter.extensions.modified import (
|
47
47
|
NComboBox, NDoubleSpinBox, NIconToolButton, NSpinBox, NToolDialog
|
@@ -55,7 +55,7 @@ from novelwriter.types import (
|
|
55
55
|
QtUserRole
|
56
56
|
)
|
57
57
|
|
58
|
-
if TYPE_CHECKING:
|
58
|
+
if TYPE_CHECKING:
|
59
59
|
from novelwriter.guimain import GuiMain
|
60
60
|
|
61
61
|
logger = logging.getLogger(__name__)
|
@@ -80,24 +80,22 @@ class GuiBuildSettings(NToolDialog):
|
|
80
80
|
logger.debug("Create: GuiBuildSettings")
|
81
81
|
self.setObjectName("GuiBuildSettings")
|
82
82
|
|
83
|
-
|
83
|
+
# Make a copy of the build object
|
84
|
+
self._build = BuildSettings.fromDict(build.pack())
|
84
85
|
|
85
86
|
self.setWindowTitle(self.tr("Manuscript Build Settings"))
|
86
|
-
self.setMinimumSize(
|
87
|
-
|
88
|
-
wWin = CONFIG.pxInt(750)
|
89
|
-
hWin = CONFIG.pxInt(550)
|
87
|
+
self.setMinimumSize(700, 400)
|
90
88
|
|
91
89
|
options = SHARED.project.options
|
92
90
|
self.resize(
|
93
|
-
|
94
|
-
|
91
|
+
options.getInt("GuiBuildSettings", "winWidth", 750),
|
92
|
+
options.getInt("GuiBuildSettings", "winHeight", 550),
|
95
93
|
)
|
96
94
|
|
97
95
|
# Title
|
98
|
-
self.titleLabel =
|
96
|
+
self.titleLabel = NColorLabel(
|
99
97
|
self.tr("Manuscript Build Settings"), self, color=SHARED.theme.helpText,
|
100
|
-
scale=
|
98
|
+
scale=NColorLabel.HEADER_SCALE, indent=4,
|
101
99
|
)
|
102
100
|
|
103
101
|
# Settings Name
|
@@ -107,6 +105,7 @@ class GuiBuildSettings(NToolDialog):
|
|
107
105
|
# SideBar
|
108
106
|
self.sidebar = NPagedSideBar(self)
|
109
107
|
self.sidebar.setLabelColor(SHARED.theme.helpText)
|
108
|
+
self.sidebar.setAccessibleName(self.titleLabel.text())
|
110
109
|
|
111
110
|
self.sidebar.addLabel(self.tr("General"))
|
112
111
|
self.sidebar.addButton(self.tr("Selection"), self.OPT_FILTERS)
|
@@ -145,7 +144,7 @@ class GuiBuildSettings(NToolDialog):
|
|
145
144
|
self.outerBox.addLayout(self.topBox)
|
146
145
|
self.outerBox.addLayout(self.mainBox)
|
147
146
|
self.outerBox.addWidget(self.buttonBox)
|
148
|
-
self.outerBox.setSpacing(
|
147
|
+
self.outerBox.setSpacing(12)
|
149
148
|
|
150
149
|
self.setLayout(self.outerBox)
|
151
150
|
|
@@ -186,6 +185,7 @@ class GuiBuildSettings(NToolDialog):
|
|
186
185
|
settings.
|
187
186
|
"""
|
188
187
|
logger.debug("Closing: GuiBuildSettings")
|
188
|
+
self._applyChanges()
|
189
189
|
self._askToSaveBuild()
|
190
190
|
self._saveSettings()
|
191
191
|
event.accept()
|
@@ -213,11 +213,14 @@ class GuiBuildSettings(NToolDialog):
|
|
213
213
|
"""Handle button clicks from the dialog button box."""
|
214
214
|
role = self.buttonBox.buttonRole(button)
|
215
215
|
if role == QtRoleApply:
|
216
|
+
self._applyChanges()
|
216
217
|
self._emitBuildData()
|
217
218
|
elif role == QtRoleAccept:
|
219
|
+
self._applyChanges()
|
218
220
|
self._emitBuildData()
|
219
221
|
self.close()
|
220
222
|
elif role == QtRoleReject:
|
223
|
+
self._build.resetChangedState()
|
221
224
|
self.close()
|
222
225
|
return
|
223
226
|
|
@@ -230,35 +233,34 @@ class GuiBuildSettings(NToolDialog):
|
|
230
233
|
whether the user wants to save them.
|
231
234
|
"""
|
232
235
|
if self._build.changed:
|
233
|
-
|
234
|
-
"Do you want to save your changes to '{0}'?"
|
235
|
-
))
|
236
|
-
if response:
|
236
|
+
if SHARED.question(self.tr(
|
237
|
+
"Do you want to save your changes to '{0}'?"
|
238
|
+
).format(self._build.name)):
|
237
239
|
self._emitBuildData()
|
238
240
|
self._build.resetChangedState()
|
239
241
|
return
|
240
242
|
|
241
243
|
def _saveSettings(self) -> None:
|
242
244
|
"""Save the various user settings."""
|
243
|
-
winWidth = CONFIG.rpxInt(self.width())
|
244
|
-
winHeight = CONFIG.rpxInt(self.height())
|
245
245
|
treeWidth, filterWidth = self.optTabSelect.mainSplitSizes()
|
246
|
-
|
247
246
|
logger.debug("Saving State: GuiBuildSettings")
|
248
247
|
pOptions = SHARED.project.options
|
249
|
-
pOptions.setValue("GuiBuildSettings", "winWidth",
|
250
|
-
pOptions.setValue("GuiBuildSettings", "winHeight",
|
248
|
+
pOptions.setValue("GuiBuildSettings", "winWidth", self.width())
|
249
|
+
pOptions.setValue("GuiBuildSettings", "winHeight", self.height())
|
251
250
|
pOptions.setValue("GuiBuildSettings", "treeWidth", treeWidth)
|
252
251
|
pOptions.setValue("GuiBuildSettings", "filterWidth", filterWidth)
|
253
252
|
pOptions.saveSettings()
|
254
|
-
|
255
253
|
return
|
256
254
|
|
257
|
-
def
|
258
|
-
"""
|
255
|
+
def _applyChanges(self) -> None:
|
256
|
+
"""Apply all settings changes to the build object."""
|
259
257
|
self._build.setName(self.editBuildName.text())
|
260
258
|
self.optTabHeadings.saveContent()
|
261
259
|
self.optTabFormatting.saveContent()
|
260
|
+
return
|
261
|
+
|
262
|
+
def _emitBuildData(self) -> None:
|
263
|
+
"""Assemble the build data and emit the signal."""
|
262
264
|
self.newSettingsReady.emit(self._build)
|
263
265
|
self._build.resetChangedState()
|
264
266
|
return
|
@@ -287,9 +289,9 @@ class _FilterTab(NFixedPage):
|
|
287
289
|
|
288
290
|
self._statusFlags: dict[int, QIcon] = {
|
289
291
|
self.F_NONE: QIcon(),
|
290
|
-
self.F_FILTERED: SHARED.theme.getIcon("
|
291
|
-
self.F_INCLUDED: SHARED.theme.getIcon("
|
292
|
-
self.F_EXCLUDED: SHARED.theme.getIcon("
|
292
|
+
self.F_FILTERED: SHARED.theme.getIcon("filter", "orange"),
|
293
|
+
self.F_INCLUDED: SHARED.theme.getIcon("pin", "blue"),
|
294
|
+
self.F_EXCLUDED: SHARED.theme.getIcon("exclude", "red"),
|
293
295
|
}
|
294
296
|
|
295
297
|
self._trIncluded = self.tr("Included in manuscript")
|
@@ -300,7 +302,6 @@ class _FilterTab(NFixedPage):
|
|
300
302
|
|
301
303
|
iSz = SHARED.theme.baseIconSize
|
302
304
|
iPx = SHARED.theme.baseIconHeight
|
303
|
-
cMg = CONFIG.pxInt(6)
|
304
305
|
|
305
306
|
# Tree Widget
|
306
307
|
self.optTree = QTreeWidget(self)
|
@@ -311,14 +312,14 @@ class _FilterTab(NFixedPage):
|
|
311
312
|
self.optTree.setIndentation(iPx)
|
312
313
|
self.optTree.setColumnCount(3)
|
313
314
|
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
315
|
+
if header := self.optTree.header():
|
316
|
+
header.setStretchLastSection(False)
|
317
|
+
header.setMinimumSectionSize(iPx + 6) # See Issue #1551
|
318
|
+
header.setSectionResizeMode(self.C_NAME, QtHeaderStretch)
|
319
|
+
header.setSectionResizeMode(self.C_ACTIVE, QtHeaderFixed)
|
320
|
+
header.setSectionResizeMode(self.C_STATUS, QtHeaderFixed)
|
321
|
+
header.resizeSection(self.C_ACTIVE, iPx + 6)
|
322
|
+
header.resizeSection(self.C_STATUS, iPx + 6)
|
322
323
|
|
323
324
|
self.optTree.setDragDropMode(QAbstractItemView.DragDropMode.NoDragDrop)
|
324
325
|
self.optTree.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
@@ -337,7 +338,7 @@ class _FilterTab(NFixedPage):
|
|
337
338
|
self.excludedButton.setIcon(self._statusFlags[self.F_EXCLUDED])
|
338
339
|
self.excludedButton.clicked.connect(qtLambda(self._setSelectedMode, self.F_EXCLUDED))
|
339
340
|
|
340
|
-
self.resetButton = NIconToolButton(self, iSz, "revert")
|
341
|
+
self.resetButton = NIconToolButton(self, iSz, "revert", "green")
|
341
342
|
self.resetButton.setToolTip(self.tr("Reset to default"))
|
342
343
|
self.resetButton.clicked.connect(qtLambda(self._setSelectedMode, self.F_FILTERED))
|
343
344
|
|
@@ -347,7 +348,7 @@ class _FilterTab(NFixedPage):
|
|
347
348
|
self.modeBox.addWidget(self.includedButton)
|
348
349
|
self.modeBox.addWidget(self.excludedButton)
|
349
350
|
self.modeBox.addWidget(self.resetButton)
|
350
|
-
self.modeBox.setSpacing(
|
351
|
+
self.modeBox.setSpacing(4)
|
351
352
|
|
352
353
|
# Filer Options
|
353
354
|
self.filterOpt = NSwitchBox(self, iPx)
|
@@ -375,8 +376,8 @@ class _FilterTab(NFixedPage):
|
|
375
376
|
self.mainSplit.setStretchFactor(0, 1)
|
376
377
|
self.mainSplit.setStretchFactor(1, 0)
|
377
378
|
self.mainSplit.setSizes([
|
378
|
-
|
379
|
-
|
379
|
+
pOptions.getInt("GuiBuildSettings", "treeWidth", 300),
|
380
|
+
pOptions.getInt("GuiBuildSettings", "filterWidth", 300),
|
380
381
|
])
|
381
382
|
|
382
383
|
self.setCentralWidget(self.mainSplit)
|
@@ -393,7 +394,7 @@ class _FilterTab(NFixedPage):
|
|
393
394
|
"""Extract the sizes of the main splitter."""
|
394
395
|
sizes = self.mainSplit.sizes()
|
395
396
|
m, n = (sizes[0], sizes[1]) if len(sizes) >= 2 else (0, 0)
|
396
|
-
return
|
397
|
+
return m, n
|
397
398
|
|
398
399
|
##
|
399
400
|
# Slots
|
@@ -459,19 +460,19 @@ class _FilterTab(NFixedPage):
|
|
459
460
|
self.filterOpt.clear()
|
460
461
|
self.filterOpt.addLabel(self._build.getLabel("filter"))
|
461
462
|
self.filterOpt.addItem(
|
462
|
-
SHARED.theme.getIcon("
|
463
|
+
SHARED.theme.getIcon("prj_scene", "scene"),
|
463
464
|
self._build.getLabel("filter.includeNovel"),
|
464
465
|
"doc:filter.includeNovel",
|
465
466
|
default=self._build.getBool("filter.includeNovel")
|
466
467
|
)
|
467
468
|
self.filterOpt.addItem(
|
468
|
-
SHARED.theme.getIcon("
|
469
|
+
SHARED.theme.getIcon("prj_note", "note"),
|
469
470
|
self._build.getLabel("filter.includeNotes"),
|
470
471
|
"doc:filter.includeNotes",
|
471
472
|
default=self._build.getBool("filter.includeNotes")
|
472
473
|
)
|
473
474
|
self.filterOpt.addItem(
|
474
|
-
SHARED.theme.getIcon("unchecked"),
|
475
|
+
SHARED.theme.getIcon("unchecked", "red"),
|
475
476
|
self._build.getLabel("filter.includeInactive"),
|
476
477
|
"doc:filter.includeInactive",
|
477
478
|
default=self._build.getBool("filter.includeInactive")
|
@@ -558,25 +559,23 @@ class _HeadingsTab(NScrollablePage):
|
|
558
559
|
|
559
560
|
iPx = SHARED.theme.baseIconHeight
|
560
561
|
iSz = SHARED.theme.baseIconSize
|
561
|
-
sSp = CONFIG.pxInt(16)
|
562
|
-
vSp = CONFIG.pxInt(12)
|
563
|
-
bSp = CONFIG.pxInt(6)
|
564
562
|
trHide = self.tr("Hide")
|
565
563
|
|
566
564
|
# Format Boxes
|
567
565
|
# ============
|
568
566
|
self.formatBox = QGridLayout()
|
569
|
-
self.formatBox.setHorizontalSpacing(
|
567
|
+
self.formatBox.setHorizontalSpacing(6)
|
570
568
|
|
571
569
|
# Title Heading
|
572
570
|
self.lblPart = QLabel(self._build.getLabel("headings.fmtPart"), self)
|
573
571
|
self.fmtPart = QLineEdit("", self)
|
574
572
|
self.fmtPart.setReadOnly(True)
|
575
|
-
self.btnPart = NIconToolButton(self, iSz, "edit")
|
573
|
+
self.btnPart = NIconToolButton(self, iSz, "edit", "green")
|
576
574
|
self.btnPart.clicked.connect(qtLambda(self._editHeading, self.EDIT_TITLE))
|
577
|
-
self.hdePart = QLabel(trHide, self)
|
578
|
-
self.hdePart.setIndent(bSp)
|
579
575
|
self.swtPart = NSwitch(self, height=iPx)
|
576
|
+
self.hdePart = QLabel(trHide, self)
|
577
|
+
self.hdePart.setIndent(6)
|
578
|
+
self.hdePart.setBuddy(self.swtPart)
|
580
579
|
|
581
580
|
self.formatBox.addWidget(self.lblPart, 0, 0)
|
582
581
|
self.formatBox.addWidget(self.fmtPart, 0, 1)
|
@@ -588,11 +587,12 @@ class _HeadingsTab(NScrollablePage):
|
|
588
587
|
self.lblChapter = QLabel(self._build.getLabel("headings.fmtChapter"), self)
|
589
588
|
self.fmtChapter = QLineEdit("", self)
|
590
589
|
self.fmtChapter.setReadOnly(True)
|
591
|
-
self.btnChapter = NIconToolButton(self, iSz, "edit")
|
590
|
+
self.btnChapter = NIconToolButton(self, iSz, "edit", "green")
|
592
591
|
self.btnChapter.clicked.connect(qtLambda(self._editHeading, self.EDIT_CHAPTER))
|
593
|
-
self.hdeChapter = QLabel(trHide, self)
|
594
|
-
self.hdeChapter.setIndent(bSp)
|
595
592
|
self.swtChapter = NSwitch(self, height=iPx)
|
593
|
+
self.hdeChapter = QLabel(trHide, self)
|
594
|
+
self.hdeChapter.setIndent(6)
|
595
|
+
self.hdeChapter.setBuddy(self.swtChapter)
|
596
596
|
|
597
597
|
self.formatBox.addWidget(self.lblChapter, 1, 0)
|
598
598
|
self.formatBox.addWidget(self.fmtChapter, 1, 1)
|
@@ -604,11 +604,12 @@ class _HeadingsTab(NScrollablePage):
|
|
604
604
|
self.lblUnnumbered = QLabel(self._build.getLabel("headings.fmtUnnumbered"), self)
|
605
605
|
self.fmtUnnumbered = QLineEdit("", self)
|
606
606
|
self.fmtUnnumbered.setReadOnly(True)
|
607
|
-
self.btnUnnumbered = NIconToolButton(self, iSz, "edit")
|
607
|
+
self.btnUnnumbered = NIconToolButton(self, iSz, "edit", "green")
|
608
608
|
self.btnUnnumbered.clicked.connect(qtLambda(self._editHeading, self.EDIT_UNNUM))
|
609
|
-
self.hdeUnnumbered = QLabel(trHide, self)
|
610
|
-
self.hdeUnnumbered.setIndent(bSp)
|
611
609
|
self.swtUnnumbered = NSwitch(self, height=iPx)
|
610
|
+
self.hdeUnnumbered = QLabel(trHide, self)
|
611
|
+
self.hdeUnnumbered.setIndent(6)
|
612
|
+
self.hdeUnnumbered.setBuddy(self.swtUnnumbered)
|
612
613
|
|
613
614
|
self.formatBox.addWidget(self.lblUnnumbered, 2, 0)
|
614
615
|
self.formatBox.addWidget(self.fmtUnnumbered, 2, 1)
|
@@ -620,11 +621,12 @@ class _HeadingsTab(NScrollablePage):
|
|
620
621
|
self.lblScene = QLabel(self._build.getLabel("headings.fmtScene"), self)
|
621
622
|
self.fmtScene = QLineEdit("", self)
|
622
623
|
self.fmtScene.setReadOnly(True)
|
623
|
-
self.btnScene = NIconToolButton(self, iSz, "edit")
|
624
|
+
self.btnScene = NIconToolButton(self, iSz, "edit", "green")
|
624
625
|
self.btnScene.clicked.connect(qtLambda(self._editHeading, self.EDIT_SCENE))
|
625
|
-
self.hdeScene = QLabel(trHide, self)
|
626
|
-
self.hdeScene.setIndent(bSp)
|
627
626
|
self.swtScene = NSwitch(self, height=iPx)
|
627
|
+
self.hdeScene = QLabel(trHide, self)
|
628
|
+
self.hdeScene.setIndent(6)
|
629
|
+
self.hdeScene.setBuddy(self.swtScene)
|
628
630
|
|
629
631
|
self.formatBox.addWidget(self.lblScene, 3, 0)
|
630
632
|
self.formatBox.addWidget(self.fmtScene, 3, 1)
|
@@ -636,11 +638,12 @@ class _HeadingsTab(NScrollablePage):
|
|
636
638
|
self.lblAScene = QLabel(self._build.getLabel("headings.fmtAltScene"), self)
|
637
639
|
self.fmtAScene = QLineEdit("", self)
|
638
640
|
self.fmtAScene.setReadOnly(True)
|
639
|
-
self.btnAScene = NIconToolButton(self, iSz, "edit")
|
641
|
+
self.btnAScene = NIconToolButton(self, iSz, "edit", "green")
|
640
642
|
self.btnAScene.clicked.connect(qtLambda(self._editHeading, self.EDIT_HSCENE))
|
641
|
-
self.hdeAScene = QLabel(trHide, self)
|
642
|
-
self.hdeAScene.setIndent(bSp)
|
643
643
|
self.swtAScene = NSwitch(self, height=iPx)
|
644
|
+
self.hdeAScene = QLabel(trHide, self)
|
645
|
+
self.hdeAScene.setIndent(6)
|
646
|
+
self.hdeAScene.setBuddy(self.swtAScene)
|
644
647
|
|
645
648
|
self.formatBox.addWidget(self.lblAScene, 4, 0)
|
646
649
|
self.formatBox.addWidget(self.fmtAScene, 4, 1)
|
@@ -652,11 +655,12 @@ class _HeadingsTab(NScrollablePage):
|
|
652
655
|
self.lblSection = QLabel(self._build.getLabel("headings.fmtSection"), self)
|
653
656
|
self.fmtSection = QLineEdit("", self)
|
654
657
|
self.fmtSection.setReadOnly(True)
|
655
|
-
self.btnSection = NIconToolButton(self, iSz, "edit")
|
658
|
+
self.btnSection = NIconToolButton(self, iSz, "edit", "green")
|
656
659
|
self.btnSection.clicked.connect(qtLambda(self._editHeading, self.EDIT_SECTION))
|
657
|
-
self.hdeSection = QLabel(trHide, self)
|
658
|
-
self.hdeSection.setIndent(bSp)
|
659
660
|
self.swtSection = NSwitch(self, height=iPx)
|
661
|
+
self.hdeSection = QLabel(trHide, self)
|
662
|
+
self.hdeSection.setIndent(6)
|
663
|
+
self.hdeSection.setBuddy(self.swtSection)
|
660
664
|
|
661
665
|
self.formatBox.addWidget(self.lblSection, 5, 0)
|
662
666
|
self.formatBox.addWidget(self.fmtSection, 5, 1)
|
@@ -675,16 +679,16 @@ class _HeadingsTab(NScrollablePage):
|
|
675
679
|
|
676
680
|
self.formSyntax = _HeadingSyntaxHighlighter(self.editTextBox.document())
|
677
681
|
|
678
|
-
self.
|
679
|
-
self.aInsTitle = self.
|
680
|
-
self.aInsChNum = self.
|
681
|
-
self.aInsChWord = self.
|
682
|
-
self.aInsChRomU = self.
|
683
|
-
self.aInsChRomL = self.
|
684
|
-
self.aInsScNum = self.
|
685
|
-
self.aInsScAbs = self.
|
686
|
-
self.aInsCharPOV = self.
|
687
|
-
self.aInsCharFocus = self.
|
682
|
+
self.mInsert = QMenu(self)
|
683
|
+
self.aInsTitle = qtAddAction(self.mInsert, self.tr("Title"))
|
684
|
+
self.aInsChNum = qtAddAction(self.mInsert, self.tr("Chapter Number"))
|
685
|
+
self.aInsChWord = qtAddAction(self.mInsert, self.tr("Chapter Number (Word)"))
|
686
|
+
self.aInsChRomU = qtAddAction(self.mInsert, self.tr("Chapter Number (Upper Case Roman)"))
|
687
|
+
self.aInsChRomL = qtAddAction(self.mInsert, self.tr("Chapter Number (Lower Case Roman)"))
|
688
|
+
self.aInsScNum = qtAddAction(self.mInsert, self.tr("Scene Number (In Chapter)"))
|
689
|
+
self.aInsScAbs = qtAddAction(self.mInsert, self.tr("Scene Number (Absolute)"))
|
690
|
+
self.aInsCharPOV = qtAddAction(self.mInsert, self.tr("Point of View Character"))
|
691
|
+
self.aInsCharFocus = qtAddAction(self.mInsert, self.tr("Focus Character"))
|
688
692
|
|
689
693
|
self.aInsTitle.triggered.connect(qtLambda(self._insertIntoForm, nwHeadFmt.TITLE))
|
690
694
|
self.aInsChNum.triggered.connect(qtLambda(self._insertIntoForm, nwHeadFmt.CH_NUM))
|
@@ -697,7 +701,7 @@ class _HeadingsTab(NScrollablePage):
|
|
697
701
|
self.aInsCharFocus.triggered.connect(qtLambda(self._insertIntoForm, nwHeadFmt.CHAR_FOCUS))
|
698
702
|
|
699
703
|
self.btnInsert = QPushButton(self.tr("Insert"), self)
|
700
|
-
self.btnInsert.setMenu(self.
|
704
|
+
self.btnInsert.setMenu(self.mInsert)
|
701
705
|
|
702
706
|
self.btnApply = QPushButton(self.tr("Apply"), self)
|
703
707
|
self.btnApply.clicked.connect(self._saveFormat)
|
@@ -714,44 +718,59 @@ class _HeadingsTab(NScrollablePage):
|
|
714
718
|
|
715
719
|
# Layout Matrix
|
716
720
|
# =============
|
721
|
+
trCentre = self.tr("Centre")
|
722
|
+
trBreak = self.tr("Page Break")
|
723
|
+
|
717
724
|
self.layoutMatrix = QGridLayout()
|
718
|
-
self.layoutMatrix.setVerticalSpacing(
|
719
|
-
self.layoutMatrix.setHorizontalSpacing(
|
725
|
+
self.layoutMatrix.setVerticalSpacing(12)
|
726
|
+
self.layoutMatrix.setHorizontalSpacing(12)
|
720
727
|
|
721
|
-
self.layoutMatrix.addWidget(QLabel(
|
722
|
-
self.layoutMatrix.addWidget(QLabel(
|
728
|
+
self.layoutMatrix.addWidget(QLabel(trCentre, self), 0, 1)
|
729
|
+
self.layoutMatrix.addWidget(QLabel(trBreak, self), 0, 2)
|
723
730
|
|
724
731
|
# Title Layout
|
725
|
-
|
732
|
+
trLabel = self._build.getLabel("headings.styleTitle")
|
733
|
+
self.lblTitle = QLabel(trLabel, self)
|
726
734
|
self.centerTitle = NSwitch(self, height=iPx)
|
735
|
+
self.centerTitle.setAccessibleName(f"{trLabel}: {trCentre}")
|
727
736
|
self.breakTitle = NSwitch(self, height=iPx)
|
737
|
+
self.breakTitle.setAccessibleName(f"{trLabel}: {trBreak}")
|
728
738
|
|
729
739
|
self.layoutMatrix.addWidget(self.lblTitle, 1, 0)
|
730
740
|
self.layoutMatrix.addWidget(self.centerTitle, 1, 1, QtAlignCenter)
|
731
741
|
self.layoutMatrix.addWidget(self.breakTitle, 1, 2, QtAlignCenter)
|
732
742
|
|
733
743
|
# Partition Layout
|
734
|
-
|
744
|
+
trLabel = self._build.getLabel("headings.stylePart")
|
745
|
+
self.lblPart = QLabel(trLabel, self)
|
735
746
|
self.centerPart = NSwitch(self, height=iPx)
|
747
|
+
self.centerPart.setAccessibleName(f"{trLabel}: {trCentre}")
|
736
748
|
self.breakPart = NSwitch(self, height=iPx)
|
749
|
+
self.breakPart.setAccessibleName(f"{trLabel}: {trBreak}")
|
737
750
|
|
738
751
|
self.layoutMatrix.addWidget(self.lblPart, 2, 0)
|
739
752
|
self.layoutMatrix.addWidget(self.centerPart, 2, 1, QtAlignCenter)
|
740
753
|
self.layoutMatrix.addWidget(self.breakPart, 2, 2, QtAlignCenter)
|
741
754
|
|
742
755
|
# Chapter Layout
|
743
|
-
|
756
|
+
trLabel = self._build.getLabel("headings.styleChapter")
|
757
|
+
self.lblChapter = QLabel(trLabel, self)
|
744
758
|
self.centerChapter = NSwitch(self, height=iPx)
|
759
|
+
self.centerChapter.setAccessibleName(f"{trLabel}: {trCentre}")
|
745
760
|
self.breakChapter = NSwitch(self, height=iPx)
|
761
|
+
self.breakChapter.setAccessibleName(f"{trLabel}: {trBreak}")
|
746
762
|
|
747
763
|
self.layoutMatrix.addWidget(self.lblChapter, 3, 0)
|
748
764
|
self.layoutMatrix.addWidget(self.centerChapter, 3, 1, QtAlignCenter)
|
749
765
|
self.layoutMatrix.addWidget(self.breakChapter, 3, 2, QtAlignCenter)
|
750
766
|
|
751
767
|
# Scene Layout
|
752
|
-
|
768
|
+
trLabel = self._build.getLabel("headings.styleScene")
|
769
|
+
self.lblScene = QLabel(trLabel, self)
|
753
770
|
self.centerScene = NSwitch(self, height=iPx)
|
771
|
+
self.centerScene.setAccessibleName(f"{trLabel}: {trCentre}")
|
754
772
|
self.breakScene = NSwitch(self, height=iPx)
|
773
|
+
self.breakScene.setAccessibleName(f"{trLabel}: {trBreak}")
|
755
774
|
|
756
775
|
self.layoutMatrix.addWidget(self.lblScene, 4, 0)
|
757
776
|
self.layoutMatrix.addWidget(self.centerScene, 4, 1, QtAlignCenter)
|
@@ -764,9 +783,9 @@ class _HeadingsTab(NScrollablePage):
|
|
764
783
|
|
765
784
|
self.outerBox = QVBoxLayout()
|
766
785
|
self.outerBox.addLayout(self.formatBox)
|
767
|
-
self.outerBox.addSpacing(
|
786
|
+
self.outerBox.addSpacing(16)
|
768
787
|
self.outerBox.addLayout(self.editFormBox)
|
769
|
-
self.outerBox.addSpacing(
|
788
|
+
self.outerBox.addSpacing(16)
|
770
789
|
self.outerBox.addLayout(self.layoutMatrix)
|
771
790
|
self.outerBox.addStretch(1)
|
772
791
|
|
@@ -904,12 +923,13 @@ class _HeadingsTab(NScrollablePage):
|
|
904
923
|
|
905
924
|
class _HeadingSyntaxHighlighter(QSyntaxHighlighter):
|
906
925
|
|
907
|
-
def __init__(self, document: QTextDocument) -> None:
|
926
|
+
def __init__(self, document: QTextDocument | None) -> None:
|
908
927
|
super().__init__(document)
|
928
|
+
syntax = SHARED.theme.syntaxTheme
|
909
929
|
self._fmtSymbol = QTextCharFormat()
|
910
|
-
self._fmtSymbol.setForeground(
|
930
|
+
self._fmtSymbol.setForeground(syntax.head)
|
911
931
|
self._fmtFormat = QTextCharFormat()
|
912
|
-
self._fmtFormat.setForeground(
|
932
|
+
self._fmtFormat.setForeground(syntax.emph)
|
913
933
|
return
|
914
934
|
|
915
935
|
def highlightBlock(self, text: str) -> None:
|
@@ -960,11 +980,15 @@ class _FormattingTab(NScrollableForm):
|
|
960
980
|
self.incBodyText = NSwitch(self, height=iPx)
|
961
981
|
self.incSynopsis = NSwitch(self, height=iPx)
|
962
982
|
self.incComments = NSwitch(self, height=iPx)
|
983
|
+
self.incStory = NSwitch(self, height=iPx)
|
984
|
+
self.incNotes = NSwitch(self, height=iPx)
|
963
985
|
self.incKeywords = NSwitch(self, height=iPx)
|
964
986
|
|
965
987
|
self.addRow(self._build.getLabel("text.includeBodyText"), self.incBodyText)
|
966
988
|
self.addRow(self._build.getLabel("text.includeSynopsis"), self.incSynopsis)
|
967
989
|
self.addRow(self._build.getLabel("text.includeComments"), self.incComments)
|
990
|
+
self.addRow(self._build.getLabel("text.includeStory"), self.incStory)
|
991
|
+
self.addRow(self._build.getLabel("text.includeNotes"), self.incNotes)
|
968
992
|
self.addRow(self._build.getLabel("text.includeKeywords"), self.incKeywords)
|
969
993
|
|
970
994
|
# Ignored Keywords
|
@@ -977,7 +1001,7 @@ class _FormattingTab(NScrollableForm):
|
|
977
1001
|
lambda keyword=keyword: self._updateIgnoredKeywords(keyword)
|
978
1002
|
)
|
979
1003
|
|
980
|
-
self.ignoredKeywordsButton = NIconToolButton(self, iSz, "add")
|
1004
|
+
self.ignoredKeywordsButton = NIconToolButton(self, iSz, "add", "green")
|
981
1005
|
self.ignoredKeywordsButton.setMenu(self.mnKeywords)
|
982
1006
|
self.addRow(
|
983
1007
|
self._build.getLabel("text.ignoredKeywords"), self.ignoredKeywords,
|
@@ -986,7 +1010,6 @@ class _FormattingTab(NScrollableForm):
|
|
986
1010
|
|
987
1011
|
# Note Headings
|
988
1012
|
self.addNoteHead = NSwitch(self, height=iPx)
|
989
|
-
|
990
1013
|
self.addRow(self._build.getLabel("text.addNoteHeadings"), self.addNoteHead)
|
991
1014
|
|
992
1015
|
# Text Format
|
@@ -1063,8 +1086,8 @@ class _FormattingTab(NScrollableForm):
|
|
1063
1086
|
pixB = SHARED.theme.getPixmap("margin_bottom", (iPx, iPx))
|
1064
1087
|
pixL = SHARED.theme.getPixmap("margin_left", (iPx, iPx))
|
1065
1088
|
pixR = SHARED.theme.getPixmap("margin_right", (iPx, iPx))
|
1066
|
-
pixH = SHARED.theme.getPixmap("
|
1067
|
-
pixW = SHARED.theme.getPixmap("
|
1089
|
+
pixH = SHARED.theme.getPixmap("fit_height", (iPx, iPx))
|
1090
|
+
pixW = SHARED.theme.getPixmap("fit_width", (iPx, iPx))
|
1068
1091
|
|
1069
1092
|
# Title
|
1070
1093
|
self.titleMarginT = NDoubleSpinBox(self)
|
@@ -1177,11 +1200,11 @@ class _FormattingTab(NScrollableForm):
|
|
1177
1200
|
for key, name in nwLabels.PAPER_NAME.items():
|
1178
1201
|
self.pageSize.addItem(trConst(name), key)
|
1179
1202
|
|
1180
|
-
self.pageWidth = NDoubleSpinBox(self,
|
1203
|
+
self.pageWidth = NDoubleSpinBox(self, maxVal=500.0)
|
1181
1204
|
self.pageWidth.setFixedWidth(dbW)
|
1182
1205
|
self.pageWidth.valueChanged.connect(self._pageSizeValueChanged)
|
1183
1206
|
|
1184
|
-
self.pageHeight = NDoubleSpinBox(self,
|
1207
|
+
self.pageHeight = NDoubleSpinBox(self, maxVal=500.0)
|
1185
1208
|
self.pageHeight.setFixedWidth(dbW)
|
1186
1209
|
self.pageHeight.valueChanged.connect(self._pageSizeValueChanged)
|
1187
1210
|
|
@@ -1222,8 +1245,8 @@ class _FormattingTab(NScrollableForm):
|
|
1222
1245
|
|
1223
1246
|
# Header
|
1224
1247
|
self.odtPageHeader = QLineEdit(self)
|
1225
|
-
self.odtPageHeader.setMinimumWidth(
|
1226
|
-
self.btnPageHeader = NIconToolButton(self, iSz, "revert")
|
1248
|
+
self.odtPageHeader.setMinimumWidth(200)
|
1249
|
+
self.btnPageHeader = NIconToolButton(self, iSz, "revert", "green")
|
1227
1250
|
self.btnPageHeader.clicked.connect(self._resetPageHeader)
|
1228
1251
|
self.addRow(
|
1229
1252
|
self._build.getLabel("doc.pageHeader"), self.odtPageHeader,
|
@@ -1273,6 +1296,8 @@ class _FormattingTab(NScrollableForm):
|
|
1273
1296
|
self.incBodyText.setChecked(self._build.getBool("text.includeBodyText"))
|
1274
1297
|
self.incSynopsis.setChecked(self._build.getBool("text.includeSynopsis"))
|
1275
1298
|
self.incComments.setChecked(self._build.getBool("text.includeComments"))
|
1299
|
+
self.incStory.setChecked(self._build.getBool("text.includeStory"))
|
1300
|
+
self.incNotes.setChecked(self._build.getBool("text.includeNotes"))
|
1276
1301
|
self.incKeywords.setChecked(self._build.getBool("text.includeKeywords"))
|
1277
1302
|
self.ignoredKeywords.setText(self._build.getStr("text.ignoredKeywords"))
|
1278
1303
|
self.addNoteHead.setChecked(self._build.getBool("text.addNoteHeadings"))
|
@@ -1371,6 +1396,8 @@ class _FormattingTab(NScrollableForm):
|
|
1371
1396
|
self._build.setValue("text.includeBodyText", self.incBodyText.isChecked())
|
1372
1397
|
self._build.setValue("text.includeSynopsis", self.incSynopsis.isChecked())
|
1373
1398
|
self._build.setValue("text.includeComments", self.incComments.isChecked())
|
1399
|
+
self._build.setValue("text.includeStory", self.incStory.isChecked())
|
1400
|
+
self._build.setValue("text.includeNotes", self.incNotes.isChecked())
|
1374
1401
|
self._build.setValue("text.includeKeywords", self.incKeywords.isChecked())
|
1375
1402
|
self._build.setValue("text.ignoredKeywords", self.ignoredKeywords.text())
|
1376
1403
|
self._build.setValue("text.addNoteHeadings", self.addNoteHead.isChecked())
|