Preferences/ConfigurationPages/EditorSpellCheckingPage.py

changeset 3010
befeff46ec0f
parent 2964
84b65fb9e780
child 3025
67064c71df21
child 3057
10516539f238
equal deleted inserted replaced
3009:bf5ae5d7477d 3010:befeff46ec0f
17 17
18 import Preferences 18 import Preferences
19 import Utilities 19 import Utilities
20 20
21 21
22 class EditorSpellCheckingPage(ConfigurationPageBase, Ui_EditorSpellCheckingPage): 22 class EditorSpellCheckingPage(ConfigurationPageBase,
23 Ui_EditorSpellCheckingPage):
23 """ 24 """
24 Class implementing the Editor Spellchecking configuration page. 25 Class implementing the Editor Spellchecking configuration page.
25 """ 26 """
26 def __init__(self): 27 def __init__(self):
27 """ 28 """
56 Preferences.getEditor("SpellCheckingMinWordSize")) 57 Preferences.getEditor("SpellCheckingMinWordSize"))
57 58
58 self.initColour("SpellingMarkers", self.spellingMarkerButton, 59 self.initColour("SpellingMarkers", self.spellingMarkerButton,
59 Preferences.getEditorColour, hasAlpha=True) 60 Preferences.getEditorColour, hasAlpha=True)
60 61
61 self.pwlEdit.setText(Preferences.getEditor("SpellCheckingPersonalWordList")) 62 self.pwlEdit.setText(
62 self.pelEdit.setText(Preferences.getEditor("SpellCheckingPersonalExcludeList")) 63 Preferences.getEditor("SpellCheckingPersonalWordList"))
64 self.pelEdit.setText(
65 Preferences.getEditor("SpellCheckingPersonalExcludeList"))
63 66
64 if self.spellingFrame.isEnabled(): 67 if self.spellingFrame.isEnabled():
65 self.enabledCheckBox.setChecked( 68 self.enabledCheckBox.setChecked(
66 Preferences.getEditor("AutoSpellCheckingEnabled")) 69 Preferences.getEditor("AutoSpellCheckingEnabled"))
67 else: 70 else:
68 self.enabledCheckBox.setChecked(False) # not available 71 self.enabledCheckBox.setChecked(False) # not available
69 self.chunkSizeSpinBox.setValue(Preferences.getEditor("AutoSpellCheckChunkSize")) 72 self.chunkSizeSpinBox.setValue(
73 Preferences.getEditor("AutoSpellCheckChunkSize"))
70 74
71 def save(self): 75 def save(self):
72 """ 76 """
73 Public slot to save the Editor Search configuration. 77 Public slot to save the Editor Search configuration.
74 """ 78 """
75 Preferences.setEditor("SpellCheckingEnabled", 79 Preferences.setEditor(
76 self.checkingEnabledCheckBox.isChecked()) 80 "SpellCheckingEnabled", self.checkingEnabledCheckBox.isChecked())
77 81
78 Preferences.setEditor("SpellCheckingDefaultLanguage", 82 Preferences.setEditor(
83 "SpellCheckingDefaultLanguage",
79 self.defaultLanguageCombo.currentText()) 84 self.defaultLanguageCombo.currentText())
80 85
81 Preferences.setEditor("SpellCheckStringsOnly", 86 Preferences.setEditor(
82 self.stringsOnlyCheckBox.isChecked()) 87 "SpellCheckStringsOnly", self.stringsOnlyCheckBox.isChecked())
83 Preferences.setEditor("SpellCheckingMinWordSize", 88 Preferences.setEditor(
84 self.minimumWordSizeSlider.value()) 89 "SpellCheckingMinWordSize", self.minimumWordSizeSlider.value())
85 90
86 self.saveColours(Preferences.setEditorColour) 91 self.saveColours(Preferences.setEditorColour)
87 92
88 Preferences.setEditor("SpellCheckingPersonalWordList", self.pwlEdit.text()) 93 Preferences.setEditor(
89 Preferences.setEditor("SpellCheckingPersonalExcludeList", self.pelEdit.text()) 94 "SpellCheckingPersonalWordList", self.pwlEdit.text())
95 Preferences.setEditor(
96 "SpellCheckingPersonalExcludeList", self.pelEdit.text())
90 97
91 Preferences.setEditor("AutoSpellCheckingEnabled", 98 Preferences.setEditor(
92 self.enabledCheckBox.isChecked()) 99 "AutoSpellCheckingEnabled", self.enabledCheckBox.isChecked())
93 Preferences.setEditor("AutoSpellCheckChunkSize", self.chunkSizeSpinBox.value()) 100 Preferences.setEditor(
101 "AutoSpellCheckChunkSize", self.chunkSizeSpinBox.value())
94 102
95 @pyqtSlot() 103 @pyqtSlot()
96 def on_pwlButton_clicked(self): 104 def on_pwlButton_clicked(self):
97 """ 105 """
98 Private method to select the personal word list file. 106 Private method to select the personal word list file.

eric ide

mercurial