eric7/Preferences/ConfigurationDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8351
7d13e08ddb3f
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
18 QSizePolicy, QSpacerItem, QWidget, QTreeWidget, QStackedWidget, QDialog, 18 QSizePolicy, QSpacerItem, QWidget, QTreeWidget, QStackedWidget, QDialog,
19 QSplitter, QScrollArea, QApplication, QDialogButtonBox, QFrame, 19 QSplitter, QScrollArea, QApplication, QDialogButtonBox, QFrame,
20 QVBoxLayout, QTreeWidgetItem, QLabel, QAbstractScrollArea, QLineEdit 20 QVBoxLayout, QTreeWidgetItem, QLabel, QAbstractScrollArea, QLineEdit
21 ) 21 )
22 22
23 from E5Gui.E5Application import e5App 23 from E5Gui.EricApplication import ericApp
24 from E5Gui import E5MessageBox 24 from E5Gui import EricMessageBox
25 from E5Gui.E5MainWindow import E5MainWindow 25 from E5Gui.EricMainWindow import EricMainWindow
26 26
27 from Globals import isMacPlatform, getWebBrowserSupport 27 from Globals import isMacPlatform, getWebBrowserSupport
28 28
29 import Preferences 29 import Preferences
30 30
114 self.itmDict = {} 114 self.itmDict = {}
115 115
116 if not fromEric: 116 if not fromEric:
117 from PluginManager.PluginManager import PluginManager 117 from PluginManager.PluginManager import PluginManager
118 try: 118 try:
119 self.pluginManager = e5App().getObject("PluginManager") 119 self.pluginManager = ericApp().getObject("PluginManager")
120 except KeyError: 120 except KeyError:
121 self.pluginManager = PluginManager(self) 121 self.pluginManager = PluginManager(self)
122 e5App().registerObject("PluginManager", self.pluginManager) 122 ericApp().registerObject("PluginManager", self.pluginManager)
123 123
124 from VirtualEnv.VirtualenvManager import VirtualenvManager 124 from VirtualEnv.VirtualenvManager import VirtualenvManager
125 try: 125 try:
126 self.virtualenvManager = e5App().getObject("VirtualEnvManager") 126 self.virtualenvManager = ericApp().getObject("VirtualEnvManager")
127 except KeyError: 127 except KeyError:
128 self.virtualenvManager = VirtualenvManager(self) 128 self.virtualenvManager = VirtualenvManager(self)
129 e5App().registerObject("VirtualEnvManager", 129 ericApp().registerObject("VirtualEnvManager",
130 self.virtualenvManager) 130 self.virtualenvManager)
131 131
132 if displayMode == ConfigurationMode.DEFAULTMODE: 132 if displayMode == ConfigurationMode.DEFAULTMODE:
133 self.configItems = { 133 self.configItems = {
134 # key : [display string, pixmap name, dialog module name or 134 # key : [display string, pixmap name, dialog module name or
362 "WebBrowserSpellCheckingPage", "0webBrowserPage", 362 "WebBrowserSpellCheckingPage", "0webBrowserPage",
363 None], 363 None],
364 }) 364 })
365 365
366 self.configItems.update( 366 self.configItems.update(
367 e5App().getObject("PluginManager").getPluginConfigData()) 367 ericApp().getObject("PluginManager").getPluginConfigData())
368 368
369 elif displayMode == ConfigurationMode.WEBBROWSERMODE: 369 elif displayMode == ConfigurationMode.WEBBROWSERMODE:
370 self.configItems = { 370 self.configItems = {
371 # key : [display string, pixmap name, dialog module name or 371 # key : [display string, pixmap name, dialog module name or
372 # page creation function, parent key, 372 # page creation function, parent key,
660 components = modName.split('.') 660 components = modName.split('.')
661 for comp in components[1:]: 661 for comp in components[1:]:
662 mod = getattr(mod, comp) 662 mod = getattr(mod, comp)
663 return mod 663 return mod
664 except ImportError: 664 except ImportError:
665 E5MessageBox.critical( 665 EricMessageBox.critical(
666 self, 666 self,
667 self.tr("Configuration Page Error"), 667 self.tr("Configuration Page Error"),
668 self.tr("""<p>The configuration page <b>{0}</b>""" 668 self.tr("""<p>The configuration page <b>{0}</b>"""
669 """ could not be loaded.</p>""").format(name)) 669 """ could not be loaded.</p>""").format(name))
670 return None 670 return None
1016 Public method to accept the dialog. 1016 Public method to accept the dialog.
1017 """ 1017 """
1018 super().accept() 1018 super().accept()
1019 1019
1020 1020
1021 class ConfigurationWindow(E5MainWindow): 1021 class ConfigurationWindow(EricMainWindow):
1022 """ 1022 """
1023 Main window class for the standalone dialog. 1023 Main window class for the standalone dialog.
1024 """ 1024 """
1025 def __init__(self, parent=None): 1025 def __init__(self, parent=None):
1026 """ 1026 """

eric ide

mercurial