novelWriter 2.1.1__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.1.1.dist-info → novelWriter-2.2rc1.dist-info}/METADATA +3 -3
- {novelWriter-2.1.1.dist-info → novelWriter-2.2rc1.dist-info}/RECORD +105 -76
- novelwriter/__init__.py +6 -24
- novelwriter/assets/i18n/project_de_DE.json +10 -0
- novelwriter/assets/i18n/project_en_GB.json +11 -0
- novelwriter/assets/i18n/project_en_US.json +10 -0
- novelwriter/assets/i18n/project_ja_JP.json +11 -1
- novelwriter/assets/i18n/project_nb_NO.json +10 -0
- novelwriter/assets/i18n/project_nn_NO.json +10 -0
- novelwriter/assets/icons/novelwriter.ico +0 -0
- novelwriter/assets/icons/novelwriter.svg +8 -183
- novelwriter/assets/icons/typicons_dark/icons.conf +17 -2
- 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/nw_tb-bold.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-markdown.svg +8 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-shortcode.svg +8 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +5 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +5 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +5 -0
- novelwriter/assets/icons/typicons_dark/typ_eye.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_th-dot-menu.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +17 -2
- 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/nw_tb-bold.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-markdown.svg +8 -0
- novelwriter/assets/icons/typicons_light/nw_tb-shortcode.svg +8 -0
- novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +5 -0
- novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +5 -0
- novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +5 -0
- novelwriter/assets/icons/typicons_light/typ_eye.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_th-dot-menu.svg +4 -0
- novelwriter/assets/icons/x-novelwriter-project.ico +0 -0
- novelwriter/assets/icons/x-novelwriter-project.svg +7 -206
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -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/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 +7 -0
- novelwriter/assets/text/release_notes.htm +7 -37
- novelwriter/common.py +22 -1
- novelwriter/config.py +27 -42
- novelwriter/constants.py +45 -7
- novelwriter/core/buildsettings.py +40 -24
- novelwriter/core/coretools.py +8 -1
- novelwriter/core/docbuild.py +2 -6
- novelwriter/core/index.py +264 -175
- novelwriter/core/options.py +8 -3
- novelwriter/core/project.py +2 -2
- novelwriter/core/projectdata.py +3 -3
- novelwriter/core/tohtml.py +60 -59
- novelwriter/core/tokenizer.py +110 -70
- novelwriter/core/tomd.py +51 -38
- novelwriter/core/toodt.py +184 -147
- novelwriter/dialogs/preferences.py +75 -106
- novelwriter/dialogs/projsettings.py +101 -110
- novelwriter/dialogs/updates.py +25 -14
- novelwriter/enum.py +28 -3
- novelwriter/extensions/novelselector.py +1 -1
- novelwriter/gui/doceditor.py +1345 -1235
- novelwriter/gui/dochighlight.py +98 -62
- novelwriter/gui/docviewer.py +151 -340
- novelwriter/gui/docviewerpanel.py +457 -0
- novelwriter/gui/editordocument.py +126 -0
- novelwriter/gui/mainmenu.py +350 -300
- novelwriter/gui/noveltree.py +101 -125
- novelwriter/gui/outline.py +154 -171
- novelwriter/gui/projtree.py +480 -380
- novelwriter/gui/sidebar.py +106 -75
- novelwriter/gui/statusbar.py +1 -1
- novelwriter/gui/theme.py +114 -75
- novelwriter/guimain.py +353 -254
- novelwriter/shared.py +36 -3
- novelwriter/tools/dictionaries.py +268 -0
- novelwriter/tools/manusbuild.py +17 -6
- novelwriter/tools/manuscript.py +11 -3
- novelwriter/tools/manussettings.py +0 -14
- novelwriter/tools/projwizard.py +16 -2
- novelwriter/tools/writingstats.py +1 -1
- novelwriter/assets/icons/typicons_dark/typ_at.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-menu.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_at.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-menu.svg +0 -4
- {novelWriter-2.1.1.dist-info → novelWriter-2.2rc1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.1.1.dist-info → novelWriter-2.2rc1.dist-info}/WHEEL +0 -0
- {novelWriter-2.1.1.dist-info → novelWriter-2.2rc1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.1.1.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
|
@@ -677,19 +671,6 @@ class GuiPreferencesEditor(QWidget):
|
|
677
671
|
self.tr("Available languages are determined by your system.")
|
678
672
|
)
|
679
673
|
|
680
|
-
# Big Document Size Limit
|
681
|
-
self.bigDocLimit = QSpinBox(self)
|
682
|
-
self.bigDocLimit.setMinimum(10)
|
683
|
-
self.bigDocLimit.setMaximum(10000)
|
684
|
-
self.bigDocLimit.setSingleStep(10)
|
685
|
-
self.bigDocLimit.setValue(CONFIG.bigDocLimit)
|
686
|
-
self.mainForm.addRow(
|
687
|
-
self.tr("Big document limit"),
|
688
|
-
self.bigDocLimit,
|
689
|
-
self.tr("Full spell checking is disabled above this limit."),
|
690
|
-
unit=self.tr("kB")
|
691
|
-
)
|
692
|
-
|
693
674
|
# Word Count
|
694
675
|
# ==========
|
695
676
|
self.mainForm.addGroupLabel(self.tr("Word Count"))
|
@@ -740,16 +721,12 @@ class GuiPreferencesEditor(QWidget):
|
|
740
721
|
self.mainForm.addGroupLabel(self.tr("Scroll Behaviour"))
|
741
722
|
|
742
723
|
# Scroll Past End
|
743
|
-
self.scrollPastEnd =
|
744
|
-
self.scrollPastEnd.
|
745
|
-
self.scrollPastEnd.setMaximum(100)
|
746
|
-
self.scrollPastEnd.setSingleStep(1)
|
747
|
-
self.scrollPastEnd.setValue(int(CONFIG.scrollPastEnd))
|
724
|
+
self.scrollPastEnd = NSwitch()
|
725
|
+
self.scrollPastEnd.setChecked(CONFIG.scrollPastEnd)
|
748
726
|
self.mainForm.addRow(
|
749
727
|
self.tr("Scroll past end of the document"),
|
750
728
|
self.scrollPastEnd,
|
751
|
-
self.tr("
|
752
|
-
unit=self.tr("lines")
|
729
|
+
self.tr("Also centres the cursor when scrolling.")
|
753
730
|
)
|
754
731
|
|
755
732
|
# Typewriter Scrolling
|
@@ -776,12 +753,10 @@ class GuiPreferencesEditor(QWidget):
|
|
776
753
|
|
777
754
|
return
|
778
755
|
|
779
|
-
def saveValues(self):
|
780
|
-
"""Save the values set for this tab.
|
781
|
-
"""
|
756
|
+
def saveValues(self) -> None:
|
757
|
+
"""Save the values set for this tab."""
|
782
758
|
# Spell Checking
|
783
759
|
CONFIG.spellLanguage = self.spellLanguage.currentData()
|
784
|
-
CONFIG.bigDocLimit = self.bigDocLimit.value()
|
785
760
|
|
786
761
|
# Word Count
|
787
762
|
CONFIG.wordCountTimer = self.wordCountTimer.value()
|
@@ -792,9 +767,9 @@ class GuiPreferencesEditor(QWidget):
|
|
792
767
|
CONFIG.showLineEndings = self.showLineEndings.isChecked()
|
793
768
|
|
794
769
|
# Scroll Behaviour
|
795
|
-
CONFIG.scrollPastEnd = self.scrollPastEnd.value()
|
796
770
|
CONFIG.autoScroll = self.autoScroll.isChecked()
|
797
771
|
CONFIG.autoScrollPos = self.autoScrollPos.value()
|
772
|
+
CONFIG.scrollPastEnd = self.scrollPastEnd.isChecked()
|
798
773
|
|
799
774
|
return
|
800
775
|
|
@@ -803,7 +778,7 @@ class GuiPreferencesEditor(QWidget):
|
|
803
778
|
|
804
779
|
class GuiPreferencesSyntax(QWidget):
|
805
780
|
|
806
|
-
def __init__(self, prefsGui):
|
781
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
807
782
|
super().__init__(parent=prefsGui)
|
808
783
|
|
809
784
|
self.prefsGui = prefsGui
|
@@ -869,9 +844,8 @@ class GuiPreferencesSyntax(QWidget):
|
|
869
844
|
|
870
845
|
return
|
871
846
|
|
872
|
-
def saveValues(self):
|
873
|
-
"""Save the values set for this tab.
|
874
|
-
"""
|
847
|
+
def saveValues(self) -> None:
|
848
|
+
"""Save the values set for this tab."""
|
875
849
|
highlightQuotes = self.highlightQuotes.isChecked()
|
876
850
|
allowOpenSQuote = self.allowOpenSQuote.isChecked()
|
877
851
|
allowOpenDQuote = self.allowOpenDQuote.isChecked()
|
@@ -891,15 +865,14 @@ class GuiPreferencesSyntax(QWidget):
|
|
891
865
|
return
|
892
866
|
|
893
867
|
##
|
894
|
-
# Slots
|
868
|
+
# Private Slots
|
895
869
|
##
|
896
870
|
|
897
|
-
|
898
|
-
|
899
|
-
quotes switch.
|
900
|
-
|
901
|
-
self.
|
902
|
-
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)
|
903
876
|
return
|
904
877
|
|
905
878
|
# END Class GuiPreferencesSyntax
|
@@ -907,7 +880,7 @@ class GuiPreferencesSyntax(QWidget):
|
|
907
880
|
|
908
881
|
class GuiPreferencesAutomation(QWidget):
|
909
882
|
|
910
|
-
def __init__(self, prefsGui):
|
883
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
911
884
|
super().__init__(parent=prefsGui)
|
912
885
|
|
913
886
|
# The Form
|
@@ -1018,9 +991,8 @@ class GuiPreferencesAutomation(QWidget):
|
|
1018
991
|
|
1019
992
|
return
|
1020
993
|
|
1021
|
-
def saveValues(self):
|
1022
|
-
"""Save the values set for this tab.
|
1023
|
-
"""
|
994
|
+
def saveValues(self) -> None:
|
995
|
+
"""Save the values set for this tab."""
|
1024
996
|
# Automatic Features
|
1025
997
|
CONFIG.autoSelect = self.autoSelect.isChecked()
|
1026
998
|
CONFIG.doReplace = self.doReplace.isChecked()
|
@@ -1039,18 +1011,17 @@ class GuiPreferencesAutomation(QWidget):
|
|
1039
1011
|
return
|
1040
1012
|
|
1041
1013
|
##
|
1042
|
-
# Slots
|
1014
|
+
# Private Slots
|
1043
1015
|
##
|
1044
1016
|
|
1045
|
-
|
1046
|
-
|
1047
|
-
replace switch.
|
1048
|
-
|
1049
|
-
self.
|
1050
|
-
self.
|
1051
|
-
self.
|
1052
|
-
self.
|
1053
|
-
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)
|
1054
1025
|
return
|
1055
1026
|
|
1056
1027
|
# END Class GuiPreferencesAutomation
|
@@ -1058,7 +1029,7 @@ class GuiPreferencesAutomation(QWidget):
|
|
1058
1029
|
|
1059
1030
|
class GuiPreferencesQuotes(QWidget):
|
1060
1031
|
|
1061
|
-
def __init__(self, prefsGui):
|
1032
|
+
def __init__(self, prefsGui: GuiPreferences) -> None:
|
1062
1033
|
super().__init__(parent=prefsGui)
|
1063
1034
|
|
1064
1035
|
# The Form
|
@@ -1142,9 +1113,8 @@ class GuiPreferencesQuotes(QWidget):
|
|
1142
1113
|
|
1143
1114
|
return
|
1144
1115
|
|
1145
|
-
def saveValues(self):
|
1146
|
-
"""Save the values set for this tab.
|
1147
|
-
"""
|
1116
|
+
def saveValues(self) -> None:
|
1117
|
+
"""Save the values set for this tab."""
|
1148
1118
|
# Quotation Style
|
1149
1119
|
CONFIG.fmtSQuoteOpen = self.quoteSym["SO"].text()
|
1150
1120
|
CONFIG.fmtSQuoteClose = self.quoteSym["SC"].text()
|
@@ -1153,12 +1123,11 @@ class GuiPreferencesQuotes(QWidget):
|
|
1153
1123
|
return
|
1154
1124
|
|
1155
1125
|
##
|
1156
|
-
#
|
1126
|
+
# Internal Functions
|
1157
1127
|
##
|
1158
1128
|
|
1159
|
-
def _getQuote(self, qType):
|
1160
|
-
"""Dialog for single quote open.
|
1161
|
-
"""
|
1129
|
+
def _getQuote(self, qType: str) -> None:
|
1130
|
+
"""Dialog for single quote open."""
|
1162
1131
|
qtBox = GuiQuoteSelect(self, currentQuote=self.quoteSym[qType].text())
|
1163
1132
|
if qtBox.exec_() == QDialog.Accepted:
|
1164
1133
|
self.quoteSym[qType].setText(qtBox.selectedQuote)
|