103 @type ConfigurationMode |
123 @type ConfigurationMode |
104 @param expandedEntries list of entries to be shown expanded |
124 @param expandedEntries list of entries to be shown expanded |
105 @type list of str |
125 @type list of str |
106 """ |
126 """ |
107 super().__init__(parent) |
127 super().__init__(parent) |
108 |
128 |
109 self.fromEric = fromEric |
129 self.fromEric = fromEric |
110 self.displayMode = displayMode |
130 self.displayMode = displayMode |
111 self.__webEngine = getWebBrowserSupport() == "QtWebEngine" |
131 self.__webEngine = getWebBrowserSupport() == "QtWebEngine" |
112 expandedEntries = [] if expandedEntries is None else expandedEntries[:] |
132 expandedEntries = [] if expandedEntries is None else expandedEntries[:] |
113 |
133 |
114 self.__setupUi() |
134 self.__setupUi() |
115 |
135 |
116 self.itmDict = {} |
136 self.itmDict = {} |
117 |
137 |
118 if not fromEric: |
138 if not fromEric: |
119 from PluginManager.PluginManager import PluginManager |
139 from PluginManager.PluginManager import PluginManager |
|
140 |
120 try: |
141 try: |
121 self.pluginManager = ericApp().getObject("PluginManager") |
142 self.pluginManager = ericApp().getObject("PluginManager") |
122 except KeyError: |
143 except KeyError: |
123 self.pluginManager = PluginManager(self) |
144 self.pluginManager = PluginManager(self) |
124 ericApp().registerObject("PluginManager", self.pluginManager) |
145 ericApp().registerObject("PluginManager", self.pluginManager) |
125 |
146 |
126 from VirtualEnv.VirtualenvManager import VirtualenvManager |
147 from VirtualEnv.VirtualenvManager import VirtualenvManager |
|
148 |
127 try: |
149 try: |
128 self.virtualenvManager = ericApp().getObject( |
150 self.virtualenvManager = ericApp().getObject("VirtualEnvManager") |
129 "VirtualEnvManager") |
|
130 except KeyError: |
151 except KeyError: |
131 self.virtualenvManager = VirtualenvManager(self) |
152 self.virtualenvManager = VirtualenvManager(self) |
132 ericApp().registerObject("VirtualEnvManager", |
153 ericApp().registerObject("VirtualEnvManager", self.virtualenvManager) |
133 self.virtualenvManager) |
154 |
134 |
|
135 if displayMode == ConfigurationMode.DEFAULTMODE: |
155 if displayMode == ConfigurationMode.DEFAULTMODE: |
136 self.configItems = { |
156 self.configItems = { |
137 # key : [display string, pixmap name, dialog module name or |
157 # key : [display string, pixmap name, dialog module name or |
138 # page creation function, parent key, |
158 # page creation function, parent key, |
139 # reference to configuration page (must always be last)] |
159 # reference to configuration page (must always be last)] |
140 # The dialog module must have the module function 'create' to |
160 # The dialog module must have the module function 'create' to |
141 # create the configuration page. This must have the method |
161 # create the configuration page. This must have the method |
142 # 'save' to save the settings. |
162 # 'save' to save the settings. |
143 "applicationPage": |
163 "applicationPage": [ |
144 [self.tr("Application"), "preferences-application", |
164 self.tr("Application"), |
145 "ApplicationPage", None, None], |
165 "preferences-application", |
146 "condaPage": |
166 "ApplicationPage", |
147 [self.tr("Conda"), "miniconda", |
167 None, |
148 "CondaPage", None, None], |
168 None, |
149 "cooperationPage": |
169 ], |
150 [self.tr("Cooperation"), "preferences-cooperation", |
170 "condaPage": [self.tr("Conda"), "miniconda", "CondaPage", None, None], |
151 "CooperationPage", None, None], |
171 "cooperationPage": [ |
152 "corbaPage": |
172 self.tr("Cooperation"), |
153 [self.tr("CORBA"), "preferences-orbit", |
173 "preferences-cooperation", |
154 "CorbaPage", None, None], |
174 "CooperationPage", |
155 "diffPage": |
175 None, |
156 [self.tr("Diff"), "diffFiles", |
176 None, |
157 "DiffColoursPage", None, None], |
177 ], |
158 "emailPage": |
178 "corbaPage": [ |
159 [self.tr("Email"), "preferences-mail_generic", |
179 self.tr("CORBA"), |
160 "EmailPage", None, None], |
180 "preferences-orbit", |
161 "graphicsPage": |
181 "CorbaPage", |
162 [self.tr("Graphics"), "preferences-graphics", |
182 None, |
163 "GraphicsPage", None, None], |
183 None, |
164 "hexEditorPage": |
184 ], |
165 [self.tr("Hex Editor"), "hexEditor", |
185 "diffPage": [ |
166 "HexEditorPage", None, None], |
186 self.tr("Diff"), |
167 "iconsPage": |
187 "diffFiles", |
168 [self.tr("Icons"), "preferences-icons", |
188 "DiffColoursPage", |
169 "IconsPage", None, None], |
189 None, |
170 "ircPage": |
190 None, |
171 [self.tr("IRC"), "irc", |
191 ], |
172 "IrcPage", None, None], |
192 "emailPage": [ |
173 "logViewerPage": |
193 self.tr("Email"), |
174 [self.tr("Log-Viewer"), "preferences-logviewer", |
194 "preferences-mail_generic", |
175 "LogViewerPage", None, None], |
195 "EmailPage", |
176 "microPythonPage": |
196 None, |
177 [self.tr("MicroPython"), "micropython", |
197 None, |
178 "MicroPythonPage", None, None], |
198 ], |
179 "mimeTypesPage": |
199 "graphicsPage": [ |
180 [self.tr("Mimetypes"), "preferences-mimetypes", |
200 self.tr("Graphics"), |
181 "MimeTypesPage", None, None], |
201 "preferences-graphics", |
182 "networkPage": |
202 "GraphicsPage", |
183 [self.tr("Network"), "preferences-network", |
203 None, |
184 "NetworkPage", None, None], |
204 None, |
185 "notificationsPage": |
205 ], |
186 [self.tr("Notifications"), |
206 "hexEditorPage": [ |
187 "preferences-notifications", |
207 self.tr("Hex Editor"), |
188 "NotificationsPage", None, None], |
208 "hexEditor", |
189 "pipPage": |
209 "HexEditorPage", |
190 [self.tr("Python Package Management"), "pypi", |
210 None, |
191 "PipPage", None, None], |
211 None, |
192 "pluginManagerPage": |
212 ], |
193 [self.tr("Plugin Manager"), |
213 "iconsPage": [ |
194 "preferences-pluginmanager", |
214 self.tr("Icons"), |
195 "PluginManagerPage", None, None], |
215 "preferences-icons", |
196 "printerPage": |
216 "IconsPage", |
197 [self.tr("Printer"), "preferences-printer", |
217 None, |
198 "PrinterPage", None, None], |
218 None, |
199 "protobufPage": |
219 ], |
200 [self.tr("Protobuf"), "protobuf", |
220 "ircPage": [self.tr("IRC"), "irc", "IrcPage", None, None], |
201 "ProtobufPage", None, None], |
221 "logViewerPage": [ |
202 "pythonPage": |
222 self.tr("Log-Viewer"), |
203 [self.tr("Python"), "preferences-python", |
223 "preferences-logviewer", |
204 "PythonPage", None, None], |
224 "LogViewerPage", |
205 "qtPage": |
225 None, |
206 [self.tr("Qt"), "preferences-qtlogo", |
226 None, |
207 "QtPage", None, None], |
227 ], |
208 "securityPage": |
228 "microPythonPage": [ |
209 [self.tr("Security"), "preferences-security", |
229 self.tr("MicroPython"), |
210 "SecurityPage", None, None], |
230 "micropython", |
211 "shellPage": |
231 "MicroPythonPage", |
212 [self.tr("Shell"), "preferences-shell", |
232 None, |
213 "ShellPage", None, None], |
233 None, |
214 "tasksPage": |
234 ], |
215 [self.tr("Tasks"), "task", |
235 "mimeTypesPage": [ |
216 "TasksPage", None, None], |
236 self.tr("Mimetypes"), |
217 "templatesPage": |
237 "preferences-mimetypes", |
218 [self.tr("Templates"), "preferences-template", |
238 "MimeTypesPage", |
219 "TemplatesPage", None, None], |
239 None, |
220 "trayStarterPage": |
240 None, |
221 [self.tr("Tray Starter"), "erict", |
241 ], |
222 "TrayStarterPage", None, None], |
242 "networkPage": [ |
223 "vcsPage": |
243 self.tr("Network"), |
224 [self.tr("Version Control Systems"), |
244 "preferences-network", |
225 "preferences-vcs", |
245 "NetworkPage", |
226 "VcsPage", None, None], |
246 None, |
227 |
247 None, |
228 "0debuggerPage": |
248 ], |
229 [self.tr("Debugger"), "preferences-debugger", |
249 "notificationsPage": [ |
230 None, None, None], |
250 self.tr("Notifications"), |
231 "debuggerGeneralPage": |
251 "preferences-notifications", |
232 [self.tr("General"), "preferences-debugger", |
252 "NotificationsPage", |
233 "DebuggerGeneralPage", "0debuggerPage", None], |
253 None, |
234 "debuggerPython3Page": |
254 None, |
235 [self.tr("Python3"), "preferences-pyDebugger", |
255 ], |
236 "DebuggerPython3Page", "0debuggerPage", None], |
256 "pipPage": [ |
237 |
257 self.tr("Python Package Management"), |
238 "0editorPage": |
258 "pypi", |
239 [self.tr("Editor"), "preferences-editor", |
259 "PipPage", |
240 None, None, None], |
260 None, |
241 "editorAPIsPage": |
261 None, |
242 [self.tr("APIs"), "preferences-api", |
262 ], |
243 "EditorAPIsPage", "0editorPage", None], |
263 "pluginManagerPage": [ |
244 "editorDocViewerPage": |
264 self.tr("Plugin Manager"), |
245 [self.tr("Documentation Viewer"), "codeDocuViewer", |
265 "preferences-pluginmanager", |
246 "EditorDocViewerPage", "0editorPage", None], |
266 "PluginManagerPage", |
247 "editorGeneralPage": |
267 None, |
248 [self.tr("General"), "preferences-general", |
268 None, |
249 "EditorGeneralPage", "0editorPage", None], |
269 ], |
250 "editorFilePage": |
270 "printerPage": [ |
251 [self.tr("Filehandling"), |
271 self.tr("Printer"), |
252 "preferences-filehandling", |
272 "preferences-printer", |
253 "EditorFilePage", "0editorPage", None], |
273 "PrinterPage", |
254 "editorSearchPage": |
274 None, |
255 [self.tr("Searching"), "preferences-search", |
275 None, |
256 "EditorSearchPage", "0editorPage", None], |
276 ], |
257 "editorSpellCheckingPage": |
277 "protobufPage": [ |
258 [self.tr("Spell checking"), |
278 self.tr("Protobuf"), |
259 "preferences-spellchecking", |
279 "protobuf", |
260 "EditorSpellCheckingPage", "0editorPage", None], |
280 "ProtobufPage", |
261 "editorStylesPage": |
281 None, |
262 [self.tr("Style"), "preferences-styles", |
282 None, |
263 "EditorStylesPage", "0editorPage", None], |
283 ], |
264 "editorSyntaxPage": |
284 "pythonPage": [ |
265 [self.tr("Code Checkers"), "preferences-debugger", |
285 self.tr("Python"), |
266 "EditorSyntaxPage", "0editorPage", None], |
286 "preferences-python", |
267 "editorTypingPage": |
287 "PythonPage", |
268 [self.tr("Typing"), "preferences-typing", |
288 None, |
269 "EditorTypingPage", "0editorPage", None], |
289 None, |
270 "editorExportersPage": |
290 ], |
271 [self.tr("Exporters"), "preferences-exporters", |
291 "qtPage": [self.tr("Qt"), "preferences-qtlogo", "QtPage", None, None], |
272 "EditorExportersPage", "0editorPage", None], |
292 "securityPage": [ |
273 |
293 self.tr("Security"), |
274 "1editorAutocompletionPage": |
294 "preferences-security", |
275 [self.tr("Autocompletion"), |
295 "SecurityPage", |
276 "preferences-autocompletion", |
296 None, |
277 "EditorAutocompletionPage", "0editorPage", None], |
297 None, |
278 "editorAutocompletionQScintillaPage": |
298 ], |
279 [self.tr("QScintilla"), "qscintilla", |
299 "shellPage": [ |
280 "EditorAutocompletionQScintillaPage", |
300 self.tr("Shell"), |
281 "1editorAutocompletionPage", None], |
301 "preferences-shell", |
282 "editorAutocompletionJediPage": |
302 "ShellPage", |
283 [self.tr("Jedi"), "jedi", |
303 None, |
284 "EditorAutoCompletionJediPage", |
304 None, |
285 "1editorAutocompletionPage", None], |
305 ], |
286 |
306 "tasksPage": [self.tr("Tasks"), "task", "TasksPage", None, None], |
287 "1editorCalltipsPage": |
307 "templatesPage": [ |
288 [self.tr("Calltips"), "preferences-calltips", |
308 self.tr("Templates"), |
289 "EditorCalltipsPage", "0editorPage", None], |
309 "preferences-template", |
290 "editorCalltipsQScintillaPage": |
310 "TemplatesPage", |
291 [self.tr("QScintilla"), "qscintilla", |
311 None, |
292 "EditorCalltipsQScintillaPage", "1editorCalltipsPage", None], |
312 None, |
293 "editorCalltipsJediPage": |
313 ], |
294 [self.tr("Jedi"), "jedi", |
314 "trayStarterPage": [ |
295 "EditorCallTipsJediPage", "1editorCalltipsPage", None], |
315 self.tr("Tray Starter"), |
296 |
316 "erict", |
297 "1editorLexerPage": |
317 "TrayStarterPage", |
298 [self.tr("Highlighters"), |
318 None, |
299 "preferences-highlighting-styles", |
319 None, |
300 None, "0editorPage", None], |
320 ], |
301 "editorHighlightersPage": |
321 "vcsPage": [ |
302 [self.tr("Filetype Associations"), |
322 self.tr("Version Control Systems"), |
303 "preferences-highlighter-association", |
323 "preferences-vcs", |
304 "EditorHighlightersPage", "1editorLexerPage", None], |
324 "VcsPage", |
305 "editorHighlightingStylesPage": |
325 None, |
306 [self.tr("Styles"), |
326 None, |
307 "preferences-highlighting-styles", |
327 ], |
308 "EditorHighlightingStylesPage", "1editorLexerPage", None], |
328 "0debuggerPage": [ |
309 "editorKeywordsPage": |
329 self.tr("Debugger"), |
310 [self.tr("Keywords"), "preferences-keywords", |
330 "preferences-debugger", |
311 "EditorKeywordsPage", "1editorLexerPage", None], |
331 None, |
312 "editorPropertiesPage": |
332 None, |
313 [self.tr("Properties"), "preferences-properties", |
333 None, |
314 "EditorPropertiesPage", "1editorLexerPage", None], |
334 ], |
315 |
335 "debuggerGeneralPage": [ |
316 "1editorMouseClickHandlers": |
336 self.tr("General"), |
317 [self.tr("Mouse Click Handlers"), |
337 "preferences-debugger", |
318 "preferences-mouse-click-handler", |
338 "DebuggerGeneralPage", |
319 "EditorMouseClickHandlerPage", "0editorPage", None], |
339 "0debuggerPage", |
320 "editorMouseClickHandlerJediPage": |
340 None, |
321 [self.tr("Jedi"), "jedi", |
341 ], |
322 "EditorMouseClickHandlerJediPage", |
342 "debuggerPython3Page": [ |
323 "1editorMouseClickHandlers", None], |
343 self.tr("Python3"), |
324 |
344 "preferences-pyDebugger", |
325 "0helpPage": |
345 "DebuggerPython3Page", |
326 [self.tr("Help"), "preferences-help", |
346 "0debuggerPage", |
327 None, None, None], |
347 None, |
328 "helpDocumentationPage": |
348 ], |
329 [self.tr("Help Documentation"), |
349 "0editorPage": [ |
330 "preferences-helpdocumentation", |
350 self.tr("Editor"), |
331 "HelpDocumentationPage", "0helpPage", None], |
351 "preferences-editor", |
332 "helpViewersPage": |
352 None, |
333 [self.tr("Help Viewers"), |
353 None, |
334 "preferences-helpviewers", |
354 None, |
335 "HelpViewersPage", "0helpPage", None], |
355 ], |
336 |
356 "editorAPIsPage": [ |
337 "0projectPage": |
357 self.tr("APIs"), |
338 [self.tr("Project"), "preferences-project", |
358 "preferences-api", |
339 None, None, None], |
359 "EditorAPIsPage", |
340 "projectBrowserPage": |
360 "0editorPage", |
341 [self.tr("Project Viewer"), "preferences-project", |
361 None, |
342 "ProjectBrowserPage", "0projectPage", None], |
362 ], |
343 "projectPage": |
363 "editorDocViewerPage": [ |
344 [self.tr("Project"), "preferences-project", |
364 self.tr("Documentation Viewer"), |
345 "ProjectPage", "0projectPage", None], |
365 "codeDocuViewer", |
346 "multiProjectPage": |
366 "EditorDocViewerPage", |
347 [self.tr("Multiproject"), |
367 "0editorPage", |
348 "preferences-multiproject", |
368 None, |
349 "MultiProjectPage", "0projectPage", None], |
369 ], |
350 |
370 "editorGeneralPage": [ |
351 "0interfacePage": |
371 self.tr("General"), |
352 [self.tr("Interface"), "preferences-interface", |
372 "preferences-general", |
353 None, None, None], |
373 "EditorGeneralPage", |
354 "interfacePage": |
374 "0editorPage", |
355 [self.tr("Interface"), "preferences-interface", |
375 None, |
356 "InterfacePage", "0interfacePage", None], |
376 ], |
357 "viewmanagerPage": |
377 "editorFilePage": [ |
358 [self.tr("Viewmanager"), "preferences-viewmanager", |
378 self.tr("Filehandling"), |
359 "ViewmanagerPage", "0interfacePage", None], |
379 "preferences-filehandling", |
|
380 "EditorFilePage", |
|
381 "0editorPage", |
|
382 None, |
|
383 ], |
|
384 "editorSearchPage": [ |
|
385 self.tr("Searching"), |
|
386 "preferences-search", |
|
387 "EditorSearchPage", |
|
388 "0editorPage", |
|
389 None, |
|
390 ], |
|
391 "editorSpellCheckingPage": [ |
|
392 self.tr("Spell checking"), |
|
393 "preferences-spellchecking", |
|
394 "EditorSpellCheckingPage", |
|
395 "0editorPage", |
|
396 None, |
|
397 ], |
|
398 "editorStylesPage": [ |
|
399 self.tr("Style"), |
|
400 "preferences-styles", |
|
401 "EditorStylesPage", |
|
402 "0editorPage", |
|
403 None, |
|
404 ], |
|
405 "editorSyntaxPage": [ |
|
406 self.tr("Code Checkers"), |
|
407 "preferences-debugger", |
|
408 "EditorSyntaxPage", |
|
409 "0editorPage", |
|
410 None, |
|
411 ], |
|
412 "editorTypingPage": [ |
|
413 self.tr("Typing"), |
|
414 "preferences-typing", |
|
415 "EditorTypingPage", |
|
416 "0editorPage", |
|
417 None, |
|
418 ], |
|
419 "editorExportersPage": [ |
|
420 self.tr("Exporters"), |
|
421 "preferences-exporters", |
|
422 "EditorExportersPage", |
|
423 "0editorPage", |
|
424 None, |
|
425 ], |
|
426 "1editorAutocompletionPage": [ |
|
427 self.tr("Autocompletion"), |
|
428 "preferences-autocompletion", |
|
429 "EditorAutocompletionPage", |
|
430 "0editorPage", |
|
431 None, |
|
432 ], |
|
433 "editorAutocompletionQScintillaPage": [ |
|
434 self.tr("QScintilla"), |
|
435 "qscintilla", |
|
436 "EditorAutocompletionQScintillaPage", |
|
437 "1editorAutocompletionPage", |
|
438 None, |
|
439 ], |
|
440 "editorAutocompletionJediPage": [ |
|
441 self.tr("Jedi"), |
|
442 "jedi", |
|
443 "EditorAutoCompletionJediPage", |
|
444 "1editorAutocompletionPage", |
|
445 None, |
|
446 ], |
|
447 "1editorCalltipsPage": [ |
|
448 self.tr("Calltips"), |
|
449 "preferences-calltips", |
|
450 "EditorCalltipsPage", |
|
451 "0editorPage", |
|
452 None, |
|
453 ], |
|
454 "editorCalltipsQScintillaPage": [ |
|
455 self.tr("QScintilla"), |
|
456 "qscintilla", |
|
457 "EditorCalltipsQScintillaPage", |
|
458 "1editorCalltipsPage", |
|
459 None, |
|
460 ], |
|
461 "editorCalltipsJediPage": [ |
|
462 self.tr("Jedi"), |
|
463 "jedi", |
|
464 "EditorCallTipsJediPage", |
|
465 "1editorCalltipsPage", |
|
466 None, |
|
467 ], |
|
468 "1editorLexerPage": [ |
|
469 self.tr("Highlighters"), |
|
470 "preferences-highlighting-styles", |
|
471 None, |
|
472 "0editorPage", |
|
473 None, |
|
474 ], |
|
475 "editorHighlightersPage": [ |
|
476 self.tr("Filetype Associations"), |
|
477 "preferences-highlighter-association", |
|
478 "EditorHighlightersPage", |
|
479 "1editorLexerPage", |
|
480 None, |
|
481 ], |
|
482 "editorHighlightingStylesPage": [ |
|
483 self.tr("Styles"), |
|
484 "preferences-highlighting-styles", |
|
485 "EditorHighlightingStylesPage", |
|
486 "1editorLexerPage", |
|
487 None, |
|
488 ], |
|
489 "editorKeywordsPage": [ |
|
490 self.tr("Keywords"), |
|
491 "preferences-keywords", |
|
492 "EditorKeywordsPage", |
|
493 "1editorLexerPage", |
|
494 None, |
|
495 ], |
|
496 "editorPropertiesPage": [ |
|
497 self.tr("Properties"), |
|
498 "preferences-properties", |
|
499 "EditorPropertiesPage", |
|
500 "1editorLexerPage", |
|
501 None, |
|
502 ], |
|
503 "1editorMouseClickHandlers": [ |
|
504 self.tr("Mouse Click Handlers"), |
|
505 "preferences-mouse-click-handler", |
|
506 "EditorMouseClickHandlerPage", |
|
507 "0editorPage", |
|
508 None, |
|
509 ], |
|
510 "editorMouseClickHandlerJediPage": [ |
|
511 self.tr("Jedi"), |
|
512 "jedi", |
|
513 "EditorMouseClickHandlerJediPage", |
|
514 "1editorMouseClickHandlers", |
|
515 None, |
|
516 ], |
|
517 "0helpPage": [self.tr("Help"), "preferences-help", None, None, None], |
|
518 "helpDocumentationPage": [ |
|
519 self.tr("Help Documentation"), |
|
520 "preferences-helpdocumentation", |
|
521 "HelpDocumentationPage", |
|
522 "0helpPage", |
|
523 None, |
|
524 ], |
|
525 "helpViewersPage": [ |
|
526 self.tr("Help Viewers"), |
|
527 "preferences-helpviewers", |
|
528 "HelpViewersPage", |
|
529 "0helpPage", |
|
530 None, |
|
531 ], |
|
532 "0projectPage": [ |
|
533 self.tr("Project"), |
|
534 "preferences-project", |
|
535 None, |
|
536 None, |
|
537 None, |
|
538 ], |
|
539 "projectBrowserPage": [ |
|
540 self.tr("Project Viewer"), |
|
541 "preferences-project", |
|
542 "ProjectBrowserPage", |
|
543 "0projectPage", |
|
544 None, |
|
545 ], |
|
546 "projectPage": [ |
|
547 self.tr("Project"), |
|
548 "preferences-project", |
|
549 "ProjectPage", |
|
550 "0projectPage", |
|
551 None, |
|
552 ], |
|
553 "multiProjectPage": [ |
|
554 self.tr("Multiproject"), |
|
555 "preferences-multiproject", |
|
556 "MultiProjectPage", |
|
557 "0projectPage", |
|
558 None, |
|
559 ], |
|
560 "0interfacePage": [ |
|
561 self.tr("Interface"), |
|
562 "preferences-interface", |
|
563 None, |
|
564 None, |
|
565 None, |
|
566 ], |
|
567 "interfacePage": [ |
|
568 self.tr("Interface"), |
|
569 "preferences-interface", |
|
570 "InterfacePage", |
|
571 "0interfacePage", |
|
572 None, |
|
573 ], |
|
574 "viewmanagerPage": [ |
|
575 self.tr("Viewmanager"), |
|
576 "preferences-viewmanager", |
|
577 "ViewmanagerPage", |
|
578 "0interfacePage", |
|
579 None, |
|
580 ], |
360 } |
581 } |
361 if self.__webEngine: |
582 if self.__webEngine: |
362 self.configItems.update({ |
583 self.configItems.update( |
363 "0webBrowserPage": |
584 { |
364 [self.tr("Web Browser"), "ericWeb", |
585 "0webBrowserPage": [ |
365 None, None, None], |
586 self.tr("Web Browser"), |
366 "webBrowserAppearancePage": |
587 "ericWeb", |
367 [self.tr("Appearance"), "preferences-styles", |
588 None, |
368 "WebBrowserAppearancePage", "0webBrowserPage", None], |
589 None, |
369 "webBrowserPage": |
590 None, |
370 [self.tr("eric Web Browser"), "ericWeb", |
591 ], |
371 "WebBrowserPage", "0webBrowserPage", None], |
592 "webBrowserAppearancePage": [ |
372 "webBrowserVirusTotalPage": |
593 self.tr("Appearance"), |
373 [self.tr("VirusTotal Interface"), "virustotal", |
594 "preferences-styles", |
374 "WebBrowserVirusTotalPage", "0webBrowserPage", None], |
595 "WebBrowserAppearancePage", |
375 "webBrowserSpellCheckingPage": |
596 "0webBrowserPage", |
376 [self.tr("Spell checking"), |
597 None, |
377 "preferences-spellchecking", |
598 ], |
378 "WebBrowserSpellCheckingPage", "0webBrowserPage", |
599 "webBrowserPage": [ |
379 None], |
600 self.tr("eric Web Browser"), |
380 }) |
601 "ericWeb", |
381 |
602 "WebBrowserPage", |
|
603 "0webBrowserPage", |
|
604 None, |
|
605 ], |
|
606 "webBrowserVirusTotalPage": [ |
|
607 self.tr("VirusTotal Interface"), |
|
608 "virustotal", |
|
609 "WebBrowserVirusTotalPage", |
|
610 "0webBrowserPage", |
|
611 None, |
|
612 ], |
|
613 "webBrowserSpellCheckingPage": [ |
|
614 self.tr("Spell checking"), |
|
615 "preferences-spellchecking", |
|
616 "WebBrowserSpellCheckingPage", |
|
617 "0webBrowserPage", |
|
618 None, |
|
619 ], |
|
620 } |
|
621 ) |
|
622 |
382 self.configItems.update( |
623 self.configItems.update( |
383 ericApp().getObject("PluginManager").getPluginConfigData()) |
624 ericApp().getObject("PluginManager").getPluginConfigData() |
384 |
625 ) |
|
626 |
385 elif displayMode == ConfigurationMode.EDITORMODE: |
627 elif displayMode == ConfigurationMode.EDITORMODE: |
386 self.configItems = { |
628 self.configItems = { |
387 # key : [display string, pixmap name, dialog module name or |
629 # key : [display string, pixmap name, dialog module name or |
388 # page creation function, parent key, |
630 # page creation function, parent key, |
389 # reference to configuration page (must always be last)] |
631 # reference to configuration page (must always be last)] |
390 # The dialog module must have the module function 'create' to |
632 # The dialog module must have the module function 'create' to |
391 # create the configuration page. This must have the method |
633 # create the configuration page. This must have the method |
392 # 'save' to save the settings. |
634 # 'save' to save the settings. |
393 "iconsPage": |
635 "iconsPage": [ |
394 [self.tr("Icons"), "preferences-icons", |
636 self.tr("Icons"), |
395 "IconsPage", None, None], |
637 "preferences-icons", |
396 "interfacePage": |
638 "IconsPage", |
397 [self.tr("Interface"), "preferences-interface", |
639 None, |
398 "InterfaceLightPage", None, None], |
640 None, |
399 "printerPage": |
641 ], |
400 [self.tr("Printer"), "preferences-printer", |
642 "interfacePage": [ |
401 "PrinterPage", None, None], |
643 self.tr("Interface"), |
402 |
644 "preferences-interface", |
403 "0editorPage": |
645 "InterfaceLightPage", |
404 [self.tr("Editor"), "preferences-editor", |
646 None, |
405 None, None, None], |
647 None, |
406 "editorGeneralPage": |
648 ], |
407 [self.tr("General"), "preferences-general", |
649 "printerPage": [ |
408 "EditorGeneralPage", "0editorPage", None], |
650 self.tr("Printer"), |
409 "editorFilePage": |
651 "preferences-printer", |
410 [self.tr("Filehandling"), |
652 "PrinterPage", |
411 "preferences-filehandling", |
653 None, |
412 "EditorFilePage", "0editorPage", None], |
654 None, |
413 "editorSearchPage": |
655 ], |
414 [self.tr("Searching"), "preferences-search", |
656 "0editorPage": [ |
415 "EditorSearchPage", "0editorPage", None], |
657 self.tr("Editor"), |
416 "editorSpellCheckingPage": |
658 "preferences-editor", |
417 [self.tr("Spell checking"), |
659 None, |
418 "preferences-spellchecking", |
660 None, |
419 "EditorSpellCheckingPage", "0editorPage", None], |
661 None, |
420 "editorStylesPage": |
662 ], |
421 [self.tr("Style"), "preferences-styles", |
663 "editorGeneralPage": [ |
422 "EditorStylesPage", "0editorPage", None], |
664 self.tr("General"), |
423 "editorTypingPage": |
665 "preferences-general", |
424 [self.tr("Typing"), "preferences-typing", |
666 "EditorGeneralPage", |
425 "EditorTypingPage", "0editorPage", None], |
667 "0editorPage", |
426 |
668 None, |
427 "1editorLexerPage": |
669 ], |
428 [self.tr("Highlighters"), |
670 "editorFilePage": [ |
429 "preferences-highlighting-styles", |
671 self.tr("Filehandling"), |
430 None, "0editorPage", None], |
672 "preferences-filehandling", |
431 "editorHighlightersPage": |
673 "EditorFilePage", |
432 [self.tr("Filetype Associations"), |
674 "0editorPage", |
433 "preferences-highlighter-association", |
675 None, |
434 "EditorHighlightersPage", "1editorLexerPage", None], |
676 ], |
435 "editorHighlightingStylesPage": |
677 "editorSearchPage": [ |
436 [self.tr("Styles"), |
678 self.tr("Searching"), |
437 "preferences-highlighting-styles", |
679 "preferences-search", |
438 "EditorHighlightingStylesPage", "1editorLexerPage", None], |
680 "EditorSearchPage", |
439 "editorKeywordsPage": |
681 "0editorPage", |
440 [self.tr("Keywords"), "preferences-keywords", |
682 None, |
441 "EditorKeywordsPage", "1editorLexerPage", None], |
683 ], |
442 "editorPropertiesPage": |
684 "editorSpellCheckingPage": [ |
443 [self.tr("Properties"), "preferences-properties", |
685 self.tr("Spell checking"), |
444 "EditorPropertiesPage", "1editorLexerPage", None], |
686 "preferences-spellchecking", |
|
687 "EditorSpellCheckingPage", |
|
688 "0editorPage", |
|
689 None, |
|
690 ], |
|
691 "editorStylesPage": [ |
|
692 self.tr("Style"), |
|
693 "preferences-styles", |
|
694 "EditorStylesPage", |
|
695 "0editorPage", |
|
696 None, |
|
697 ], |
|
698 "editorTypingPage": [ |
|
699 self.tr("Typing"), |
|
700 "preferences-typing", |
|
701 "EditorTypingPage", |
|
702 "0editorPage", |
|
703 None, |
|
704 ], |
|
705 "1editorLexerPage": [ |
|
706 self.tr("Highlighters"), |
|
707 "preferences-highlighting-styles", |
|
708 None, |
|
709 "0editorPage", |
|
710 None, |
|
711 ], |
|
712 "editorHighlightersPage": [ |
|
713 self.tr("Filetype Associations"), |
|
714 "preferences-highlighter-association", |
|
715 "EditorHighlightersPage", |
|
716 "1editorLexerPage", |
|
717 None, |
|
718 ], |
|
719 "editorHighlightingStylesPage": [ |
|
720 self.tr("Styles"), |
|
721 "preferences-highlighting-styles", |
|
722 "EditorHighlightingStylesPage", |
|
723 "1editorLexerPage", |
|
724 None, |
|
725 ], |
|
726 "editorKeywordsPage": [ |
|
727 self.tr("Keywords"), |
|
728 "preferences-keywords", |
|
729 "EditorKeywordsPage", |
|
730 "1editorLexerPage", |
|
731 None, |
|
732 ], |
|
733 "editorPropertiesPage": [ |
|
734 self.tr("Properties"), |
|
735 "preferences-properties", |
|
736 "EditorPropertiesPage", |
|
737 "1editorLexerPage", |
|
738 None, |
|
739 ], |
445 } |
740 } |
446 |
741 |
447 elif displayMode == ConfigurationMode.WEBBROWSERMODE: |
742 elif displayMode == ConfigurationMode.WEBBROWSERMODE: |
448 self.configItems = { |
743 self.configItems = { |
449 # key : [display string, pixmap name, dialog module name or |
744 # key : [display string, pixmap name, dialog module name or |
450 # page creation function, parent key, |
745 # page creation function, parent key, |
451 # reference to configuration page (must always be last)] |
746 # reference to configuration page (must always be last)] |
452 # The dialog module must have the module function 'create' to |
747 # The dialog module must have the module function 'create' to |
453 # create the configuration page. This must have the method |
748 # create the configuration page. This must have the method |
454 # 'save' to save the settings. |
749 # 'save' to save the settings. |
455 "iconsPage": |
750 "iconsPage": [ |
456 [self.tr("Icons"), "preferences-icons", |
751 self.tr("Icons"), |
457 "IconsPage", None, None], |
752 "preferences-icons", |
458 "interfacePage": |
753 "IconsPage", |
459 [self.tr("Interface"), "preferences-interface", |
754 None, |
460 "InterfaceLightPage", None, None], |
755 None, |
461 "networkPage": |
756 ], |
462 [self.tr("Network"), "preferences-network", |
757 "interfacePage": [ |
463 "NetworkPage", None, None], |
758 self.tr("Interface"), |
464 "printerPage": |
759 "preferences-interface", |
465 [self.tr("Printer"), "preferences-printer", |
760 "InterfaceLightPage", |
466 "PrinterPage", None, None], |
761 None, |
467 "securityPage": |
762 None, |
468 [self.tr("Security"), "preferences-security", |
763 ], |
469 "SecurityPage", None, None], |
764 "networkPage": [ |
470 |
765 self.tr("Network"), |
471 "helpDocumentationPage": |
766 "preferences-network", |
472 [self.tr("Help Documentation"), |
767 "NetworkPage", |
473 "preferences-helpdocumentation", |
768 None, |
474 "HelpDocumentationPage", None, None], |
769 None, |
475 |
770 ], |
476 "webBrowserAppearancePage": |
771 "printerPage": [ |
477 [self.tr("Appearance"), "preferences-styles", |
772 self.tr("Printer"), |
478 "WebBrowserAppearancePage", None, None], |
773 "preferences-printer", |
479 "webBrowserPage": |
774 "PrinterPage", |
480 [self.tr("eric Web Browser"), "ericWeb", |
775 None, |
481 "WebBrowserPage", None, None], |
776 None, |
482 |
777 ], |
483 "webBrowserVirusTotalPage": |
778 "securityPage": [ |
484 [self.tr("VirusTotal Interface"), "virustotal", |
779 self.tr("Security"), |
485 "WebBrowserVirusTotalPage", None, None], |
780 "preferences-security", |
486 |
781 "SecurityPage", |
487 "webBrowserSpellCheckingPage": |
782 None, |
488 [self.tr("Spell checking"), |
783 None, |
489 "preferences-spellchecking", |
784 ], |
490 "WebBrowserSpellCheckingPage", None, None], |
785 "helpDocumentationPage": [ |
|
786 self.tr("Help Documentation"), |
|
787 "preferences-helpdocumentation", |
|
788 "HelpDocumentationPage", |
|
789 None, |
|
790 None, |
|
791 ], |
|
792 "webBrowserAppearancePage": [ |
|
793 self.tr("Appearance"), |
|
794 "preferences-styles", |
|
795 "WebBrowserAppearancePage", |
|
796 None, |
|
797 None, |
|
798 ], |
|
799 "webBrowserPage": [ |
|
800 self.tr("eric Web Browser"), |
|
801 "ericWeb", |
|
802 "WebBrowserPage", |
|
803 None, |
|
804 None, |
|
805 ], |
|
806 "webBrowserVirusTotalPage": [ |
|
807 self.tr("VirusTotal Interface"), |
|
808 "virustotal", |
|
809 "WebBrowserVirusTotalPage", |
|
810 None, |
|
811 None, |
|
812 ], |
|
813 "webBrowserSpellCheckingPage": [ |
|
814 self.tr("Spell checking"), |
|
815 "preferences-spellchecking", |
|
816 "WebBrowserSpellCheckingPage", |
|
817 None, |
|
818 None, |
|
819 ], |
491 } |
820 } |
492 |
821 |
493 elif displayMode == ConfigurationMode.TRAYSTARTERMODE: |
822 elif displayMode == ConfigurationMode.TRAYSTARTERMODE: |
494 self.configItems = { |
823 self.configItems = { |
495 # key : [display string, pixmap name, dialog module name or |
824 # key : [display string, pixmap name, dialog module name or |
496 # page creation function, parent key, |
825 # page creation function, parent key, |
497 # reference to configuration page (must always be last)] |
826 # reference to configuration page (must always be last)] |
498 # The dialog module must have the module function 'create' to |
827 # The dialog module must have the module function 'create' to |
499 # create the configuration page. This must have the method |
828 # create the configuration page. This must have the method |
500 # 'save' to save the settings. |
829 # 'save' to save the settings. |
501 "trayStarterPage": |
830 "trayStarterPage": [ |
502 [self.tr("Tray Starter"), "erict", |
831 self.tr("Tray Starter"), |
503 "TrayStarterPage", None, None], |
832 "erict", |
|
833 "TrayStarterPage", |
|
834 None, |
|
835 None, |
|
836 ], |
504 } |
837 } |
505 |
838 |
506 elif displayMode == ConfigurationMode.HEXEDITORMODE: |
839 elif displayMode == ConfigurationMode.HEXEDITORMODE: |
507 self.configItems = { |
840 self.configItems = { |
508 # key : [display string, pixmap name, dialog module name or |
841 # key : [display string, pixmap name, dialog module name or |
509 # page creation function, parent key, |
842 # page creation function, parent key, |
510 # reference to configuration page (must always be last)] |
843 # reference to configuration page (must always be last)] |
511 # The dialog module must have the module function 'create' to |
844 # The dialog module must have the module function 'create' to |
512 # create the configuration page. This must have the method |
845 # create the configuration page. This must have the method |
513 # 'save' to save the settings. |
846 # 'save' to save the settings. |
514 "iconsPage": |
847 "iconsPage": [ |
515 [self.tr("Icons"), "preferences-icons", |
848 self.tr("Icons"), |
516 "IconsPage", None, None], |
849 "preferences-icons", |
517 "interfacePage": |
850 "IconsPage", |
518 [self.tr("Interface"), "preferences-interface", |
851 None, |
519 "InterfaceLightPage", None, None], |
852 None, |
520 "hexEditorPage": |
853 ], |
521 [self.tr("Hex Editor"), "hexEditor", |
854 "interfacePage": [ |
522 "HexEditorPage", None, None], |
855 self.tr("Interface"), |
|
856 "preferences-interface", |
|
857 "InterfaceLightPage", |
|
858 None, |
|
859 None, |
|
860 ], |
|
861 "hexEditorPage": [ |
|
862 self.tr("Hex Editor"), |
|
863 "hexEditor", |
|
864 "HexEditorPage", |
|
865 None, |
|
866 None, |
|
867 ], |
523 } |
868 } |
524 |
869 |
525 else: |
870 else: |
526 # display mode for generic use |
871 # display mode for generic use |
527 self.configItems = { |
872 self.configItems = { |
528 # key : [display string, pixmap name, dialog module name or |
873 # key : [display string, pixmap name, dialog module name or |
529 # page creation function, parent key, |
874 # page creation function, parent key, |
530 # reference to configuration page (must always be last)] |
875 # reference to configuration page (must always be last)] |
531 # The dialog module must have the module function 'create' to |
876 # The dialog module must have the module function 'create' to |
532 # create the configuration page. This must have the method |
877 # create the configuration page. This must have the method |
533 # 'save' to save the settings. |
878 # 'save' to save the settings. |
534 "iconsPage": |
879 "iconsPage": [ |
535 [self.tr("Icons"), "preferences-icons", |
880 self.tr("Icons"), |
536 "IconsPage", None, None], |
881 "preferences-icons", |
537 "interfacePage": |
882 "IconsPage", |
538 [self.tr("Interface"), "preferences-interface", |
883 None, |
539 "InterfaceLightPage", None, None], |
884 None, |
|
885 ], |
|
886 "interfacePage": [ |
|
887 self.tr("Interface"), |
|
888 "preferences-interface", |
|
889 "InterfaceLightPage", |
|
890 None, |
|
891 None, |
|
892 ], |
540 } |
893 } |
541 |
894 |
542 # generate the list entries |
895 # generate the list entries |
543 self.__expandedEntries = [] |
896 self.__expandedEntries = [] |
544 for key in sorted(self.configItems.keys()): |
897 for key in sorted(self.configItems.keys()): |
545 pageData = self.configItems[key] |
898 pageData = self.configItems[key] |
546 if pageData[3]: |
899 if pageData[3]: |
599 self.resize(900, 750) |
957 self.resize(900, 750) |
600 self.verticalLayout_2 = QVBoxLayout(self) |
958 self.verticalLayout_2 = QVBoxLayout(self) |
601 self.verticalLayout_2.setSpacing(6) |
959 self.verticalLayout_2.setSpacing(6) |
602 self.verticalLayout_2.setContentsMargins(6, 6, 6, 6) |
960 self.verticalLayout_2.setContentsMargins(6, 6, 6, 6) |
603 self.verticalLayout_2.setObjectName("verticalLayout_2") |
961 self.verticalLayout_2.setObjectName("verticalLayout_2") |
604 |
962 |
605 self.configSplitter = QSplitter(self) |
963 self.configSplitter = QSplitter(self) |
606 self.configSplitter.setOrientation(Qt.Orientation.Horizontal) |
964 self.configSplitter.setOrientation(Qt.Orientation.Horizontal) |
607 self.configSplitter.setObjectName("configSplitter") |
965 self.configSplitter.setObjectName("configSplitter") |
608 |
966 |
609 self.configListWidget = QWidget(self.configSplitter) |
967 self.configListWidget = QWidget(self.configSplitter) |
610 self.leftVBoxLayout = QVBoxLayout(self.configListWidget) |
968 self.leftVBoxLayout = QVBoxLayout(self.configListWidget) |
611 self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0) |
969 self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0) |
612 self.leftVBoxLayout.setSpacing(0) |
970 self.leftVBoxLayout.setSpacing(0) |
613 self.leftVBoxLayout.setObjectName("leftVBoxLayout") |
971 self.leftVBoxLayout.setObjectName("leftVBoxLayout") |
614 self.configListSearch = QLineEdit(self) |
972 self.configListSearch = QLineEdit(self) |
615 self.configListSearch.setPlaceholderText( |
973 self.configListSearch.setPlaceholderText(self.tr("Enter search text...")) |
616 self.tr("Enter search text...")) |
|
617 self.configListSearch.setClearButtonEnabled(True) |
974 self.configListSearch.setClearButtonEnabled(True) |
618 self.configListSearch.setObjectName("configListSearch") |
975 self.configListSearch.setObjectName("configListSearch") |
619 self.configListSearch.setClearButtonEnabled(True) |
976 self.configListSearch.setClearButtonEnabled(True) |
620 self.leftVBoxLayout.addWidget(self.configListSearch) |
977 self.leftVBoxLayout.addWidget(self.configListSearch) |
621 self.configList = QTreeWidget() |
978 self.configList = QTreeWidget() |
622 self.configList.setObjectName("configList") |
979 self.configList.setObjectName("configList") |
623 self.leftVBoxLayout.addWidget(self.configList) |
980 self.leftVBoxLayout.addWidget(self.configList) |
624 self.configListSearch.textChanged.connect(self.__searchTextChanged) |
981 self.configListSearch.textChanged.connect(self.__searchTextChanged) |
625 |
982 |
626 self.scrollArea = QScrollArea(self.configSplitter) |
983 self.scrollArea = QScrollArea(self.configSplitter) |
627 self.scrollArea.setFrameShape(QFrame.Shape.NoFrame) |
984 self.scrollArea.setFrameShape(QFrame.Shape.NoFrame) |
628 self.scrollArea.setVerticalScrollBarPolicy( |
985 self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn) |
629 Qt.ScrollBarPolicy.ScrollBarAlwaysOn) |
|
630 self.scrollArea.setHorizontalScrollBarPolicy( |
986 self.scrollArea.setHorizontalScrollBarPolicy( |
631 Qt.ScrollBarPolicy.ScrollBarAlwaysOn) |
987 Qt.ScrollBarPolicy.ScrollBarAlwaysOn |
|
988 ) |
632 self.scrollArea.setWidgetResizable(False) |
989 self.scrollArea.setWidgetResizable(False) |
633 self.scrollArea.setSizeAdjustPolicy( |
990 self.scrollArea.setSizeAdjustPolicy( |
634 QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents) |
991 QAbstractScrollArea.SizeAdjustPolicy.AdjustToContents |
|
992 ) |
635 self.scrollArea.setObjectName("scrollArea") |
993 self.scrollArea.setObjectName("scrollArea") |
636 |
994 |
637 self.configStack = QStackedWidget() |
995 self.configStack = QStackedWidget() |
638 self.configStack.setFrameShape(QFrame.Shape.Box) |
996 self.configStack.setFrameShape(QFrame.Shape.Box) |
639 self.configStack.setFrameShadow(QFrame.Shadow.Sunken) |
997 self.configStack.setFrameShadow(QFrame.Shadow.Sunken) |
640 self.configStack.setObjectName("configStack") |
998 self.configStack.setObjectName("configStack") |
641 self.scrollArea.setWidget(self.configStack) |
999 self.scrollArea.setWidget(self.configStack) |
642 |
1000 |
643 self.emptyPage = QWidget() |
1001 self.emptyPage = QWidget() |
644 self.emptyPage.setGeometry(QRect(0, 0, 372, 591)) |
1002 self.emptyPage.setGeometry(QRect(0, 0, 372, 591)) |
645 self.emptyPage.setObjectName("emptyPage") |
1003 self.emptyPage.setObjectName("emptyPage") |
646 self.vboxlayout = QVBoxLayout(self.emptyPage) |
1004 self.vboxlayout = QVBoxLayout(self.emptyPage) |
647 self.vboxlayout.setSpacing(6) |
1005 self.vboxlayout.setSpacing(6) |
648 self.vboxlayout.setContentsMargins(6, 6, 6, 6) |
1006 self.vboxlayout.setContentsMargins(6, 6, 6, 6) |
649 self.vboxlayout.setObjectName("vboxlayout") |
1007 self.vboxlayout.setObjectName("vboxlayout") |
650 spacerItem = QSpacerItem( |
1008 spacerItem = QSpacerItem( |
651 20, 20, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) |
1009 20, 20, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding |
|
1010 ) |
652 self.vboxlayout.addItem(spacerItem) |
1011 self.vboxlayout.addItem(spacerItem) |
653 self.emptyPagePixmap = QLabel(self.emptyPage) |
1012 self.emptyPagePixmap = QLabel(self.emptyPage) |
654 self.emptyPagePixmap.setAlignment(Qt.AlignmentFlag.AlignCenter) |
1013 self.emptyPagePixmap.setAlignment(Qt.AlignmentFlag.AlignCenter) |
655 self.emptyPagePixmap.setObjectName("emptyPagePixmap") |
1014 self.emptyPagePixmap.setObjectName("emptyPagePixmap") |
656 self.emptyPagePixmap.setPixmap( |
1015 self.emptyPagePixmap.setPixmap( |
657 QPixmap(os.path.join(getConfig('ericPixDir'), 'eric.png'))) |
1016 QPixmap(os.path.join(getConfig("ericPixDir"), "eric.png")) |
|
1017 ) |
658 self.vboxlayout.addWidget(self.emptyPagePixmap) |
1018 self.vboxlayout.addWidget(self.emptyPagePixmap) |
659 self.textLabel1 = QLabel(self.emptyPage) |
1019 self.textLabel1 = QLabel(self.emptyPage) |
660 self.textLabel1.setAlignment(Qt.AlignmentFlag.AlignCenter) |
1020 self.textLabel1.setAlignment(Qt.AlignmentFlag.AlignCenter) |
661 self.textLabel1.setObjectName("textLabel1") |
1021 self.textLabel1.setObjectName("textLabel1") |
662 self.vboxlayout.addWidget(self.textLabel1) |
1022 self.vboxlayout.addWidget(self.textLabel1) |
663 spacerItem1 = QSpacerItem( |
1023 spacerItem1 = QSpacerItem( |
664 20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) |
1024 20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding |
|
1025 ) |
665 self.vboxlayout.addItem(spacerItem1) |
1026 self.vboxlayout.addItem(spacerItem1) |
666 self.configStack.addWidget(self.emptyPage) |
1027 self.configStack.addWidget(self.emptyPage) |
667 |
1028 |
668 self.verticalLayout_2.addWidget(self.configSplitter) |
1029 self.verticalLayout_2.addWidget(self.configSplitter) |
669 |
1030 |
670 self.buttonBox = QDialogButtonBox(self) |
1031 self.buttonBox = QDialogButtonBox(self) |
671 self.buttonBox.setOrientation(Qt.Orientation.Horizontal) |
1032 self.buttonBox.setOrientation(Qt.Orientation.Horizontal) |
672 self.buttonBox.setStandardButtons( |
1033 self.buttonBox.setStandardButtons( |
673 QDialogButtonBox.StandardButton.Apply | |
1034 QDialogButtonBox.StandardButton.Apply |
674 QDialogButtonBox.StandardButton.Cancel | |
1035 | QDialogButtonBox.StandardButton.Cancel |
675 QDialogButtonBox.StandardButton.Ok | |
1036 | QDialogButtonBox.StandardButton.Ok |
676 QDialogButtonBox.StandardButton.Reset |
1037 | QDialogButtonBox.StandardButton.Reset |
677 ) |
1038 ) |
678 self.buttonBox.setObjectName("buttonBox") |
1039 self.buttonBox.setObjectName("buttonBox") |
679 if ( |
1040 if not self.fromEric and self.displayMode == ConfigurationMode.DEFAULTMODE: |
680 not self.fromEric and |
|
681 self.displayMode == ConfigurationMode.DEFAULTMODE |
|
682 ): |
|
683 self.buttonBox.button(QDialogButtonBox.StandardButton.Apply).hide() |
1041 self.buttonBox.button(QDialogButtonBox.StandardButton.Apply).hide() |
684 self.buttonBox.button( |
1042 self.buttonBox.button(QDialogButtonBox.StandardButton.Apply).setEnabled(False) |
685 QDialogButtonBox.StandardButton.Apply).setEnabled(False) |
1043 self.buttonBox.button(QDialogButtonBox.StandardButton.Reset).setEnabled(False) |
686 self.buttonBox.button( |
|
687 QDialogButtonBox.StandardButton.Reset).setEnabled(False) |
|
688 self.verticalLayout_2.addWidget(self.buttonBox) |
1044 self.verticalLayout_2.addWidget(self.buttonBox) |
689 |
1045 |
690 self.setWindowTitle(self.tr("Preferences")) |
1046 self.setWindowTitle(self.tr("Preferences")) |
691 |
1047 |
692 self.configList.header().hide() |
1048 self.configList.header().hide() |
693 self.configList.header().setSortIndicator( |
1049 self.configList.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder) |
694 0, Qt.SortOrder.AscendingOrder) |
|
695 self.configList.setSortingEnabled(True) |
1050 self.configList.setSortingEnabled(True) |
696 self.textLabel1.setText( |
1051 self.textLabel1.setText( |
697 self.tr("Please select an entry of the list \n" |
1052 self.tr( |
698 "to display the configuration page.")) |
1053 "Please select an entry of the list \n" |
699 |
1054 "to display the configuration page." |
|
1055 ) |
|
1056 ) |
|
1057 |
700 QMetaObject.connectSlotsByName(self) |
1058 QMetaObject.connectSlotsByName(self) |
701 self.setTabOrder(self.configList, self.configStack) |
1059 self.setTabOrder(self.configList, self.configStack) |
702 |
1060 |
703 self.configStack.setCurrentWidget(self.emptyPage) |
1061 self.configStack.setCurrentWidget(self.emptyPage) |
704 |
1062 |
705 self.configList.setFocus() |
1063 self.configList.setFocus() |
706 |
1064 |
707 def __searchTextChanged(self, text): |
1065 def __searchTextChanged(self, text): |
708 """ |
1066 """ |
709 Private slot to handle a change of the search text. |
1067 Private slot to handle a change of the search text. |
710 |
1068 |
711 @param text text to search for (string) |
1069 @param text text to search for (string) |
712 """ |
1070 """ |
713 self.__searchChildItems(self.configList.invisibleRootItem(), text) |
1071 self.__searchChildItems(self.configList.invisibleRootItem(), text) |
714 |
1072 |
715 def __searchChildItems(self, parent, text): |
1073 def __searchChildItems(self, parent, text): |
716 """ |
1074 """ |
717 Private method to enable child items based on a search string. |
1075 Private method to enable child items based on a search string. |
718 |
1076 |
719 @param parent reference to the parent item (QTreeWidgetItem) |
1077 @param parent reference to the parent item (QTreeWidgetItem) |
720 @param text text to search for (string) |
1078 @param text text to search for (string) |
721 @return flag indicating an enabled child item (boolean) |
1079 @return flag indicating an enabled child item (boolean) |
722 """ |
1080 """ |
723 childEnabled = False |
1081 childEnabled = False |
724 text = text.lower() |
1082 text = text.lower() |
725 for index in range(parent.childCount()): |
1083 for index in range(parent.childCount()): |
726 itm = parent.child(index) |
1084 itm = parent.child(index) |
727 enable = ( |
1085 enable = ( |
728 (self.__searchChildItems(itm, text) or |
1086 ( |
729 text == "" or |
1087 self.__searchChildItems(itm, text) |
730 text in itm.text(0).lower()) |
1088 or text == "" |
731 if itm.childCount() > 0 else |
1089 or text in itm.text(0).lower() |
732 (text == "" or text in itm.text(0).lower()) |
1090 ) |
|
1091 if itm.childCount() > 0 |
|
1092 else (text == "" or text in itm.text(0).lower()) |
733 ) |
1093 ) |
734 if enable: |
1094 if enable: |
735 childEnabled = True |
1095 childEnabled = True |
736 itm.setDisabled(not enable) |
1096 itm.setDisabled(not enable) |
737 |
1097 |
738 return childEnabled |
1098 return childEnabled |
739 |
1099 |
740 def __initLexers(self): |
1100 def __initLexers(self): |
741 """ |
1101 """ |
742 Private method to initialize the dictionary of preferences lexers. |
1102 Private method to initialize the dictionary of preferences lexers. |
743 """ |
1103 """ |
744 import QScintilla.Lexers |
1104 import QScintilla.Lexers |
745 from .PreferencesLexer import ( |
1105 from .PreferencesLexer import PreferencesLexer, PreferencesLexerLanguageError |
746 PreferencesLexer, PreferencesLexerLanguageError |
1106 |
747 ) |
|
748 |
|
749 self.lexers = {} |
1107 self.lexers = {} |
750 for language in QScintilla.Lexers.getSupportedLanguages(): |
1108 for language in QScintilla.Lexers.getSupportedLanguages(): |
751 if language not in self.lexers: |
1109 if language not in self.lexers: |
752 with contextlib.suppress(PreferencesLexerLanguageError): |
1110 with contextlib.suppress(PreferencesLexerLanguageError): |
753 self.lexers[language] = PreferencesLexer(language, self) |
1111 self.lexers[language] = PreferencesLexer(language, self) |
754 |
1112 |
755 def __importConfigurationPage(self, name): |
1113 def __importConfigurationPage(self, name): |
756 """ |
1114 """ |
757 Private method to import a configuration page module. |
1115 Private method to import a configuration page module. |
758 |
1116 |
759 @param name name of the configuration page module (string) |
1117 @param name name of the configuration page module (string) |
760 @return reference to the configuration page module |
1118 @return reference to the configuration page module |
761 """ |
1119 """ |
762 modName = "Preferences.ConfigurationPages.{0}".format(name) |
1120 modName = "Preferences.ConfigurationPages.{0}".format(name) |
763 try: |
1121 try: |
764 mod = __import__(modName) |
1122 mod = __import__(modName) |
765 components = modName.split('.') |
1123 components = modName.split(".") |
766 for comp in components[1:]: |
1124 for comp in components[1:]: |
767 mod = getattr(mod, comp) |
1125 mod = getattr(mod, comp) |
768 return mod |
1126 return mod |
769 except ImportError: |
1127 except ImportError: |
770 EricMessageBox.critical( |
1128 EricMessageBox.critical( |
771 self, |
1129 self, |
772 self.tr("Configuration Page Error"), |
1130 self.tr("Configuration Page Error"), |
773 self.tr("""<p>The configuration page <b>{0}</b>""" |
1131 self.tr( |
774 """ could not be loaded.</p>""").format(name)) |
1132 """<p>The configuration page <b>{0}</b>""" |
|
1133 """ could not be loaded.</p>""" |
|
1134 ).format(name), |
|
1135 ) |
775 return None |
1136 return None |
776 |
1137 |
777 def __showConfigurationPage(self, itm, column): |
1138 def __showConfigurationPage(self, itm, column): |
778 """ |
1139 """ |
779 Private slot to show a selected configuration page. |
1140 Private slot to show a selected configuration page. |
780 |
1141 |
781 @param itm reference to the selected item (QTreeWidgetItem) |
1142 @param itm reference to the selected item (QTreeWidgetItem) |
782 @param column column that was selected (integer) (ignored) |
1143 @param column column that was selected (integer) (ignored) |
783 """ |
1144 """ |
784 pageName = itm.getPageName() |
1145 pageName = itm.getPageName() |
785 self.showConfigurationPageByName(pageName, setCurrent=False) |
1146 self.showConfigurationPageByName(pageName, setCurrent=False) |
786 |
1147 |
787 def __initPage(self, pageData): |
1148 def __initPage(self, pageData): |
788 """ |
1149 """ |
789 Private method to initialize a configuration page. |
1150 Private method to initialize a configuration page. |
790 |
1151 |
791 @param pageData data structure for the page to initialize |
1152 @param pageData data structure for the page to initialize |
792 @return reference to the initialized page |
1153 @return reference to the initialized page |
793 """ |
1154 """ |
794 page = None |
1155 page = None |
795 if isinstance(pageData[2], types.FunctionType): |
1156 if isinstance(pageData[2], types.FunctionType): |