mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
Expose setting for external Python editor
Adds user visible option to set the external Python code editor, from the Settings - Options - IDE - Python tab.
This commit is contained in:
parent
73ff4adc7e
commit
970196c84a
@ -221,6 +221,8 @@ class ConsoleOptionsWidget(QWidget, Ui_SettingsDialogPythonConsole):
|
||||
pythonSettingsTreeNode.childSetting("autopep8-level").setValue(self.autopep8Level.value())
|
||||
pythonSettingsTreeNode.childSetting("black-normalize-quotes").setValue(self.blackNormalizeQuotes.isChecked())
|
||||
pythonSettingsTreeNode.childSetting("max-line-length").setValue(self.maxLineLength.value())
|
||||
pythonSettingsTreeNode.childSetting('external-editor').setValue(
|
||||
self.externalEditor.text())
|
||||
|
||||
def restoreSettings(self):
|
||||
settings = QgsSettings()
|
||||
@ -263,6 +265,10 @@ class ConsoleOptionsWidget(QWidget, Ui_SettingsDialogPythonConsole):
|
||||
elif settings.value("pythonConsole/autoCompleteSource") == 'fromDocAPI':
|
||||
self.autoCompFromDocAPI.setChecked(True)
|
||||
|
||||
self.externalEditor.setText(
|
||||
pythonSettingsTreeNode.childSetting('external-editor').value()
|
||||
)
|
||||
|
||||
def onFormatterChanged(self):
|
||||
""" Toggle formatter-specific options visibility when the formatter is changed """
|
||||
if self.formatter.currentText() == 'autopep8':
|
||||
|
@ -52,9 +52,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>789</width>
|
||||
<height>974</height>
|
||||
<y>-192</y>
|
||||
<width>775</width>
|
||||
<height>1166</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
@ -173,6 +173,20 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="sortImports">
|
||||
<property name="text">
|
||||
<string>Sort imports</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Maximum line length</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QgsSpinBox" name="maxLineLength">
|
||||
<property name="minimum">
|
||||
@ -186,51 +200,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="formatOnSave">
|
||||
<property name="text">
|
||||
<string>Reformat on save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="blackNormalizeQuotes">
|
||||
<property name="text">
|
||||
<string>Normalize quotes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="formatter">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="sortImports">
|
||||
<property name="text">
|
||||
<string>Sort imports</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="autopep8LevelLabel">
|
||||
<property name="text">
|
||||
<string>Autopep8 level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Maximum line length</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@ -248,6 +217,37 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="autopep8LevelLabel">
|
||||
<property name="text">
|
||||
<string>Autopep8 level</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="blackNormalizeQuotes">
|
||||
<property name="text">
|
||||
<string>Normalize quotes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="formatOnSave">
|
||||
<property name="text">
|
||||
<string>Reformat on save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="formatter">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
@ -265,7 +265,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<widget class="QgsCollapsibleGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>GitHub Access Token</string>
|
||||
</property>
|
||||
@ -322,6 +322,19 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QgsCollapsibleGroupBox" name="groupBoxApi">
|
||||
<property name="title">
|
||||
@ -564,17 +577,33 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<widget class="QgsCollapsibleGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>External Editor</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Command to launch an external Python code editor. If empty, the default system editor will be used.</p><p>Use the token <span style=" font-style:italic;">&lt;file&gt;</span> to insert the filename, <span style=" font-style:italic;">&lt;line&gt;</span> to insert line number, and <span style=" font-style:italic;">&lt;col&gt;</span> to insert the column number. For example:<br/><span style=" font-family:'Noto Sans Mono';">kate -l &lt;line&gt; -c &lt;col&gt; &quot;&lt;file&gt;&quot;</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QgsFilterLineEdit" name="externalEditor">
|
||||
<property name="placeholderText">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -594,6 +623,11 @@
|
||||
<extends>QSpinBox</extends>
|
||||
<header>qgis.gui</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsFilterLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>qgis.gui</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>groupBoxAutoCompletion</tabstop>
|
||||
|
Loading…
x
Reference in New Issue
Block a user