Preferences/ConfigurationDialog.py

changeset 3190
a9a94491c4fd
parent 3189
9a21c547de5f
child 3345
071afe8be2a1
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
117 # reference to configuration page (must always be last)] 117 # reference to configuration page (must always be last)]
118 # The dialog module must have the module function create to 118 # The dialog module must have the module function create to
119 # create the configuration page. This must have the method 119 # create the configuration page. This must have the method
120 # save to save the settings. 120 # save to save the settings.
121 "applicationPage": 121 "applicationPage":
122 [self.trUtf8("Application"), "preferences-application.png", 122 [self.tr("Application"), "preferences-application.png",
123 "ApplicationPage", None, None], 123 "ApplicationPage", None, None],
124 "cooperationPage": 124 "cooperationPage":
125 [self.trUtf8("Cooperation"), "preferences-cooperation.png", 125 [self.tr("Cooperation"), "preferences-cooperation.png",
126 "CooperationPage", None, None], 126 "CooperationPage", None, None],
127 "corbaPage": 127 "corbaPage":
128 [self.trUtf8("CORBA"), "preferences-orbit.png", 128 [self.tr("CORBA"), "preferences-orbit.png",
129 "CorbaPage", None, None], 129 "CorbaPage", None, None],
130 "emailPage": 130 "emailPage":
131 [self.trUtf8("Email"), "preferences-mail_generic.png", 131 [self.tr("Email"), "preferences-mail_generic.png",
132 "EmailPage", None, None], 132 "EmailPage", None, None],
133 "graphicsPage": 133 "graphicsPage":
134 [self.trUtf8("Graphics"), "preferences-graphics.png", 134 [self.tr("Graphics"), "preferences-graphics.png",
135 "GraphicsPage", None, None], 135 "GraphicsPage", None, None],
136 "iconsPage": 136 "iconsPage":
137 [self.trUtf8("Icons"), "preferences-icons.png", 137 [self.tr("Icons"), "preferences-icons.png",
138 "IconsPage", None, None], 138 "IconsPage", None, None],
139 "ircPage": 139 "ircPage":
140 [self.trUtf8("IRC"), "irc.png", 140 [self.tr("IRC"), "irc.png",
141 "IrcPage", None, None], 141 "IrcPage", None, None],
142 "networkPage": 142 "networkPage":
143 [self.trUtf8("Network"), "preferences-network.png", 143 [self.tr("Network"), "preferences-network.png",
144 "NetworkPage", None, None], 144 "NetworkPage", None, None],
145 "notificationsPage": 145 "notificationsPage":
146 [self.trUtf8("Notifications"), 146 [self.tr("Notifications"),
147 "preferences-notifications.png", 147 "preferences-notifications.png",
148 "NotificationsPage", None, None], 148 "NotificationsPage", None, None],
149 "pluginManagerPage": 149 "pluginManagerPage":
150 [self.trUtf8("Plugin Manager"), 150 [self.tr("Plugin Manager"),
151 "preferences-pluginmanager.png", 151 "preferences-pluginmanager.png",
152 "PluginManagerPage", None, None], 152 "PluginManagerPage", None, None],
153 "printerPage": 153 "printerPage":
154 [self.trUtf8("Printer"), "preferences-printer.png", 154 [self.tr("Printer"), "preferences-printer.png",
155 "PrinterPage", None, None], 155 "PrinterPage", None, None],
156 "pythonPage": 156 "pythonPage":
157 [self.trUtf8("Python"), "preferences-python.png", 157 [self.tr("Python"), "preferences-python.png",
158 "PythonPage", None, None], 158 "PythonPage", None, None],
159 "qtPage": 159 "qtPage":
160 [self.trUtf8("Qt"), "preferences-qtlogo.png", 160 [self.tr("Qt"), "preferences-qtlogo.png",
161 "QtPage", None, None], 161 "QtPage", None, None],
162 "securityPage": 162 "securityPage":
163 [self.trUtf8("Security"), "preferences-security.png", 163 [self.tr("Security"), "preferences-security.png",
164 "SecurityPage", None, None], 164 "SecurityPage", None, None],
165 "shellPage": 165 "shellPage":
166 [self.trUtf8("Shell"), "preferences-shell.png", 166 [self.tr("Shell"), "preferences-shell.png",
167 "ShellPage", None, None], 167 "ShellPage", None, None],
168 "tasksPage": 168 "tasksPage":
169 [self.trUtf8("Tasks"), "task.png", 169 [self.tr("Tasks"), "task.png",
170 "TasksPage", None, None], 170 "TasksPage", None, None],
171 "templatesPage": 171 "templatesPage":
172 [self.trUtf8("Templates"), "preferences-template.png", 172 [self.tr("Templates"), "preferences-template.png",
173 "TemplatesPage", None, None], 173 "TemplatesPage", None, None],
174 "trayStarterPage": 174 "trayStarterPage":
175 [self.trUtf8("Tray Starter"), "erict.png", 175 [self.tr("Tray Starter"), "erict.png",
176 "TrayStarterPage", None, None], 176 "TrayStarterPage", None, None],
177 "vcsPage": 177 "vcsPage":
178 [self.trUtf8("Version Control Systems"), 178 [self.tr("Version Control Systems"),
179 "preferences-vcs.png", 179 "preferences-vcs.png",
180 "VcsPage", None, None], 180 "VcsPage", None, None],
181 181
182 "0debuggerPage": 182 "0debuggerPage":
183 [self.trUtf8("Debugger"), "preferences-debugger.png", 183 [self.tr("Debugger"), "preferences-debugger.png",
184 None, None, None], 184 None, None, None],
185 "debuggerGeneralPage": 185 "debuggerGeneralPage":
186 [self.trUtf8("General"), "preferences-debugger.png", 186 [self.tr("General"), "preferences-debugger.png",
187 "DebuggerGeneralPage", "0debuggerPage", None], 187 "DebuggerGeneralPage", "0debuggerPage", None],
188 "debuggerPythonPage": 188 "debuggerPythonPage":
189 [self.trUtf8("Python"), "preferences-pyDebugger.png", 189 [self.tr("Python"), "preferences-pyDebugger.png",
190 "DebuggerPythonPage", "0debuggerPage", None], 190 "DebuggerPythonPage", "0debuggerPage", None],
191 "debuggerPython3Page": 191 "debuggerPython3Page":
192 [self.trUtf8("Python3"), "preferences-pyDebugger.png", 192 [self.tr("Python3"), "preferences-pyDebugger.png",
193 "DebuggerPython3Page", "0debuggerPage", None], 193 "DebuggerPython3Page", "0debuggerPage", None],
194 "debuggerRubyPage": 194 "debuggerRubyPage":
195 [self.trUtf8("Ruby"), "preferences-rbDebugger.png", 195 [self.tr("Ruby"), "preferences-rbDebugger.png",
196 "DebuggerRubyPage", "0debuggerPage", None], 196 "DebuggerRubyPage", "0debuggerPage", None],
197 197
198 "0editorPage": 198 "0editorPage":
199 [self.trUtf8("Editor"), "preferences-editor.png", 199 [self.tr("Editor"), "preferences-editor.png",
200 None, None, None], 200 None, None, None],
201 "editorAPIsPage": 201 "editorAPIsPage":
202 [self.trUtf8("APIs"), "preferences-api.png", 202 [self.tr("APIs"), "preferences-api.png",
203 "EditorAPIsPage", "0editorPage", None], 203 "EditorAPIsPage", "0editorPage", None],
204 "editorAutocompletionPage": 204 "editorAutocompletionPage":
205 [self.trUtf8("Autocompletion"), 205 [self.tr("Autocompletion"),
206 "preferences-autocompletion.png", 206 "preferences-autocompletion.png",
207 "EditorAutocompletionPage", "0editorPage", None], 207 "EditorAutocompletionPage", "0editorPage", None],
208 "editorAutocompletionQScintillaPage": 208 "editorAutocompletionQScintillaPage":
209 [self.trUtf8("QScintilla"), "qscintilla.png", 209 [self.tr("QScintilla"), "qscintilla.png",
210 "EditorAutocompletionQScintillaPage", 210 "EditorAutocompletionQScintillaPage",
211 "editorAutocompletionPage", None], 211 "editorAutocompletionPage", None],
212 "editorCalltipsPage": 212 "editorCalltipsPage":
213 [self.trUtf8("Calltips"), "preferences-calltips.png", 213 [self.tr("Calltips"), "preferences-calltips.png",
214 "EditorCalltipsPage", "0editorPage", None], 214 "EditorCalltipsPage", "0editorPage", None],
215 "editorCalltipsQScintillaPage": 215 "editorCalltipsQScintillaPage":
216 [self.trUtf8("QScintilla"), "qscintilla.png", 216 [self.tr("QScintilla"), "qscintilla.png",
217 "EditorCalltipsQScintillaPage", "editorCalltipsPage", None], 217 "EditorCalltipsQScintillaPage", "editorCalltipsPage", None],
218 "editorGeneralPage": 218 "editorGeneralPage":
219 [self.trUtf8("General"), "preferences-general.png", 219 [self.tr("General"), "preferences-general.png",
220 "EditorGeneralPage", "0editorPage", None], 220 "EditorGeneralPage", "0editorPage", None],
221 "editorFilePage": 221 "editorFilePage":
222 [self.trUtf8("Filehandling"), 222 [self.tr("Filehandling"),
223 "preferences-filehandling.png", 223 "preferences-filehandling.png",
224 "EditorFilePage", "0editorPage", None], 224 "EditorFilePage", "0editorPage", None],
225 "editorSearchPage": 225 "editorSearchPage":
226 [self.trUtf8("Searching"), "preferences-search.png", 226 [self.tr("Searching"), "preferences-search.png",
227 "EditorSearchPage", "0editorPage", None], 227 "EditorSearchPage", "0editorPage", None],
228 "editorSpellCheckingPage": 228 "editorSpellCheckingPage":
229 [self.trUtf8("Spell checking"), 229 [self.tr("Spell checking"),
230 "preferences-spellchecking.png", 230 "preferences-spellchecking.png",
231 "EditorSpellCheckingPage", "0editorPage", None], 231 "EditorSpellCheckingPage", "0editorPage", None],
232 "editorStylesPage": 232 "editorStylesPage":
233 [self.trUtf8("Style"), "preferences-styles.png", 233 [self.tr("Style"), "preferences-styles.png",
234 "EditorStylesPage", "0editorPage", None], 234 "EditorStylesPage", "0editorPage", None],
235 "editorSyntaxPage": 235 "editorSyntaxPage":
236 [self.trUtf8("Code Checkers"), "preferences-debugger.png", 236 [self.tr("Code Checkers"), "preferences-debugger.png",
237 "EditorSyntaxPage", "0editorPage", None], 237 "EditorSyntaxPage", "0editorPage", None],
238 "editorTypingPage": 238 "editorTypingPage":
239 [self.trUtf8("Typing"), "preferences-typing.png", 239 [self.tr("Typing"), "preferences-typing.png",
240 "EditorTypingPage", "0editorPage", None], 240 "EditorTypingPage", "0editorPage", None],
241 "editorExportersPage": 241 "editorExportersPage":
242 [self.trUtf8("Exporters"), "preferences-exporters.png", 242 [self.tr("Exporters"), "preferences-exporters.png",
243 "EditorExportersPage", "0editorPage", None], 243 "EditorExportersPage", "0editorPage", None],
244 244
245 "1editorLexerPage": 245 "1editorLexerPage":
246 [self.trUtf8("Highlighters"), 246 [self.tr("Highlighters"),
247 "preferences-highlighting-styles.png", 247 "preferences-highlighting-styles.png",
248 None, "0editorPage", None], 248 None, "0editorPage", None],
249 "editorHighlightersPage": 249 "editorHighlightersPage":
250 [self.trUtf8("Filetype Associations"), 250 [self.tr("Filetype Associations"),
251 "preferences-highlighter-association.png", 251 "preferences-highlighter-association.png",
252 "EditorHighlightersPage", "1editorLexerPage", None], 252 "EditorHighlightersPage", "1editorLexerPage", None],
253 "editorHighlightingStylesPage": 253 "editorHighlightingStylesPage":
254 [self.trUtf8("Styles"), 254 [self.tr("Styles"),
255 "preferences-highlighting-styles.png", 255 "preferences-highlighting-styles.png",
256 "EditorHighlightingStylesPage", "1editorLexerPage", None], 256 "EditorHighlightingStylesPage", "1editorLexerPage", None],
257 "editorKeywordsPage": 257 "editorKeywordsPage":
258 [self.trUtf8("Keywords"), "preferences-keywords.png", 258 [self.tr("Keywords"), "preferences-keywords.png",
259 "EditorKeywordsPage", "1editorLexerPage", None], 259 "EditorKeywordsPage", "1editorLexerPage", None],
260 "editorPropertiesPage": 260 "editorPropertiesPage":
261 [self.trUtf8("Properties"), "preferences-properties.png", 261 [self.tr("Properties"), "preferences-properties.png",
262 "EditorPropertiesPage", "1editorLexerPage", None], 262 "EditorPropertiesPage", "1editorLexerPage", None],
263 263
264 "0helpPage": 264 "0helpPage":
265 [self.trUtf8("Help"), "preferences-help.png", 265 [self.tr("Help"), "preferences-help.png",
266 None, None, None], 266 None, None, None],
267 "helpAppearancePage": 267 "helpAppearancePage":
268 [self.trUtf8("Appearance"), "preferences-styles.png", 268 [self.tr("Appearance"), "preferences-styles.png",
269 "HelpAppearancePage", "0helpPage", None], 269 "HelpAppearancePage", "0helpPage", None],
270 "helpDocumentationPage": 270 "helpDocumentationPage":
271 [self.trUtf8("Help Documentation"), 271 [self.tr("Help Documentation"),
272 "preferences-helpdocumentation.png", 272 "preferences-helpdocumentation.png",
273 "HelpDocumentationPage", "0helpPage", None], 273 "HelpDocumentationPage", "0helpPage", None],
274 "helpViewersPage": 274 "helpViewersPage":
275 [self.trUtf8("Help Viewers"), 275 [self.tr("Help Viewers"),
276 "preferences-helpviewers.png", 276 "preferences-helpviewers.png",
277 "HelpViewersPage", "0helpPage", None], 277 "HelpViewersPage", "0helpPage", None],
278 "helpVirusTotalPage": 278 "helpVirusTotalPage":
279 [self.trUtf8("VirusTotal Interface"), "virustotal.png", 279 [self.tr("VirusTotal Interface"), "virustotal.png",
280 "HelpVirusTotalPage", "0helpPage", None], 280 "HelpVirusTotalPage", "0helpPage", None],
281 "helpWebBrowserPage": 281 "helpWebBrowserPage":
282 [self.trUtf8("eric5 Web Browser"), "ericWeb.png", 282 [self.tr("eric5 Web Browser"), "ericWeb.png",
283 "HelpWebBrowserPage", "0helpPage", None], 283 "HelpWebBrowserPage", "0helpPage", None],
284 284
285 "0projectPage": 285 "0projectPage":
286 [self.trUtf8("Project"), "preferences-project.png", 286 [self.tr("Project"), "preferences-project.png",
287 None, None, None], 287 None, None, None],
288 "projectBrowserPage": 288 "projectBrowserPage":
289 [self.trUtf8("Project Viewer"), "preferences-project.png", 289 [self.tr("Project Viewer"), "preferences-project.png",
290 "ProjectBrowserPage", "0projectPage", None], 290 "ProjectBrowserPage", "0projectPage", None],
291 "projectPage": 291 "projectPage":
292 [self.trUtf8("Project"), "preferences-project.png", 292 [self.tr("Project"), "preferences-project.png",
293 "ProjectPage", "0projectPage", None], 293 "ProjectPage", "0projectPage", None],
294 "multiProjectPage": 294 "multiProjectPage":
295 [self.trUtf8("Multiproject"), 295 [self.tr("Multiproject"),
296 "preferences-multiproject.png", 296 "preferences-multiproject.png",
297 "MultiProjectPage", "0projectPage", None], 297 "MultiProjectPage", "0projectPage", None],
298 298
299 "0interfacePage": 299 "0interfacePage":
300 [self.trUtf8("Interface"), "preferences-interface.png", 300 [self.tr("Interface"), "preferences-interface.png",
301 None, None, None], 301 None, None, None],
302 "interfacePage": 302 "interfacePage":
303 [self.trUtf8("Interface"), "preferences-interface.png", 303 [self.tr("Interface"), "preferences-interface.png",
304 "InterfacePage", "0interfacePage", None], 304 "InterfacePage", "0interfacePage", None],
305 "viewmanagerPage": 305 "viewmanagerPage":
306 [self.trUtf8("Viewmanager"), "preferences-viewmanager.png", 306 [self.tr("Viewmanager"), "preferences-viewmanager.png",
307 "ViewmanagerPage", "0interfacePage", None], 307 "ViewmanagerPage", "0interfacePage", None],
308 } 308 }
309 309
310 self.configItems.update( 310 self.configItems.update(
311 e5App().getObject("PluginManager").getPluginConfigData()) 311 e5App().getObject("PluginManager").getPluginConfigData())
316 # reference to configuration page (must always be last)] 316 # reference to configuration page (must always be last)]
317 # The dialog module must have the module function create to 317 # The dialog module must have the module function create to
318 # create the configuration page. This must have the method 318 # create the configuration page. This must have the method
319 # save to save the settings. 319 # save to save the settings.
320 "interfacePage": 320 "interfacePage":
321 [self.trUtf8("Interface"), "preferences-interface.png", 321 [self.tr("Interface"), "preferences-interface.png",
322 "HelpInterfacePage", None, None], 322 "HelpInterfacePage", None, None],
323 "networkPage": 323 "networkPage":
324 [self.trUtf8("Network"), "preferences-network.png", 324 [self.tr("Network"), "preferences-network.png",
325 "NetworkPage", None, None], 325 "NetworkPage", None, None],
326 "printerPage": 326 "printerPage":
327 [self.trUtf8("Printer"), "preferences-printer.png", 327 [self.tr("Printer"), "preferences-printer.png",
328 "PrinterPage", None, None], 328 "PrinterPage", None, None],
329 "securityPage": 329 "securityPage":
330 [self.trUtf8("Security"), "preferences-security.png", 330 [self.tr("Security"), "preferences-security.png",
331 "SecurityPage", None, None], 331 "SecurityPage", None, None],
332 332
333 "0helpPage": 333 "0helpPage":
334 [self.trUtf8("Help"), "preferences-help.png", 334 [self.tr("Help"), "preferences-help.png",
335 None, None, None], 335 None, None, None],
336 "helpAppearancePage": 336 "helpAppearancePage":
337 [self.trUtf8("Appearance"), "preferences-styles.png", 337 [self.tr("Appearance"), "preferences-styles.png",
338 "HelpAppearancePage", "0helpPage", None], 338 "HelpAppearancePage", "0helpPage", None],
339 "helpDocumentationPage": 339 "helpDocumentationPage":
340 [self.trUtf8("Help Documentation"), 340 [self.tr("Help Documentation"),
341 "preferences-helpdocumentation.png", 341 "preferences-helpdocumentation.png",
342 "HelpDocumentationPage", "0helpPage", None], 342 "HelpDocumentationPage", "0helpPage", None],
343 "helpVirusTotalPage": 343 "helpVirusTotalPage":
344 [self.trUtf8("VirusTotal Interface"), "virustotal.png", 344 [self.tr("VirusTotal Interface"), "virustotal.png",
345 "HelpVirusTotalPage", "0helpPage", None], 345 "HelpVirusTotalPage", "0helpPage", None],
346 "helpWebBrowserPage": 346 "helpWebBrowserPage":
347 [self.trUtf8("eric5 Web Browser"), "ericWeb.png", 347 [self.tr("eric5 Web Browser"), "ericWeb.png",
348 "HelpWebBrowserPage", "0helpPage", None], 348 "HelpWebBrowserPage", "0helpPage", None],
349 } 349 }
350 elif displayMode == ConfigurationWidget.TrayStarterMode: 350 elif displayMode == ConfigurationWidget.TrayStarterMode:
351 self.configItems = { 351 self.configItems = {
352 # key : [display string, pixmap name, dialog module name or 352 # key : [display string, pixmap name, dialog module name or
354 # reference to configuration page (must always be last)] 354 # reference to configuration page (must always be last)]
355 # The dialog module must have the module function create to 355 # The dialog module must have the module function create to
356 # create the configuration page. This must have the method 356 # create the configuration page. This must have the method
357 # save to save the settings. 357 # save to save the settings.
358 "trayStarterPage": 358 "trayStarterPage":
359 [self.trUtf8("Tray Starter"), "erict.png", 359 [self.tr("Tray Starter"), "erict.png",
360 "TrayStarterPage", None, None], 360 "TrayStarterPage", None, None],
361 } 361 }
362 else: 362 else:
363 raise RuntimeError("Illegal mode value: {0}".format(displayMode)) 363 raise RuntimeError("Illegal mode value: {0}".format(displayMode))
364 364
416 self.leftVBoxLayout = QVBoxLayout(self.configListWidget) 416 self.leftVBoxLayout = QVBoxLayout(self.configListWidget)
417 self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0) 417 self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0)
418 self.leftVBoxLayout.setSpacing(0) 418 self.leftVBoxLayout.setSpacing(0)
419 self.leftVBoxLayout.setObjectName("leftVBoxLayout") 419 self.leftVBoxLayout.setObjectName("leftVBoxLayout")
420 self.configListFilter = E5ClearableLineEdit( 420 self.configListFilter = E5ClearableLineEdit(
421 self, self.trUtf8("Enter filter text...")) 421 self, self.tr("Enter filter text..."))
422 self.configListFilter.setObjectName("configListFilter") 422 self.configListFilter.setObjectName("configListFilter")
423 self.leftVBoxLayout.addWidget(self.configListFilter) 423 self.leftVBoxLayout.addWidget(self.configListFilter)
424 self.configList = QTreeWidget() 424 self.configList = QTreeWidget()
425 self.configList.setObjectName("configList") 425 self.configList.setObjectName("configList")
426 self.leftVBoxLayout.addWidget(self.configList) 426 self.leftVBoxLayout.addWidget(self.configList)
477 self.buttonBox.button(QDialogButtonBox.Apply).hide() 477 self.buttonBox.button(QDialogButtonBox.Apply).hide()
478 self.buttonBox.button(QDialogButtonBox.Apply).setEnabled(False) 478 self.buttonBox.button(QDialogButtonBox.Apply).setEnabled(False)
479 self.buttonBox.button(QDialogButtonBox.Reset).setEnabled(False) 479 self.buttonBox.button(QDialogButtonBox.Reset).setEnabled(False)
480 self.verticalLayout_2.addWidget(self.buttonBox) 480 self.verticalLayout_2.addWidget(self.buttonBox)
481 481
482 self.setWindowTitle(self.trUtf8("Preferences")) 482 self.setWindowTitle(self.tr("Preferences"))
483 483
484 self.configList.header().hide() 484 self.configList.header().hide()
485 self.configList.header().setSortIndicator(0, Qt.AscendingOrder) 485 self.configList.header().setSortIndicator(0, Qt.AscendingOrder)
486 self.configList.setSortingEnabled(True) 486 self.configList.setSortingEnabled(True)
487 self.textLabel1.setText( 487 self.textLabel1.setText(
488 self.trUtf8("Please select an entry of the list \n" 488 self.tr("Please select an entry of the list \n"
489 "to display the configuration page.")) 489 "to display the configuration page."))
490 490
491 QMetaObject.connectSlotsByName(self) 491 QMetaObject.connectSlotsByName(self)
492 self.setTabOrder(self.configList, self.configStack) 492 self.setTabOrder(self.configList, self.configStack)
493 493
494 self.configStack.setCurrentWidget(self.emptyPage) 494 self.configStack.setCurrentWidget(self.emptyPage)
556 mod = getattr(mod, comp) 556 mod = getattr(mod, comp)
557 return mod 557 return mod
558 except ImportError: 558 except ImportError:
559 E5MessageBox.critical( 559 E5MessageBox.critical(
560 self, 560 self,
561 self.trUtf8("Configuration Page Error"), 561 self.tr("Configuration Page Error"),
562 self.trUtf8("""<p>The configuration page <b>{0}</b>""" 562 self.tr("""<p>The configuration page <b>{0}</b>"""
563 """ could not be loaded.</p>""").format(name)) 563 """ could not be loaded.</p>""").format(name))
564 return None 564 return None
565 565
566 def __showConfigurationPage(self, itm, column): 566 def __showConfigurationPage(self, itm, column):
567 """ 567 """
568 Private slot to show a selected configuration page. 568 Private slot to show a selected configuration page.

eric ide

mercurial