17 |
17 |
18 class EditorPropertiesPage(ConfigurationPageBase, Ui_EditorPropertiesPage): |
18 class EditorPropertiesPage(ConfigurationPageBase, Ui_EditorPropertiesPage): |
19 """ |
19 """ |
20 Class implementing the Editor Properties configuration page. |
20 Class implementing the Editor Properties configuration page. |
21 """ |
21 """ |
|
22 |
22 def __init__(self, lexers): |
23 def __init__(self, lexers): |
23 """ |
24 """ |
24 Constructor |
25 Constructor |
25 |
26 |
26 @param lexers reference to the lexers dictionary |
27 @param lexers reference to the lexers dictionary |
27 """ |
28 """ |
28 super().__init__() |
29 super().__init__() |
29 self.setupUi(self) |
30 self.setupUi(self) |
30 self.setObjectName("EditorPropertiesPage") |
31 self.setObjectName("EditorPropertiesPage") |
31 |
32 |
32 self.languages = sorted(list(lexers.keys())[:]) |
33 self.languages = sorted(list(lexers.keys())[:]) |
33 |
34 |
34 # set initial values |
35 # set initial values |
35 # All |
36 # All |
36 self.allFoldCompactCheckBox.setChecked( |
37 self.allFoldCompactCheckBox.setChecked(Preferences.getEditor("AllFoldCompact")) |
37 Preferences.getEditor("AllFoldCompact")) |
38 |
38 |
|
39 # Bash |
39 # Bash |
40 self.foldBashCommentCheckBox.setChecked( |
40 self.foldBashCommentCheckBox.setChecked( |
41 Preferences.getEditor("BashFoldComment")) |
41 Preferences.getEditor("BashFoldComment") |
42 |
42 ) |
|
43 |
43 # C++ |
44 # C++ |
44 self.foldCppCommentCheckBox.setChecked( |
45 self.foldCppCommentCheckBox.setChecked(Preferences.getEditor("CppFoldComment")) |
45 Preferences.getEditor("CppFoldComment")) |
|
46 self.foldCppPreprocessorCheckBox.setChecked( |
46 self.foldCppPreprocessorCheckBox.setChecked( |
47 Preferences.getEditor("CppFoldPreprocessor")) |
47 Preferences.getEditor("CppFoldPreprocessor") |
48 self.foldCppAtElseCheckBox.setChecked( |
48 ) |
49 Preferences.getEditor("CppFoldAtElse")) |
49 self.foldCppAtElseCheckBox.setChecked(Preferences.getEditor("CppFoldAtElse")) |
50 self.cppIndentOpeningBraceCheckBox.setChecked( |
50 self.cppIndentOpeningBraceCheckBox.setChecked( |
51 Preferences.getEditor("CppIndentOpeningBrace")) |
51 Preferences.getEditor("CppIndentOpeningBrace") |
|
52 ) |
52 self.cppIndentClosingBraceCheckBox.setChecked( |
53 self.cppIndentClosingBraceCheckBox.setChecked( |
53 Preferences.getEditor("CppIndentClosingBrace")) |
54 Preferences.getEditor("CppIndentClosingBrace") |
|
55 ) |
54 self.cppCaseInsensitiveCheckBox.setChecked( |
56 self.cppCaseInsensitiveCheckBox.setChecked( |
55 Preferences.getEditor("CppCaseInsensitiveKeywords")) |
57 Preferences.getEditor("CppCaseInsensitiveKeywords") |
|
58 ) |
56 self.cppDollarAllowedCheckBox.setChecked( |
59 self.cppDollarAllowedCheckBox.setChecked( |
57 Preferences.getEditor("CppDollarsAllowed")) |
60 Preferences.getEditor("CppDollarsAllowed") |
|
61 ) |
58 self.cppStylePreprocessorCheckBox.setChecked( |
62 self.cppStylePreprocessorCheckBox.setChecked( |
59 Preferences.getEditor("CppStylePreprocessor")) |
63 Preferences.getEditor("CppStylePreprocessor") |
|
64 ) |
60 self.cppHighlightTripleQuotedCheckBox.setChecked( |
65 self.cppHighlightTripleQuotedCheckBox.setChecked( |
61 Preferences.getEditor("CppHighlightTripleQuotedStrings")) |
66 Preferences.getEditor("CppHighlightTripleQuotedStrings") |
|
67 ) |
62 self.cppHighlightHashQuotedCheckBox.setChecked( |
68 self.cppHighlightHashQuotedCheckBox.setChecked( |
63 Preferences.getEditor("CppHighlightHashQuotedStrings")) |
69 Preferences.getEditor("CppHighlightHashQuotedStrings") |
|
70 ) |
64 self.cppHighlightBackQuotedCheckBox.setChecked( |
71 self.cppHighlightBackQuotedCheckBox.setChecked( |
65 Preferences.getEditor("CppHighlightBackQuotedStrings")) |
72 Preferences.getEditor("CppHighlightBackQuotedStrings") |
|
73 ) |
66 self.cppHighlightEsacepSequencesCheckBox.setChecked( |
74 self.cppHighlightEsacepSequencesCheckBox.setChecked( |
67 Preferences.getEditor("CppHighlightEscapeSequences")) |
75 Preferences.getEditor("CppHighlightEscapeSequences") |
|
76 ) |
68 self.cppVerbatimStringEscapeAllowedCheckBox.setChecked( |
77 self.cppVerbatimStringEscapeAllowedCheckBox.setChecked( |
69 Preferences.getEditor( |
78 Preferences.getEditor("CppVerbatimStringEscapeSequencesAllowed") |
70 "CppVerbatimStringEscapeSequencesAllowed")) |
79 ) |
71 |
80 |
72 # CMake |
81 # CMake |
73 self.cmakeFoldAtElseCheckBox.setChecked( |
82 self.cmakeFoldAtElseCheckBox.setChecked( |
74 Preferences.getEditor("CMakeFoldAtElse")) |
83 Preferences.getEditor("CMakeFoldAtElse") |
75 |
84 ) |
|
85 |
76 # CoffeeScript |
86 # CoffeeScript |
77 if "CoffeeScript" in self.languages: |
87 if "CoffeeScript" in self.languages: |
78 self.foldCoffeeScriptCommentCheckBox.setChecked( |
88 self.foldCoffeeScriptCommentCheckBox.setChecked( |
79 Preferences.getEditor("CoffeScriptFoldComment")) |
89 Preferences.getEditor("CoffeScriptFoldComment") |
|
90 ) |
80 self.coffeeScriptDollarAllowedCheckBox.setChecked( |
91 self.coffeeScriptDollarAllowedCheckBox.setChecked( |
81 Preferences.getEditor("CoffeeScriptDollarsAllowed")) |
92 Preferences.getEditor("CoffeeScriptDollarsAllowed") |
|
93 ) |
82 self.coffeeScriptStylePreprocessorCheckBox.setChecked( |
94 self.coffeeScriptStylePreprocessorCheckBox.setChecked( |
83 Preferences.getEditor("CoffeeScriptStylePreprocessor")) |
95 Preferences.getEditor("CoffeeScriptStylePreprocessor") |
|
96 ) |
84 else: |
97 else: |
85 self.coffeeScriptGroup.setEnabled(False) |
98 self.coffeeScriptGroup.setEnabled(False) |
86 |
99 |
87 # CSS |
100 # CSS |
88 self.foldCssCommentCheckBox.setChecked( |
101 self.foldCssCommentCheckBox.setChecked(Preferences.getEditor("CssFoldComment")) |
89 Preferences.getEditor("CssFoldComment")) |
102 self.cssHssCheckBox.setChecked(Preferences.getEditor("CssHssSupport")) |
90 self.cssHssCheckBox.setChecked( |
103 self.cssLessCheckBox.setChecked(Preferences.getEditor("CssLessSupport")) |
91 Preferences.getEditor("CssHssSupport")) |
104 self.cssSassyCheckBox.setChecked(Preferences.getEditor("CssSassySupport")) |
92 self.cssLessCheckBox.setChecked( |
105 |
93 Preferences.getEditor("CssLessSupport")) |
|
94 self.cssSassyCheckBox.setChecked( |
|
95 Preferences.getEditor("CssSassySupport")) |
|
96 |
|
97 # D |
106 # D |
98 self.foldDCommentCheckBox.setChecked( |
107 self.foldDCommentCheckBox.setChecked(Preferences.getEditor("DFoldComment")) |
99 Preferences.getEditor("DFoldComment")) |
108 self.foldDAtElseCheckBox.setChecked(Preferences.getEditor("DFoldAtElse")) |
100 self.foldDAtElseCheckBox.setChecked( |
|
101 Preferences.getEditor("DFoldAtElse")) |
|
102 self.dIndentOpeningBraceCheckBox.setChecked( |
109 self.dIndentOpeningBraceCheckBox.setChecked( |
103 Preferences.getEditor("DIndentOpeningBrace")) |
110 Preferences.getEditor("DIndentOpeningBrace") |
|
111 ) |
104 self.dIndentClosingBraceCheckBox.setChecked( |
112 self.dIndentClosingBraceCheckBox.setChecked( |
105 Preferences.getEditor("DIndentClosingBrace")) |
113 Preferences.getEditor("DIndentClosingBrace") |
106 |
114 ) |
|
115 |
107 # Gettext |
116 # Gettext |
108 if "Gettext" in self.languages: |
117 if "Gettext" in self.languages: |
109 self.foldPoCommentCheckBox.setChecked( |
118 self.foldPoCommentCheckBox.setChecked( |
110 Preferences.getEditor("PoFoldComment")) |
119 Preferences.getEditor("PoFoldComment") |
|
120 ) |
111 else: |
121 else: |
112 self.gettextGroup.setEnabled(False) |
122 self.gettextGroup.setEnabled(False) |
113 |
123 |
114 # HTML |
124 # HTML |
115 self.foldHtmlPreprocessorCheckBox.setChecked( |
125 self.foldHtmlPreprocessorCheckBox.setChecked( |
116 Preferences.getEditor("HtmlFoldPreprocessor")) |
126 Preferences.getEditor("HtmlFoldPreprocessor") |
|
127 ) |
117 self.htmlCaseSensitiveTagsCheckBox.setChecked( |
128 self.htmlCaseSensitiveTagsCheckBox.setChecked( |
118 Preferences.getEditor("HtmlCaseSensitiveTags")) |
129 Preferences.getEditor("HtmlCaseSensitiveTags") |
|
130 ) |
119 self.foldHtmlScriptCommentsCheckBox.setChecked( |
131 self.foldHtmlScriptCommentsCheckBox.setChecked( |
120 Preferences.getEditor("HtmlFoldScriptComments")) |
132 Preferences.getEditor("HtmlFoldScriptComments") |
|
133 ) |
121 self.foldHtmlScriptHereDocsCheckBox.setChecked( |
134 self.foldHtmlScriptHereDocsCheckBox.setChecked( |
122 Preferences.getEditor("HtmlFoldScriptHeredocs")) |
135 Preferences.getEditor("HtmlFoldScriptHeredocs") |
123 self.htmlDjangoCheckBox.setChecked( |
136 ) |
124 Preferences.getEditor("HtmlDjangoTemplates")) |
137 self.htmlDjangoCheckBox.setChecked(Preferences.getEditor("HtmlDjangoTemplates")) |
125 self.htmlMakoCheckBox.setChecked( |
138 self.htmlMakoCheckBox.setChecked(Preferences.getEditor("HtmlMakoTemplates")) |
126 Preferences.getEditor("HtmlMakoTemplates")) |
139 |
127 |
|
128 # JSON |
140 # JSON |
129 if "JSON" in self.languages: |
141 if "JSON" in self.languages: |
130 self.jsonHighlightCommentsCheckBox.setChecked( |
142 self.jsonHighlightCommentsCheckBox.setChecked( |
131 Preferences.getEditor("JSONHightlightComments")) |
143 Preferences.getEditor("JSONHightlightComments") |
|
144 ) |
132 self.jsonHighlightEscapeCheckBox.setChecked( |
145 self.jsonHighlightEscapeCheckBox.setChecked( |
133 Preferences.getEditor("JSONHighlightEscapeSequences")) |
146 Preferences.getEditor("JSONHighlightEscapeSequences") |
|
147 ) |
134 else: |
148 else: |
135 self.jsonGroup.setEnabled(False) |
149 self.jsonGroup.setEnabled(False) |
136 |
150 |
137 # Pascal |
151 # Pascal |
138 self.pascalGroup.setEnabled(True) |
152 self.pascalGroup.setEnabled(True) |
139 self.foldPascalCommentCheckBox.setChecked( |
153 self.foldPascalCommentCheckBox.setChecked( |
140 Preferences.getEditor("PascalFoldComment")) |
154 Preferences.getEditor("PascalFoldComment") |
|
155 ) |
141 self.foldPascalPreprocessorCheckBox.setChecked( |
156 self.foldPascalPreprocessorCheckBox.setChecked( |
142 Preferences.getEditor("PascalFoldPreprocessor")) |
157 Preferences.getEditor("PascalFoldPreprocessor") |
|
158 ) |
143 self.pascalSmartHighlightingCheckBox.setChecked( |
159 self.pascalSmartHighlightingCheckBox.setChecked( |
144 Preferences.getEditor("PascalSmartHighlighting")) |
160 Preferences.getEditor("PascalSmartHighlighting") |
145 |
161 ) |
|
162 |
146 # Perl |
163 # Perl |
147 self.foldPerlCommentCheckBox.setChecked( |
164 self.foldPerlCommentCheckBox.setChecked( |
148 Preferences.getEditor("PerlFoldComment")) |
165 Preferences.getEditor("PerlFoldComment") |
|
166 ) |
149 self.foldPerlPackagesCheckBox.setChecked( |
167 self.foldPerlPackagesCheckBox.setChecked( |
150 Preferences.getEditor("PerlFoldPackages")) |
168 Preferences.getEditor("PerlFoldPackages") |
|
169 ) |
151 self.foldPerlPODBlocksCheckBox.setChecked( |
170 self.foldPerlPODBlocksCheckBox.setChecked( |
152 Preferences.getEditor("PerlFoldPODBlocks")) |
171 Preferences.getEditor("PerlFoldPODBlocks") |
153 self.foldPerlAtElseCheckBox.setChecked( |
172 ) |
154 Preferences.getEditor("PerlFoldAtElse")) |
173 self.foldPerlAtElseCheckBox.setChecked(Preferences.getEditor("PerlFoldAtElse")) |
155 |
174 |
156 # PostScript |
175 # PostScript |
157 self.postscriptGroup.setEnabled(True) |
176 self.postscriptGroup.setEnabled(True) |
158 self.psFoldAtElseCheckBox.setChecked( |
177 self.psFoldAtElseCheckBox.setChecked( |
159 Preferences.getEditor("PostScriptFoldAtElse")) |
178 Preferences.getEditor("PostScriptFoldAtElse") |
|
179 ) |
160 self.psMarkTokensCheckBox.setChecked( |
180 self.psMarkTokensCheckBox.setChecked( |
161 Preferences.getEditor("PostScriptTokenize")) |
181 Preferences.getEditor("PostScriptTokenize") |
162 self.psLevelSpinBox.setValue( |
182 ) |
163 Preferences.getEditor("PostScriptLevel")) |
183 self.psLevelSpinBox.setValue(Preferences.getEditor("PostScriptLevel")) |
164 |
184 |
165 # Povray |
185 # Povray |
166 self.foldPovrayCommentCheckBox.setChecked( |
186 self.foldPovrayCommentCheckBox.setChecked( |
167 Preferences.getEditor("PovFoldComment")) |
187 Preferences.getEditor("PovFoldComment") |
|
188 ) |
168 self.foldPovrayDirectivesCheckBox.setChecked( |
189 self.foldPovrayDirectivesCheckBox.setChecked( |
169 Preferences.getEditor("PovFoldDirectives")) |
190 Preferences.getEditor("PovFoldDirectives") |
170 |
191 ) |
|
192 |
171 # Properties |
193 # Properties |
172 self.propertiesInitialSpacesCheckBox.setChecked( |
194 self.propertiesInitialSpacesCheckBox.setChecked( |
173 Preferences.getEditor("PropertiesInitialSpaces")) |
195 Preferences.getEditor("PropertiesInitialSpaces") |
174 |
196 ) |
|
197 |
175 # Python |
198 # Python |
176 self.pythonBadIndentationComboBox.addItems([ |
199 self.pythonBadIndentationComboBox.addItems( |
177 self.tr("No Warning"), |
200 [ |
178 self.tr("Inconsistent"), |
201 self.tr("No Warning"), |
179 self.tr("Tabs after Spaces"), |
202 self.tr("Inconsistent"), |
180 self.tr("Spaces"), |
203 self.tr("Tabs after Spaces"), |
181 self.tr("Tabs"), |
204 self.tr("Spaces"), |
182 ]) |
205 self.tr("Tabs"), |
|
206 ] |
|
207 ) |
183 self.pythonBadIndentationComboBox.setCurrentIndex( |
208 self.pythonBadIndentationComboBox.setCurrentIndex( |
184 Preferences.getEditor("PythonBadIndentation").value) |
209 Preferences.getEditor("PythonBadIndentation").value |
|
210 ) |
185 self.foldPythonCommentCheckBox.setChecked( |
211 self.foldPythonCommentCheckBox.setChecked( |
186 Preferences.getEditor("PythonFoldComment")) |
212 Preferences.getEditor("PythonFoldComment") |
|
213 ) |
187 self.foldPythonStringCheckBox.setChecked( |
214 self.foldPythonStringCheckBox.setChecked( |
188 Preferences.getEditor("PythonFoldString")) |
215 Preferences.getEditor("PythonFoldString") |
|
216 ) |
189 self.pythonAutoindentCheckBox.setChecked( |
217 self.pythonAutoindentCheckBox.setChecked( |
190 Preferences.getEditor("PythonAutoIndent")) |
218 Preferences.getEditor("PythonAutoIndent") |
|
219 ) |
191 self.pythonV2UnicodeAllowedCheckBox.setChecked( |
220 self.pythonV2UnicodeAllowedCheckBox.setChecked( |
192 Preferences.getEditor("PythonAllowV2Unicode")) |
221 Preferences.getEditor("PythonAllowV2Unicode") |
|
222 ) |
193 self.pythonV3BinaryAllowedCheckBox.setChecked( |
223 self.pythonV3BinaryAllowedCheckBox.setChecked( |
194 Preferences.getEditor("PythonAllowV3Binary")) |
224 Preferences.getEditor("PythonAllowV3Binary") |
|
225 ) |
195 self.pythonV3BytesAllowedCheckBox.setChecked( |
226 self.pythonV3BytesAllowedCheckBox.setChecked( |
196 Preferences.getEditor("PythonAllowV3Bytes")) |
227 Preferences.getEditor("PythonAllowV3Bytes") |
|
228 ) |
197 self.foldPythonQuotesCheckBox.setChecked( |
229 self.foldPythonQuotesCheckBox.setChecked( |
198 Preferences.getEditor("PythonFoldQuotes")) |
230 Preferences.getEditor("PythonFoldQuotes") |
|
231 ) |
199 self.pythonStringsOverNewlineCheckBox.setChecked( |
232 self.pythonStringsOverNewlineCheckBox.setChecked( |
200 Preferences.getEditor("PythonStringsOverNewLineAllowed")) |
233 Preferences.getEditor("PythonStringsOverNewLineAllowed") |
|
234 ) |
201 self.pythonHighlightSubidentifierCheckBox.setChecked( |
235 self.pythonHighlightSubidentifierCheckBox.setChecked( |
202 Preferences.getEditor("PythonHighlightSubidentifier")) |
236 Preferences.getEditor("PythonHighlightSubidentifier") |
203 |
237 ) |
|
238 |
204 # Ruby |
239 # Ruby |
205 self.foldRubyCommentCheckBox.setChecked( |
240 self.foldRubyCommentCheckBox.setChecked( |
206 Preferences.getEditor("RubyFoldComment")) |
241 Preferences.getEditor("RubyFoldComment") |
207 |
242 ) |
|
243 |
208 # SQL |
244 # SQL |
209 self.foldSqlCommentCheckBox.setChecked( |
245 self.foldSqlCommentCheckBox.setChecked(Preferences.getEditor("SqlFoldComment")) |
210 Preferences.getEditor("SqlFoldComment")) |
|
211 self.sqlBackslashEscapesCheckBox.setChecked( |
246 self.sqlBackslashEscapesCheckBox.setChecked( |
212 Preferences.getEditor("SqlBackslashEscapes")) |
247 Preferences.getEditor("SqlBackslashEscapes") |
213 self.sqlFoldAtElseCheckBox.setChecked( |
248 ) |
214 Preferences.getEditor("SqlFoldAtElse")) |
249 self.sqlFoldAtElseCheckBox.setChecked(Preferences.getEditor("SqlFoldAtElse")) |
215 self.sqlFoldOnlyBeginCheckBox.setChecked( |
250 self.sqlFoldOnlyBeginCheckBox.setChecked( |
216 Preferences.getEditor("SqlFoldOnlyBegin")) |
251 Preferences.getEditor("SqlFoldOnlyBegin") |
217 self.sqlDottedWordsCheckBox.setChecked( |
252 ) |
218 Preferences.getEditor("SqlDottedWords")) |
253 self.sqlDottedWordsCheckBox.setChecked(Preferences.getEditor("SqlDottedWords")) |
219 self.sqlHashCommentsCheckBox.setChecked( |
254 self.sqlHashCommentsCheckBox.setChecked( |
220 Preferences.getEditor("SqlHashComments")) |
255 Preferences.getEditor("SqlHashComments") |
|
256 ) |
221 self.sqlQuotedIdentifiersCheckBox.setChecked( |
257 self.sqlQuotedIdentifiersCheckBox.setChecked( |
222 Preferences.getEditor("SqlQuotedIdentifiers")) |
258 Preferences.getEditor("SqlQuotedIdentifiers") |
223 |
259 ) |
|
260 |
224 # TCL |
261 # TCL |
225 self.foldTclCommentCheckBox.setChecked( |
262 self.foldTclCommentCheckBox.setChecked(Preferences.getEditor("TclFoldComment")) |
226 Preferences.getEditor("TclFoldComment")) |
263 |
227 |
|
228 # TeX |
264 # TeX |
229 self.foldTexCommentCheckBox.setChecked( |
265 self.foldTexCommentCheckBox.setChecked(Preferences.getEditor("TexFoldComment")) |
230 Preferences.getEditor("TexFoldComment")) |
|
231 self.texProcessCommentsCheckBox.setChecked( |
266 self.texProcessCommentsCheckBox.setChecked( |
232 Preferences.getEditor("TexProcessComments")) |
267 Preferences.getEditor("TexProcessComments") |
233 self.texProcessIfCheckBox.setChecked( |
268 ) |
234 Preferences.getEditor("TexProcessIf")) |
269 self.texProcessIfCheckBox.setChecked(Preferences.getEditor("TexProcessIf")) |
235 |
270 |
236 # VHDL |
271 # VHDL |
237 self.vhdlFoldCommentCheckBox.setChecked( |
272 self.vhdlFoldCommentCheckBox.setChecked( |
238 Preferences.getEditor("VHDLFoldComment")) |
273 Preferences.getEditor("VHDLFoldComment") |
239 self.vhdlFoldAtElseCheckBox.setChecked( |
274 ) |
240 Preferences.getEditor("VHDLFoldAtElse")) |
275 self.vhdlFoldAtElseCheckBox.setChecked(Preferences.getEditor("VHDLFoldAtElse")) |
241 self.vhdlFoldAtBeginCheckBox.setChecked( |
276 self.vhdlFoldAtBeginCheckBox.setChecked( |
242 Preferences.getEditor("VHDLFoldAtBegin")) |
277 Preferences.getEditor("VHDLFoldAtBegin") |
|
278 ) |
243 self.vhdlFoldAtParenthesisCheckBox.setChecked( |
279 self.vhdlFoldAtParenthesisCheckBox.setChecked( |
244 Preferences.getEditor("VHDLFoldAtParenthesis")) |
280 Preferences.getEditor("VHDLFoldAtParenthesis") |
245 |
281 ) |
|
282 |
246 # XML |
283 # XML |
247 self.xmlSyleScriptsCheckBox.setChecked( |
284 self.xmlSyleScriptsCheckBox.setChecked(Preferences.getEditor("XMLStyleScripts")) |
248 Preferences.getEditor("XMLStyleScripts")) |
285 |
249 |
|
250 # YAML |
286 # YAML |
251 self.yamlGroup.setEnabled(True) |
287 self.yamlGroup.setEnabled(True) |
252 self.foldYamlCommentCheckBox.setChecked( |
288 self.foldYamlCommentCheckBox.setChecked( |
253 Preferences.getEditor("YAMLFoldComment")) |
289 Preferences.getEditor("YAMLFoldComment") |
254 |
290 ) |
|
291 |
255 def save(self): |
292 def save(self): |
256 """ |
293 """ |
257 Public slot to save the Editor Properties (1) configuration. |
294 Public slot to save the Editor Properties (1) configuration. |
258 """ |
295 """ |
259 # All |
296 # All |
260 Preferences.setEditor( |
297 Preferences.setEditor("AllFoldCompact", self.allFoldCompactCheckBox.isChecked()) |
261 "AllFoldCompact", |
298 |
262 self.allFoldCompactCheckBox.isChecked()) |
|
263 |
|
264 # Bash |
299 # Bash |
265 Preferences.setEditor( |
300 Preferences.setEditor( |
266 "BashFoldComment", |
301 "BashFoldComment", self.foldBashCommentCheckBox.isChecked() |
267 self.foldBashCommentCheckBox.isChecked()) |
302 ) |
268 |
303 |
269 # CMake |
304 # CMake |
270 Preferences.setEditor( |
305 Preferences.setEditor( |
271 "CMakeFoldAtElse", |
306 "CMakeFoldAtElse", self.cmakeFoldAtElseCheckBox.isChecked() |
272 self.cmakeFoldAtElseCheckBox.isChecked()) |
307 ) |
273 |
308 |
274 # C++ |
309 # C++ |
275 Preferences.setEditor( |
310 Preferences.setEditor("CppFoldComment", self.foldCppCommentCheckBox.isChecked()) |
276 "CppFoldComment", |
311 Preferences.setEditor( |
277 self.foldCppCommentCheckBox.isChecked()) |
312 "CppFoldPreprocessor", self.foldCppPreprocessorCheckBox.isChecked() |
278 Preferences.setEditor( |
313 ) |
279 "CppFoldPreprocessor", |
314 Preferences.setEditor("CppFoldAtElse", self.foldCppAtElseCheckBox.isChecked()) |
280 self.foldCppPreprocessorCheckBox.isChecked()) |
315 Preferences.setEditor( |
281 Preferences.setEditor( |
316 "CppIndentOpeningBrace", self.cppIndentOpeningBraceCheckBox.isChecked() |
282 "CppFoldAtElse", |
317 ) |
283 self.foldCppAtElseCheckBox.isChecked()) |
318 Preferences.setEditor( |
284 Preferences.setEditor( |
319 "CppIndentClosingBrace", self.cppIndentClosingBraceCheckBox.isChecked() |
285 "CppIndentOpeningBrace", |
320 ) |
286 self.cppIndentOpeningBraceCheckBox.isChecked()) |
321 Preferences.setEditor( |
287 Preferences.setEditor( |
322 "CppCaseInsensitiveKeywords", self.cppCaseInsensitiveCheckBox.isChecked() |
288 "CppIndentClosingBrace", |
323 ) |
289 self.cppIndentClosingBraceCheckBox.isChecked()) |
324 Preferences.setEditor( |
290 Preferences.setEditor( |
325 "CppDollarsAllowed", self.cppDollarAllowedCheckBox.isChecked() |
291 "CppCaseInsensitiveKeywords", |
326 ) |
292 self.cppCaseInsensitiveCheckBox.isChecked()) |
327 Preferences.setEditor( |
293 Preferences.setEditor( |
328 "CppStylePreprocessor", self.cppStylePreprocessorCheckBox.isChecked() |
294 "CppDollarsAllowed", |
329 ) |
295 self.cppDollarAllowedCheckBox.isChecked()) |
|
296 Preferences.setEditor( |
|
297 "CppStylePreprocessor", |
|
298 self.cppStylePreprocessorCheckBox.isChecked()) |
|
299 Preferences.setEditor( |
330 Preferences.setEditor( |
300 "CppHighlightTripleQuotedStrings", |
331 "CppHighlightTripleQuotedStrings", |
301 self.cppHighlightTripleQuotedCheckBox.isChecked()) |
332 self.cppHighlightTripleQuotedCheckBox.isChecked(), |
|
333 ) |
302 Preferences.setEditor( |
334 Preferences.setEditor( |
303 "CppHighlightHashQuotedStrings", |
335 "CppHighlightHashQuotedStrings", |
304 self.cppHighlightHashQuotedCheckBox.isChecked()) |
336 self.cppHighlightHashQuotedCheckBox.isChecked(), |
|
337 ) |
305 Preferences.setEditor( |
338 Preferences.setEditor( |
306 "CppHighlightBackQuotedStrings", |
339 "CppHighlightBackQuotedStrings", |
307 self.cppHighlightBackQuotedCheckBox.isChecked()) |
340 self.cppHighlightBackQuotedCheckBox.isChecked(), |
|
341 ) |
308 Preferences.setEditor( |
342 Preferences.setEditor( |
309 "CppHighlightEscapeSequences", |
343 "CppHighlightEscapeSequences", |
310 self.cppHighlightEsacepSequencesCheckBox.isChecked()) |
344 self.cppHighlightEsacepSequencesCheckBox.isChecked(), |
|
345 ) |
311 Preferences.setEditor( |
346 Preferences.setEditor( |
312 "CppVerbatimStringEscapeSequencesAllowed", |
347 "CppVerbatimStringEscapeSequencesAllowed", |
313 self.cppVerbatimStringEscapeAllowedCheckBox.isChecked()) |
348 self.cppVerbatimStringEscapeAllowedCheckBox.isChecked(), |
314 |
349 ) |
|
350 |
315 # CMake |
351 # CMake |
316 Preferences.setEditor( |
352 Preferences.setEditor( |
317 "CMakeFoldAtElse", |
353 "CMakeFoldAtElse", self.cmakeFoldAtElseCheckBox.isChecked() |
318 self.cmakeFoldAtElseCheckBox.isChecked()) |
354 ) |
319 |
355 |
320 # CoffeeScript |
356 # CoffeeScript |
321 if "CoffeeScript" in self.languages: |
357 if "CoffeeScript" in self.languages: |
322 Preferences.setEditor( |
358 Preferences.setEditor( |
323 "CoffeScriptFoldComment", |
359 "CoffeScriptFoldComment", |
324 self.foldCoffeeScriptCommentCheckBox.isChecked()) |
360 self.foldCoffeeScriptCommentCheckBox.isChecked(), |
|
361 ) |
325 Preferences.setEditor( |
362 Preferences.setEditor( |
326 "CoffeeScriptDollarsAllowed", |
363 "CoffeeScriptDollarsAllowed", |
327 self.coffeeScriptDollarAllowedCheckBox.isChecked()) |
364 self.coffeeScriptDollarAllowedCheckBox.isChecked(), |
|
365 ) |
328 Preferences.setEditor( |
366 Preferences.setEditor( |
329 "CoffeeScriptStylePreprocessor", |
367 "CoffeeScriptStylePreprocessor", |
330 self.coffeeScriptStylePreprocessorCheckBox.isChecked()) |
368 self.coffeeScriptStylePreprocessorCheckBox.isChecked(), |
331 |
369 ) |
|
370 |
332 # CSS |
371 # CSS |
333 Preferences.setEditor( |
372 Preferences.setEditor("CssFoldComment", self.foldCssCommentCheckBox.isChecked()) |
334 "CssFoldComment", |
373 Preferences.setEditor("CssHssSupport", self.cssHssCheckBox.isChecked()) |
335 self.foldCssCommentCheckBox.isChecked()) |
374 Preferences.setEditor("CssLessSupport", self.cssLessCheckBox.isChecked()) |
336 Preferences.setEditor( |
375 Preferences.setEditor("CssSassySupport", self.cssSassyCheckBox.isChecked()) |
337 "CssHssSupport", |
376 |
338 self.cssHssCheckBox.isChecked()) |
|
339 Preferences.setEditor( |
|
340 "CssLessSupport", |
|
341 self.cssLessCheckBox.isChecked()) |
|
342 Preferences.setEditor( |
|
343 "CssSassySupport", |
|
344 self.cssSassyCheckBox.isChecked()) |
|
345 |
|
346 # D |
377 # D |
347 Preferences.setEditor( |
378 Preferences.setEditor("DFoldComment", self.foldDCommentCheckBox.isChecked()) |
348 "DFoldComment", |
379 Preferences.setEditor("DFoldAtElse", self.foldDAtElseCheckBox.isChecked()) |
349 self.foldDCommentCheckBox.isChecked()) |
380 Preferences.setEditor( |
350 Preferences.setEditor( |
381 "DIndentOpeningBrace", self.dIndentOpeningBraceCheckBox.isChecked() |
351 "DFoldAtElse", |
382 ) |
352 self.foldDAtElseCheckBox.isChecked()) |
383 Preferences.setEditor( |
353 Preferences.setEditor( |
384 "DIndentClosingBrace", self.dIndentClosingBraceCheckBox.isChecked() |
354 "DIndentOpeningBrace", |
385 ) |
355 self.dIndentOpeningBraceCheckBox.isChecked()) |
386 |
356 Preferences.setEditor( |
|
357 "DIndentClosingBrace", |
|
358 self.dIndentClosingBraceCheckBox.isChecked()) |
|
359 |
|
360 # Gettext |
387 # Gettext |
361 if "Gettext" in self.languages: |
388 if "Gettext" in self.languages: |
362 Preferences.setEditor( |
389 Preferences.setEditor( |
363 "PoFoldComment", |
390 "PoFoldComment", self.foldPoCommentCheckBox.isChecked() |
364 self.foldPoCommentCheckBox.isChecked()) |
391 ) |
365 |
392 |
366 # HTML |
393 # HTML |
367 Preferences.setEditor( |
394 Preferences.setEditor( |
368 "HtmlFoldPreprocessor", |
395 "HtmlFoldPreprocessor", self.foldHtmlPreprocessorCheckBox.isChecked() |
369 self.foldHtmlPreprocessorCheckBox.isChecked()) |
396 ) |
370 Preferences.setEditor( |
397 Preferences.setEditor( |
371 "HtmlCaseSensitiveTags", |
398 "HtmlCaseSensitiveTags", self.htmlCaseSensitiveTagsCheckBox.isChecked() |
372 self.htmlCaseSensitiveTagsCheckBox.isChecked()) |
399 ) |
373 Preferences.setEditor( |
400 Preferences.setEditor( |
374 "HtmlFoldScriptComments", |
401 "HtmlFoldScriptComments", self.foldHtmlScriptCommentsCheckBox.isChecked() |
375 self.foldHtmlScriptCommentsCheckBox.isChecked()) |
402 ) |
376 Preferences.setEditor( |
403 Preferences.setEditor( |
377 "HtmlFoldScriptHeredocs", |
404 "HtmlFoldScriptHeredocs", self.foldHtmlScriptHereDocsCheckBox.isChecked() |
378 self.foldHtmlScriptHereDocsCheckBox.isChecked()) |
405 ) |
379 Preferences.setEditor( |
406 Preferences.setEditor( |
380 "HtmlDjangoTemplates", |
407 "HtmlDjangoTemplates", self.htmlDjangoCheckBox.isChecked() |
381 self.htmlDjangoCheckBox.isChecked()) |
408 ) |
382 Preferences.setEditor( |
409 Preferences.setEditor("HtmlMakoTemplates", self.htmlMakoCheckBox.isChecked()) |
383 "HtmlMakoTemplates", |
410 |
384 self.htmlMakoCheckBox.isChecked()) |
|
385 |
|
386 # JSON |
411 # JSON |
387 if "JSON" in self.languages: |
412 if "JSON" in self.languages: |
388 Preferences.setEditor( |
413 Preferences.setEditor( |
389 "JSONHightlightComments", |
414 "JSONHightlightComments", self.jsonHighlightCommentsCheckBox.isChecked() |
390 self.jsonHighlightCommentsCheckBox.isChecked()) |
415 ) |
391 Preferences.setEditor( |
416 Preferences.setEditor( |
392 "JSONHighlightEscapeSequences", |
417 "JSONHighlightEscapeSequences", |
393 self.jsonHighlightEscapeCheckBox.isChecked()) |
418 self.jsonHighlightEscapeCheckBox.isChecked(), |
394 |
419 ) |
|
420 |
395 # Pascal |
421 # Pascal |
396 Preferences.setEditor( |
422 Preferences.setEditor( |
397 "PascalFoldComment", |
423 "PascalFoldComment", self.foldPascalCommentCheckBox.isChecked() |
398 self.foldPascalCommentCheckBox.isChecked()) |
424 ) |
399 Preferences.setEditor( |
425 Preferences.setEditor( |
400 "PascalFoldPreprocessor", |
426 "PascalFoldPreprocessor", self.foldPascalPreprocessorCheckBox.isChecked() |
401 self.foldPascalPreprocessorCheckBox.isChecked()) |
427 ) |
402 Preferences.setEditor( |
428 Preferences.setEditor( |
403 "PascalSmartHighlighting", |
429 "PascalSmartHighlighting", self.pascalSmartHighlightingCheckBox.isChecked() |
404 self.pascalSmartHighlightingCheckBox.isChecked()) |
430 ) |
405 |
431 |
406 # Perl |
432 # Perl |
407 Preferences.setEditor( |
433 Preferences.setEditor( |
408 "PerlFoldComment", |
434 "PerlFoldComment", self.foldPerlCommentCheckBox.isChecked() |
409 self.foldPerlCommentCheckBox.isChecked()) |
435 ) |
410 Preferences.setEditor( |
436 Preferences.setEditor( |
411 "PerlFoldPackages", |
437 "PerlFoldPackages", self.foldPerlPackagesCheckBox.isChecked() |
412 self.foldPerlPackagesCheckBox.isChecked()) |
438 ) |
413 Preferences.setEditor( |
439 Preferences.setEditor( |
414 "PerlFoldPODBlocks", |
440 "PerlFoldPODBlocks", self.foldPerlPODBlocksCheckBox.isChecked() |
415 self.foldPerlPODBlocksCheckBox.isChecked()) |
441 ) |
416 Preferences.setEditor( |
442 Preferences.setEditor("PerlFoldAtElse", self.foldPerlAtElseCheckBox.isChecked()) |
417 "PerlFoldAtElse", |
443 |
418 self.foldPerlAtElseCheckBox.isChecked()) |
|
419 |
|
420 # PostScript |
444 # PostScript |
421 Preferences.setEditor( |
445 Preferences.setEditor( |
422 "PostScriptFoldAtElse", |
446 "PostScriptFoldAtElse", self.psFoldAtElseCheckBox.isChecked() |
423 self.psFoldAtElseCheckBox.isChecked()) |
447 ) |
424 Preferences.setEditor( |
448 Preferences.setEditor( |
425 "PostScriptTokenize", |
449 "PostScriptTokenize", self.psMarkTokensCheckBox.isChecked() |
426 self.psMarkTokensCheckBox.isChecked()) |
450 ) |
427 Preferences.setEditor( |
451 Preferences.setEditor("PostScriptLevel", self.psLevelSpinBox.value()) |
428 "PostScriptLevel", |
452 |
429 self.psLevelSpinBox.value()) |
|
430 |
|
431 # Povray |
453 # Povray |
432 Preferences.setEditor( |
454 Preferences.setEditor( |
433 "PovFoldComment", |
455 "PovFoldComment", self.foldPovrayCommentCheckBox.isChecked() |
434 self.foldPovrayCommentCheckBox.isChecked()) |
456 ) |
435 Preferences.setEditor( |
457 Preferences.setEditor( |
436 "PovFoldDirectives", |
458 "PovFoldDirectives", self.foldPovrayDirectivesCheckBox.isChecked() |
437 self.foldPovrayDirectivesCheckBox.isChecked()) |
459 ) |
438 |
460 |
439 # Properties |
461 # Properties |
440 Preferences.setEditor( |
462 Preferences.setEditor( |
441 "PropertiesInitialSpaces", |
463 "PropertiesInitialSpaces", self.propertiesInitialSpacesCheckBox.isChecked() |
442 self.propertiesInitialSpacesCheckBox.isChecked()) |
464 ) |
443 |
465 |
444 # Python |
466 # Python |
445 Preferences.setEditor( |
467 Preferences.setEditor( |
446 "PythonFoldComment", |
468 "PythonFoldComment", self.foldPythonCommentCheckBox.isChecked() |
447 self.foldPythonCommentCheckBox.isChecked()) |
469 ) |
448 Preferences.setEditor( |
470 Preferences.setEditor( |
449 "PythonFoldString", |
471 "PythonFoldString", self.foldPythonStringCheckBox.isChecked() |
450 self.foldPythonStringCheckBox.isChecked()) |
472 ) |
451 Preferences.setEditor( |
473 Preferences.setEditor( |
452 "PythonBadIndentation", |
474 "PythonBadIndentation", |
453 QsciLexerPython.IndentationWarning( |
475 QsciLexerPython.IndentationWarning( |
454 self.pythonBadIndentationComboBox.currentIndex())) |
476 self.pythonBadIndentationComboBox.currentIndex() |
455 Preferences.setEditor( |
477 ), |
456 "PythonAutoIndent", |
478 ) |
457 self.pythonAutoindentCheckBox.isChecked()) |
479 Preferences.setEditor( |
458 Preferences.setEditor( |
480 "PythonAutoIndent", self.pythonAutoindentCheckBox.isChecked() |
459 "PythonAllowV2Unicode", |
481 ) |
460 self.pythonV2UnicodeAllowedCheckBox.isChecked()) |
482 Preferences.setEditor( |
461 Preferences.setEditor( |
483 "PythonAllowV2Unicode", self.pythonV2UnicodeAllowedCheckBox.isChecked() |
462 "PythonAllowV3Binary", |
484 ) |
463 self.pythonV3BinaryAllowedCheckBox.isChecked()) |
485 Preferences.setEditor( |
464 Preferences.setEditor( |
486 "PythonAllowV3Binary", self.pythonV3BinaryAllowedCheckBox.isChecked() |
465 "PythonAllowV3Bytes", |
487 ) |
466 self.pythonV3BytesAllowedCheckBox.isChecked()) |
488 Preferences.setEditor( |
467 Preferences.setEditor( |
489 "PythonAllowV3Bytes", self.pythonV3BytesAllowedCheckBox.isChecked() |
468 "PythonFoldQuotes", |
490 ) |
469 self.foldPythonQuotesCheckBox.isChecked()) |
491 Preferences.setEditor( |
|
492 "PythonFoldQuotes", self.foldPythonQuotesCheckBox.isChecked() |
|
493 ) |
470 Preferences.setEditor( |
494 Preferences.setEditor( |
471 "PythonStringsOverNewLineAllowed", |
495 "PythonStringsOverNewLineAllowed", |
472 self.pythonStringsOverNewlineCheckBox.isChecked()) |
496 self.pythonStringsOverNewlineCheckBox.isChecked(), |
|
497 ) |
473 Preferences.setEditor( |
498 Preferences.setEditor( |
474 "PythonHighlightSubidentifier", |
499 "PythonHighlightSubidentifier", |
475 self.pythonHighlightSubidentifierCheckBox.isChecked()) |
500 self.pythonHighlightSubidentifierCheckBox.isChecked(), |
476 |
501 ) |
|
502 |
477 # Ruby |
503 # Ruby |
478 Preferences.setEditor( |
504 Preferences.setEditor( |
479 "RubyFoldComment", |
505 "RubyFoldComment", self.foldRubyCommentCheckBox.isChecked() |
480 self.foldRubyCommentCheckBox.isChecked()) |
506 ) |
481 |
507 |
482 # SQL |
508 # SQL |
483 Preferences.setEditor( |
509 Preferences.setEditor("SqlFoldComment", self.foldSqlCommentCheckBox.isChecked()) |
484 "SqlFoldComment", |
510 Preferences.setEditor( |
485 self.foldSqlCommentCheckBox.isChecked()) |
511 "SqlBackslashEscapes", self.sqlBackslashEscapesCheckBox.isChecked() |
486 Preferences.setEditor( |
512 ) |
487 "SqlBackslashEscapes", |
513 Preferences.setEditor("SqlFoldAtElse", self.sqlFoldAtElseCheckBox.isChecked()) |
488 self.sqlBackslashEscapesCheckBox.isChecked()) |
514 Preferences.setEditor( |
489 Preferences.setEditor( |
515 "SqlFoldOnlyBegin", self.sqlFoldOnlyBeginCheckBox.isChecked() |
490 "SqlFoldAtElse", |
516 ) |
491 self.sqlFoldAtElseCheckBox.isChecked()) |
517 Preferences.setEditor("SqlDottedWords", self.sqlDottedWordsCheckBox.isChecked()) |
492 Preferences.setEditor( |
518 Preferences.setEditor( |
493 "SqlFoldOnlyBegin", |
519 "SqlHashComments", self.sqlHashCommentsCheckBox.isChecked() |
494 self.sqlFoldOnlyBeginCheckBox.isChecked()) |
520 ) |
495 Preferences.setEditor( |
521 Preferences.setEditor( |
496 "SqlDottedWords", |
522 "SqlQuotedIdentifiers", self.sqlQuotedIdentifiersCheckBox.isChecked() |
497 self.sqlDottedWordsCheckBox.isChecked()) |
523 ) |
498 Preferences.setEditor( |
524 |
499 "SqlHashComments", |
|
500 self.sqlHashCommentsCheckBox.isChecked()) |
|
501 Preferences.setEditor( |
|
502 "SqlQuotedIdentifiers", |
|
503 self.sqlQuotedIdentifiersCheckBox.isChecked()) |
|
504 |
|
505 # TCL |
525 # TCL |
506 Preferences.setEditor( |
526 Preferences.setEditor("TclFoldComment", self.foldTclCommentCheckBox.isChecked()) |
507 "TclFoldComment", |
527 |
508 self.foldTclCommentCheckBox.isChecked()) |
|
509 |
|
510 # TeX |
528 # TeX |
511 Preferences.setEditor( |
529 Preferences.setEditor("TexFoldComment", self.foldTexCommentCheckBox.isChecked()) |
512 "TexFoldComment", |
530 Preferences.setEditor( |
513 self.foldTexCommentCheckBox.isChecked()) |
531 "TexProcessComments", self.texProcessCommentsCheckBox.isChecked() |
514 Preferences.setEditor( |
532 ) |
515 "TexProcessComments", |
533 Preferences.setEditor("TexProcessIf", self.texProcessIfCheckBox.isChecked()) |
516 self.texProcessCommentsCheckBox.isChecked()) |
534 |
517 Preferences.setEditor( |
|
518 "TexProcessIf", |
|
519 self.texProcessIfCheckBox.isChecked()) |
|
520 |
|
521 # VHDL |
535 # VHDL |
522 Preferences.setEditor( |
536 Preferences.setEditor( |
523 "VHDLFoldComment", |
537 "VHDLFoldComment", self.vhdlFoldCommentCheckBox.isChecked() |
524 self.vhdlFoldCommentCheckBox.isChecked()) |
538 ) |
525 Preferences.setEditor( |
539 Preferences.setEditor("VHDLFoldAtElse", self.vhdlFoldAtElseCheckBox.isChecked()) |
526 "VHDLFoldAtElse", |
540 Preferences.setEditor( |
527 self.vhdlFoldAtElseCheckBox.isChecked()) |
541 "VHDLFoldAtBegin", self.vhdlFoldAtBeginCheckBox.isChecked() |
528 Preferences.setEditor( |
542 ) |
529 "VHDLFoldAtBegin", |
543 Preferences.setEditor( |
530 self.vhdlFoldAtBeginCheckBox.isChecked()) |
544 "VHDLFoldAtParenthesis", self.vhdlFoldAtParenthesisCheckBox.isChecked() |
531 Preferences.setEditor( |
545 ) |
532 "VHDLFoldAtParenthesis", |
546 |
533 self.vhdlFoldAtParenthesisCheckBox.isChecked()) |
|
534 |
|
535 # XML |
547 # XML |
536 Preferences.setEditor( |
548 Preferences.setEditor( |
537 "XMLStyleScripts", |
549 "XMLStyleScripts", self.xmlSyleScriptsCheckBox.isChecked() |
538 self.xmlSyleScriptsCheckBox.isChecked()) |
550 ) |
539 |
551 |
540 # YAML |
552 # YAML |
541 Preferences.setEditor( |
553 Preferences.setEditor( |
542 "YAMLFoldComment", |
554 "YAMLFoldComment", self.foldYamlCommentCheckBox.isChecked() |
543 self.foldYamlCommentCheckBox.isChecked()) |
555 ) |
544 |
556 |
545 |
557 |
546 def create(dlg): |
558 def create(dlg): |
547 """ |
559 """ |
548 Module function to create the configuration page. |
560 Module function to create the configuration page. |
549 |
561 |
550 @param dlg reference to the configuration dialog |
562 @param dlg reference to the configuration dialog |
551 @return reference to the instantiated page (ConfigurationPageBase) |
563 @return reference to the instantiated page (ConfigurationPageBase) |
552 """ |
564 """ |
553 page = EditorPropertiesPage(dlg.getLexers()) |
565 page = EditorPropertiesPage(dlg.getLexers()) |
554 return page |
566 return page |