def __initDocumentsTab(self): """ Private method to initialize the documents tab. """ self.documentsList.clear() self.removeDocumentsButton.setEnabled(False) docs = self.__engine.registeredDocumentations() self.documentsList.addItems(docs) self.__registeredDocs = [] self.__unregisteredDocs = [] self.__tabsToClose = [] try: self.__pluginHelpDocuments = ( e5App().getObject("PluginManager").getPluginQtHelpFiles()) except KeyError: from PluginManager.PluginManager import PluginManager pluginManager = PluginManager(self, doLoadPlugins=False) pluginManager.loadDocumentationSetPlugins() pluginManager.activatePlugins() self.__pluginHelpDocuments = pluginManager.getPluginQtHelpFiles() self.addPluginButton.setEnabled(bool(self.__pluginHelpDocuments))
def __init__(self, parent=None, fromEric=True, displayMode=DefaultMode): """ Constructor @param parent The parent widget of this dialog. (QWidget) @keyparam fromEric flag indicating a dialog generation from within the eric6 ide (boolean) @keyparam displayMode mode of the configuration dialog (DefaultMode, HelpBrowserMode, TrayStarterMode) @exception RuntimeError raised to indicate an invalid dialog mode """ assert displayMode in (ConfigurationWidget.DefaultMode, ConfigurationWidget.HelpBrowserMode, ConfigurationWidget.TrayStarterMode) super(ConfigurationWidget, self).__init__(parent) self.fromEric = fromEric self.displayMode = displayMode self.__setupUi() self.itmDict = {} if not fromEric: from PluginManager.PluginManager import PluginManager try: self.pluginManager = e5App().getObject("PluginManager") except KeyError: self.pluginManager = PluginManager(self) e5App().registerObject("PluginManager", self.pluginManager) if displayMode == ConfigurationWidget.DefaultMode: self.configItems = { # key : [display string, pixmap name, dialog module name or # page creation function, parent key, # reference to configuration page (must always be last)] # The dialog module must have the module function create to # create the configuration page. This must have the method # save to save the settings. "applicationPage": [ self.tr("Application"), "preferences-application.png", "ApplicationPage", None, None ], "cooperationPage": [ self.tr("Cooperation"), "preferences-cooperation.png", "CooperationPage", None, None ], "corbaPage": [ self.tr("CORBA"), "preferences-orbit.png", "CorbaPage", None, None ], "emailPage": [ self.tr("Email"), "preferences-mail_generic.png", "EmailPage", None, None ], "graphicsPage": [ self.tr("Graphics"), "preferences-graphics.png", "GraphicsPage", None, None ], "iconsPage": [ self.tr("Icons"), "preferences-icons.png", "IconsPage", None, None ], "ircPage": [self.tr("IRC"), "irc.png", "IrcPage", None, None], "networkPage": [ self.tr("Network"), "preferences-network.png", "NetworkPage", None, None ], "notificationsPage": [ self.tr("Notifications"), "preferences-notifications.png", "NotificationsPage", None, None ], "pluginManagerPage": [ self.tr("Plugin Manager"), "preferences-pluginmanager.png", "PluginManagerPage", None, None ], "printerPage": [ self.tr("Printer"), "preferences-printer.png", "PrinterPage", None, None ], "pythonPage": [ self.tr("Python"), "preferences-python.png", "PythonPage", None, None ], "qtPage": [ self.tr("Qt"), "preferences-qtlogo.png", "QtPage", None, None ], "securityPage": [ self.tr("Security"), "preferences-security.png", "SecurityPage", None, None ], "shellPage": [ self.tr("Shell"), "preferences-shell.png", "ShellPage", None, None ], "tasksPage": [self.tr("Tasks"), "task.png", "TasksPage", None, None], "templatesPage": [ self.tr("Templates"), "preferences-template.png", "TemplatesPage", None, None ], "trayStarterPage": [ self.tr("Tray Starter"), "erict.png", "TrayStarterPage", None, None ], "vcsPage": [ self.tr("Version Control Systems"), "preferences-vcs.png", "VcsPage", None, None ], "0debuggerPage": [ self.tr("Debugger"), "preferences-debugger.png", None, None, None ], "debuggerGeneralPage": [ self.tr("General"), "preferences-debugger.png", "DebuggerGeneralPage", "0debuggerPage", None ], "debuggerPythonPage": [ self.tr("Python"), "preferences-pyDebugger.png", "DebuggerPythonPage", "0debuggerPage", None ], "debuggerPython3Page": [ self.tr("Python3"), "preferences-pyDebugger.png", "DebuggerPython3Page", "0debuggerPage", None ], "debuggerRubyPage": [ self.tr("Ruby"), "preferences-rbDebugger.png", "DebuggerRubyPage", "0debuggerPage", None ], "0editorPage": [ self.tr("Editor"), "preferences-editor.png", None, None, None ], "editorAPIsPage": [ self.tr("APIs"), "preferences-api.png", "EditorAPIsPage", "0editorPage", None ], "editorAutocompletionPage": [ self.tr("Autocompletion"), "preferences-autocompletion.png", "EditorAutocompletionPage", "0editorPage", None ], "editorAutocompletionQScintillaPage": [ self.tr("QScintilla"), "qscintilla.png", "EditorAutocompletionQScintillaPage", "editorAutocompletionPage", None ], "editorCalltipsPage": [ self.tr("Calltips"), "preferences-calltips.png", "EditorCalltipsPage", "0editorPage", None ], "editorCalltipsQScintillaPage": [ self.tr("QScintilla"), "qscintilla.png", "EditorCalltipsQScintillaPage", "editorCalltipsPage", None ], "editorGeneralPage": [ self.tr("General"), "preferences-general.png", "EditorGeneralPage", "0editorPage", None ], "editorFilePage": [ self.tr("Filehandling"), "preferences-filehandling.png", "EditorFilePage", "0editorPage", None ], "editorSearchPage": [ self.tr("Searching"), "preferences-search.png", "EditorSearchPage", "0editorPage", None ], "editorSpellCheckingPage": [ self.tr("Spell checking"), "preferences-spellchecking.png", "EditorSpellCheckingPage", "0editorPage", None ], "editorStylesPage": [ self.tr("Style"), "preferences-styles.png", "EditorStylesPage", "0editorPage", None ], "editorSyntaxPage": [ self.tr("Code Checkers"), "preferences-debugger.png", "EditorSyntaxPage", "0editorPage", None ], "editorTypingPage": [ self.tr("Typing"), "preferences-typing.png", "EditorTypingPage", "0editorPage", None ], "editorExportersPage": [ self.tr("Exporters"), "preferences-exporters.png", "EditorExportersPage", "0editorPage", None ], "1editorLexerPage": [ self.tr("Highlighters"), "preferences-highlighting-styles.png", None, "0editorPage", None ], "editorHighlightersPage": [ self.tr("Filetype Associations"), "preferences-highlighter-association.png", "EditorHighlightersPage", "1editorLexerPage", None ], "editorHighlightingStylesPage": [ self.tr("Styles"), "preferences-highlighting-styles.png", "EditorHighlightingStylesPage", "1editorLexerPage", None ], "editorKeywordsPage": [ self.tr("Keywords"), "preferences-keywords.png", "EditorKeywordsPage", "1editorLexerPage", None ], "editorPropertiesPage": [ self.tr("Properties"), "preferences-properties.png", "EditorPropertiesPage", "1editorLexerPage", None ], "0helpPage": [self.tr("Help"), "preferences-help.png", None, None, None], "helpAppearancePage": [ self.tr("Appearance"), "preferences-styles.png", "HelpAppearancePage", "0helpPage", None ], "helpDocumentationPage": [ self.tr("Help Documentation"), "preferences-helpdocumentation.png", "HelpDocumentationPage", "0helpPage", None ], "helpViewersPage": [ self.tr("Help Viewers"), "preferences-helpviewers.png", "HelpViewersPage", "0helpPage", None ], "helpWebBrowserPage": [ self.tr("eric6 Web Browser"), "ericWeb.png", "HelpWebBrowserPage", "0helpPage", None ], "0projectPage": [ self.tr("Project"), "preferences-project.png", None, None, None ], "projectBrowserPage": [ self.tr("Project Viewer"), "preferences-project.png", "ProjectBrowserPage", "0projectPage", None ], "projectPage": [ self.tr("Project"), "preferences-project.png", "ProjectPage", "0projectPage", None ], "multiProjectPage": [ self.tr("Multiproject"), "preferences-multiproject.png", "MultiProjectPage", "0projectPage", None ], "0interfacePage": [ self.tr("Interface"), "preferences-interface.png", None, None, None ], "interfacePage": [ self.tr("Interface"), "preferences-interface.png", "InterfacePage", "0interfacePage", None ], "viewmanagerPage": [ self.tr("Viewmanager"), "preferences-viewmanager.png", "ViewmanagerPage", "0interfacePage", None ], } self.configItems.update( e5App().getObject("PluginManager").getPluginConfigData()) elif displayMode == ConfigurationWidget.HelpBrowserMode: self.configItems = { # key : [display string, pixmap name, dialog module name or # page creation function, parent key, # reference to configuration page (must always be last)] # The dialog module must have the module function create to # create the configuration page. This must have the method # save to save the settings. "interfacePage": [ self.tr("Interface"), "preferences-interface.png", "HelpInterfacePage", None, None ], "networkPage": [ self.tr("Network"), "preferences-network.png", "NetworkPage", None, None ], "printerPage": [ self.tr("Printer"), "preferences-printer.png", "PrinterPage", None, None ], "securityPage": [ self.tr("Security"), "preferences-security.png", "SecurityPage", None, None ], "0helpPage": [self.tr("Help"), "preferences-help.png", None, None, None], "helpAppearancePage": [ self.tr("Appearance"), "preferences-styles.png", "HelpAppearancePage", "0helpPage", None ], "helpDocumentationPage": [ self.tr("Help Documentation"), "preferences-helpdocumentation.png", "HelpDocumentationPage", "0helpPage", None ], "helpWebBrowserPage": [ self.tr("eric6 Web Browser"), "ericWeb.png", "HelpWebBrowserPage", "0helpPage", None ], } elif displayMode == ConfigurationWidget.TrayStarterMode: self.configItems = { # key : [display string, pixmap name, dialog module name or # page creation function, parent key, # reference to configuration page (must always be last)] # The dialog module must have the module function create to # create the configuration page. This must have the method # save to save the settings. "trayStarterPage": [ self.tr("Tray Starter"), "erict.png", "TrayStarterPage", None, None ], } else: raise RuntimeError("Illegal mode value: {0}".format(displayMode)) # generate the list entries for key in sorted(self.configItems.keys()): pageData = self.configItems[key] if pageData[3]: pitm = self.itmDict[pageData[3]] # get the parent item else: pitm = self.configList self.itmDict[key] = ConfigurationPageItem(pitm, pageData[0], key, pageData[1]) self.itmDict[key].setData(0, Qt.UserRole, key) self.itmDict[key].setExpanded(True) self.configList.sortByColumn(0, Qt.AscendingOrder) # set the initial size of the splitter self.configSplitter.setSizes([200, 600]) self.configList.itemActivated.connect(self.__showConfigurationPage) self.configList.itemClicked.connect(self.__showConfigurationPage) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.rejected) if displayMode != ConfigurationWidget.TrayStarterMode: self.__initLexers()
def __init__(self, parent=None): """ """ super(MainWindow, self).__init__(parent) self.setupUi(self) self.pluginManager = PluginManager(self) #初始化插件管理器