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
@@ -25,14 +25,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
25
25
|
"""
|
26
26
|
from __future__ import annotations
|
27
27
|
|
28
|
-
from PyQt5.QtGui import QColor, QPaintEvent, QPainter, QPolygon
|
29
28
|
from PyQt5.QtCore import QPoint, QRectF, QSize, Qt, pyqtSignal, pyqtSlot
|
29
|
+
from PyQt5.QtGui import QColor, QPainter, QPaintEvent, QPolygon
|
30
30
|
from PyQt5.QtWidgets import (
|
31
|
-
QAbstractButton, QAction, QButtonGroup, QLabel,
|
31
|
+
QAbstractButton, QAction, QButtonGroup, QLabel, QStyle,
|
32
32
|
QStyleOptionToolButton, QToolBar, QToolButton, QWidget
|
33
33
|
)
|
34
34
|
|
35
|
-
from novelwriter.types import
|
35
|
+
from novelwriter.types import (
|
36
|
+
QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen, QtPaintAnitAlias,
|
37
|
+
QtSizeExpanding, QtSizeFixed
|
38
|
+
)
|
36
39
|
|
37
40
|
|
38
41
|
class NPagedSideBar(QToolBar):
|
@@ -59,7 +62,7 @@ class NPagedSideBar(QToolBar):
|
|
59
62
|
self.setOrientation(Qt.Orientation.Vertical)
|
60
63
|
|
61
64
|
stretch = QWidget(self)
|
62
|
-
stretch.setSizePolicy(
|
65
|
+
stretch.setSizePolicy(QtSizeExpanding, QtSizeExpanding)
|
63
66
|
self._stretchAction = self.addWidget(stretch)
|
64
67
|
|
65
68
|
return
|
@@ -109,8 +112,6 @@ class NPagedSideBar(QToolBar):
|
|
109
112
|
self.buttonClicked.emit(buttonId)
|
110
113
|
return
|
111
114
|
|
112
|
-
# END Class NPagedSideBar
|
113
|
-
|
114
115
|
|
115
116
|
class _NPagedToolButton(QToolButton):
|
116
117
|
|
@@ -119,7 +120,7 @@ class _NPagedToolButton(QToolButton):
|
|
119
120
|
def __init__(self, parent: QWidget) -> None:
|
120
121
|
super().__init__(parent=parent)
|
121
122
|
|
122
|
-
self.setSizePolicy(
|
123
|
+
self.setSizePolicy(QtSizeExpanding, QtSizeFixed)
|
123
124
|
self.setCheckable(True)
|
124
125
|
|
125
126
|
fH = self.fontMetrics().height()
|
@@ -187,8 +188,6 @@ class _NPagedToolButton(QToolButton):
|
|
187
188
|
|
188
189
|
return
|
189
190
|
|
190
|
-
# END Class _NPagedToolButton
|
191
|
-
|
192
191
|
|
193
192
|
class _NPagedToolLabel(QLabel):
|
194
193
|
|
@@ -197,7 +196,7 @@ class _NPagedToolLabel(QLabel):
|
|
197
196
|
def __init__(self, parent: QWidget, textColor: QColor | None = None) -> None:
|
198
197
|
super().__init__(parent=parent)
|
199
198
|
|
200
|
-
self.setSizePolicy(
|
199
|
+
self.setSizePolicy(QtSizeExpanding, QtSizeFixed)
|
201
200
|
|
202
201
|
fH = self.fontMetrics().height()
|
203
202
|
self._bH = round(fH * 1.7)
|
@@ -228,5 +227,3 @@ class _NPagedToolLabel(QLabel):
|
|
228
227
|
paint.drawText(QRectF(self._lM, self._tM, tW, tH), QtAlignLeft, self.text())
|
229
228
|
|
230
229
|
return
|
231
|
-
|
232
|
-
# END Class _NPagedToolLabel
|
@@ -1,9 +1,10 @@
|
|
1
1
|
"""
|
2
|
-
novelWriter – Custom Widget: Progress
|
3
|
-
|
2
|
+
novelWriter – Custom Widget: Progress Bars
|
3
|
+
==========================================
|
4
4
|
|
5
5
|
File History:
|
6
|
-
Created: 2023-06-07 [2.1b1]
|
6
|
+
Created: 2023-06-07 [2.1b1] NProgressCircle
|
7
|
+
Created: 2023-06-09 [2.1b1] NProgressSimple
|
7
8
|
|
8
9
|
This file is a part of novelWriter
|
9
10
|
Copyright 2018–2024, Veronica Berglyd Olsen
|
@@ -26,11 +27,12 @@ from __future__ import annotations
|
|
26
27
|
from math import ceil
|
27
28
|
|
28
29
|
from PyQt5.QtCore import QRect
|
29
|
-
from PyQt5.QtGui import QBrush, QColor,
|
30
|
-
from PyQt5.QtWidgets import QProgressBar,
|
30
|
+
from PyQt5.QtGui import QBrush, QColor, QPainter, QPaintEvent, QPen
|
31
|
+
from PyQt5.QtWidgets import QProgressBar, QWidget
|
31
32
|
|
32
33
|
from novelwriter.types import (
|
33
|
-
|
34
|
+
QtAlignCenter, QtPaintAnitAlias, QtRoundCap, QtSizeFixed, QtSolidLine,
|
35
|
+
QtTransparent
|
34
36
|
)
|
35
37
|
|
36
38
|
|
@@ -59,7 +61,7 @@ class NProgressCircle(QProgressBar):
|
|
59
61
|
bar=self.palette().highlight().color(),
|
60
62
|
text=self.palette().text().color()
|
61
63
|
)
|
62
|
-
self.setSizePolicy(
|
64
|
+
self.setSizePolicy(QtSizeFixed, QtSizeFixed)
|
63
65
|
self.setFixedWidth(size)
|
64
66
|
self.setFixedHeight(size)
|
65
67
|
return
|
@@ -101,4 +103,24 @@ class NProgressCircle(QProgressBar):
|
|
101
103
|
painter.drawText(self._cRect, QtAlignCenter, self._text or f"{progress:.1f} %")
|
102
104
|
return
|
103
105
|
|
104
|
-
|
106
|
+
|
107
|
+
class NProgressSimple(QProgressBar):
|
108
|
+
"""Extension: Simple Progress Widget
|
109
|
+
|
110
|
+
A custom widget that paints a plain bar with no other styling.
|
111
|
+
"""
|
112
|
+
|
113
|
+
def __init__(self, parent: QWidget) -> None:
|
114
|
+
super().__init__(parent=parent)
|
115
|
+
return
|
116
|
+
|
117
|
+
def paintEvent(self, event: QPaintEvent) -> None:
|
118
|
+
"""Custom painter for the progress bar."""
|
119
|
+
if (value := self.value()) > 0:
|
120
|
+
progress = ceil(self.width()*float(value)/self.maximum())
|
121
|
+
painter = QPainter(self)
|
122
|
+
painter.setRenderHint(QtPaintAnitAlias, True)
|
123
|
+
painter.setPen(self.palette().highlight().color())
|
124
|
+
painter.setBrush(self.palette().highlight())
|
125
|
+
painter.drawRect(0, 0, progress, self.height())
|
126
|
+
return
|
@@ -25,44 +25,56 @@ from __future__ import annotations
|
|
25
25
|
|
26
26
|
import logging
|
27
27
|
|
28
|
-
from
|
29
|
-
|
30
|
-
from PyQt5.QtGui import QColor, QPaintEvent, QPainter
|
28
|
+
from PyQt5.QtGui import QColor, QPainter, QPaintEvent
|
31
29
|
from PyQt5.QtWidgets import QAbstractButton, QWidget
|
32
30
|
|
33
|
-
from novelwriter
|
31
|
+
from novelwriter import CONFIG
|
32
|
+
from novelwriter.enum import nwTrinary
|
33
|
+
from novelwriter.types import QtBlack, QtPaintAnitAlias
|
34
34
|
|
35
35
|
logger = logging.getLogger(__name__)
|
36
36
|
|
37
37
|
|
38
38
|
class StatusLED(QAbstractButton):
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
__slots__ = (
|
41
|
+
"_neutral", "_postitve", "_negative", "_color", "_state", "_bPx"
|
42
|
+
)
|
43
43
|
|
44
|
-
def __init__(self,
|
45
|
-
sW: int, sH: int, parent: QWidget | None = None) -> None:
|
44
|
+
def __init__(self, sW: int, sH: int, parent: QWidget | None = None) -> None:
|
46
45
|
super().__init__(parent=parent)
|
47
|
-
|
48
|
-
self.
|
49
|
-
self.
|
50
|
-
self.
|
51
|
-
self.
|
52
|
-
|
46
|
+
self._neutral = QtBlack
|
47
|
+
self._postitve = QtBlack
|
48
|
+
self._negative = QtBlack
|
49
|
+
self._color = QtBlack
|
50
|
+
self._state = nwTrinary.NEUTRAL
|
51
|
+
self._bPx = CONFIG.pxInt(1)
|
53
52
|
self.setFixedWidth(sW)
|
54
53
|
self.setFixedHeight(sH)
|
54
|
+
return
|
55
55
|
|
56
|
+
@property
|
57
|
+
def state(self) -> nwTrinary:
|
58
|
+
"""The current state of the LED."""
|
59
|
+
return self._state
|
60
|
+
|
61
|
+
def setColors(self, neutral: QColor, positive: QColor, negative: QColor) -> None:
|
62
|
+
"""Set the three colours for the status values."""
|
63
|
+
self._neutral = neutral
|
64
|
+
self._postitve = positive
|
65
|
+
self._negative = negative
|
66
|
+
self.setState(self._state)
|
56
67
|
return
|
57
68
|
|
58
|
-
def setState(self, state:
|
69
|
+
def setState(self, state: nwTrinary) -> None:
|
59
70
|
"""Set the colour state."""
|
60
|
-
if state ==
|
61
|
-
self.
|
62
|
-
elif state ==
|
63
|
-
self.
|
71
|
+
if state == nwTrinary.POSITIVE:
|
72
|
+
self._color = self._postitve
|
73
|
+
elif state == nwTrinary.NEGATIVE:
|
74
|
+
self._color = self._negative
|
64
75
|
else:
|
65
|
-
self.
|
76
|
+
self._color = self._neutral
|
77
|
+
self._state = state
|
66
78
|
self.update()
|
67
79
|
return
|
68
80
|
|
@@ -70,10 +82,12 @@ class StatusLED(QAbstractButton):
|
|
70
82
|
"""Draw the LED."""
|
71
83
|
painter = QPainter(self)
|
72
84
|
painter.setRenderHint(QtPaintAnitAlias, True)
|
73
|
-
painter.setPen(self.palette().
|
74
|
-
painter.setBrush(self.
|
85
|
+
painter.setPen(self.palette().windowText().color())
|
86
|
+
painter.setBrush(self._color)
|
75
87
|
painter.setOpacity(1.0)
|
76
|
-
painter.drawEllipse(
|
88
|
+
painter.drawEllipse(
|
89
|
+
self._bPx, self._bPx,
|
90
|
+
self.width() - 2*self._bPx,
|
91
|
+
self.height() - 2*self._bPx
|
92
|
+
)
|
77
93
|
return
|
78
|
-
|
79
|
-
# END Class StatusLED
|
novelwriter/extensions/switch.py
CHANGED
@@ -23,12 +23,12 @@ 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.QtGui import QMouseEvent, QPainter, QPaintEvent, QResizeEvent
|
27
26
|
from PyQt5.QtCore import QEvent, QPropertyAnimation, Qt, pyqtProperty
|
28
|
-
from PyQt5.
|
27
|
+
from PyQt5.QtGui import QMouseEvent, QPainter, QPaintEvent, QResizeEvent
|
28
|
+
from PyQt5.QtWidgets import QAbstractButton, QWidget
|
29
29
|
|
30
30
|
from novelwriter import CONFIG, SHARED
|
31
|
-
from novelwriter.types import
|
31
|
+
from novelwriter.types import QtMouseLeft, QtNoPen, QtPaintAnitAlias, QtSizeFixed
|
32
32
|
|
33
33
|
|
34
34
|
class NSwitch(QAbstractButton):
|
@@ -46,7 +46,7 @@ class NSwitch(QAbstractButton):
|
|
46
46
|
self._rR = self._xR - self._rB
|
47
47
|
|
48
48
|
self.setCheckable(True)
|
49
|
-
self.setSizePolicy(
|
49
|
+
self.setSizePolicy(QtSizeFixed, QtSizeFixed)
|
50
50
|
self.setFixedWidth(self._xW)
|
51
51
|
self.setFixedHeight(self._xH)
|
52
52
|
self._offset = self._xR
|
@@ -133,5 +133,3 @@ class NSwitch(QAbstractButton):
|
|
133
133
|
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
134
134
|
super().enterEvent(event)
|
135
135
|
return
|
136
|
-
|
137
|
-
# END Class NSwitch
|
@@ -23,12 +23,15 @@ 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.QtGui import QIcon
|
27
26
|
from PyQt5.QtCore import pyqtSignal
|
28
|
-
from PyQt5.
|
27
|
+
from PyQt5.QtGui import QIcon
|
28
|
+
from PyQt5.QtWidgets import QGridLayout, QLabel, QScrollArea, QWidget
|
29
29
|
|
30
30
|
from novelwriter.extensions.switch import NSwitch
|
31
|
-
from novelwriter.types import
|
31
|
+
from novelwriter.types import (
|
32
|
+
QtAlignLeft, QtAlignRight, QtAlignRightMiddle, QtSizeMinimum,
|
33
|
+
QtSizeMinimumExpanding
|
34
|
+
)
|
32
35
|
|
33
36
|
|
34
37
|
class NSwitchBox(QScrollArea):
|
@@ -59,7 +62,7 @@ class NSwitchBox(QScrollArea):
|
|
59
62
|
self._content.setColumnStretch(1, 1)
|
60
63
|
|
61
64
|
self._widget = QWidget(self)
|
62
|
-
self._widget.setSizePolicy(
|
65
|
+
self._widget.setSizePolicy(QtSizeMinimumExpanding, QtSizeMinimum)
|
63
66
|
self._widget.setLayout(self._content)
|
64
67
|
|
65
68
|
self.setWidgetResizable(True)
|
@@ -124,5 +127,3 @@ class NSwitchBox(QScrollArea):
|
|
124
127
|
self._content.setRowStretch(self._index + 1, 1)
|
125
128
|
self._index += 1
|
126
129
|
return
|
127
|
-
|
128
|
-
# END Class NSwitchBox
|
@@ -26,16 +26,16 @@ from __future__ import annotations
|
|
26
26
|
import json
|
27
27
|
import logging
|
28
28
|
|
29
|
-
from time import sleep
|
30
29
|
from datetime import datetime
|
30
|
+
from time import sleep
|
31
31
|
from urllib.error import HTTPError
|
32
32
|
from urllib.request import Request, urlopen
|
33
33
|
|
34
|
-
from PyQt5.QtGui import QDesktopServices
|
35
34
|
from PyQt5.QtCore import QObject, QRunnable, QUrl, pyqtSignal, pyqtSlot
|
35
|
+
from PyQt5.QtGui import QDesktopServices
|
36
36
|
from PyQt5.QtWidgets import QLabel, QVBoxLayout, QWidget
|
37
37
|
|
38
|
-
from novelwriter import CONFIG, SHARED,
|
38
|
+
from novelwriter import CONFIG, SHARED, __date__, __domain__, __version__
|
39
39
|
from novelwriter.common import formatVersion
|
40
40
|
from novelwriter.constants import nwConst
|
41
41
|
|
@@ -111,8 +111,6 @@ class VersionInfoWidget(QWidget):
|
|
111
111
|
self._lblRelease.setText(self._trLatest.format(reason or self.tr("Failed")))
|
112
112
|
return
|
113
113
|
|
114
|
-
# END Class VersionInfoWidget
|
115
|
-
|
116
114
|
|
117
115
|
class _Retriever(QRunnable):
|
118
116
|
|
@@ -144,10 +142,6 @@ class _Retriever(QRunnable):
|
|
144
142
|
self.signals.dataReady.emit("", str(e))
|
145
143
|
return
|
146
144
|
|
147
|
-
# END Class _Retriever
|
148
|
-
|
149
145
|
|
150
146
|
class _RetrieverSignal(QObject):
|
151
147
|
dataReady = pyqtSignal(str, str)
|
152
|
-
|
153
|
-
# END Class _RetrieverSignal
|