コード例 #1
0
    def _onSettingsDialogAboutToExecute(self, dialog):
        """UI settings dialogue is about to execute.
        Add own options
        """
        fontWidget = _SettingsPageWidget('Font.ui', dialog)
        indentWidget = _SettingsPageWidget('Indentation.ui', dialog)
        complWidget = _SettingsPageWidget('Autocompletion.ui', dialog)
        eolWidget = _SettingsPageWidget('Eol.ui', dialog)
        edgeWidget = _SettingsPageWidget('Edge.ui', dialog)
        wrapWidget = _SettingsPageWidget('Wrap.ui', dialog)

        dialog.appendPage(u"Editor/Font", fontWidget)
        dialog.appendPage(u"Editor/Indentation", indentWidget)
        dialog.appendPage(u"Editor/Autocompletion", complWidget)
        dialog.appendPage(u"Editor/EOL", eolWidget)
        dialog.appendPage(u"Editor/Edge", edgeWidget)
        dialog.appendPage(u"Editor/Wrap", wrapWidget)

        cfg = core.config()
        options = \
        (
            FontOption(dialog, cfg, "Qutepart/Font/Family", "Qutepart/Font/Size",
                       fontWidget.lFont, fontWidget.pbFont),

            ChoiseOption(dialog, cfg, "Qutepart/Indentation/UseTabs",
                         {indentWidget.rbIndentationSpaces : False,
                          indentWidget.rbIndentationTabs: True}),
            NumericOption(dialog, cfg, "Qutepart/Indentation/Width", indentWidget.sIndentationWidth),
            CheckableOption(dialog, cfg, "Qutepart/Indentation/AutoDetect", indentWidget.cbAutodetectIndent),

            ChoiseOption(dialog, cfg, "Qutepart/EOL/Mode",
                         {eolWidget.rbEolUnix: r'\n',
                          eolWidget.rbEolWindows: r'\r\n',
                          eolWidget.rbEolMac: r'\r'}),
            CheckableOption(dialog, cfg, "Qutepart/EOL/AutoDetect", eolWidget.cbAutoDetectEol),

            CheckableOption(dialog, cfg, "Qutepart/Edge/Enabled", edgeWidget.gbEdgeEnabled),
            NumericOption(dialog, cfg, "Qutepart/Edge/Column", edgeWidget.sEdgeColumnNumber),
            ColorOption(dialog, cfg, "Qutepart/Edge/Color", edgeWidget.tbEdgeColor),

            CheckableOption(dialog, cfg, "Qutepart/AutoCompletion/Enabled", complWidget.gbAutoCompletion),
            NumericOption(dialog, cfg, "Qutepart/AutoCompletion/Threshold", complWidget.sThreshold),

            CheckableOption(dialog, cfg, "Qutepart/Wrap/Enabled", wrapWidget.gbWrapEnabled),
            ChoiseOption(dialog, cfg, "Qutepart/Wrap/Mode",
                         {wrapWidget.rbWrapAtWord : "WrapAtWord",
                          wrapWidget.rbWrapAnywhere: "WrapAnywhere"}),
        )

        for option in options:
            dialog.appendOption(option)

        eolWidget.lReloadToReapply.setVisible(
            eolWidget.cbAutoDetectEol.isChecked())
コード例 #2
0
ファイル: __init__.py プロジェクト: mrsuman2002/enki-1
    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))
コード例 #3
0
ファイル: __init__.py プロジェクト: rockiger/mambapreview
    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()
コード例 #4
0
 def _onSettingsDialogAboutToExecute(self, dialog):
     """UI settings dialogue is about to execute.
     Add own option
     """
     dialog.appendOption(
         ChoiseOption(
             dialog, core.config(), "Workspace/FileSortMode", {
                 dialog.rbOpeningOrder: "OpeningOrder",
                 dialog.rbFileName: "FileName",
                 dialog.rbUri: "URL",
                 dialog.rbSuffix: "Suffixes"
             }))
コード例 #5
0
    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))