novelWriter 2.6.3__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.
- novelwriter/__init__.py +84 -74
- novelwriter/assets/i18n/project_en_GB.json +1 -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 +108 -0
- novelwriter/assets/icons/remix_outline.icons +108 -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/text/credits_en.htm +6 -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/solarized_dark.conf +24 -8
- novelwriter/assets/themes/solarized_light.conf +22 -6
- novelwriter/common.py +33 -26
- novelwriter/config.py +118 -127
- novelwriter/constants.py +50 -36
- novelwriter/core/buildsettings.py +23 -16
- novelwriter/core/coretools.py +11 -7
- novelwriter/core/docbuild.py +19 -13
- novelwriter/core/document.py +2 -2
- novelwriter/core/index.py +142 -432
- novelwriter/core/indexdata.py +403 -0
- novelwriter/core/item.py +35 -28
- novelwriter/core/itemmodel.py +27 -26
- novelwriter/core/novelmodel.py +223 -0
- novelwriter/core/options.py +1 -1
- novelwriter/core/project.py +10 -11
- novelwriter/core/projectdata.py +5 -5
- novelwriter/core/projectxml.py +1 -1
- novelwriter/core/sessions.py +3 -2
- novelwriter/core/spellcheck.py +4 -3
- novelwriter/core/status.py +12 -15
- novelwriter/core/storage.py +1 -1
- novelwriter/core/tree.py +46 -8
- novelwriter/dialogs/about.py +19 -22
- novelwriter/dialogs/docmerge.py +21 -23
- novelwriter/dialogs/docsplit.py +20 -23
- novelwriter/dialogs/editlabel.py +9 -13
- novelwriter/dialogs/preferences.py +111 -48
- novelwriter/dialogs/projectsettings.py +48 -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 +18 -18
- 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 +19 -30
- novelwriter/extensions/switchbox.py +7 -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 +36 -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 +216 -265
- 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 +11 -14
- novelwriter/gui/mainmenu.py +146 -145
- novelwriter/gui/noveltree.py +239 -405
- novelwriter/gui/outline.py +133 -72
- novelwriter/gui/projtree.py +138 -132
- novelwriter/gui/search.py +33 -31
- novelwriter/gui/sidebar.py +13 -18
- novelwriter/gui/statusbar.py +13 -15
- novelwriter/gui/theme.py +533 -430
- novelwriter/guimain.py +27 -29
- novelwriter/shared.py +32 -23
- novelwriter/text/comments.py +70 -0
- novelwriter/text/patterns.py +4 -4
- novelwriter/tools/dictionaries.py +20 -29
- novelwriter/tools/lipsum.py +16 -17
- novelwriter/tools/manusbuild.py +39 -42
- novelwriter/tools/manuscript.py +101 -114
- novelwriter/tools/manussettings.py +78 -83
- novelwriter/tools/noveldetails.py +51 -64
- novelwriter/tools/welcome.py +56 -75
- novelwriter/tools/writingstats.py +44 -57
- novelwriter/types.py +5 -7
- {novelWriter-2.6.3.dist-info → novelwriter-2.7b1.dist-info}/METADATA +6 -6
- novelwriter-2.7b1.dist-info/RECORD +159 -0
- {novelWriter-2.6.3.dist-info → novelwriter-2.7b1.dist-info}/WHEEL +1 -1
- novelWriter-2.6.3.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.3.dist-info → novelwriter-2.7b1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.6.3.dist-info → novelwriter-2.7b1.dist-info/licenses}/LICENSE.md +0 -0
- {novelWriter-2.6.3.dist-info → novelwriter-2.7b1.dist-info}/top_level.txt +0 -0
@@ -29,20 +29,20 @@ import logging
|
|
29
29
|
|
30
30
|
from pathlib import Path
|
31
31
|
|
32
|
-
from
|
33
|
-
from
|
34
|
-
from
|
32
|
+
from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
|
33
|
+
from PyQt6.QtGui import QCloseEvent, QColor
|
34
|
+
from PyQt6.QtWidgets import (
|
35
35
|
QAbstractItemView, QApplication, QColorDialog, QDialogButtonBox,
|
36
36
|
QFileDialog, QGridLayout, QHBoxLayout, QLineEdit, QMenu, QStackedWidget,
|
37
37
|
QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget
|
38
38
|
)
|
39
39
|
|
40
40
|
from novelwriter import CONFIG, SHARED
|
41
|
-
from novelwriter.common import formatFileFilter, qtLambda, simplified
|
41
|
+
from novelwriter.common import formatFileFilter, qtAddAction, qtLambda, simplified
|
42
42
|
from novelwriter.constants import nwLabels, trConst
|
43
43
|
from novelwriter.core.status import NWStatus, StatusEntry
|
44
44
|
from novelwriter.enum import nwStatusShape
|
45
|
-
from novelwriter.extensions.configlayout import
|
45
|
+
from novelwriter.extensions.configlayout import NColorLabel, NFixedPage, NScrollableForm
|
46
46
|
from novelwriter.extensions.modified import NComboBox, NDialog, NIconToolButton
|
47
47
|
from novelwriter.extensions.pagedsidebar import NPagedSideBar
|
48
48
|
from novelwriter.extensions.switch import NSwitch
|
@@ -71,16 +71,16 @@ class GuiProjectSettings(NDialog):
|
|
71
71
|
self.setWindowTitle(self.tr("Project Settings"))
|
72
72
|
|
73
73
|
options = SHARED.project.options
|
74
|
-
self.setMinimumSize(
|
74
|
+
self.setMinimumSize(500, 400)
|
75
75
|
self.resize(
|
76
|
-
|
77
|
-
|
76
|
+
options.getInt("GuiProjectSettings", "winWidth", 650),
|
77
|
+
options.getInt("GuiProjectSettings", "winHeight", 500),
|
78
78
|
)
|
79
79
|
|
80
80
|
# Title
|
81
|
-
self.titleLabel =
|
81
|
+
self.titleLabel = NColorLabel(
|
82
82
|
self.tr("Project Settings"), self, color=SHARED.theme.helpText,
|
83
|
-
scale=
|
83
|
+
scale=NColorLabel.HEADER_SCALE, indent=4,
|
84
84
|
)
|
85
85
|
|
86
86
|
# SideBar
|
@@ -125,7 +125,7 @@ class GuiProjectSettings(NDialog):
|
|
125
125
|
self.outerBox.addLayout(self.topBox)
|
126
126
|
self.outerBox.addLayout(self.mainBox)
|
127
127
|
self.outerBox.addWidget(self.buttonBox)
|
128
|
-
self.outerBox.setSpacing(
|
128
|
+
self.outerBox.setSpacing(8)
|
129
129
|
|
130
130
|
self.setLayout(self.outerBox)
|
131
131
|
self.setSizeGripEnabled(True)
|
@@ -210,16 +210,14 @@ class GuiProjectSettings(NDialog):
|
|
210
210
|
|
211
211
|
def _saveSettings(self) -> None:
|
212
212
|
"""Save GUI settings."""
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
importColW = CONFIG.rpxInt(self.importPage.columnWidth())
|
217
|
-
replaceColW = CONFIG.rpxInt(self.replacePage.columnWidth())
|
213
|
+
statusColW = self.statusPage.columnWidth()
|
214
|
+
importColW = self.importPage.columnWidth()
|
215
|
+
replaceColW = self.replacePage.columnWidth()
|
218
216
|
|
219
217
|
logger.debug("Saving State: GuiProjectSettings")
|
220
218
|
options = SHARED.project.options
|
221
|
-
options.setValue("GuiProjectSettings", "winWidth",
|
222
|
-
options.setValue("GuiProjectSettings", "winHeight",
|
219
|
+
options.setValue("GuiProjectSettings", "winWidth", self.width())
|
220
|
+
options.setValue("GuiProjectSettings", "winHeight", self.height())
|
223
221
|
options.setValue("GuiProjectSettings", "statusColW", statusColW)
|
224
222
|
options.setValue("GuiProjectSettings", "importColW", importColW)
|
225
223
|
options.setValue("GuiProjectSettings", "replaceColW", replaceColW)
|
@@ -232,7 +230,6 @@ class _SettingsPage(NScrollableForm):
|
|
232
230
|
def __init__(self, parent: QWidget) -> None:
|
233
231
|
super().__init__(parent=parent)
|
234
232
|
|
235
|
-
xW = CONFIG.pxInt(200)
|
236
233
|
data = SHARED.project.data
|
237
234
|
self.setHelpTextStyle(SHARED.theme.helpText)
|
238
235
|
self.setRowIndent(0)
|
@@ -240,7 +237,7 @@ class _SettingsPage(NScrollableForm):
|
|
240
237
|
# Project Name
|
241
238
|
self.projName = QLineEdit(self)
|
242
239
|
self.projName.setMaxLength(200)
|
243
|
-
self.projName.setMinimumWidth(
|
240
|
+
self.projName.setMinimumWidth(200)
|
244
241
|
self.projName.setText(data.name)
|
245
242
|
self.addRow(
|
246
243
|
self.tr("Project name"), self.projName,
|
@@ -251,7 +248,7 @@ class _SettingsPage(NScrollableForm):
|
|
251
248
|
# Project Author
|
252
249
|
self.projAuthor = QLineEdit(self)
|
253
250
|
self.projAuthor.setMaxLength(200)
|
254
|
-
self.projAuthor.setMinimumWidth(
|
251
|
+
self.projAuthor.setMinimumWidth(200)
|
255
252
|
self.projAuthor.setText(data.author)
|
256
253
|
self.addRow(
|
257
254
|
self.tr("Author(s)"), self.projAuthor,
|
@@ -262,7 +259,7 @@ class _SettingsPage(NScrollableForm):
|
|
262
259
|
# Project Language
|
263
260
|
projLang = data.language or CONFIG.guiLocale
|
264
261
|
self.projLang = NComboBox(self)
|
265
|
-
self.projLang.setMinimumWidth(
|
262
|
+
self.projLang.setMinimumWidth(200)
|
266
263
|
for tag, language in CONFIG.listLanguages(CONFIG.LANG_PROJ):
|
267
264
|
self.projLang.addItem(language, tag)
|
268
265
|
self.projLang.setCurrentData(projLang, projLang)
|
@@ -274,7 +271,7 @@ class _SettingsPage(NScrollableForm):
|
|
274
271
|
|
275
272
|
# Spell Check Language
|
276
273
|
self.spellLang = NComboBox(self)
|
277
|
-
self.spellLang.setMinimumWidth(
|
274
|
+
self.spellLang.setMinimumWidth(200)
|
278
275
|
self.spellLang.addItem(self.tr("Default"), "None")
|
279
276
|
if CONFIG.hasEnchant:
|
280
277
|
for tag, language in SHARED.spelling.listDictionaries():
|
@@ -323,9 +320,7 @@ class _StatusPage(NFixedPage):
|
|
323
320
|
pageLabel = self.tr("Project Note Importance Levels")
|
324
321
|
colSetting = "importColW"
|
325
322
|
|
326
|
-
wCol0 =
|
327
|
-
SHARED.project.options.getInt("GuiProjectSettings", colSetting, 130)
|
328
|
-
)
|
323
|
+
wCol0 = SHARED.project.options.getInt("GuiProjectSettings", colSetting, 130)
|
329
324
|
|
330
325
|
self._changed = False
|
331
326
|
self._color = QColor(100, 100, 100)
|
@@ -334,7 +329,6 @@ class _StatusPage(NFixedPage):
|
|
334
329
|
|
335
330
|
self._iPx = SHARED.theme.baseIconHeight
|
336
331
|
iSz = SHARED.theme.baseIconSize
|
337
|
-
bPd = CONFIG.pxInt(4)
|
338
332
|
|
339
333
|
iColor = self.palette().text().color()
|
340
334
|
|
@@ -345,9 +339,9 @@ class _StatusPage(NFixedPage):
|
|
345
339
|
self.trSelColor = self.tr("Select Colour")
|
346
340
|
|
347
341
|
# Title
|
348
|
-
self.pageTitle =
|
342
|
+
self.pageTitle = NColorLabel(
|
349
343
|
pageLabel, self, color=SHARED.theme.helpText,
|
350
|
-
scale=
|
344
|
+
scale=NColorLabel.HEADER_SCALE
|
351
345
|
)
|
352
346
|
|
353
347
|
# List Box
|
@@ -363,27 +357,27 @@ class _StatusPage(NFixedPage):
|
|
363
357
|
self._addItem(key, StatusEntry.duplicate(entry))
|
364
358
|
|
365
359
|
# List Controls
|
366
|
-
self.addButton = NIconToolButton(self, iSz, "add")
|
360
|
+
self.addButton = NIconToolButton(self, iSz, "add", "green")
|
367
361
|
self.addButton.setToolTip(self.tr("Add Label"))
|
368
362
|
self.addButton.clicked.connect(self._onItemCreate)
|
369
363
|
|
370
|
-
self.delButton = NIconToolButton(self, iSz, "remove")
|
364
|
+
self.delButton = NIconToolButton(self, iSz, "remove", "red")
|
371
365
|
self.delButton.setToolTip(self.tr("Delete Label"))
|
372
366
|
self.delButton.clicked.connect(self._onItemDelete)
|
373
367
|
|
374
|
-
self.upButton = NIconToolButton(self, iSz, "
|
368
|
+
self.upButton = NIconToolButton(self, iSz, "chevron_up", "blue")
|
375
369
|
self.upButton.setToolTip(self.tr("Move Up"))
|
376
370
|
self.upButton.clicked.connect(qtLambda(self._moveItem, -1))
|
377
371
|
|
378
|
-
self.downButton = NIconToolButton(self, iSz, "
|
372
|
+
self.downButton = NIconToolButton(self, iSz, "chevron_down", "blue")
|
379
373
|
self.downButton.setToolTip(self.tr("Move Down"))
|
380
374
|
self.downButton.clicked.connect(qtLambda(self._moveItem, 1))
|
381
375
|
|
382
|
-
self.importButton = NIconToolButton(self, iSz, "import")
|
376
|
+
self.importButton = NIconToolButton(self, iSz, "import", "green")
|
383
377
|
self.importButton.setToolTip(self.tr("Import Labels"))
|
384
378
|
self.importButton.clicked.connect(self._importLabels)
|
385
379
|
|
386
|
-
self.exportButton = NIconToolButton(self, iSz, "export")
|
380
|
+
self.exportButton = NIconToolButton(self, iSz, "export", "blue")
|
387
381
|
self.exportButton.setToolTip(self.tr("Export Labels"))
|
388
382
|
self.exportButton.clicked.connect(self._exportLabels)
|
389
383
|
|
@@ -395,7 +389,7 @@ class _StatusPage(NFixedPage):
|
|
395
389
|
self.labelText.textEdited.connect(self._onNameEdit)
|
396
390
|
|
397
391
|
buttonStyle = (
|
398
|
-
|
392
|
+
"QToolButton {padding: 0 4px;} "
|
399
393
|
"QToolButton::menu-indicator {image: none;}"
|
400
394
|
)
|
401
395
|
|
@@ -404,14 +398,17 @@ class _StatusPage(NFixedPage):
|
|
404
398
|
self.colorButton.setSizePolicy(QtSizeMinimum, QtSizeMinimumExpanding)
|
405
399
|
self.colorButton.setStyleSheet(buttonStyle)
|
406
400
|
self.colorButton.setEnabled(False)
|
407
|
-
self.colorButton.clicked.connect(self.
|
408
|
-
|
409
|
-
def buildMenu(menu: QMenu, items: dict[nwStatusShape, str]) -> None:
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
401
|
+
self.colorButton.clicked.connect(self._onColorSelect)
|
402
|
+
|
403
|
+
def buildMenu(menu: QMenu | None, items: dict[nwStatusShape, str]) -> None:
|
404
|
+
if menu is not None:
|
405
|
+
for shape, label in items.items():
|
406
|
+
icon = NWStatus.createIcon(self._iPx, iColor, shape)
|
407
|
+
action = qtAddAction(menu, trConst(label))
|
408
|
+
action.setIcon(icon)
|
409
|
+
action.triggered.connect(qtLambda(self._selectShape, shape))
|
410
|
+
menu.addAction(action)
|
411
|
+
self._icons[shape] = icon
|
415
412
|
|
416
413
|
self.shapeMenu = QMenu(self)
|
417
414
|
buildMenu(self.shapeMenu, nwLabels.SHAPES_PLAIN)
|
@@ -498,7 +495,7 @@ class _StatusPage(NFixedPage):
|
|
498
495
|
return
|
499
496
|
|
500
497
|
@pyqtSlot()
|
501
|
-
def
|
498
|
+
def _onColorSelect(self) -> None:
|
502
499
|
"""Open a dialog to select the status icon colour."""
|
503
500
|
if (color := QColorDialog.getColor(self._color, self, self.trSelColor)).isValid():
|
504
501
|
self._color = color
|
@@ -676,15 +673,12 @@ class _ReplacePage(NFixedPage):
|
|
676
673
|
self._changed = False
|
677
674
|
|
678
675
|
iSz = SHARED.theme.baseIconSize
|
679
|
-
|
680
|
-
wCol0 = CONFIG.pxInt(
|
681
|
-
SHARED.project.options.getInt("GuiProjectSettings", "replaceColW", 130)
|
682
|
-
)
|
676
|
+
wCol0 = SHARED.project.options.getInt("GuiProjectSettings", "replaceColW", 130)
|
683
677
|
|
684
678
|
# Title
|
685
|
-
self.pageTitle =
|
679
|
+
self.pageTitle = NColorLabel(
|
686
680
|
self.tr("Text Auto-Replace for Preview and Build"), self,
|
687
|
-
color=SHARED.theme.helpText, scale=
|
681
|
+
color=SHARED.theme.helpText, scale=NColorLabel.HEADER_SCALE
|
688
682
|
)
|
689
683
|
|
690
684
|
# List Box
|
@@ -697,17 +691,17 @@ class _ReplacePage(NFixedPage):
|
|
697
691
|
self.listBox.itemSelectionChanged.connect(self._onSelectionChanged)
|
698
692
|
|
699
693
|
for aKey, aVal in SHARED.project.data.autoReplace.items():
|
700
|
-
newItem = QTreeWidgetItem(["
|
694
|
+
newItem = QTreeWidgetItem([f"<{aKey}>", aVal])
|
701
695
|
self.listBox.addTopLevelItem(newItem)
|
702
696
|
|
703
697
|
self.listBox.sortByColumn(self.C_KEY, Qt.SortOrder.AscendingOrder)
|
704
698
|
self.listBox.setSortingEnabled(True)
|
705
699
|
|
706
700
|
# List Controls
|
707
|
-
self.addButton = NIconToolButton(self, iSz, "add")
|
701
|
+
self.addButton = NIconToolButton(self, iSz, "add", "green")
|
708
702
|
self.addButton.clicked.connect(self._onEntryCreated)
|
709
703
|
|
710
|
-
self.delButton = NIconToolButton(self, iSz, "remove")
|
704
|
+
self.delButton = NIconToolButton(self, iSz, "remove", "red")
|
711
705
|
self.delButton.clicked.connect(self._onEntryDeleted)
|
712
706
|
|
713
707
|
# Edit Form
|
novelwriter/dialogs/quotes.py
CHANGED
@@ -25,14 +25,13 @@ from __future__ import annotations
|
|
25
25
|
|
26
26
|
import logging
|
27
27
|
|
28
|
-
from
|
29
|
-
from
|
30
|
-
from
|
28
|
+
from PyQt6.QtCore import QSize, pyqtSlot
|
29
|
+
from PyQt6.QtGui import QFontMetrics
|
30
|
+
from PyQt6.QtWidgets import (
|
31
31
|
QDialogButtonBox, QFrame, QHBoxLayout, QLabel, QListWidget,
|
32
32
|
QListWidgetItem, QVBoxLayout, QWidget
|
33
33
|
)
|
34
34
|
|
35
|
-
from novelwriter import CONFIG
|
36
35
|
from novelwriter.constants import nwQuotes, trConst
|
37
36
|
from novelwriter.extensions.modified import NDialog
|
38
37
|
from novelwriter.types import (
|
@@ -62,18 +61,14 @@ class GuiQuoteSelect(NDialog):
|
|
62
61
|
|
63
62
|
self._selected = current
|
64
63
|
|
65
|
-
qMetrics = QFontMetrics(self.font())
|
66
|
-
pxW = 7*qMetrics.boundingRectChar("M").width()
|
67
|
-
pxH = 7*qMetrics.boundingRectChar("M").height()
|
68
|
-
pxH = 7*qMetrics.boundingRectChar("M").height()
|
69
|
-
|
70
64
|
lblFont = self.font()
|
71
65
|
lblFont.setPointSizeF(4*lblFont.pointSizeF())
|
66
|
+
metrics = QFontMetrics(self.font())
|
72
67
|
|
73
68
|
# Preview Label
|
74
69
|
self.previewLabel = QLabel(current, self)
|
75
70
|
self.previewLabel.setFont(lblFont)
|
76
|
-
self.previewLabel.setFixedSize(QSize(
|
71
|
+
self.previewLabel.setFixedSize(QSize(4*metrics.maxWidth(), 5*metrics.height()))
|
77
72
|
self.previewLabel.setAlignment(QtAlignCenter)
|
78
73
|
self.previewLabel.setFrameStyle(QFrame.Shape.Box | QFrame.Shadow.Plain)
|
79
74
|
|
@@ -83,16 +78,16 @@ class GuiQuoteSelect(NDialog):
|
|
83
78
|
|
84
79
|
minSize = 100
|
85
80
|
for sKey, sLabel in nwQuotes.SYMBOLS.items():
|
86
|
-
text = "[
|
87
|
-
minSize = max(minSize,
|
81
|
+
text = f"[ {sKey} ] {trConst(sLabel)}"
|
82
|
+
minSize = max(minSize, metrics.boundingRect(text).width())
|
88
83
|
qtItem = QListWidgetItem(text)
|
89
84
|
qtItem.setData(self.D_KEY, sKey)
|
90
85
|
self.listBox.addItem(qtItem)
|
91
86
|
if sKey == current:
|
92
87
|
self.listBox.setCurrentItem(qtItem)
|
93
88
|
|
94
|
-
self.listBox.setMinimumWidth(minSize +
|
95
|
-
self.listBox.setMinimumHeight(
|
89
|
+
self.listBox.setMinimumWidth(minSize + 40)
|
90
|
+
self.listBox.setMinimumHeight(150)
|
96
91
|
|
97
92
|
# Buttons
|
98
93
|
self.buttonBox = QDialogButtonBox(QtDialogOk | QtDialogCancel, self)
|
@@ -127,11 +122,11 @@ class GuiQuoteSelect(NDialog):
|
|
127
122
|
@classmethod
|
128
123
|
def getQuote(cls, parent: QWidget, current: str = "") -> tuple[str, bool]:
|
129
124
|
"""Pop the dialog and return the result."""
|
130
|
-
|
131
|
-
|
132
|
-
quote =
|
133
|
-
accepted =
|
134
|
-
|
125
|
+
dialog = cls(parent, current=current)
|
126
|
+
dialog.exec()
|
127
|
+
quote = dialog._selected
|
128
|
+
accepted = dialog.result() == QtAccepted
|
129
|
+
dialog.softDelete()
|
135
130
|
return quote, accepted
|
136
131
|
|
137
132
|
##
|
novelwriter/dialogs/wordlist.py
CHANGED
@@ -26,10 +26,10 @@ from __future__ import annotations
|
|
26
26
|
import logging
|
27
27
|
|
28
28
|
from pathlib import Path
|
29
|
+
from typing import TYPE_CHECKING
|
29
30
|
|
30
|
-
from
|
31
|
-
from
|
32
|
-
from PyQt5.QtWidgets import (
|
31
|
+
from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
|
32
|
+
from PyQt6.QtWidgets import (
|
33
33
|
QAbstractItemView, QApplication, QDialogButtonBox, QFileDialog,
|
34
34
|
QHBoxLayout, QLineEdit, QListWidget, QVBoxLayout, QWidget
|
35
35
|
)
|
@@ -37,10 +37,13 @@ from PyQt5.QtWidgets import (
|
|
37
37
|
from novelwriter import CONFIG, SHARED
|
38
38
|
from novelwriter.common import formatFileFilter
|
39
39
|
from novelwriter.core.spellcheck import UserDictionary
|
40
|
-
from novelwriter.extensions.configlayout import
|
40
|
+
from novelwriter.extensions.configlayout import NColorLabel
|
41
41
|
from novelwriter.extensions.modified import NDialog, NIconToolButton
|
42
42
|
from novelwriter.types import QtDialogClose, QtDialogSave
|
43
43
|
|
44
|
+
if TYPE_CHECKING:
|
45
|
+
from PyQt6.QtGui import QCloseEvent
|
46
|
+
|
44
47
|
logger = logging.getLogger(__name__)
|
45
48
|
|
46
49
|
|
@@ -56,28 +59,25 @@ class GuiWordList(NDialog):
|
|
56
59
|
self.setWindowTitle(self.tr("Project Word List"))
|
57
60
|
|
58
61
|
iSz = SHARED.theme.baseIconSize
|
59
|
-
mS = CONFIG.pxInt(250)
|
60
|
-
wW = CONFIG.pxInt(320)
|
61
|
-
wH = CONFIG.pxInt(340)
|
62
62
|
|
63
|
-
self.setMinimumWidth(
|
64
|
-
self.setMinimumHeight(
|
63
|
+
self.setMinimumWidth(250)
|
64
|
+
self.setMinimumHeight(250)
|
65
65
|
self.resize(
|
66
|
-
|
67
|
-
|
66
|
+
SHARED.project.options.getInt("GuiWordList", "winWidth", 320),
|
67
|
+
SHARED.project.options.getInt("GuiWordList", "winHeight", 340),
|
68
68
|
)
|
69
69
|
|
70
70
|
# Header
|
71
|
-
self.headLabel =
|
71
|
+
self.headLabel = NColorLabel(
|
72
72
|
self.tr("Project Word List"), self, color=SHARED.theme.helpText,
|
73
|
-
scale=
|
73
|
+
scale=NColorLabel.HEADER_SCALE
|
74
74
|
)
|
75
75
|
|
76
|
-
self.importButton = NIconToolButton(self, iSz, "import")
|
76
|
+
self.importButton = NIconToolButton(self, iSz, "import", "green")
|
77
77
|
self.importButton.setToolTip(self.tr("Import words from text file"))
|
78
78
|
self.importButton.clicked.connect(self._importWords)
|
79
79
|
|
80
|
-
self.exportButton = NIconToolButton(self, iSz, "export")
|
80
|
+
self.exportButton = NIconToolButton(self, iSz, "export", "blue")
|
81
81
|
self.exportButton.setToolTip(self.tr("Export words to text file"))
|
82
82
|
self.exportButton.clicked.connect(self._exportWords)
|
83
83
|
|
@@ -95,11 +95,11 @@ class GuiWordList(NDialog):
|
|
95
95
|
# Add/Remove Form
|
96
96
|
self.newEntry = QLineEdit(self)
|
97
97
|
|
98
|
-
self.addButton = NIconToolButton(self, iSz, "add")
|
98
|
+
self.addButton = NIconToolButton(self, iSz, "add", "green")
|
99
99
|
self.addButton.setToolTip(self.tr("Add Word"))
|
100
100
|
self.addButton.clicked.connect(self._doAdd)
|
101
101
|
|
102
|
-
self.delButton = NIconToolButton(self, iSz, "remove")
|
102
|
+
self.delButton = NIconToolButton(self, iSz, "remove", "red")
|
103
103
|
self.delButton.setToolTip(self.tr("Remove Word"))
|
104
104
|
self.delButton.clicked.connect(self._doDelete)
|
105
105
|
|
@@ -118,9 +118,9 @@ class GuiWordList(NDialog):
|
|
118
118
|
self.outerBox.addLayout(self.headerBox, 0)
|
119
119
|
self.outerBox.addWidget(self.listBox, 1)
|
120
120
|
self.outerBox.addLayout(self.editBox, 0)
|
121
|
-
self.outerBox.addSpacing(
|
121
|
+
self.outerBox.addSpacing(12)
|
122
122
|
self.outerBox.addWidget(self.buttonBox, 0)
|
123
|
-
self.outerBox.setSpacing(
|
123
|
+
self.outerBox.setSpacing(4)
|
124
124
|
|
125
125
|
self.setLayout(self.outerBox)
|
126
126
|
|
@@ -230,14 +230,10 @@ class GuiWordList(NDialog):
|
|
230
230
|
|
231
231
|
def _saveGuiSettings(self) -> None:
|
232
232
|
"""Save GUI settings."""
|
233
|
-
winWidth = CONFIG.rpxInt(self.width())
|
234
|
-
winHeight = CONFIG.rpxInt(self.height())
|
235
|
-
|
236
233
|
logger.debug("Saving State: GuiWordList")
|
237
234
|
pOptions = SHARED.project.options
|
238
|
-
pOptions.setValue("GuiWordList", "winWidth",
|
239
|
-
pOptions.setValue("GuiWordList", "winHeight",
|
240
|
-
|
235
|
+
pOptions.setValue("GuiWordList", "winWidth", self.width())
|
236
|
+
pOptions.setValue("GuiWordList", "winHeight", self.height())
|
241
237
|
return
|
242
238
|
|
243
239
|
def _addWord(self, word: str) -> None:
|
@@ -249,8 +245,7 @@ class GuiWordList(NDialog):
|
|
249
245
|
|
250
246
|
def _listWords(self) -> list[str]:
|
251
247
|
"""List all words in the list box."""
|
252
|
-
|
253
|
-
|
254
|
-
if (item := self.listBox.item(i)) and (word := item.text().strip())
|
255
|
-
|
256
|
-
return result
|
248
|
+
return [
|
249
|
+
word for i in range(self.listBox.count())
|
250
|
+
if (item := self.listBox.item(i)) and (word := item.text().strip())
|
251
|
+
]
|
novelwriter/enum.py
CHANGED
novelwriter/error.py
CHANGED
@@ -29,14 +29,14 @@ import sys
|
|
29
29
|
|
30
30
|
from typing import TYPE_CHECKING
|
31
31
|
|
32
|
-
from
|
33
|
-
from
|
34
|
-
from
|
32
|
+
from PyQt6.QtCore import Qt, pyqtSlot
|
33
|
+
from PyQt6.QtGui import QFont, QFontDatabase
|
34
|
+
from PyQt6.QtWidgets import (
|
35
35
|
QApplication, QDialog, QDialogButtonBox, QGridLayout, QLabel,
|
36
36
|
QPlainTextEdit, QStyle, QWidget
|
37
37
|
)
|
38
38
|
|
39
|
-
if TYPE_CHECKING:
|
39
|
+
if TYPE_CHECKING:
|
40
40
|
from types import TracebackType
|
41
41
|
|
42
42
|
logger = logging.getLogger(__name__)
|
@@ -46,7 +46,7 @@ def logException() -> None:
|
|
46
46
|
"""Log the content of an exception message."""
|
47
47
|
exType, exValue, _ = sys.exc_info()
|
48
48
|
if exType is not None:
|
49
|
-
logger.error(f"{exType.__name__}: {
|
49
|
+
logger.error(f"{exType.__name__}: {exValue!s}", stacklevel=2)
|
50
50
|
return
|
51
51
|
|
52
52
|
|
@@ -54,7 +54,7 @@ def formatException(exc: BaseException) -> str:
|
|
54
54
|
"""Format an exception as a string the same way the default
|
55
55
|
exception handler does.
|
56
56
|
"""
|
57
|
-
return f"{type(exc).__name__}: {
|
57
|
+
return f"{type(exc).__name__}: {exc!s}"
|
58
58
|
|
59
59
|
|
60
60
|
class NWErrorMessage(QDialog):
|
@@ -65,11 +65,11 @@ class NWErrorMessage(QDialog):
|
|
65
65
|
|
66
66
|
# Widgets
|
67
67
|
self.msgIcon = QLabel()
|
68
|
-
|
69
|
-
|
70
|
-
QStyle.StandardPixmap.SP_MessageBoxCritical
|
71
|
-
)
|
72
|
-
|
68
|
+
if style := QApplication.style():
|
69
|
+
self.msgIcon.setPixmap(
|
70
|
+
style.standardIcon(QStyle.StandardPixmap.SP_MessageBoxCritical).pixmap(64, 64)
|
71
|
+
)
|
72
|
+
|
73
73
|
self.msgHead = QLabel()
|
74
74
|
self.msgHead.setOpenExternalLinks(True)
|
75
75
|
self.msgHead.setWordWrap(True)
|
@@ -118,7 +118,7 @@ class NWErrorMessage(QDialog):
|
|
118
118
|
"""
|
119
119
|
from traceback import format_tb
|
120
120
|
|
121
|
-
from
|
121
|
+
from PyQt6.QtCore import PYQT_VERSION_STR, QT_VERSION_STR, QSysInfo
|
122
122
|
|
123
123
|
from novelwriter import __version__
|
124
124
|
from novelwriter.constants import nwConst
|
@@ -144,16 +144,16 @@ class NWErrorMessage(QDialog):
|
|
144
144
|
|
145
145
|
try:
|
146
146
|
txtTrace = "\n".join(format_tb(exTrace))
|
147
|
-
self.msgBody.setPlainText(
|
147
|
+
self.msgBody.setPlainText(
|
148
148
|
"Environment:\n"
|
149
149
|
f"novelWriter Version: {__version__}\n"
|
150
150
|
f"Host OS: {sys.platform} ({kernelVersion})\n"
|
151
151
|
f"Python: {sys.version.split()[0]} ({sys.hexversion:#x})\n"
|
152
152
|
f"Qt: {QT_VERSION_STR}, PyQt: {PYQT_VERSION_STR}\n"
|
153
153
|
f"enchant: {enchantVersion}\n\n"
|
154
|
-
f"{exType.__name__}:\n{
|
154
|
+
f"{exType.__name__}:\n{exValue!s}\n\n"
|
155
155
|
f"Traceback:\n{txtTrace}\n"
|
156
|
-
)
|
156
|
+
)
|
157
157
|
except Exception:
|
158
158
|
self.msgBody.setPlainText("Failed to generate error report ...")
|
159
159
|
|
@@ -174,7 +174,7 @@ def exceptionHandler(exType: type, exValue: BaseException, exTrace: TracebackTyp
|
|
174
174
|
"""Function to catch unhandled global exceptions."""
|
175
175
|
from traceback import print_tb
|
176
176
|
|
177
|
-
from
|
177
|
+
from PyQt6.QtWidgets import QApplication
|
178
178
|
|
179
179
|
logger.critical("%s: %s", exType.__name__, str(exValue))
|
180
180
|
print_tb(exTrace)
|