novelWriter 2.3rc1__py3-none-any.whl → 2.4__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.3rc1.dist-info → novelWriter-2.4.dist-info}/METADATA +5 -6
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4.dist-info}/RECORD +119 -109
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4.dist-info}/WHEEL +1 -1
- novelWriter-2.4.dist-info/entry_points.txt +2 -0
- novelwriter/__init__.py +17 -10
- 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_pt_BR.qm +0 -0
- novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
- novelwriter/assets/i18n/project_nl_NL.json +11 -0
- novelwriter/assets/i18n/project_pt_BR.json +11 -0
- novelwriter/assets/icons/none.svg +4 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_times.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_unfold-hidden.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_unfold-visible.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_times.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_unfold-hidden.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_unfold-visible.svg +4 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +26 -0
- novelwriter/assets/syntax/default_dark.conf +1 -0
- novelwriter/assets/syntax/default_light.conf +1 -0
- novelwriter/assets/syntax/grey_dark.conf +1 -0
- novelwriter/assets/syntax/grey_light.conf +1 -0
- novelwriter/assets/syntax/light_owl.conf +1 -0
- novelwriter/assets/syntax/night_owl.conf +1 -0
- novelwriter/assets/syntax/solarized_dark.conf +1 -0
- novelwriter/assets/syntax/solarized_light.conf +1 -0
- novelwriter/assets/syntax/tango.conf +23 -0
- novelwriter/assets/syntax/tomorrow.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_blue.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_bright.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +1 -0
- novelwriter/assets/text/credits_en.htm +25 -23
- novelwriter/assets/themes/cyberpunk_night.conf +29 -0
- novelwriter/common.py +12 -4
- novelwriter/config.py +47 -16
- novelwriter/constants.py +5 -6
- novelwriter/core/buildsettings.py +64 -44
- novelwriter/core/coretools.py +97 -13
- novelwriter/core/docbuild.py +74 -7
- novelwriter/core/document.py +24 -3
- novelwriter/core/index.py +31 -112
- novelwriter/core/project.py +11 -15
- novelwriter/core/projectxml.py +3 -2
- novelwriter/core/sessions.py +2 -2
- novelwriter/core/spellcheck.py +3 -3
- novelwriter/core/status.py +6 -5
- novelwriter/core/storage.py +16 -6
- novelwriter/core/tohtml.py +22 -25
- novelwriter/core/tokenizer.py +417 -237
- novelwriter/core/tomd.py +17 -8
- novelwriter/core/toodt.py +386 -351
- novelwriter/core/tree.py +8 -8
- novelwriter/dialogs/about.py +10 -12
- novelwriter/dialogs/docmerge.py +17 -14
- novelwriter/dialogs/docsplit.py +20 -19
- novelwriter/dialogs/editlabel.py +5 -4
- novelwriter/dialogs/preferences.py +32 -40
- novelwriter/dialogs/projectsettings.py +31 -28
- novelwriter/dialogs/quotes.py +10 -9
- novelwriter/dialogs/wordlist.py +18 -15
- novelwriter/enum.py +17 -14
- novelwriter/error.py +14 -12
- novelwriter/extensions/circularprogress.py +12 -8
- novelwriter/extensions/configlayout.py +23 -3
- novelwriter/extensions/modified.py +51 -2
- novelwriter/extensions/pagedsidebar.py +16 -14
- novelwriter/extensions/simpleprogress.py +3 -1
- novelwriter/extensions/statusled.py +3 -1
- novelwriter/extensions/switch.py +10 -9
- novelwriter/extensions/switchbox.py +14 -13
- novelwriter/extensions/versioninfo.py +1 -1
- novelwriter/gui/doceditor.py +433 -496
- novelwriter/gui/dochighlight.py +54 -33
- novelwriter/gui/docviewer.py +162 -175
- novelwriter/gui/docviewerpanel.py +20 -37
- novelwriter/gui/editordocument.py +15 -4
- novelwriter/gui/itemdetails.py +51 -54
- novelwriter/gui/mainmenu.py +37 -17
- novelwriter/gui/noveltree.py +31 -37
- novelwriter/gui/outline.py +120 -98
- novelwriter/gui/projtree.py +114 -112
- novelwriter/gui/search.py +362 -0
- novelwriter/gui/sidebar.py +36 -45
- novelwriter/gui/statusbar.py +14 -14
- novelwriter/gui/theme.py +116 -34
- novelwriter/guimain.py +216 -207
- novelwriter/shared.py +31 -6
- novelwriter/text/counting.py +138 -0
- novelwriter/tools/dictionaries.py +15 -14
- novelwriter/tools/lipsum.py +20 -17
- novelwriter/tools/manusbuild.py +43 -35
- novelwriter/tools/manuscript.py +381 -104
- novelwriter/tools/manussettings.py +263 -125
- novelwriter/tools/noveldetails.py +21 -19
- novelwriter/tools/welcome.py +59 -57
- novelwriter/tools/writingstats.py +61 -55
- novelwriter/types.py +90 -0
- novelWriter-2.3rc1.dist-info/entry_points.txt +0 -5
- novelwriter/core/__init__.py +0 -3
- novelwriter/dialogs/__init__.py +0 -3
- novelwriter/extensions/__init__.py +0 -3
- novelwriter/gui/__init__.py +0 -3
- novelwriter/tools/__init__.py +0 -3
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4.dist-info}/top_level.txt +0 -0
@@ -29,18 +29,23 @@ import logging
|
|
29
29
|
from datetime import datetime
|
30
30
|
from typing import TYPE_CHECKING
|
31
31
|
|
32
|
-
from PyQt5.QtGui import QCloseEvent, QPixmap, QCursor
|
33
32
|
from PyQt5.QtCore import Qt, pyqtSlot
|
33
|
+
from PyQt5.QtGui import QCloseEvent, QCursor, QPixmap
|
34
34
|
from PyQt5.QtWidgets import (
|
35
|
-
|
36
|
-
|
35
|
+
QAction, QApplication, QDialog, QDialogButtonBox, QFileDialog, QGridLayout,
|
36
|
+
QGroupBox, QHBoxLayout, QLabel, QMenu, QSpinBox, QTreeWidget,
|
37
|
+
QTreeWidgetItem
|
37
38
|
)
|
38
39
|
|
39
40
|
from novelwriter import CONFIG, SHARED
|
40
|
-
from novelwriter.error import formatException
|
41
41
|
from novelwriter.common import formatTime, checkInt, checkIntTuple, minmax
|
42
42
|
from novelwriter.constants import nwConst
|
43
|
+
from novelwriter.error import formatException
|
43
44
|
from novelwriter.extensions.switch import NSwitch
|
45
|
+
from novelwriter.types import (
|
46
|
+
QtAlignLeftMiddle, QtAlignRight, QtAlignRightMiddle, QtDecoration,
|
47
|
+
QtDialogClose, QtRoleAction
|
48
|
+
)
|
44
49
|
|
45
50
|
if TYPE_CHECKING: # pragma: no cover
|
46
51
|
from novelwriter.guimain import GuiMain
|
@@ -100,7 +105,7 @@ class GuiWritingStats(QDialog):
|
|
100
105
|
pOptions.getInt("GuiWritingStats", "widthCol3", 80)
|
101
106
|
)
|
102
107
|
|
103
|
-
self.listBox = QTreeWidget()
|
108
|
+
self.listBox = QTreeWidget(self)
|
104
109
|
self.listBox.setHeaderLabels([
|
105
110
|
self.tr("Session Start"),
|
106
111
|
self.tr("Length"),
|
@@ -116,14 +121,15 @@ class GuiWritingStats(QDialog):
|
|
116
121
|
|
117
122
|
hHeader = self.listBox.headerItem()
|
118
123
|
if hHeader is not None:
|
119
|
-
hHeader.setTextAlignment(self.C_LENGTH,
|
120
|
-
hHeader.setTextAlignment(self.C_IDLE,
|
121
|
-
hHeader.setTextAlignment(self.C_COUNT,
|
124
|
+
hHeader.setTextAlignment(self.C_LENGTH, QtAlignRight)
|
125
|
+
hHeader.setTextAlignment(self.C_IDLE, QtAlignRight)
|
126
|
+
hHeader.setTextAlignment(self.C_COUNT, QtAlignRight)
|
122
127
|
|
128
|
+
sDec = Qt.SortOrder.DescendingOrder
|
129
|
+
sAsc = Qt.SortOrder.AscendingOrder
|
123
130
|
sortCol = minmax(pOptions.getInt("GuiWritingStats", "sortCol", 0), 0, 2)
|
124
131
|
sortOrder = checkIntTuple(
|
125
|
-
pOptions.getInt("GuiWritingStats", "sortOrder",
|
126
|
-
(Qt.AscendingOrder, Qt.DescendingOrder), Qt.DescendingOrder
|
132
|
+
pOptions.getInt("GuiWritingStats", "sortOrder", sDec), (sAsc, sDec), sDec
|
127
133
|
)
|
128
134
|
self.listBox.sortByColumn(sortCol, sortOrder) # type: ignore
|
129
135
|
self.listBox.setSortingEnabled(True)
|
@@ -139,36 +145,36 @@ class GuiWritingStats(QDialog):
|
|
139
145
|
self.infoForm = QGridLayout(self)
|
140
146
|
self.infoBox.setLayout(self.infoForm)
|
141
147
|
|
142
|
-
self.labelTotal = QLabel(formatTime(0))
|
148
|
+
self.labelTotal = QLabel(formatTime(0), self)
|
143
149
|
self.labelTotal.setFont(SHARED.theme.guiFontFixed)
|
144
|
-
self.labelTotal.setAlignment(
|
150
|
+
self.labelTotal.setAlignment(QtAlignRightMiddle)
|
145
151
|
|
146
|
-
self.labelIdleT = QLabel(formatTime(0))
|
152
|
+
self.labelIdleT = QLabel(formatTime(0), self)
|
147
153
|
self.labelIdleT.setFont(SHARED.theme.guiFontFixed)
|
148
|
-
self.labelIdleT.setAlignment(
|
154
|
+
self.labelIdleT.setAlignment(QtAlignRightMiddle)
|
149
155
|
|
150
|
-
self.labelFilter = QLabel(formatTime(0))
|
156
|
+
self.labelFilter = QLabel(formatTime(0), self)
|
151
157
|
self.labelFilter.setFont(SHARED.theme.guiFontFixed)
|
152
|
-
self.labelFilter.setAlignment(
|
158
|
+
self.labelFilter.setAlignment(QtAlignRightMiddle)
|
153
159
|
|
154
|
-
self.novelWords = QLabel("0")
|
160
|
+
self.novelWords = QLabel("0", self)
|
155
161
|
self.novelWords.setFont(SHARED.theme.guiFontFixed)
|
156
|
-
self.novelWords.setAlignment(
|
162
|
+
self.novelWords.setAlignment(QtAlignRightMiddle)
|
157
163
|
|
158
|
-
self.notesWords = QLabel("0")
|
164
|
+
self.notesWords = QLabel("0", self)
|
159
165
|
self.notesWords.setFont(SHARED.theme.guiFontFixed)
|
160
|
-
self.notesWords.setAlignment(
|
166
|
+
self.notesWords.setAlignment(QtAlignRightMiddle)
|
161
167
|
|
162
|
-
self.totalWords = QLabel("0")
|
168
|
+
self.totalWords = QLabel("0", self)
|
163
169
|
self.totalWords.setFont(SHARED.theme.guiFontFixed)
|
164
|
-
self.totalWords.setAlignment(
|
170
|
+
self.totalWords.setAlignment(QtAlignRightMiddle)
|
165
171
|
|
166
|
-
lblTTime = QLabel(self.tr("Total Time:"))
|
167
|
-
lblITime = QLabel(self.tr("Idle Time:"))
|
168
|
-
lblFTime = QLabel(self.tr("Filtered Time:"))
|
169
|
-
lblNvCount = QLabel(self.tr("Novel Word Count:"))
|
170
|
-
lblNtCount = QLabel(self.tr("Notes Word Count:"))
|
171
|
-
lblTtCount = QLabel(self.tr("Total Word Count:"))
|
172
|
+
lblTTime = QLabel(self.tr("Total Time:"), self)
|
173
|
+
lblITime = QLabel(self.tr("Idle Time:"), self)
|
174
|
+
lblFTime = QLabel(self.tr("Filtered Time:"), self)
|
175
|
+
lblNvCount = QLabel(self.tr("Novel Word Count:"), self)
|
176
|
+
lblNtCount = QLabel(self.tr("Notes Word Count:"), self)
|
177
|
+
lblTtCount = QLabel(self.tr("Total Word Count:"), self)
|
172
178
|
|
173
179
|
self.infoForm.addWidget(lblTTime, 0, 0)
|
174
180
|
self.infoForm.addWidget(lblITime, 1, 0)
|
@@ -187,54 +193,54 @@ class GuiWritingStats(QDialog):
|
|
187
193
|
self.infoForm.setRowStretch(6, 1)
|
188
194
|
|
189
195
|
# Filter Options
|
190
|
-
|
196
|
+
iPx = SHARED.theme.baseIconHeight
|
191
197
|
|
192
198
|
self.filterBox = QGroupBox(self.tr("Filters"), self)
|
193
199
|
self.filterForm = QGridLayout(self)
|
194
200
|
self.filterBox.setLayout(self.filterForm)
|
195
201
|
|
196
|
-
self.incNovel = NSwitch(self, height=
|
202
|
+
self.incNovel = NSwitch(self, height=iPx)
|
197
203
|
self.incNovel.setChecked(
|
198
204
|
pOptions.getBool("GuiWritingStats", "incNovel", True)
|
199
205
|
)
|
200
206
|
self.incNovel.clicked.connect(self._updateListBox)
|
201
207
|
|
202
|
-
self.incNotes = NSwitch(self, height=
|
208
|
+
self.incNotes = NSwitch(self, height=iPx)
|
203
209
|
self.incNotes.setChecked(
|
204
210
|
pOptions.getBool("GuiWritingStats", "incNotes", True)
|
205
211
|
)
|
206
212
|
self.incNotes.clicked.connect(self._updateListBox)
|
207
213
|
|
208
|
-
self.hideZeros = NSwitch(self, height=
|
214
|
+
self.hideZeros = NSwitch(self, height=iPx)
|
209
215
|
self.hideZeros.setChecked(
|
210
216
|
pOptions.getBool("GuiWritingStats", "hideZeros", True)
|
211
217
|
)
|
212
218
|
self.hideZeros.clicked.connect(self._updateListBox)
|
213
219
|
|
214
|
-
self.hideNegative = NSwitch(self, height=
|
220
|
+
self.hideNegative = NSwitch(self, height=iPx)
|
215
221
|
self.hideNegative.setChecked(
|
216
222
|
pOptions.getBool("GuiWritingStats", "hideNegative", False)
|
217
223
|
)
|
218
224
|
self.hideNegative.clicked.connect(self._updateListBox)
|
219
225
|
|
220
|
-
self.groupByDay = NSwitch(self, height=
|
226
|
+
self.groupByDay = NSwitch(self, height=iPx)
|
221
227
|
self.groupByDay.setChecked(
|
222
228
|
pOptions.getBool("GuiWritingStats", "groupByDay", False)
|
223
229
|
)
|
224
230
|
self.groupByDay.clicked.connect(self._updateListBox)
|
225
231
|
|
226
|
-
self.showIdleTime = NSwitch(self, height=
|
232
|
+
self.showIdleTime = NSwitch(self, height=iPx)
|
227
233
|
self.showIdleTime.setChecked(
|
228
234
|
pOptions.getBool("GuiWritingStats", "showIdleTime", False)
|
229
235
|
)
|
230
236
|
self.showIdleTime.clicked.connect(self._updateListBox)
|
231
237
|
|
232
|
-
self.filterForm.addWidget(QLabel(self.tr("Count novel files")), 0, 0)
|
233
|
-
self.filterForm.addWidget(QLabel(self.tr("Count note files")), 1, 0)
|
234
|
-
self.filterForm.addWidget(QLabel(self.tr("Hide zero word count")), 2, 0)
|
235
|
-
self.filterForm.addWidget(QLabel(self.tr("Hide negative word count")), 3, 0)
|
236
|
-
self.filterForm.addWidget(QLabel(self.tr("Group entries by day")), 4, 0)
|
237
|
-
self.filterForm.addWidget(QLabel(self.tr("Show idle time")), 5, 0)
|
238
|
+
self.filterForm.addWidget(QLabel(self.tr("Count novel files"), self), 0, 0)
|
239
|
+
self.filterForm.addWidget(QLabel(self.tr("Count note files"), self), 1, 0)
|
240
|
+
self.filterForm.addWidget(QLabel(self.tr("Hide zero word count"), self), 2, 0)
|
241
|
+
self.filterForm.addWidget(QLabel(self.tr("Hide negative word count"), self), 3, 0)
|
242
|
+
self.filterForm.addWidget(QLabel(self.tr("Group entries by day"), self), 4, 0)
|
243
|
+
self.filterForm.addWidget(QLabel(self.tr("Show idle time"), self), 5, 0)
|
238
244
|
self.filterForm.addWidget(self.incNovel, 0, 1)
|
239
245
|
self.filterForm.addWidget(self.incNotes, 1, 1)
|
240
246
|
self.filterForm.addWidget(self.hideZeros, 2, 1)
|
@@ -255,17 +261,17 @@ class GuiWritingStats(QDialog):
|
|
255
261
|
|
256
262
|
self.optsBox = QHBoxLayout()
|
257
263
|
self.optsBox.addStretch(1)
|
258
|
-
self.optsBox.addWidget(QLabel(self.tr("Word count cap for the histogram")), 0)
|
264
|
+
self.optsBox.addWidget(QLabel(self.tr("Word count cap for the histogram"), self), 0)
|
259
265
|
self.optsBox.addWidget(self.histMax, 0)
|
260
266
|
|
261
267
|
# Buttons
|
262
|
-
self.buttonBox = QDialogButtonBox()
|
268
|
+
self.buttonBox = QDialogButtonBox(self)
|
263
269
|
self.buttonBox.rejected.connect(self._doClose)
|
264
270
|
|
265
|
-
self.btnClose = self.buttonBox.addButton(
|
271
|
+
self.btnClose = self.buttonBox.addButton(QtDialogClose)
|
266
272
|
self.btnClose.setAutoDefault(False)
|
267
273
|
|
268
|
-
self.btnSave = self.buttonBox.addButton(self.tr("Save As"),
|
274
|
+
self.btnSave = self.buttonBox.addButton(self.tr("Save As"), QtRoleAction)
|
269
275
|
self.btnSave.setAutoDefault(False)
|
270
276
|
|
271
277
|
self.saveMenu = QMenu(self)
|
@@ -300,10 +306,10 @@ class GuiWritingStats(QDialog):
|
|
300
306
|
|
301
307
|
def populateGUI(self) -> None:
|
302
308
|
"""Populate list box with data from the log file."""
|
303
|
-
|
309
|
+
QApplication.setOverrideCursor(QCursor(Qt.CursorShape.WaitCursor))
|
304
310
|
self._loadLogFile()
|
305
311
|
self._updateListBox()
|
306
|
-
|
312
|
+
QApplication.restoreOverrideCursor()
|
307
313
|
return
|
308
314
|
|
309
315
|
##
|
@@ -569,6 +575,8 @@ class GuiWritingStats(QDialog):
|
|
569
575
|
pcTotal = wcTotal
|
570
576
|
|
571
577
|
# Populate the list
|
578
|
+
mTrans = Qt.TransformationMode.FastTransformation
|
579
|
+
mAspect = Qt.AspectRatioMode.IgnoreAspectRatio
|
572
580
|
showIdleTime = self.showIdleTime.isChecked()
|
573
581
|
for _, sStart, sDiff, nWords, _, _, sIdle in self.filterData:
|
574
582
|
|
@@ -587,16 +595,14 @@ class GuiWritingStats(QDialog):
|
|
587
595
|
if nWords > 0 and listMax > 0:
|
588
596
|
wBar = self.barImage.scaled(
|
589
597
|
int(200*min(nWords, histMax)/listMax),
|
590
|
-
self.barHeight,
|
591
|
-
Qt.IgnoreAspectRatio,
|
592
|
-
Qt.FastTransformation
|
598
|
+
self.barHeight, mAspect, mTrans
|
593
599
|
)
|
594
|
-
newItem.setData(self.C_BAR,
|
600
|
+
newItem.setData(self.C_BAR, QtDecoration, wBar)
|
595
601
|
|
596
|
-
newItem.setTextAlignment(self.C_LENGTH,
|
597
|
-
newItem.setTextAlignment(self.C_IDLE,
|
598
|
-
newItem.setTextAlignment(self.C_COUNT,
|
599
|
-
newItem.setTextAlignment(self.C_BAR,
|
602
|
+
newItem.setTextAlignment(self.C_LENGTH, QtAlignRight)
|
603
|
+
newItem.setTextAlignment(self.C_IDLE, QtAlignRight)
|
604
|
+
newItem.setTextAlignment(self.C_COUNT, QtAlignRight)
|
605
|
+
newItem.setTextAlignment(self.C_BAR, QtAlignLeftMiddle)
|
600
606
|
|
601
607
|
newItem.setFont(self.C_TIME, SHARED.theme.guiFontFixed)
|
602
608
|
newItem.setFont(self.C_LENGTH, SHARED.theme.guiFontFixed)
|
novelwriter/types.py
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
"""
|
2
|
+
novelWriter – Types and Flags
|
3
|
+
=============================
|
4
|
+
|
5
|
+
File History:
|
6
|
+
Created: 2024-04-01 [2.4rc1]
|
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 PyQt5.QtCore import Qt
|
27
|
+
from PyQt5.QtGui import QColor, QPainter, QTextCursor
|
28
|
+
from PyQt5.QtWidgets import QDialogButtonBox, QStyle
|
29
|
+
|
30
|
+
# Qt Alignment Flags
|
31
|
+
|
32
|
+
QtAlignAbsolute = Qt.AlignmentFlag.AlignAbsolute
|
33
|
+
QtAlignCenter = Qt.AlignmentFlag.AlignCenter
|
34
|
+
QtAlignCenterTop = Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignTop
|
35
|
+
QtAlignJustify = Qt.AlignmentFlag.AlignJustify
|
36
|
+
QtAlignLeft = Qt.AlignmentFlag.AlignLeft
|
37
|
+
QtAlignLeftBase = Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignBaseline
|
38
|
+
QtAlignLeftMiddle = Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter
|
39
|
+
QtAlignLeftTop = Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignTop
|
40
|
+
QtAlignMiddle = Qt.AlignmentFlag.AlignVCenter
|
41
|
+
QtAlignRight = Qt.AlignmentFlag.AlignRight
|
42
|
+
QtAlignRightBase = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignBaseline
|
43
|
+
QtAlignRightMiddle = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter
|
44
|
+
QtAlignRightTop = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignTop
|
45
|
+
QtAlignTop = Qt.AlignmentFlag.AlignTop
|
46
|
+
|
47
|
+
# Qt Painter Types
|
48
|
+
|
49
|
+
QtTransparent = QColor(0, 0, 0, 0)
|
50
|
+
QtNoBrush = Qt.BrushStyle.NoBrush
|
51
|
+
QtNoPen = Qt.PenStyle.NoPen
|
52
|
+
QtRoundCap = Qt.PenCapStyle.RoundCap
|
53
|
+
QtSolidLine = Qt.PenStyle.SolidLine
|
54
|
+
QtPaintAnitAlias = QPainter.RenderHint.Antialiasing
|
55
|
+
QtMouseOver = QStyle.StateFlag.State_MouseOver
|
56
|
+
QtSelected = QStyle.StateFlag.State_Selected
|
57
|
+
|
58
|
+
# Qt Tree and Table Types
|
59
|
+
|
60
|
+
QtDecoration = Qt.ItemDataRole.DecorationRole
|
61
|
+
QtUserRole = Qt.ItemDataRole.UserRole
|
62
|
+
|
63
|
+
# Keyboard and Mouse Buttons
|
64
|
+
|
65
|
+
QtModCtrl = Qt.KeyboardModifier.ControlModifier
|
66
|
+
QtModeNone = Qt.KeyboardModifier.NoModifier
|
67
|
+
QtModShift = Qt.KeyboardModifier.ShiftModifier
|
68
|
+
QtMouseLeft = Qt.MouseButton.LeftButton
|
69
|
+
QtMouseMiddle = Qt.MouseButton.MiddleButton
|
70
|
+
|
71
|
+
# Dialog Button Box Types
|
72
|
+
|
73
|
+
QtDialogApply = QDialogButtonBox.StandardButton.Apply
|
74
|
+
QtDialogCancel = QDialogButtonBox.StandardButton.Cancel
|
75
|
+
QtDialogClose = QDialogButtonBox.StandardButton.Close
|
76
|
+
QtDialogOk = QDialogButtonBox.StandardButton.Ok
|
77
|
+
QtDialogReset = QDialogButtonBox.StandardButton.Reset
|
78
|
+
QtDialogSave = QDialogButtonBox.StandardButton.Save
|
79
|
+
|
80
|
+
QtRoleAccept = QDialogButtonBox.ButtonRole.AcceptRole
|
81
|
+
QtRoleAction = QDialogButtonBox.ButtonRole.ActionRole
|
82
|
+
QtRoleApply = QDialogButtonBox.ButtonRole.ApplyRole
|
83
|
+
QtRoleReject = QDialogButtonBox.ButtonRole.RejectRole
|
84
|
+
|
85
|
+
# Cursor Types
|
86
|
+
|
87
|
+
QtKeepAnchor = QTextCursor.MoveMode.KeepAnchor
|
88
|
+
QtMoveAnchor = QTextCursor.MoveMode.MoveAnchor
|
89
|
+
QtMoveLeft = QTextCursor.MoveOperation.Left
|
90
|
+
QtMoveRight = QTextCursor.MoveOperation.Right
|
novelwriter/core/__init__.py
DELETED
novelwriter/dialogs/__init__.py
DELETED
novelwriter/gui/__init__.py
DELETED
novelwriter/tools/__init__.py
DELETED
File without changes
|
File without changes
|