Preferences/ConfigurationDialog.py

changeset 3034
7ce719013078
parent 3025
67064c71df21
child 3038
7fe9a53280bd
equal deleted inserted replaced
3033:58fe260e7469 3034:7ce719013078
116 # page creation function, parent key, 116 # page creation function, parent key,
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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("Icons"), "preferences-icons.png",
138 "IconsPage", None, None], 138 "IconsPage", None, None],
139 "ircPage": \ 139 "ircPage":
140 [self.trUtf8("IRC"), "irc.png", 140 [self.trUtf8("IRC"), "irc.png",
141 "IrcPage", None, None], 141 "IrcPage", None, None],
142 "networkPage": \ 142 "networkPage":
143 [self.trUtf8("Network"), "preferences-network.png", 143 [self.trUtf8("Network"), "preferences-network.png",
144 "NetworkPage", None, None], 144 "NetworkPage", None, None],
145 "notificationsPage": \ 145 "notificationsPage":
146 [self.trUtf8("Notifications"), 146 [self.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("Shell"), "preferences-shell.png",
167 "ShellPage", None, None], 167 "ShellPage", None, None],
168 "tasksPage": \ 168 "tasksPage":
169 [self.trUtf8("Tasks"), "task.png", 169 [self.trUtf8("Tasks"), "task.png",
170 "TasksPage", None, None], 170 "TasksPage", None, None],
171 "templatesPage": \ 171 "templatesPage":
172 [self.trUtf8("Templates"), "preferences-template.png", 172 [self.trUtf8("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.trUtf8("Tray Starter"), "erict.png",
176 "TrayStarterPage", None, None], 176 "TrayStarterPage", None, None],
177 "vcsPage": \ 177 "vcsPage":
178 [self.trUtf8("Version Control Systems"), 178 [self.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("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.trUtf8("APIs"), "preferences-api.png",
203 "EditorAPIsPage", "0editorPage", None], 203 "EditorAPIsPage", "0editorPage", None],
204 "editorAutocompletionPage": \ 204 "editorAutocompletionPage":
205 [self.trUtf8("Autocompletion"), 205 [self.trUtf8("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.trUtf8("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.trUtf8("Calltips"), "preferences-calltips.png",
214 "EditorCalltipsPage", "0editorPage", None], 214 "EditorCalltipsPage", "0editorPage", None],
215 "editorCalltipsQScintillaPage": \ 215 "editorCalltipsQScintillaPage":
216 [self.trUtf8("QScintilla"), "qscintilla.png", 216 [self.trUtf8("QScintilla"), "qscintilla.png",
217 "EditorCalltipsQScintillaPage", "editorCalltipsPage", 217 "EditorCalltipsQScintillaPage", "editorCalltipsPage",
218 None], 218 None],
219 "editorGeneralPage": \ 219 "editorGeneralPage":
220 [self.trUtf8("General"), "preferences-general.png", 220 [self.trUtf8("General"), "preferences-general.png",
221 "EditorGeneralPage", "0editorPage", None], 221 "EditorGeneralPage", "0editorPage", None],
222 "editorFilePage": \ 222 "editorFilePage":
223 [self.trUtf8("Filehandling"), 223 [self.trUtf8("Filehandling"),
224 "preferences-filehandling.png", 224 "preferences-filehandling.png",
225 "EditorFilePage", "0editorPage", None], 225 "EditorFilePage", "0editorPage", None],
226 "editorSearchPage": \ 226 "editorSearchPage":
227 [self.trUtf8("Searching"), "preferences-search.png", 227 [self.trUtf8("Searching"), "preferences-search.png",
228 "EditorSearchPage", "0editorPage", None], 228 "EditorSearchPage", "0editorPage", None],
229 "editorSpellCheckingPage": \ 229 "editorSpellCheckingPage":
230 [self.trUtf8("Spell checking"), 230 [self.trUtf8("Spell checking"),
231 "preferences-spellchecking.png", 231 "preferences-spellchecking.png",
232 "EditorSpellCheckingPage", "0editorPage", None], 232 "EditorSpellCheckingPage", "0editorPage", None],
233 "editorStylesPage": \ 233 "editorStylesPage":
234 [self.trUtf8("Style"), "preferences-styles.png", 234 [self.trUtf8("Style"), "preferences-styles.png",
235 "EditorStylesPage", "0editorPage", None], 235 "EditorStylesPage", "0editorPage", None],
236 "editorSyntaxPage": \ 236 "editorSyntaxPage":
237 [self.trUtf8("Code Checkers"), "preferences-debugger.png", 237 [self.trUtf8("Code Checkers"), "preferences-debugger.png",
238 "EditorSyntaxPage", "0editorPage", None], 238 "EditorSyntaxPage", "0editorPage", None],
239 "editorTypingPage": \ 239 "editorTypingPage":
240 [self.trUtf8("Typing"), "preferences-typing.png", 240 [self.trUtf8("Typing"), "preferences-typing.png",
241 "EditorTypingPage", "0editorPage", None], 241 "EditorTypingPage", "0editorPage", None],
242 "editorExportersPage": \ 242 "editorExportersPage":
243 [self.trUtf8("Exporters"), "preferences-exporters.png", 243 [self.trUtf8("Exporters"), "preferences-exporters.png",
244 "EditorExportersPage", "0editorPage", None], 244 "EditorExportersPage", "0editorPage", None],
245 245
246 "1editorLexerPage": \ 246 "1editorLexerPage":
247 [self.trUtf8("Highlighters"), 247 [self.trUtf8("Highlighters"),
248 "preferences-highlighting-styles.png", 248 "preferences-highlighting-styles.png",
249 None, "0editorPage", None], 249 None, "0editorPage", None],
250 "editorHighlightersPage": \ 250 "editorHighlightersPage":
251 [self.trUtf8("Filetype Associations"), 251 [self.trUtf8("Filetype Associations"),
252 "preferences-highlighter-association.png", 252 "preferences-highlighter-association.png",
253 "EditorHighlightersPage", "1editorLexerPage", None], 253 "EditorHighlightersPage", "1editorLexerPage", None],
254 "editorHighlightingStylesPage": \ 254 "editorHighlightingStylesPage":
255 [self.trUtf8("Styles"), 255 [self.trUtf8("Styles"),
256 "preferences-highlighting-styles.png", 256 "preferences-highlighting-styles.png",
257 "EditorHighlightingStylesPage", "1editorLexerPage", None], 257 "EditorHighlightingStylesPage", "1editorLexerPage", None],
258 "editorKeywordsPage": \ 258 "editorKeywordsPage":
259 [self.trUtf8("Keywords"), "preferences-keywords.png", 259 [self.trUtf8("Keywords"), "preferences-keywords.png",
260 "EditorKeywordsPage", "1editorLexerPage", None], 260 "EditorKeywordsPage", "1editorLexerPage", None],
261 "editorPropertiesPage": \ 261 "editorPropertiesPage":
262 [self.trUtf8("Properties"), "preferences-properties.png", 262 [self.trUtf8("Properties"), "preferences-properties.png",
263 "EditorPropertiesPage", "1editorLexerPage", None], 263 "EditorPropertiesPage", "1editorLexerPage", None],
264 264
265 "0helpPage": \ 265 "0helpPage":
266 [self.trUtf8("Help"), "preferences-help.png", 266 [self.trUtf8("Help"), "preferences-help.png",
267 None, None, None], 267 None, None, None],
268 "helpAppearancePage": \ 268 "helpAppearancePage":
269 [self.trUtf8("Appearance"), "preferences-styles.png", 269 [self.trUtf8("Appearance"), "preferences-styles.png",
270 "HelpAppearancePage", "0helpPage", None], 270 "HelpAppearancePage", "0helpPage", None],
271 "helpDocumentationPage": \ 271 "helpDocumentationPage":
272 [self.trUtf8("Help Documentation"), 272 [self.trUtf8("Help Documentation"),
273 "preferences-helpdocumentation.png", 273 "preferences-helpdocumentation.png",
274 "HelpDocumentationPage", "0helpPage", None], 274 "HelpDocumentationPage", "0helpPage", None],
275 "helpViewersPage": \ 275 "helpViewersPage":
276 [self.trUtf8("Help Viewers"), 276 [self.trUtf8("Help Viewers"),
277 "preferences-helpviewers.png", 277 "preferences-helpviewers.png",
278 "HelpViewersPage", "0helpPage", None], 278 "HelpViewersPage", "0helpPage", None],
279 "helpVirusTotalPage": \ 279 "helpVirusTotalPage":
280 [self.trUtf8("VirusTotal Interface"), "virustotal.png", 280 [self.trUtf8("VirusTotal Interface"), "virustotal.png",
281 "HelpVirusTotalPage", "0helpPage", None], 281 "HelpVirusTotalPage", "0helpPage", None],
282 "helpWebBrowserPage": \ 282 "helpWebBrowserPage":
283 [self.trUtf8("eric5 Web Browser"), "ericWeb.png", 283 [self.trUtf8("eric5 Web Browser"), "ericWeb.png",
284 "HelpWebBrowserPage", "0helpPage", None], 284 "HelpWebBrowserPage", "0helpPage", None],
285 285
286 "0projectPage": \ 286 "0projectPage":
287 [self.trUtf8("Project"), "preferences-project.png", 287 [self.trUtf8("Project"), "preferences-project.png",
288 None, None, None], 288 None, None, None],
289 "projectBrowserPage": \ 289 "projectBrowserPage":
290 [self.trUtf8("Project Viewer"), "preferences-project.png", 290 [self.trUtf8("Project Viewer"), "preferences-project.png",
291 "ProjectBrowserPage", "0projectPage", None], 291 "ProjectBrowserPage", "0projectPage", None],
292 "projectPage": \ 292 "projectPage":
293 [self.trUtf8("Project"), "preferences-project.png", 293 [self.trUtf8("Project"), "preferences-project.png",
294 "ProjectPage", "0projectPage", None], 294 "ProjectPage", "0projectPage", None],
295 "multiProjectPage": \ 295 "multiProjectPage":
296 [self.trUtf8("Multiproject"), 296 [self.trUtf8("Multiproject"),
297 "preferences-multiproject.png", 297 "preferences-multiproject.png",
298 "MultiProjectPage", "0projectPage", None], 298 "MultiProjectPage", "0projectPage", None],
299 299
300 "0interfacePage": \ 300 "0interfacePage":
301 [self.trUtf8("Interface"), "preferences-interface.png", 301 [self.trUtf8("Interface"), "preferences-interface.png",
302 None, None, None], 302 None, None, None],
303 "interfacePage": \ 303 "interfacePage":
304 [self.trUtf8("Interface"), "preferences-interface.png", 304 [self.trUtf8("Interface"), "preferences-interface.png",
305 "InterfacePage", "0interfacePage", None], 305 "InterfacePage", "0interfacePage", None],
306 "viewmanagerPage": \ 306 "viewmanagerPage":
307 [self.trUtf8("Viewmanager"), "preferences-viewmanager.png", 307 [self.trUtf8("Viewmanager"), "preferences-viewmanager.png",
308 "ViewmanagerPage", "0interfacePage", None], 308 "ViewmanagerPage", "0interfacePage", None],
309 } 309 }
310 310
311 self.configItems.update( 311 self.configItems.update(
316 # page creation function, parent key, 316 # page creation function, parent key,
317 # reference to configuration page (must always be last)] 317 # reference to configuration page (must always be last)]
318 # The dialog module must have the module function create to 318 # The dialog module must have the module function create to
319 # create the configuration page. This must have the method 319 # create the configuration page. This must have the method
320 # save to save the settings. 320 # save to save the settings.
321 "interfacePage": \ 321 "interfacePage":
322 [self.trUtf8("Interface"), "preferences-interface.png", 322 [self.trUtf8("Interface"), "preferences-interface.png",
323 "HelpInterfacePage", None, None], 323 "HelpInterfacePage", None, None],
324 "networkPage": \ 324 "networkPage":
325 [self.trUtf8("Network"), "preferences-network.png", 325 [self.trUtf8("Network"), "preferences-network.png",
326 "NetworkPage", None, None], 326 "NetworkPage", None, None],
327 "printerPage": \ 327 "printerPage":
328 [self.trUtf8("Printer"), "preferences-printer.png", 328 [self.trUtf8("Printer"), "preferences-printer.png",
329 "PrinterPage", None, None], 329 "PrinterPage", None, None],
330 "securityPage": \ 330 "securityPage":
331 [self.trUtf8("Security"), "preferences-security.png", 331 [self.trUtf8("Security"), "preferences-security.png",
332 "SecurityPage", None, None], 332 "SecurityPage", None, None],
333 333
334 "0helpPage": \ 334 "0helpPage":
335 [self.trUtf8("Help"), "preferences-help.png", 335 [self.trUtf8("Help"), "preferences-help.png",
336 None, None, None], 336 None, None, None],
337 "helpAppearancePage": \ 337 "helpAppearancePage":
338 [self.trUtf8("Appearance"), "preferences-styles.png", 338 [self.trUtf8("Appearance"), "preferences-styles.png",
339 "HelpAppearancePage", "0helpPage", None], 339 "HelpAppearancePage", "0helpPage", None],
340 "helpDocumentationPage": \ 340 "helpDocumentationPage":
341 [self.trUtf8("Help Documentation"), 341 [self.trUtf8("Help Documentation"),
342 "preferences-helpdocumentation.png", 342 "preferences-helpdocumentation.png",
343 "HelpDocumentationPage", "0helpPage", None], 343 "HelpDocumentationPage", "0helpPage", None],
344 "helpVirusTotalPage": \ 344 "helpVirusTotalPage":
345 [self.trUtf8("VirusTotal Interface"), "virustotal.png", 345 [self.trUtf8("VirusTotal Interface"), "virustotal.png",
346 "HelpVirusTotalPage", "0helpPage", None], 346 "HelpVirusTotalPage", "0helpPage", None],
347 "helpWebBrowserPage": \ 347 "helpWebBrowserPage":
348 [self.trUtf8("eric5 Web Browser"), "ericWeb.png", 348 [self.trUtf8("eric5 Web Browser"), "ericWeb.png",
349 "HelpWebBrowserPage", "0helpPage", None], 349 "HelpWebBrowserPage", "0helpPage", None],
350 } 350 }
351 elif displayMode == ConfigurationWidget.TrayStarterMode: 351 elif displayMode == ConfigurationWidget.TrayStarterMode:
352 self.configItems = { 352 self.configItems = {
354 # page creation function, parent key, 354 # page creation function, parent key,
355 # reference to configuration page (must always be last)] 355 # reference to configuration page (must always be last)]
356 # The dialog module must have the module function create to 356 # The dialog module must have the module function create to
357 # create the configuration page. This must have the method 357 # create the configuration page. This must have the method
358 # save to save the settings. 358 # save to save the settings.
359 "trayStarterPage": \ 359 "trayStarterPage":
360 [self.trUtf8("Tray Starter"), "erict.png", 360 [self.trUtf8("Tray Starter"), "erict.png",
361 "TrayStarterPage", None, None], 361 "TrayStarterPage", None, None],
362 } 362 }
363 else: 363 else:
364 raise RuntimeError("Illegal mode value: {0}".format(displayMode)) 364 raise RuntimeError("Illegal mode value: {0}".format(displayMode))
468 self.verticalLayout_2.addWidget(self.configSplitter) 468 self.verticalLayout_2.addWidget(self.configSplitter)
469 469
470 self.buttonBox = QDialogButtonBox(self) 470 self.buttonBox = QDialogButtonBox(self)
471 self.buttonBox.setOrientation(Qt.Horizontal) 471 self.buttonBox.setOrientation(Qt.Horizontal)
472 self.buttonBox.setStandardButtons( 472 self.buttonBox.setStandardButtons(
473 QDialogButtonBox.Apply | QDialogButtonBox.Cancel | \ 473 QDialogButtonBox.Apply | QDialogButtonBox.Cancel |
474 QDialogButtonBox.Ok | QDialogButtonBox.Reset) 474 QDialogButtonBox.Ok | QDialogButtonBox.Reset)
475 self.buttonBox.setObjectName("buttonBox") 475 self.buttonBox.setObjectName("buttonBox")
476 if not self.fromEric and \ 476 if not self.fromEric and \
477 self.displayMode == ConfigurationWidget.DefaultMode: 477 self.displayMode == ConfigurationWidget.DefaultMode:
478 self.buttonBox.button(QDialogButtonBox.Apply).hide() 478 self.buttonBox.button(QDialogButtonBox.Apply).hide()
623 self.configList.setCurrentItem(items[0]) 623 self.configList.setCurrentItem(items[0])
624 self.configStack.setCurrentWidget(page) 624 self.configStack.setCurrentWidget(page)
625 ssize = self.scrollArea.size() 625 ssize = self.scrollArea.size()
626 if self.scrollArea.horizontalScrollBar(): 626 if self.scrollArea.horizontalScrollBar():
627 ssize.setHeight( 627 ssize.setHeight(
628 ssize.height() - 628 ssize.height() -
629 self.scrollArea.horizontalScrollBar().height() - 2) 629 self.scrollArea.horizontalScrollBar().height() - 2)
630 if self.scrollArea.verticalScrollBar(): 630 if self.scrollArea.verticalScrollBar():
631 ssize.setWidth( 631 ssize.setWidth(
632 ssize.width() - 632 ssize.width() -
633 self.scrollArea.verticalScrollBar().width() - 2) 633 self.scrollArea.verticalScrollBar().width() - 2)
634 psize = page.minimumSizeHint() 634 psize = page.minimumSizeHint()
635 self.configStack.resize(max(ssize.width(), psize.width()), 635 self.configStack.resize(max(ssize.width(), psize.width()),
636 max(ssize.height(), psize.height())) 636 max(ssize.height(), psize.height()))
637 637

eric ide

mercurial