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 |