novelWriter 2.2b1__py3-none-any.whl → 2.2rc1__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.2b1.dist-info → novelWriter-2.2rc1.dist-info}/METADATA +3 -3
- {novelWriter-2.2b1.dist-info → novelWriter-2.2rc1.dist-info}/RECORD +60 -48
- novelwriter/__init__.py +3 -3
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/icons/novelwriter.ico +0 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +8 -1
- novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_panel.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_eye.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +8 -1
- novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_deco-note.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_panel.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_eye.svg +4 -0
- novelwriter/assets/icons/x-novelwriter-project.ico +0 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/text/release_notes.htm +4 -4
- novelwriter/common.py +22 -1
- novelwriter/config.py +12 -27
- novelwriter/constants.py +20 -3
- novelwriter/core/buildsettings.py +1 -1
- novelwriter/core/coretools.py +6 -1
- novelwriter/core/index.py +100 -34
- novelwriter/core/options.py +3 -0
- novelwriter/core/project.py +2 -2
- novelwriter/core/projectdata.py +1 -1
- novelwriter/core/tohtml.py +9 -3
- novelwriter/core/tokenizer.py +27 -20
- novelwriter/core/tomd.py +4 -0
- novelwriter/core/toodt.py +11 -4
- novelwriter/dialogs/preferences.py +80 -82
- novelwriter/dialogs/updates.py +25 -14
- novelwriter/enum.py +14 -4
- novelwriter/gui/doceditor.py +282 -177
- novelwriter/gui/dochighlight.py +7 -9
- novelwriter/gui/docviewer.py +142 -319
- novelwriter/gui/docviewerpanel.py +457 -0
- novelwriter/gui/editordocument.py +1 -1
- novelwriter/gui/mainmenu.py +16 -7
- novelwriter/gui/outline.py +10 -6
- novelwriter/gui/projtree.py +461 -376
- novelwriter/gui/sidebar.py +3 -3
- novelwriter/gui/statusbar.py +1 -1
- novelwriter/gui/theme.py +21 -2
- novelwriter/guimain.py +86 -32
- novelwriter/shared.py +23 -1
- novelwriter/tools/dictionaries.py +268 -0
- novelwriter/tools/manusbuild.py +17 -6
- novelwriter/tools/manuscript.py +1 -1
- novelwriter/tools/writingstats.py +1 -1
- novelwriter/assets/icons/typicons_dark/typ_at.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_at.svg +0 -4
- {novelWriter-2.2b1.dist-info → novelWriter-2.2rc1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.2b1.dist-info → novelWriter-2.2rc1.dist-info}/WHEEL +0 -0
- {novelWriter-2.2b1.dist-info → novelWriter-2.2rc1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.2b1.dist-info → novelWriter-2.2rc1.dist-info}/top_level.txt +0 -0
@@ -26,7 +26,7 @@ from __future__ import annotations
|
|
26
26
|
import logging
|
27
27
|
|
28
28
|
from PyQt5.QtGui import QFont
|
29
|
-
from PyQt5.QtCore import Qt
|
29
|
+
from PyQt5.QtCore import Qt, pyqtSlot
|
30
30
|
from PyQt5.QtWidgets import (
|
31
31
|
QDialog, QWidget, QComboBox, QSpinBox, QPushButton, QDialogButtonBox,
|
32
32
|
QLineEdit, QFileDialog, QFontDialog, QDoubleSpinBox
|
@@ -43,12 +43,11 @@ logger = logging.getLogger(__name__)
|
|
43
43
|
|
44
44
|
class GuiPreferences(NPagedDialog):
|
45
45
|
|
46
|
-
def __init__(self,
|
47
|
-
super().__init__(parent=
|
46
|
+
def __init__(self, parent: QWidget) -> None:
|
47
|
+
super().__init__(parent=parent)
|
48
48
|
|
49
49
|
logger.debug("Create: GuiPreferences")
|
50
50
|
self.setObjectName("GuiPreferences")
|
51
|
-
|
52
51
|
self.setWindowTitle(self.tr("Preferences"))
|
53
52
|
|
54
53
|
self.tabGeneral = GuiPreferencesGeneral(self)
|
@@ -93,26 +92,27 @@ class GuiPreferences(NPagedDialog):
|
|
93
92
|
##
|
94
93
|
|
95
94
|
@property
|
96
|
-
def updateTheme(self):
|
95
|
+
def updateTheme(self) -> bool:
|
97
96
|
return self._updateTheme
|
98
97
|
|
99
98
|
@property
|
100
|
-
def updateSyntax(self):
|
99
|
+
def updateSyntax(self) -> bool:
|
101
100
|
return self._updateSyntax
|
102
101
|
|
103
102
|
@property
|
104
|
-
def needsRestart(self):
|
103
|
+
def needsRestart(self) -> bool:
|
105
104
|
return self._needsRestart
|
106
105
|
|
107
106
|
@property
|
108
|
-
def refreshTree(self):
|
107
|
+
def refreshTree(self) -> bool:
|
109
108
|
return self._refreshTree
|
110
109
|
|
111
110
|
##
|
112
|
-
# Slots
|
111
|
+
# Private Slots
|
113
112
|
##
|
114
113
|
|
115
|
-
|
114
|
+
@pyqtSlot()
|
115
|
+
def _doSave(self) -> None:
|
116
116
|
"""Trigger all the save functions in the tabs, and collect the
|
117
117
|
status of the saves.
|
118
118
|
"""
|
@@ -132,9 +132,9 @@ class GuiPreferences(NPagedDialog):
|
|
132
132
|
|
133
133
|
return
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
"""
|
135
|
+
@pyqtSlot()
|
136
|
+
def _doClose(self) -> None:
|
137
|
+
"""Close the preferences without saving the changes."""
|
138
138
|
self._saveWindowSize()
|
139
139
|
self.reject()
|
140
140
|
return
|
@@ -143,9 +143,8 @@ class GuiPreferences(NPagedDialog):
|
|
143
143
|
# Internal Functions
|
144
144
|
##
|
145
145
|
|
146
|
-
def _saveWindowSize(self):
|
147
|
-
"""Save the dialog window size.
|
148
|
-
"""
|
146
|
+
def _saveWindowSize(self) -> None:
|
147
|
+
"""Save the dialog window size."""
|
149
148
|
CONFIG.setPreferencesWinSize(self.width(), self.height())
|
150
149
|
return
|
151
150
|
|
@@ -154,7 +153,7 @@ class GuiPreferences(NPagedDialog):
|
|
154
153
|
|
155
154
|
class GuiPreferencesGeneral(QWidget):
|
156
155
|
|
157
|
-
def __init__(self, prefsGui):
|
156
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
158
157
|
super().__init__(parent=prefsGui)
|
159
158
|
|
160
159
|
self.prefsGui = prefsGui
|
@@ -285,9 +284,8 @@ class GuiPreferencesGeneral(QWidget):
|
|
285
284
|
|
286
285
|
return
|
287
286
|
|
288
|
-
def saveValues(self):
|
289
|
-
"""Save the values set for this tab.
|
290
|
-
"""
|
287
|
+
def saveValues(self) -> None:
|
288
|
+
"""Save the values set for this tab."""
|
291
289
|
guiLocale = self.guiLocale.currentData()
|
292
290
|
guiTheme = self.guiTheme.currentData()
|
293
291
|
guiSyntax = self.guiSyntax.currentData()
|
@@ -316,12 +314,12 @@ class GuiPreferencesGeneral(QWidget):
|
|
316
314
|
return
|
317
315
|
|
318
316
|
##
|
319
|
-
# Slots
|
317
|
+
# Private Slots
|
320
318
|
##
|
321
319
|
|
322
|
-
|
323
|
-
|
324
|
-
"""
|
320
|
+
@pyqtSlot()
|
321
|
+
def _selectFont(self) -> None:
|
322
|
+
"""Open the QFontDialog and set a font for the font style."""
|
325
323
|
currFont = QFont()
|
326
324
|
currFont.setFamily(CONFIG.guiFont)
|
327
325
|
currFont.setPointSize(CONFIG.guiFontSize)
|
@@ -336,7 +334,7 @@ class GuiPreferencesGeneral(QWidget):
|
|
336
334
|
|
337
335
|
class GuiPreferencesProjects(QWidget):
|
338
336
|
|
339
|
-
def __init__(self, prefsGui):
|
337
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
340
338
|
super().__init__(parent=prefsGui)
|
341
339
|
|
342
340
|
# The Form
|
@@ -438,9 +436,8 @@ class GuiPreferencesProjects(QWidget):
|
|
438
436
|
|
439
437
|
return
|
440
438
|
|
441
|
-
def saveValues(self):
|
442
|
-
"""Save the values set for this tab.
|
443
|
-
"""
|
439
|
+
def saveValues(self) -> None:
|
440
|
+
"""Save the values set for this tab."""
|
444
441
|
# Automatic Save
|
445
442
|
CONFIG.autoSaveDoc = self.autoSaveDoc.value()
|
446
443
|
CONFIG.autoSaveProj = self.autoSaveProj.value()
|
@@ -457,12 +454,12 @@ class GuiPreferencesProjects(QWidget):
|
|
457
454
|
return
|
458
455
|
|
459
456
|
##
|
460
|
-
# Slots
|
457
|
+
# Private Slots
|
461
458
|
##
|
462
459
|
|
463
|
-
|
464
|
-
|
465
|
-
"""
|
460
|
+
@pyqtSlot()
|
461
|
+
def _backupFolder(self) -> None:
|
462
|
+
"""Open a dialog to select the backup folder."""
|
466
463
|
currDir = self.backupPath or ""
|
467
464
|
newDir = QFileDialog.getExistingDirectory(
|
468
465
|
self, self.tr("Backup Directory"), str(currDir), options=QFileDialog.ShowDirsOnly
|
@@ -472,15 +469,13 @@ class GuiPreferencesProjects(QWidget):
|
|
472
469
|
self.mainForm.setHelpText(
|
473
470
|
self.backupPathRow, self.tr("Path: {0}").format(self.backupPath)
|
474
471
|
)
|
475
|
-
return
|
476
|
-
|
477
|
-
return False
|
472
|
+
return
|
473
|
+
return
|
478
474
|
|
479
|
-
|
480
|
-
|
481
|
-
switch.
|
482
|
-
|
483
|
-
self.askBeforeBackup.setEnabled(theState)
|
475
|
+
@pyqtSlot(bool)
|
476
|
+
def _toggledBackupOnClose(self, state: bool) -> None:
|
477
|
+
"""Toggle switch that depends on the backup on close switch."""
|
478
|
+
self.askBeforeBackup.setEnabled(state)
|
484
479
|
return
|
485
480
|
|
486
481
|
# END Class GuiPreferencesProjects
|
@@ -488,7 +483,7 @@ class GuiPreferencesProjects(QWidget):
|
|
488
483
|
|
489
484
|
class GuiPreferencesDocuments(QWidget):
|
490
485
|
|
491
|
-
def __init__(self, prefsGui):
|
486
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
492
487
|
super().__init__(parent=prefsGui)
|
493
488
|
|
494
489
|
# The Form
|
@@ -604,9 +599,8 @@ class GuiPreferencesDocuments(QWidget):
|
|
604
599
|
|
605
600
|
return
|
606
601
|
|
607
|
-
def saveValues(self):
|
608
|
-
"""Save the values set for this tab.
|
609
|
-
"""
|
602
|
+
def saveValues(self) -> None:
|
603
|
+
"""Save the values set for this tab."""
|
610
604
|
# Text Style
|
611
605
|
CONFIG.setTextFont(self.textFont.text(), self.textSize.value())
|
612
606
|
|
@@ -621,12 +615,12 @@ class GuiPreferencesDocuments(QWidget):
|
|
621
615
|
return
|
622
616
|
|
623
617
|
##
|
624
|
-
# Slots
|
618
|
+
# Private Slots
|
625
619
|
##
|
626
620
|
|
621
|
+
@pyqtSlot()
|
627
622
|
def _selectFont(self):
|
628
|
-
"""Open the QFontDialog and set a font for the font style.
|
629
|
-
"""
|
623
|
+
"""Open the QFontDialog and set a font for the font style."""
|
630
624
|
currFont = QFont()
|
631
625
|
currFont.setFamily(CONFIG.textFont)
|
632
626
|
currFont.setPointSize(CONFIG.textSize)
|
@@ -642,7 +636,7 @@ class GuiPreferencesDocuments(QWidget):
|
|
642
636
|
|
643
637
|
class GuiPreferencesEditor(QWidget):
|
644
638
|
|
645
|
-
def __init__(self, prefsGui):
|
639
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
646
640
|
super().__init__(parent=prefsGui)
|
647
641
|
|
648
642
|
# The Form
|
@@ -726,6 +720,15 @@ class GuiPreferencesEditor(QWidget):
|
|
726
720
|
# ================
|
727
721
|
self.mainForm.addGroupLabel(self.tr("Scroll Behaviour"))
|
728
722
|
|
723
|
+
# Scroll Past End
|
724
|
+
self.scrollPastEnd = NSwitch()
|
725
|
+
self.scrollPastEnd.setChecked(CONFIG.scrollPastEnd)
|
726
|
+
self.mainForm.addRow(
|
727
|
+
self.tr("Scroll past end of the document"),
|
728
|
+
self.scrollPastEnd,
|
729
|
+
self.tr("Also centres the cursor when scrolling.")
|
730
|
+
)
|
731
|
+
|
729
732
|
# Typewriter Scrolling
|
730
733
|
self.autoScroll = NSwitch()
|
731
734
|
self.autoScroll.setChecked(CONFIG.autoScroll)
|
@@ -750,7 +753,7 @@ class GuiPreferencesEditor(QWidget):
|
|
750
753
|
|
751
754
|
return
|
752
755
|
|
753
|
-
def saveValues(self):
|
756
|
+
def saveValues(self) -> None:
|
754
757
|
"""Save the values set for this tab."""
|
755
758
|
# Spell Checking
|
756
759
|
CONFIG.spellLanguage = self.spellLanguage.currentData()
|
@@ -766,6 +769,7 @@ class GuiPreferencesEditor(QWidget):
|
|
766
769
|
# Scroll Behaviour
|
767
770
|
CONFIG.autoScroll = self.autoScroll.isChecked()
|
768
771
|
CONFIG.autoScrollPos = self.autoScrollPos.value()
|
772
|
+
CONFIG.scrollPastEnd = self.scrollPastEnd.isChecked()
|
769
773
|
|
770
774
|
return
|
771
775
|
|
@@ -774,7 +778,7 @@ class GuiPreferencesEditor(QWidget):
|
|
774
778
|
|
775
779
|
class GuiPreferencesSyntax(QWidget):
|
776
780
|
|
777
|
-
def __init__(self, prefsGui):
|
781
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
778
782
|
super().__init__(parent=prefsGui)
|
779
783
|
|
780
784
|
self.prefsGui = prefsGui
|
@@ -840,9 +844,8 @@ class GuiPreferencesSyntax(QWidget):
|
|
840
844
|
|
841
845
|
return
|
842
846
|
|
843
|
-
def saveValues(self):
|
844
|
-
"""Save the values set for this tab.
|
845
|
-
"""
|
847
|
+
def saveValues(self) -> None:
|
848
|
+
"""Save the values set for this tab."""
|
846
849
|
highlightQuotes = self.highlightQuotes.isChecked()
|
847
850
|
allowOpenSQuote = self.allowOpenSQuote.isChecked()
|
848
851
|
allowOpenDQuote = self.allowOpenDQuote.isChecked()
|
@@ -862,15 +865,14 @@ class GuiPreferencesSyntax(QWidget):
|
|
862
865
|
return
|
863
866
|
|
864
867
|
##
|
865
|
-
# Slots
|
868
|
+
# Private Slots
|
866
869
|
##
|
867
870
|
|
868
|
-
|
869
|
-
|
870
|
-
quotes switch.
|
871
|
-
|
872
|
-
self.
|
873
|
-
self.allowOpenDQuote.setEnabled(theState)
|
871
|
+
@pyqtSlot(bool)
|
872
|
+
def _toggleHighlightQuotes(self, state: bool) -> None:
|
873
|
+
"""Toggle switches controlled by the highlight quotes switch."""
|
874
|
+
self.allowOpenSQuote.setEnabled(state)
|
875
|
+
self.allowOpenDQuote.setEnabled(state)
|
874
876
|
return
|
875
877
|
|
876
878
|
# END Class GuiPreferencesSyntax
|
@@ -878,7 +880,7 @@ class GuiPreferencesSyntax(QWidget):
|
|
878
880
|
|
879
881
|
class GuiPreferencesAutomation(QWidget):
|
880
882
|
|
881
|
-
def __init__(self, prefsGui):
|
883
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
882
884
|
super().__init__(parent=prefsGui)
|
883
885
|
|
884
886
|
# The Form
|
@@ -989,9 +991,8 @@ class GuiPreferencesAutomation(QWidget):
|
|
989
991
|
|
990
992
|
return
|
991
993
|
|
992
|
-
def saveValues(self):
|
993
|
-
"""Save the values set for this tab.
|
994
|
-
"""
|
994
|
+
def saveValues(self) -> None:
|
995
|
+
"""Save the values set for this tab."""
|
995
996
|
# Automatic Features
|
996
997
|
CONFIG.autoSelect = self.autoSelect.isChecked()
|
997
998
|
CONFIG.doReplace = self.doReplace.isChecked()
|
@@ -1010,18 +1011,17 @@ class GuiPreferencesAutomation(QWidget):
|
|
1010
1011
|
return
|
1011
1012
|
|
1012
1013
|
##
|
1013
|
-
# Slots
|
1014
|
+
# Private Slots
|
1014
1015
|
##
|
1015
1016
|
|
1016
|
-
|
1017
|
-
|
1018
|
-
replace switch.
|
1019
|
-
|
1020
|
-
self.
|
1021
|
-
self.
|
1022
|
-
self.
|
1023
|
-
self.
|
1024
|
-
self.fmtPadThin.setEnabled(theState)
|
1017
|
+
@pyqtSlot(bool)
|
1018
|
+
def _toggleAutoReplaceMain(self, state: bool) -> None:
|
1019
|
+
"""Toggle switches controlled by the auto replace switch."""
|
1020
|
+
self.doReplaceSQuote.setEnabled(state)
|
1021
|
+
self.doReplaceDQuote.setEnabled(state)
|
1022
|
+
self.doReplaceDash.setEnabled(state)
|
1023
|
+
self.doReplaceDots.setEnabled(state)
|
1024
|
+
self.fmtPadThin.setEnabled(state)
|
1025
1025
|
return
|
1026
1026
|
|
1027
1027
|
# END Class GuiPreferencesAutomation
|
@@ -1029,7 +1029,7 @@ class GuiPreferencesAutomation(QWidget):
|
|
1029
1029
|
|
1030
1030
|
class GuiPreferencesQuotes(QWidget):
|
1031
1031
|
|
1032
|
-
def __init__(self, prefsGui):
|
1032
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
1033
1033
|
super().__init__(parent=prefsGui)
|
1034
1034
|
|
1035
1035
|
# The Form
|
@@ -1113,9 +1113,8 @@ class GuiPreferencesQuotes(QWidget):
|
|
1113
1113
|
|
1114
1114
|
return
|
1115
1115
|
|
1116
|
-
def saveValues(self):
|
1117
|
-
"""Save the values set for this tab.
|
1118
|
-
"""
|
1116
|
+
def saveValues(self) -> None:
|
1117
|
+
"""Save the values set for this tab."""
|
1119
1118
|
# Quotation Style
|
1120
1119
|
CONFIG.fmtSQuoteOpen = self.quoteSym["SO"].text()
|
1121
1120
|
CONFIG.fmtSQuoteClose = self.quoteSym["SC"].text()
|
@@ -1124,12 +1123,11 @@ class GuiPreferencesQuotes(QWidget):
|
|
1124
1123
|
return
|
1125
1124
|
|
1126
1125
|
##
|
1127
|
-
#
|
1126
|
+
# Internal Functions
|
1128
1127
|
##
|
1129
1128
|
|
1130
|
-
def _getQuote(self, qType):
|
1131
|
-
"""Dialog for single quote open.
|
1132
|
-
"""
|
1129
|
+
def _getQuote(self, qType: str) -> None:
|
1130
|
+
"""Dialog for single quote open."""
|
1133
1131
|
qtBox = GuiQuoteSelect(self, currentQuote=self.quoteSym[qType].text())
|
1134
1132
|
if qtBox.exec_() == QDialog.Accepted:
|
1135
1133
|
self.quoteSym[qType].setText(qtBox.selectedQuote)
|
novelwriter/dialogs/updates.py
CHANGED
@@ -29,10 +29,10 @@ import logging
|
|
29
29
|
from datetime import datetime
|
30
30
|
from urllib.request import Request, urlopen
|
31
31
|
|
32
|
-
from PyQt5.QtGui import QCursor
|
33
|
-
from PyQt5.QtCore import Qt
|
32
|
+
from PyQt5.QtGui import QCloseEvent, QCursor
|
33
|
+
from PyQt5.QtCore import Qt, pyqtSlot
|
34
34
|
from PyQt5.QtWidgets import (
|
35
|
-
qApp, QDialog, QHBoxLayout, QVBoxLayout, QDialogButtonBox, QLabel
|
35
|
+
QWidget, qApp, QDialog, QHBoxLayout, QVBoxLayout, QDialogButtonBox, QLabel
|
36
36
|
)
|
37
37
|
|
38
38
|
from novelwriter import CONFIG, SHARED, __version__, __date__
|
@@ -44,8 +44,8 @@ logger = logging.getLogger(__name__)
|
|
44
44
|
|
45
45
|
class GuiUpdates(QDialog):
|
46
46
|
|
47
|
-
def __init__(self,
|
48
|
-
super().__init__(parent=
|
47
|
+
def __init__(self, parent: QWidget) -> None:
|
48
|
+
super().__init__(parent=parent)
|
49
49
|
|
50
50
|
logger.debug("Create: GuiUpdates")
|
51
51
|
self.setObjectName("GuiUpdates")
|
@@ -94,8 +94,8 @@ class GuiUpdates(QDialog):
|
|
94
94
|
self.latestLabel.setFont(hFont)
|
95
95
|
|
96
96
|
# Buttons
|
97
|
-
self.buttonBox = QDialogButtonBox(QDialogButtonBox.
|
98
|
-
self.buttonBox.
|
97
|
+
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Close)
|
98
|
+
self.buttonBox.rejected.connect(self._doClose)
|
99
99
|
|
100
100
|
# Assemble
|
101
101
|
self.innerBox = QHBoxLayout()
|
@@ -114,17 +114,16 @@ class GuiUpdates(QDialog):
|
|
114
114
|
|
115
115
|
return
|
116
116
|
|
117
|
-
def __del__(self): # pragma: no cover
|
117
|
+
def __del__(self) -> None: # pragma: no cover
|
118
118
|
logger.debug("Delete: GuiUpdates")
|
119
119
|
return
|
120
120
|
|
121
|
-
def checkLatest(self):
|
122
|
-
"""Check for latest release.
|
123
|
-
"""
|
121
|
+
def checkLatest(self) -> None:
|
122
|
+
"""Check for latest release."""
|
124
123
|
qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
|
125
124
|
|
126
125
|
urlReq = Request("https://api.github.com/repos/vkbo/novelwriter/releases/latest")
|
127
|
-
urlReq.add_header("User-Agent",
|
126
|
+
urlReq.add_header("User-Agent", nwConst.USER_AGENT)
|
128
127
|
urlReq.add_header("Accept", "application/vnd.github.v3+json")
|
129
128
|
|
130
129
|
rawData = {}
|
@@ -161,10 +160,22 @@ class GuiUpdates(QDialog):
|
|
161
160
|
return
|
162
161
|
|
163
162
|
##
|
164
|
-
#
|
163
|
+
# Events
|
165
164
|
##
|
166
165
|
|
167
|
-
def
|
166
|
+
def closeEvent(self, event: QCloseEvent) -> None:
|
167
|
+
"""Capture the user closing the window."""
|
168
|
+
event.accept()
|
169
|
+
self.deleteLater()
|
170
|
+
return
|
171
|
+
|
172
|
+
##
|
173
|
+
# Private Slots
|
174
|
+
##
|
175
|
+
|
176
|
+
@pyqtSlot()
|
177
|
+
def _doClose(self) -> None:
|
178
|
+
"""Close the dialog."""
|
168
179
|
self.close()
|
169
180
|
return
|
170
181
|
|
novelwriter/enum.py
CHANGED
@@ -61,10 +61,19 @@ class nwItemLayout(Enum):
|
|
61
61
|
# END Enum nwItemLayout
|
62
62
|
|
63
63
|
|
64
|
+
class nwComment(Enum):
|
65
|
+
|
66
|
+
PLAIN = 0
|
67
|
+
SYNOPSIS = 1
|
68
|
+
SHORT = 2
|
69
|
+
|
70
|
+
# END Enum nwComment
|
71
|
+
|
72
|
+
|
64
73
|
class nwTrinary(Enum):
|
65
74
|
|
66
75
|
NEGATIVE = -1
|
67
|
-
|
76
|
+
NEUTRAL = 0
|
68
77
|
POSITIVE = 1
|
69
78
|
|
70
79
|
# END Enum nwTrinary
|
@@ -127,9 +136,10 @@ class nwDocInsert(Enum):
|
|
127
136
|
QUOTE_LD = 3
|
128
137
|
QUOTE_RD = 4
|
129
138
|
SYNOPSIS = 5
|
130
|
-
|
131
|
-
|
132
|
-
|
139
|
+
SHORT = 6
|
140
|
+
NEW_PAGE = 7
|
141
|
+
VSPACE_S = 8
|
142
|
+
VSPACE_M = 9
|
133
143
|
|
134
144
|
# END Enum nwDocInsert
|
135
145
|
|