novelWriter 2.4.3__py3-none-any.whl → 2.5__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-2.4.3.dist-info → novelWriter-2.5.dist-info}/METADATA +4 -5
- {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/RECORD +122 -112
- {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/WHEEL +1 -1
- novelwriter/__init__.py +33 -39
- 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_zh_CN.qm +0 -0
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/i18n/project_pl_PL.json +116 -0
- novelwriter/assets/i18n/project_pt_BR.json +74 -74
- novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
- novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +2 -0
- novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
- novelwriter/assets/syntax/default_dark.conf +32 -18
- novelwriter/assets/syntax/default_light.conf +24 -10
- novelwriter/assets/syntax/dracula.conf +44 -0
- novelwriter/assets/syntax/grey_dark.conf +5 -4
- novelwriter/assets/syntax/grey_light.conf +5 -4
- novelwriter/assets/syntax/light_owl.conf +7 -6
- novelwriter/assets/syntax/night_owl.conf +7 -6
- novelwriter/assets/syntax/snazzy.conf +42 -0
- novelwriter/assets/syntax/solarized_dark.conf +4 -3
- novelwriter/assets/syntax/solarized_light.conf +4 -3
- novelwriter/assets/syntax/tango.conf +27 -11
- novelwriter/assets/syntax/tomorrow.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night.conf +7 -6
- novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
- novelwriter/assets/text/credits_en.htm +52 -41
- novelwriter/assets/themes/cyberpunk_night.conf +3 -0
- novelwriter/assets/themes/default_dark.conf +2 -0
- novelwriter/assets/themes/default_light.conf +2 -0
- novelwriter/assets/themes/dracula.conf +48 -0
- novelwriter/assets/themes/solarized_dark.conf +2 -0
- novelwriter/assets/themes/solarized_light.conf +2 -0
- novelwriter/common.py +33 -12
- novelwriter/config.py +184 -98
- novelwriter/constants.py +47 -35
- novelwriter/core/buildsettings.py +68 -69
- novelwriter/core/coretools.py +5 -23
- novelwriter/core/docbuild.py +52 -40
- novelwriter/core/document.py +3 -5
- novelwriter/core/index.py +115 -45
- novelwriter/core/item.py +8 -19
- novelwriter/core/options.py +2 -4
- novelwriter/core/project.py +37 -61
- novelwriter/core/projectdata.py +1 -3
- novelwriter/core/projectxml.py +12 -15
- novelwriter/core/sessions.py +3 -5
- novelwriter/core/spellcheck.py +4 -9
- novelwriter/core/status.py +211 -164
- novelwriter/core/storage.py +0 -8
- novelwriter/core/tohtml.py +139 -105
- novelwriter/core/tokenizer.py +278 -122
- novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
- novelwriter/core/toodt.py +257 -166
- novelwriter/core/toqdoc.py +419 -0
- novelwriter/core/tree.py +5 -7
- novelwriter/dialogs/about.py +11 -18
- novelwriter/dialogs/docmerge.py +17 -19
- novelwriter/dialogs/docsplit.py +17 -19
- novelwriter/dialogs/editlabel.py +6 -10
- novelwriter/dialogs/preferences.py +200 -164
- novelwriter/dialogs/projectsettings.py +225 -189
- novelwriter/dialogs/quotes.py +12 -9
- novelwriter/dialogs/wordlist.py +9 -15
- novelwriter/enum.py +35 -30
- novelwriter/error.py +8 -15
- novelwriter/extensions/configlayout.py +55 -21
- novelwriter/extensions/eventfilters.py +1 -5
- novelwriter/extensions/modified.py +70 -14
- novelwriter/extensions/novelselector.py +1 -3
- novelwriter/extensions/pagedsidebar.py +9 -12
- novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
- novelwriter/extensions/statusled.py +40 -26
- novelwriter/extensions/switch.py +4 -6
- novelwriter/extensions/switchbox.py +7 -6
- novelwriter/extensions/versioninfo.py +3 -9
- novelwriter/gui/doceditor.py +120 -139
- novelwriter/gui/dochighlight.py +231 -186
- novelwriter/gui/docviewer.py +69 -108
- novelwriter/gui/docviewerpanel.py +3 -10
- novelwriter/gui/editordocument.py +1 -3
- novelwriter/gui/itemdetails.py +7 -11
- novelwriter/gui/mainmenu.py +22 -18
- novelwriter/gui/noveltree.py +11 -24
- novelwriter/gui/outline.py +15 -26
- novelwriter/gui/projtree.py +39 -65
- novelwriter/gui/search.py +10 -3
- novelwriter/gui/sidebar.py +2 -6
- novelwriter/gui/statusbar.py +29 -37
- novelwriter/gui/theme.py +26 -48
- novelwriter/guimain.py +162 -160
- novelwriter/shared.py +36 -19
- novelwriter/text/patterns.py +113 -0
- novelwriter/tools/dictionaries.py +10 -20
- novelwriter/tools/lipsum.py +10 -16
- novelwriter/tools/manusbuild.py +9 -11
- novelwriter/tools/manuscript.py +75 -149
- novelwriter/tools/manussettings.py +74 -76
- novelwriter/tools/noveldetails.py +16 -21
- novelwriter/tools/welcome.py +21 -26
- novelwriter/tools/writingstats.py +9 -12
- novelwriter/types.py +49 -4
- novelwriter/extensions/simpleprogress.py +0 -55
- {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/top_level.txt +0 -0
@@ -32,15 +32,16 @@ from typing import TYPE_CHECKING
|
|
32
32
|
from PyQt5.QtCore import Qt, pyqtSlot
|
33
33
|
from PyQt5.QtGui import QCloseEvent, QCursor, QPixmap
|
34
34
|
from PyQt5.QtWidgets import (
|
35
|
-
QAction, QApplication,
|
35
|
+
QAction, QApplication, QDialogButtonBox, QFileDialog, QGridLayout,
|
36
36
|
QGroupBox, QHBoxLayout, QLabel, QMenu, QSpinBox, QTreeWidget,
|
37
37
|
QTreeWidgetItem
|
38
38
|
)
|
39
39
|
|
40
40
|
from novelwriter import CONFIG, SHARED
|
41
|
-
from novelwriter.common import
|
41
|
+
from novelwriter.common import checkInt, checkIntTuple, formatTime, minmax
|
42
42
|
from novelwriter.constants import nwConst
|
43
43
|
from novelwriter.error import formatException
|
44
|
+
from novelwriter.extensions.modified import NToolDialog
|
44
45
|
from novelwriter.extensions.switch import NSwitch
|
45
46
|
from novelwriter.types import (
|
46
47
|
QtAlignLeftMiddle, QtAlignRight, QtAlignRightMiddle, QtDecoration,
|
@@ -53,7 +54,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
53
54
|
logger = logging.getLogger(__name__)
|
54
55
|
|
55
56
|
|
56
|
-
class GuiWritingStats(
|
57
|
+
class GuiWritingStats(NToolDialog):
|
57
58
|
"""GUI Tools: Writing Statistics
|
58
59
|
|
59
60
|
Displays data from the NWSessionLog object.
|
@@ -68,13 +69,11 @@ class GuiWritingStats(QDialog):
|
|
68
69
|
FMT_JSON = 0
|
69
70
|
FMT_CSV = 1
|
70
71
|
|
71
|
-
def __init__(self,
|
72
|
-
super().__init__(parent=
|
72
|
+
def __init__(self, parent: GuiMain) -> None:
|
73
|
+
super().__init__(parent=parent)
|
73
74
|
|
74
75
|
logger.debug("Create: GuiWritingStats")
|
75
76
|
self.setObjectName("GuiWritingStats")
|
76
|
-
if CONFIG.osDarwin:
|
77
|
-
self.setWindowFlag(Qt.WindowType.Tool)
|
78
77
|
|
79
78
|
self.logData = []
|
80
79
|
self.filterData = []
|
@@ -319,7 +318,7 @@ class GuiWritingStats(QDialog):
|
|
319
318
|
def closeEvent(self, event: QCloseEvent) -> None:
|
320
319
|
"""Capture the user closing the window."""
|
321
320
|
event.accept()
|
322
|
-
self.
|
321
|
+
self.softDelete()
|
323
322
|
return
|
324
323
|
|
325
324
|
##
|
@@ -385,14 +384,14 @@ class GuiWritingStats(QDialog):
|
|
385
384
|
return False
|
386
385
|
|
387
386
|
# Generate the file name
|
388
|
-
savePath = CONFIG.lastPath() / f"sessionStats.{fileExt}"
|
387
|
+
savePath = CONFIG.lastPath("stats") / f"sessionStats.{fileExt}"
|
389
388
|
savePath, _ = QFileDialog.getSaveFileName(
|
390
389
|
self, self.tr("Save Data As"), str(savePath), f"{textFmt} (*.{fileExt})"
|
391
390
|
)
|
392
391
|
if not savePath:
|
393
392
|
return False
|
394
393
|
|
395
|
-
CONFIG.setLastPath(savePath)
|
394
|
+
CONFIG.setLastPath("stats", savePath)
|
396
395
|
|
397
396
|
# Do the actual writing
|
398
397
|
wSuccess = False
|
@@ -615,5 +614,3 @@ class GuiWritingStats(QDialog):
|
|
615
614
|
self.labelFilter.setText(formatTime(round(self.timeFilter)))
|
616
615
|
|
617
616
|
return
|
618
|
-
|
619
|
-
# END Class GuiWritingStats
|
novelwriter/types.py
CHANGED
@@ -23,9 +23,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
"""
|
24
24
|
from __future__ import annotations
|
25
25
|
|
26
|
-
from PyQt5.QtCore import Qt
|
27
|
-
from PyQt5.QtGui import QColor, QPainter, QTextCursor
|
28
|
-
from PyQt5.QtWidgets import QDialogButtonBox, QStyle
|
26
|
+
from PyQt5.QtCore import QRegularExpression, Qt
|
27
|
+
from PyQt5.QtGui import QColor, QFont, QPainter, QTextCharFormat, QTextCursor, QTextFormat
|
28
|
+
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QSizePolicy, QStyle
|
29
29
|
|
30
30
|
# Qt Alignment Flags
|
31
31
|
|
@@ -44,9 +44,19 @@ QtAlignRightMiddle = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter
|
|
44
44
|
QtAlignRightTop = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignTop
|
45
45
|
QtAlignTop = Qt.AlignmentFlag.AlignTop
|
46
46
|
|
47
|
+
QtVAlignNormal = QTextCharFormat.VerticalAlignment.AlignNormal
|
48
|
+
QtVAlignSub = QTextCharFormat.VerticalAlignment.AlignSubScript
|
49
|
+
QtVAlignSuper = QTextCharFormat.VerticalAlignment.AlignSuperScript
|
50
|
+
|
51
|
+
# Qt Page Break
|
52
|
+
|
53
|
+
QtPageBreakBefore = QTextFormat.PageBreakFlag.PageBreak_AlwaysBefore
|
54
|
+
QtPageBreakAfter = QTextFormat.PageBreakFlag.PageBreak_AlwaysAfter
|
55
|
+
|
47
56
|
# Qt Painter Types
|
48
57
|
|
49
58
|
QtTransparent = QColor(0, 0, 0, 0)
|
59
|
+
QtBlack = QColor(0, 0, 0)
|
50
60
|
QtNoBrush = Qt.BrushStyle.NoBrush
|
51
61
|
QtNoPen = Qt.PenStyle.NoPen
|
52
62
|
QtRoundCap = Qt.PenCapStyle.RoundCap
|
@@ -63,13 +73,16 @@ QtUserRole = Qt.ItemDataRole.UserRole
|
|
63
73
|
# Keyboard and Mouse Buttons
|
64
74
|
|
65
75
|
QtModCtrl = Qt.KeyboardModifier.ControlModifier
|
66
|
-
|
76
|
+
QtModNone = Qt.KeyboardModifier.NoModifier
|
67
77
|
QtModShift = Qt.KeyboardModifier.ShiftModifier
|
68
78
|
QtMouseLeft = Qt.MouseButton.LeftButton
|
69
79
|
QtMouseMiddle = Qt.MouseButton.MiddleButton
|
70
80
|
|
71
81
|
# Dialog Button Box Types
|
72
82
|
|
83
|
+
QtAccepted = QDialog.DialogCode.Accepted
|
84
|
+
QtRejected = QDialog.DialogCode.Rejected
|
85
|
+
|
73
86
|
QtDialogApply = QDialogButtonBox.StandardButton.Apply
|
74
87
|
QtDialogCancel = QDialogButtonBox.StandardButton.Cancel
|
75
88
|
QtDialogClose = QDialogButtonBox.StandardButton.Close
|
@@ -88,3 +101,35 @@ QtKeepAnchor = QTextCursor.MoveMode.KeepAnchor
|
|
88
101
|
QtMoveAnchor = QTextCursor.MoveMode.MoveAnchor
|
89
102
|
QtMoveLeft = QTextCursor.MoveOperation.Left
|
90
103
|
QtMoveRight = QTextCursor.MoveOperation.Right
|
104
|
+
|
105
|
+
# Size Policy
|
106
|
+
|
107
|
+
QtSizeExpanding = QSizePolicy.Policy.Expanding
|
108
|
+
QtSizeFixed = QSizePolicy.Policy.Fixed
|
109
|
+
QtSizeIgnored = QSizePolicy.Policy.Ignored
|
110
|
+
QtSizeMinimum = QSizePolicy.Policy.Minimum
|
111
|
+
QtSizeMinimumExpanding = QSizePolicy.Policy.MinimumExpanding
|
112
|
+
|
113
|
+
# Other
|
114
|
+
|
115
|
+
QRegExUnicode = QRegularExpression.PatternOption.UseUnicodePropertiesOption
|
116
|
+
|
117
|
+
# Maps
|
118
|
+
|
119
|
+
FONT_WEIGHTS: dict[int, int] = {
|
120
|
+
QFont.Weight.Thin: 100,
|
121
|
+
QFont.Weight.ExtraLight: 200,
|
122
|
+
QFont.Weight.Light: 300,
|
123
|
+
QFont.Weight.Normal: 400,
|
124
|
+
QFont.Weight.Medium: 500,
|
125
|
+
QFont.Weight.DemiBold: 600,
|
126
|
+
QFont.Weight.Bold: 700,
|
127
|
+
QFont.Weight.ExtraBold: 800,
|
128
|
+
QFont.Weight.Black: 900,
|
129
|
+
}
|
130
|
+
|
131
|
+
FONT_STYLE: dict[int, str] = {
|
132
|
+
QFont.Style.StyleNormal: "normal",
|
133
|
+
QFont.Style.StyleItalic: "italic",
|
134
|
+
QFont.Style.StyleOblique: "oblique",
|
135
|
+
}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
novelWriter – Custom Widget: Progress Simple
|
3
|
-
============================================
|
4
|
-
|
5
|
-
File History:
|
6
|
-
Created: 2023-06-09 [2.1b1]
|
7
|
-
|
8
|
-
This file is a part of novelWriter
|
9
|
-
Copyright 2018–2024, Veronica Berglyd Olsen
|
10
|
-
|
11
|
-
This program is free software: you can redistribute it and/or modify
|
12
|
-
it under the terms of the GNU General Public License as published by
|
13
|
-
the Free Software Foundation, either version 3 of the License, or
|
14
|
-
(at your option) any later version.
|
15
|
-
|
16
|
-
This program is distributed in the hope that it will be useful, but
|
17
|
-
WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
19
|
-
General Public License for more details.
|
20
|
-
|
21
|
-
You should have received a copy of the GNU General Public License
|
22
|
-
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
23
|
-
"""
|
24
|
-
from __future__ import annotations
|
25
|
-
|
26
|
-
from math import ceil
|
27
|
-
|
28
|
-
from PyQt5.QtGui import QPaintEvent, QPainter
|
29
|
-
from PyQt5.QtWidgets import QProgressBar, QWidget
|
30
|
-
|
31
|
-
from novelwriter.types import QtPaintAnitAlias
|
32
|
-
|
33
|
-
|
34
|
-
class NProgressSimple(QProgressBar):
|
35
|
-
"""Extension: Simple Progress Widget
|
36
|
-
|
37
|
-
A custom widget that paints a plain bar with no other styling.
|
38
|
-
"""
|
39
|
-
|
40
|
-
def __init__(self, parent: QWidget) -> None:
|
41
|
-
super().__init__(parent=parent)
|
42
|
-
return
|
43
|
-
|
44
|
-
def paintEvent(self, event: QPaintEvent) -> None:
|
45
|
-
"""Custom painter for the progress bar."""
|
46
|
-
if (value := self.value()) > 0:
|
47
|
-
progress = ceil(self.width()*float(value)/self.maximum())
|
48
|
-
painter = QPainter(self)
|
49
|
-
painter.setRenderHint(QtPaintAnitAlias, True)
|
50
|
-
painter.setPen(self.palette().highlight().color())
|
51
|
-
painter.setBrush(self.palette().highlight())
|
52
|
-
painter.drawRect(0, 0, progress, self.height())
|
53
|
-
return
|
54
|
-
|
55
|
-
# END Class NProgressSimple
|
File without changes
|
File without changes
|
File without changes
|