def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. Add own options """ from .settings_widget import SettingsWidget widget = SettingsWidget(dialog) icon = QIcon(os.path.join(os.path.dirname(__file__), 'python.png')) dialog.appendPage("Lint/Python", widget, icon) # Options dialog.appendOption( CheckableOption(dialog, core.config(), "Lint/Python/Enabled", widget.gbEnabled)) dialog.appendOption( ChoiseOption( dialog, core.config(), "Lint/Python/Show", { widget.rbErrors: "errors", widget.rbErrorsAndWarnings: "errorsAndWarnings", widget.rbAll: "all" })) dialog.appendOption( TextOption(dialog, core.config(), "Lint/Python/Path", widget.leFlake8Path)) dialog.appendOption( TextOption(dialog, core.config(), "Lint/Python/IgnoredMessages", widget.leIgnoredMessages)) dialog.appendOption( NumericOption(dialog, core.config(), "Lint/Python/MaxLineLength", widget.spMaxLineLength))
def __init__(self, settingsPage, dialog): # Initialize the dialog, loading in the literate programming settings # GUI. QWidget.__init__(self, dialog) uic.loadUi(os.path.join(os.path.dirname(__file__), 'Sphinx_Settings.ui'), self) # Make links gray when they are disabled palette = self.palette() palette.setColor(QPalette.Disabled, QPalette.Link, palette.color(QPalette.Disabled, QPalette.Text)) self.lbSphinxReference.setPalette(palette) palette = self.palette() palette.setColor(QPalette.Active, QPalette.WindowText, palette.color(QPalette.Normal, QPalette.Link)) self.lbSphinxEnableAdvMode.setPalette(palette) # Clicking on advanced mode label triggers either advanced mode or # normal mode. self.lbSphinxEnableAdvMode.mousePressEvent = self.on_ToggleSphinxSettingModeClicked # Update misc pieces of the GUI that can't be stored in the .ui file. self._updateSphinxSettingMode() # Add this GUI to the settings dialog box. settingsPage.addWidget(QLabel("<h3>Sphinx</h3>")) settingsPage.addWidget(self) # Next, have the setting UI auto-update the corresponding CodeChat and # config entries. dialog.appendOption(CheckableOption(dialog, core.config(), "Sphinx/Enabled", self.gbSphinxProject)) dialog.appendOption(ChoiseOption(dialog, core.config(), "Sphinx/BuildOnSave", {self.rbBuildOnlyOnSave: True, self.rbBuildOnFileChange: False})) dialog.appendOption(TextOption(dialog, core.config(), "Sphinx/ProjectPath", self.leSphinxProjectPath)) dialog.appendOption(TextOption(dialog, core.config(), "Sphinx/SourcePath", self.leSphinxSourcePath)) dialog.appendOption(TextOption(dialog, core.config(), "Sphinx/OutputPath", self.leSphinxOutputPath)) dialog.appendOption(TextOption(dialog, core.config(), "Sphinx/Executable", self.leSphinxExecutable)) dialog.appendOption(TextOption(dialog, core.config(), "Sphinx/Cmdline", self.leSphinxCmdline)) # Run this after the appendOption calls, since these fields must be set # up before _updateleValidateSphinxExecutable can run. self._updateleValidateSphinxExecutable()
def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. """ page = SettingsPage(dialog, self._chooseDefaultTerminal()) dialog.appendPage(ACTION_TEXT, page, QIcon(':enkiicons/console.png')) # Options dialog.appendOption(TextOption(dialog, core.config(), "OpenTerm/Term", page.edit))
def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. Add own options """ page = SettingsPage(dialog) dialog.appendPage("Hello World", page, QIcon(':/enkiicons/help.png')) # Options dialog.appendOption(TextOption(dialog, core.config(), "HelloWorld/VeryImportantOption", page.edit))
def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. """ page = SettingsPage(dialog) dialog.appendPage(u"OpenTerm", page) # Options dialog.appendOption( TextOption(dialog, core.config(), "OpenTerm/defaultTerm", page.edit))
def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. Add own options """ widget = SettingsWidget(dialog) dialog.appendPage("Navigator", widget, QIcon(':/enkiicons/goto.png')) # Options dialog.appendOption( TextOption(dialog, core.config(), "Navigator/CtagsPath", widget.leCtagsPath)) dialog.appendOption( CheckableOption(dialog, core.config(), "Navigator/SortAlphabetically", widget.cbSortTagsAlphabetically))
def _onSettingsDialogAboutToExecute(self, dialog): """UI settings dialogue is about to execute. Add own options """ from .repl import SettingsWidget widget = SettingsWidget(dialog) dialog.appendPage("REPL/%s" % self._FULL_NAME, widget, self._icon()) # Options dialog.appendOption(ChoiseOption(dialog, core.config(), "Modes/%s/Enabled" % self._LANGUAGE, {widget.rbWhenOpened: "whenOpened", widget.rbNever: "never", widget.rbAlways: "always"})) dialog.appendOption(TextOption(dialog, core.config(), "Modes/%s/InterpreterPath" % self._LANGUAGE, widget.leInterpreterPath))