Preferences/ConfigurationPages/EditorSpellCheckingPage.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3010
befeff46ec0f
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
19 19
20 import Preferences 20 import Preferences
21 import Utilities 21 import Utilities
22 22
23 23
24 class EditorSpellCheckingPage(ConfigurationPageBase, Ui_EditorSpellCheckingPage): 24 class EditorSpellCheckingPage(ConfigurationPageBase,
25 Ui_EditorSpellCheckingPage):
25 """ 26 """
26 Class implementing the Editor Spellchecking configuration page. 27 Class implementing the Editor Spellchecking configuration page.
27 """ 28 """
28 def __init__(self): 29 def __init__(self):
29 """ 30 """
58 Preferences.getEditor("SpellCheckingMinWordSize")) 59 Preferences.getEditor("SpellCheckingMinWordSize"))
59 60
60 self.initColour("SpellingMarkers", self.spellingMarkerButton, 61 self.initColour("SpellingMarkers", self.spellingMarkerButton,
61 Preferences.getEditorColour, hasAlpha=True) 62 Preferences.getEditorColour, hasAlpha=True)
62 63
63 self.pwlEdit.setText(Preferences.getEditor("SpellCheckingPersonalWordList")) 64 self.pwlEdit.setText(
64 self.pelEdit.setText(Preferences.getEditor("SpellCheckingPersonalExcludeList")) 65 Preferences.getEditor("SpellCheckingPersonalWordList"))
66 self.pelEdit.setText(
67 Preferences.getEditor("SpellCheckingPersonalExcludeList"))
65 68
66 if self.spellingFrame.isEnabled(): 69 if self.spellingFrame.isEnabled():
67 self.enabledCheckBox.setChecked( 70 self.enabledCheckBox.setChecked(
68 Preferences.getEditor("AutoSpellCheckingEnabled")) 71 Preferences.getEditor("AutoSpellCheckingEnabled"))
69 else: 72 else:
70 self.enabledCheckBox.setChecked(False) # not available 73 self.enabledCheckBox.setChecked(False) # not available
71 self.chunkSizeSpinBox.setValue(Preferences.getEditor("AutoSpellCheckChunkSize")) 74 self.chunkSizeSpinBox.setValue(
75 Preferences.getEditor("AutoSpellCheckChunkSize"))
72 76
73 def save(self): 77 def save(self):
74 """ 78 """
75 Public slot to save the Editor Search configuration. 79 Public slot to save the Editor Search configuration.
76 """ 80 """
77 Preferences.setEditor("SpellCheckingEnabled", 81 Preferences.setEditor(
78 self.checkingEnabledCheckBox.isChecked()) 82 "SpellCheckingEnabled", self.checkingEnabledCheckBox.isChecked())
79 83
80 Preferences.setEditor("SpellCheckingDefaultLanguage", 84 Preferences.setEditor(
85 "SpellCheckingDefaultLanguage",
81 self.defaultLanguageCombo.currentText()) 86 self.defaultLanguageCombo.currentText())
82 87
83 Preferences.setEditor("SpellCheckStringsOnly", 88 Preferences.setEditor(
84 self.stringsOnlyCheckBox.isChecked()) 89 "SpellCheckStringsOnly", self.stringsOnlyCheckBox.isChecked())
85 Preferences.setEditor("SpellCheckingMinWordSize", 90 Preferences.setEditor(
86 self.minimumWordSizeSlider.value()) 91 "SpellCheckingMinWordSize", self.minimumWordSizeSlider.value())
87 92
88 self.saveColours(Preferences.setEditorColour) 93 self.saveColours(Preferences.setEditorColour)
89 94
90 Preferences.setEditor("SpellCheckingPersonalWordList", self.pwlEdit.text()) 95 Preferences.setEditor(
91 Preferences.setEditor("SpellCheckingPersonalExcludeList", self.pelEdit.text()) 96 "SpellCheckingPersonalWordList", self.pwlEdit.text())
97 Preferences.setEditor(
98 "SpellCheckingPersonalExcludeList", self.pelEdit.text())
92 99
93 Preferences.setEditor("AutoSpellCheckingEnabled", 100 Preferences.setEditor(
94 self.enabledCheckBox.isChecked()) 101 "AutoSpellCheckingEnabled", self.enabledCheckBox.isChecked())
95 Preferences.setEditor("AutoSpellCheckChunkSize", self.chunkSizeSpinBox.value()) 102 Preferences.setEditor(
103 "AutoSpellCheckChunkSize", self.chunkSizeSpinBox.value())
96 104
97 @pyqtSlot() 105 @pyqtSlot()
98 def on_pwlButton_clicked(self): 106 def on_pwlButton_clicked(self):
99 """ 107 """
100 Private method to select the personal word list file. 108 Private method to select the personal word list file.
126 def create(dlg): 134 def create(dlg):
127 """ 135 """
128 Module function to create the configuration page. 136 Module function to create the configuration page.
129 137
130 @param dlg reference to the configuration dialog 138 @param dlg reference to the configuration dialog
139 @return reference to the instantiated page (ConfigurationPageBase)
131 """ 140 """
132 page = EditorSpellCheckingPage() 141 page = EditorSpellCheckingPage()
133 return page 142 return page

eric ide

mercurial