95 self.pluginManager = PluginManager(self) |
97 self.pluginManager = PluginManager(self) |
96 e5App().registerObject("PluginManager", self.pluginManager) |
98 e5App().registerObject("PluginManager", self.pluginManager) |
97 |
99 |
98 if displayMode == ConfigurationWidget.DefaultMode: |
100 if displayMode == ConfigurationWidget.DefaultMode: |
99 self.configItems = { |
101 self.configItems = { |
100 # key : [display string, pixmap name, dialog module name or |
102 # key : [display string, pixmap name, dialog module name or |
101 # page creation function, parent key, |
103 # page creation function, parent key, |
102 # reference to configuration page (must always be last)] |
104 # reference to configuration page (must always be last)] |
103 # The dialog module must have the module function create to create |
105 # The dialog module must have the module function create to create |
104 # the configuration page. This must have the method save to save |
106 # the configuration page. This must have the method save to save |
105 # the settings. |
107 # the settings. |
106 "applicationPage" : \ |
108 "applicationPage": \ |
107 [self.trUtf8("Application"), "preferences-application.png", |
109 [self.trUtf8("Application"), "preferences-application.png", |
108 "ApplicationPage", None, None], |
110 "ApplicationPage", None, None], |
109 "cooperationPage" : \ |
111 "cooperationPage": \ |
110 [self.trUtf8("Cooperation"), "preferences-cooperation.png", |
112 [self.trUtf8("Cooperation"), "preferences-cooperation.png", |
111 "CooperationPage", None, None], |
113 "CooperationPage", None, None], |
112 "corbaPage" : \ |
114 "corbaPage": \ |
113 [self.trUtf8("CORBA"), "preferences-orbit.png", |
115 [self.trUtf8("CORBA"), "preferences-orbit.png", |
114 "CorbaPage", None, None], |
116 "CorbaPage", None, None], |
115 "emailPage" : \ |
117 "emailPage": \ |
116 [self.trUtf8("Email"), "preferences-mail_generic.png", |
118 [self.trUtf8("Email"), "preferences-mail_generic.png", |
117 "EmailPage", None, None], |
119 "EmailPage", None, None], |
118 "graphicsPage" : \ |
120 "graphicsPage": \ |
119 [self.trUtf8("Graphics"), "preferences-graphics.png", |
121 [self.trUtf8("Graphics"), "preferences-graphics.png", |
120 "GraphicsPage", None, None], |
122 "GraphicsPage", None, None], |
121 "iconsPage" : \ |
123 "iconsPage": \ |
122 [self.trUtf8("Icons"), "preferences-icons.png", |
124 [self.trUtf8("Icons"), "preferences-icons.png", |
123 "IconsPage", None, None], |
125 "IconsPage", None, None], |
124 "networkPage" : \ |
126 "networkPage": \ |
125 [self.trUtf8("Network"), "preferences-network.png", |
127 [self.trUtf8("Network"), "preferences-network.png", |
126 "NetworkPage", None, None], |
128 "NetworkPage", None, None], |
127 "pluginManagerPage" : \ |
129 "pluginManagerPage": \ |
128 [self.trUtf8("Plugin Manager"), "preferences-pluginmanager.png", |
130 [self.trUtf8("Plugin Manager"), "preferences-pluginmanager.png", |
129 "PluginManagerPage", None, None], |
131 "PluginManagerPage", None, None], |
130 "printerPage" : \ |
132 "printerPage": \ |
131 [self.trUtf8("Printer"), "preferences-printer.png", |
133 [self.trUtf8("Printer"), "preferences-printer.png", |
132 "PrinterPage", None, None], |
134 "PrinterPage", None, None], |
133 "py3flakesPage" : \ |
135 "py3flakesPage": \ |
134 [self.trUtf8("PyFlakes"), "warning.png", |
136 [self.trUtf8("PyFlakes"), "warning.png", |
135 "Py3FlakesPage", None, None], |
137 "Py3FlakesPage", None, None], |
136 "pythonPage" : \ |
138 "pythonPage": \ |
137 [self.trUtf8("Python"), "preferences-python.png", |
139 [self.trUtf8("Python"), "preferences-python.png", |
138 "PythonPage", None, None], |
140 "PythonPage", None, None], |
139 "qtPage" : \ |
141 "qtPage": \ |
140 [self.trUtf8("Qt"), "preferences-qtlogo.png", |
142 [self.trUtf8("Qt"), "preferences-qtlogo.png", |
141 "QtPage", None, None], |
143 "QtPage", None, None], |
142 "shellPage" : \ |
144 "shellPage": \ |
143 [self.trUtf8("Shell"), "preferences-shell.png", |
145 [self.trUtf8("Shell"), "preferences-shell.png", |
144 "ShellPage", None, None], |
146 "ShellPage", None, None], |
145 "tasksPage" : \ |
147 "tasksPage": \ |
146 [self.trUtf8("Tasks"), "task.png", |
148 [self.trUtf8("Tasks"), "task.png", |
147 "TasksPage", None, None], |
149 "TasksPage", None, None], |
148 "templatesPage" : \ |
150 "templatesPage": \ |
149 [self.trUtf8("Templates"), "preferences-template.png", |
151 [self.trUtf8("Templates"), "preferences-template.png", |
150 "TemplatesPage", None, None], |
152 "TemplatesPage", None, None], |
151 "terminalPage" : \ |
153 "terminalPage": \ |
152 [self.trUtf8("Terminal"), "terminal.png", |
154 [self.trUtf8("Terminal"), "terminal.png", |
153 "TerminalPage", None, None], |
155 "TerminalPage", None, None], |
154 "trayStarterPage" : \ |
156 "trayStarterPage": \ |
155 [self.trUtf8("Tray Starter"), "erict.png", |
157 [self.trUtf8("Tray Starter"), "erict.png", |
156 "TrayStarterPage", None, None], |
158 "TrayStarterPage", None, None], |
157 "vcsPage" : \ |
159 "vcsPage": \ |
158 [self.trUtf8("Version Control Systems"), "preferences-vcs.png", |
160 [self.trUtf8("Version Control Systems"), "preferences-vcs.png", |
159 "VcsPage", None, None], |
161 "VcsPage", None, None], |
160 |
162 |
161 "0debuggerPage": \ |
163 "0debuggerPage": \ |
162 [self.trUtf8("Debugger"), "preferences-debugger.png", |
164 [self.trUtf8("Debugger"), "preferences-debugger.png", |
163 None, None, None], |
165 None, None, None], |
164 "debuggerGeneralPage" : \ |
166 "debuggerGeneralPage": \ |
165 [self.trUtf8("General"), "preferences-debugger.png", |
167 [self.trUtf8("General"), "preferences-debugger.png", |
166 "DebuggerGeneralPage", "0debuggerPage", None], |
168 "DebuggerGeneralPage", "0debuggerPage", None], |
167 "debuggerPythonPage" : \ |
169 "debuggerPythonPage": \ |
168 [self.trUtf8("Python"), "preferences-pyDebugger.png", |
170 [self.trUtf8("Python"), "preferences-pyDebugger.png", |
169 "DebuggerPythonPage", "0debuggerPage", None], |
171 "DebuggerPythonPage", "0debuggerPage", None], |
170 "debuggerPython3Page" : \ |
172 "debuggerPython3Page": \ |
171 [self.trUtf8("Python3"), "preferences-pyDebugger.png", |
173 [self.trUtf8("Python3"), "preferences-pyDebugger.png", |
172 "DebuggerPython3Page", "0debuggerPage", None], |
174 "DebuggerPython3Page", "0debuggerPage", None], |
173 "debuggerRubyPage" : \ |
175 "debuggerRubyPage": \ |
174 [self.trUtf8("Ruby"), "preferences-rbDebugger.png", |
176 [self.trUtf8("Ruby"), "preferences-rbDebugger.png", |
175 "DebuggerRubyPage", "0debuggerPage", None], |
177 "DebuggerRubyPage", "0debuggerPage", None], |
176 |
178 |
177 "0editorPage" : \ |
179 "0editorPage": \ |
178 [self.trUtf8("Editor"), "preferences-editor.png", |
180 [self.trUtf8("Editor"), "preferences-editor.png", |
179 None, None, None], |
181 None, None, None], |
180 "editorAPIsPage" : \ |
182 "editorAPIsPage": \ |
181 [self.trUtf8("APIs"), "preferences-api.png", |
183 [self.trUtf8("APIs"), "preferences-api.png", |
182 "EditorAPIsPage", "0editorPage", None], |
184 "EditorAPIsPage", "0editorPage", None], |
183 "editorAutocompletionPage" : \ |
185 "editorAutocompletionPage": \ |
184 [self.trUtf8("Autocompletion"), "preferences-autocompletion.png", |
186 [self.trUtf8("Autocompletion"), "preferences-autocompletion.png", |
185 "EditorAutocompletionPage", "0editorPage", None], |
187 "EditorAutocompletionPage", "0editorPage", None], |
186 "editorAutocompletionQScintillaPage" : \ |
188 "editorAutocompletionQScintillaPage": \ |
187 [self.trUtf8("QScintilla"), "qscintilla.png", |
189 [self.trUtf8("QScintilla"), "qscintilla.png", |
188 "EditorAutocompletionQScintillaPage", |
190 "EditorAutocompletionQScintillaPage", |
189 "editorAutocompletionPage", None], |
191 "editorAutocompletionPage", None], |
190 "editorCalltipsPage" : \ |
192 "editorCalltipsPage": \ |
191 [self.trUtf8("Calltips"), "preferences-calltips.png", |
193 [self.trUtf8("Calltips"), "preferences-calltips.png", |
192 "EditorCalltipsPage", "0editorPage", None], |
194 "EditorCalltipsPage", "0editorPage", None], |
193 "editorCalltipsQScintillaPage" : \ |
195 "editorCalltipsQScintillaPage": \ |
194 [self.trUtf8("QScintilla"), "qscintilla.png", |
196 [self.trUtf8("QScintilla"), "qscintilla.png", |
195 "EditorCalltipsQScintillaPage", "editorCalltipsPage", None], |
197 "EditorCalltipsQScintillaPage", "editorCalltipsPage", None], |
196 "editorGeneralPage" : \ |
198 "editorGeneralPage": \ |
197 [self.trUtf8("General"), "preferences-general.png", |
199 [self.trUtf8("General"), "preferences-general.png", |
198 "EditorGeneralPage", "0editorPage", None], |
200 "EditorGeneralPage", "0editorPage", None], |
199 "editorFilePage" : \ |
201 "editorFilePage": \ |
200 [self.trUtf8("Filehandling"), "preferences-filehandling.png", |
202 [self.trUtf8("Filehandling"), "preferences-filehandling.png", |
201 "EditorFilePage", "0editorPage", None], |
203 "EditorFilePage", "0editorPage", None], |
202 "editorSearchPage" : \ |
204 "editorSearchPage": \ |
203 [self.trUtf8("Searching"), "preferences-search.png", |
205 [self.trUtf8("Searching"), "preferences-search.png", |
204 "EditorSearchPage", "0editorPage", None], |
206 "EditorSearchPage", "0editorPage", None], |
205 "editorSpellCheckingPage" : \ |
207 "editorSpellCheckingPage": \ |
206 [self.trUtf8("Spell checking"), "preferences-spellchecking.png", |
208 [self.trUtf8("Spell checking"), "preferences-spellchecking.png", |
207 "EditorSpellCheckingPage", "0editorPage", None], |
209 "EditorSpellCheckingPage", "0editorPage", None], |
208 "editorStylesPage" : \ |
210 "editorStylesPage": \ |
209 [self.trUtf8("Style"), "preferences-styles.png", |
211 [self.trUtf8("Style"), "preferences-styles.png", |
210 "EditorStylesPage", "0editorPage", None], |
212 "EditorStylesPage", "0editorPage", None], |
211 "editorTypingPage" : \ |
213 "editorTypingPage": \ |
212 [self.trUtf8("Typing"), "preferences-typing.png", |
214 [self.trUtf8("Typing"), "preferences-typing.png", |
213 "EditorTypingPage", "0editorPage", None], |
215 "EditorTypingPage", "0editorPage", None], |
214 "editorExportersPage" : \ |
216 "editorExportersPage": \ |
215 [self.trUtf8("Exporters"), "preferences-exporters.png", |
217 [self.trUtf8("Exporters"), "preferences-exporters.png", |
216 "EditorExportersPage", "0editorPage", None], |
218 "EditorExportersPage", "0editorPage", None], |
217 |
219 |
218 "1editorLexerPage" : \ |
220 "1editorLexerPage": \ |
219 [self.trUtf8("Highlighters"), "preferences-highlighting-styles.png", |
221 [self.trUtf8("Highlighters"), "preferences-highlighting-styles.png", |
220 None, "0editorPage", None], |
222 None, "0editorPage", None], |
221 "editorHighlightersPage" : \ |
223 "editorHighlightersPage": \ |
222 [self.trUtf8("Filetype Associations"), |
224 [self.trUtf8("Filetype Associations"), |
223 "preferences-highlighter-association.png", |
225 "preferences-highlighter-association.png", |
224 "EditorHighlightersPage", "1editorLexerPage", None], |
226 "EditorHighlightersPage", "1editorLexerPage", None], |
225 "editorHighlightingStylesPage" : \ |
227 "editorHighlightingStylesPage": \ |
226 [self.trUtf8("Styles"), |
228 [self.trUtf8("Styles"), |
227 "preferences-highlighting-styles.png", |
229 "preferences-highlighting-styles.png", |
228 "EditorHighlightingStylesPage", "1editorLexerPage", None], |
230 "EditorHighlightingStylesPage", "1editorLexerPage", None], |
229 "editorKeywordsPage" : \ |
231 "editorKeywordsPage": \ |
230 [self.trUtf8("Keywords"), "preferences-keywords.png", |
232 [self.trUtf8("Keywords"), "preferences-keywords.png", |
231 "EditorKeywordsPage", "1editorLexerPage", None], |
233 "EditorKeywordsPage", "1editorLexerPage", None], |
232 "editorPropertiesPage" : \ |
234 "editorPropertiesPage": \ |
233 [self.trUtf8("Properties"), "preferences-properties.png", |
235 [self.trUtf8("Properties"), "preferences-properties.png", |
234 "EditorPropertiesPage", "1editorLexerPage", None], |
236 "EditorPropertiesPage", "1editorLexerPage", None], |
235 |
237 |
236 "0helpPage" : \ |
238 "0helpPage": \ |
237 [self.trUtf8("Help"), "preferences-help.png", |
239 [self.trUtf8("Help"), "preferences-help.png", |
238 None, None, None], |
240 None, None, None], |
239 "helpAppearancePage" : \ |
241 "helpAppearancePage": \ |
240 [self.trUtf8("Appearance"), "preferences-styles.png", |
242 [self.trUtf8("Appearance"), "preferences-styles.png", |
241 "HelpAppearancePage", "0helpPage", None], |
243 "HelpAppearancePage", "0helpPage", None], |
242 "helpDocumentationPage" : \ |
244 "helpDocumentationPage": \ |
243 [self.trUtf8("Help Documentation"), |
245 [self.trUtf8("Help Documentation"), |
244 "preferences-helpdocumentation.png", |
246 "preferences-helpdocumentation.png", |
245 "HelpDocumentationPage", "0helpPage", None], |
247 "HelpDocumentationPage", "0helpPage", None], |
246 "helpViewersPage" : \ |
248 "helpViewersPage": \ |
247 [self.trUtf8("Help Viewers"), "preferences-helpviewers.png", |
249 [self.trUtf8("Help Viewers"), "preferences-helpviewers.png", |
248 "HelpViewersPage", "0helpPage", None], |
250 "HelpViewersPage", "0helpPage", None], |
249 "helpWebBrowserPage" : \ |
251 "helpWebBrowserPage": \ |
250 [self.trUtf8("Eric Web Browser"), "ericWeb.png", |
252 [self.trUtf8("Eric Web Browser"), "ericWeb.png", |
251 "HelpWebBrowserPage", "0helpPage", None], |
253 "HelpWebBrowserPage", "0helpPage", None], |
252 |
254 |
253 "0projectPage" : \ |
255 "0projectPage": \ |
254 [self.trUtf8("Project"), "preferences-project.png", |
256 [self.trUtf8("Project"), "preferences-project.png", |
255 None, None, None], |
257 None, None, None], |
256 "projectBrowserPage" : \ |
258 "projectBrowserPage": \ |
257 [self.trUtf8("Project Viewer"), "preferences-project.png", |
259 [self.trUtf8("Project Viewer"), "preferences-project.png", |
258 "ProjectBrowserPage", "0projectPage", None], |
260 "ProjectBrowserPage", "0projectPage", None], |
259 "projectPage" : \ |
261 "projectPage": \ |
260 [self.trUtf8("Project"), "preferences-project.png", |
262 [self.trUtf8("Project"), "preferences-project.png", |
261 "ProjectPage", "0projectPage", None], |
263 "ProjectPage", "0projectPage", None], |
262 "multiProjectPage" : \ |
264 "multiProjectPage": \ |
263 [self.trUtf8("Multiproject"), "preferences-multiproject.png", |
265 [self.trUtf8("Multiproject"), "preferences-multiproject.png", |
264 "MultiProjectPage", "0projectPage", None], |
266 "MultiProjectPage", "0projectPage", None], |
265 |
267 |
266 "0interfacePage" : \ |
268 "0interfacePage": \ |
267 [self.trUtf8("Interface"), "preferences-interface.png", |
269 [self.trUtf8("Interface"), "preferences-interface.png", |
268 None, None, None], |
270 None, None, None], |
269 "interfacePage" : \ |
271 "interfacePage": \ |
270 [self.trUtf8("Interface"), "preferences-interface.png", |
272 [self.trUtf8("Interface"), "preferences-interface.png", |
271 "InterfacePage", "0interfacePage", None], |
273 "InterfacePage", "0interfacePage", None], |
272 "viewmanagerPage" : \ |
274 "viewmanagerPage": \ |
273 [self.trUtf8("Viewmanager"), "preferences-viewmanager.png", |
275 [self.trUtf8("Viewmanager"), "preferences-viewmanager.png", |
274 "ViewmanagerPage", "0interfacePage", None], |
276 "ViewmanagerPage", "0interfacePage", None], |
275 } |
277 } |
276 |
278 |
277 self.configItems.update( |
279 self.configItems.update( |
278 e5App().getObject("PluginManager").getPluginConfigData()) |
280 e5App().getObject("PluginManager").getPluginConfigData()) |
279 elif displayMode == ConfigurationWidget.HelpBrowserMode: |
281 elif displayMode == ConfigurationWidget.HelpBrowserMode: |
280 self.configItems = { |
282 self.configItems = { |
281 # key : [display string, pixmap name, dialog module name or |
283 # key : [display string, pixmap name, dialog module name or |
282 # page creation function, parent key, |
284 # page creation function, parent key, |
283 # reference to configuration page (must always be last)] |
285 # reference to configuration page (must always be last)] |
284 # The dialog module must have the module function create to create |
286 # The dialog module must have the module function create to create |
285 # the configuration page. This must have the method save to save |
287 # the configuration page. This must have the method save to save |
286 # the settings. |
288 # the settings. |
287 "networkPage" : \ |
289 "networkPage": \ |
288 [self.trUtf8("Network"), "preferences-network.png", |
290 [self.trUtf8("Network"), "preferences-network.png", |
289 "NetworkPage", None, None], |
291 "NetworkPage", None, None], |
290 "pythonPage" : \ |
292 "pythonPage": \ |
291 [self.trUtf8("Python"), "preferences-python.png", |
293 [self.trUtf8("Python"), "preferences-python.png", |
292 "PythonPage", None, None], |
294 "PythonPage", None, None], |
293 |
295 |
294 "0helpPage" : \ |
296 "0helpPage": \ |
295 [self.trUtf8("Help"), "preferences-help.png", |
297 [self.trUtf8("Help"), "preferences-help.png", |
296 None, None, None], |
298 None, None, None], |
297 "helpAppearancePage" : \ |
299 "helpAppearancePage": \ |
298 [self.trUtf8("Appearance"), "preferences-styles.png", |
300 [self.trUtf8("Appearance"), "preferences-styles.png", |
299 "HelpAppearancePage", "0helpPage", None], |
301 "HelpAppearancePage", "0helpPage", None], |
300 "helpDocumentationPage" : \ |
302 "helpDocumentationPage": \ |
301 [self.trUtf8("Help Documentation"), |
303 [self.trUtf8("Help Documentation"), |
302 "preferences-helpdocumentation.png", |
304 "preferences-helpdocumentation.png", |
303 "HelpDocumentationPage", "0helpPage", None], |
305 "HelpDocumentationPage", "0helpPage", None], |
304 "helpViewersPage" : \ |
306 "helpViewersPage": \ |
305 [self.trUtf8("Help Viewers"), "preferences-helpviewers.png", |
307 [self.trUtf8("Help Viewers"), "preferences-helpviewers.png", |
306 "HelpViewersPage", "0helpPage", None], |
308 "HelpViewersPage", "0helpPage", None], |
307 "helpWebBrowserPage" : \ |
309 "helpWebBrowserPage": \ |
308 [self.trUtf8("Eric Web Browser"), "ericWeb.png", |
310 [self.trUtf8("Eric Web Browser"), "ericWeb.png", |
309 "HelpWebBrowserPage", "0helpPage", None], |
311 "HelpWebBrowserPage", "0helpPage", None], |
310 } |
312 } |
311 elif displayMode == ConfigurationWidget.TrayStarterMode: |
313 elif displayMode == ConfigurationWidget.TrayStarterMode: |
312 self.configItems = { |
314 self.configItems = { |
313 # key : [display string, pixmap name, dialog module name or |
315 # key : [display string, pixmap name, dialog module name or |
314 # page creation function, parent key, |
316 # page creation function, parent key, |
315 # reference to configuration page (must always be last)] |
317 # reference to configuration page (must always be last)] |
316 # The dialog module must have the module function create to create |
318 # The dialog module must have the module function create to create |
317 # the configuration page. This must have the method save to save |
319 # the configuration page. This must have the method save to save |
318 # the settings. |
320 # the settings. |
319 "trayStarterPage" : \ |
321 "trayStarterPage": \ |
320 [self.trUtf8("Tray Starter"), "erict.png", |
322 [self.trUtf8("Tray Starter"), "erict.png", |
321 "TrayStarterPage", None, None], |
323 "TrayStarterPage", None, None], |
322 } |
324 } |
323 else: |
325 else: |
324 raise RuntimeError("Illegal mode value: {0}".format(displayMode)) |
326 raise RuntimeError("Illegal mode value: {0}".format(displayMode)) |
325 |
327 |
326 # generate the list entries |
328 # generate the list entries |
327 for key in sorted(self.configItems.keys()): |
329 for key in sorted(self.configItems.keys()): |
328 pageData = self.configItems[key] |
330 pageData = self.configItems[key] |
329 if pageData[3]: |
331 if pageData[3]: |
330 pitm = self.itmDict[pageData[3]] # get the parent item |
332 pitm = self.itmDict[pageData[3]] # get the parent item |
331 else: |
333 else: |
332 pitm = self.configList |
334 pitm = self.configList |
333 self.itmDict[key] = ConfigurationPageItem(pitm, pageData[0], key, pageData[1]) |
335 self.itmDict[key] = ConfigurationPageItem(pitm, pageData[0], key, pageData[1]) |
334 self.itmDict[key].setExpanded(True) |
336 self.itmDict[key].setExpanded(True) |
335 self.configList.sortByColumn(0, Qt.AscendingOrder) |
337 self.configList.sortByColumn(0, Qt.AscendingOrder) |