aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/behaviorsettingspage.ui
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2011-02-01 14:13:54 +0100
committerLeandro Melo <leandro.melo@nokia.com>2011-02-21 17:22:24 +0100
commitea313f3ec84692c6112ad2a0f7d47909dafbb69c (patch)
treee952cb85d0e9ca8d974d2c44f8dc4396a1cc0026 /src/plugins/texteditor/behaviorsettingspage.ui
parentcbafc50acc48d75a1fc993e72bcb6587f8bb9a4e (diff)
Text editor: Introduce per project settings
With some refactorings to make the code look better. Reviewed-by: con
Diffstat (limited to 'src/plugins/texteditor/behaviorsettingspage.ui')
-rw-r--r--src/plugins/texteditor/behaviorsettingspage.ui612
1 files changed, 20 insertions, 592 deletions
diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui
index e14f95dfe7..b5b3316bde 100644
--- a/src/plugins/texteditor/behaviorsettingspage.ui
+++ b/src/plugins/texteditor/behaviorsettingspage.ui
@@ -1,429 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>TextEditor::BehaviorSettingsPage</class>
- <widget class="QWidget" name="TextEditor::BehaviorSettingsPage">
+ <class>BehaviorSettingsPage</class>
+ <widget class="QWidget" name="BehaviorSettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>662</width>
- <height>538</height>
+ <width>432</width>
+ <height>50</height>
</rect>
</property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0" colspan="2">
- <widget class="QGroupBox" name="groupBoxTabAndIndentSettings">
- <property name="title">
- <string>Tabs and Indentation</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QCheckBox" name="insertSpaces">
- <property name="text">
- <string>Insert &amp;spaces instead of tabs</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="labelTabSize">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Ta&amp;b size:</string>
- </property>
- <property name="buddy">
- <cstring>tabSize</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QSpinBox" name="tabSize">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>20</number>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>0</width>
- <height>22</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <spacer name="horizontalSpacer_5">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>30</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QCheckBox" name="autoInsertSpaces">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Automatically determine based on the nearest indented line (previous line preferred over next line)</string>
- </property>
- <property name="text">
- <string>Based on the surrounding lines</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="labelIndentSize">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>&amp;Indent size:</string>
- </property>
- <property name="buddy">
- <cstring>indentSize</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QSpinBox" name="indentSize">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>20</number>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="autoIndent">
- <property name="text">
- <string>Enable automatic &amp;indentation</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QCheckBox" name="smartBackspace">
- <property name="toolTip">
- <string>Backspace will go back one indentation level instead of one space.</string>
- </property>
- <property name="text">
- <string>&amp;Backspace follows indentation</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="indentBlocksLabel">
- <property name="text">
- <string>Block indentation style:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="indentBlocksBehavior">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
-Controls the indentation style of curly brace blocks.
-
-&lt;ul&gt;
-&lt;li&gt;Exclude Braces: The braces are not indented.
-&lt;pre&gt;
-void foo()
-{
- if (a)
- {
- bar();
- }
-}
-&lt;/pre&gt;
-&lt;/li&gt;
-
-&lt;li&gt;Include Braces: The braces are indented. The contents of the block are on the same level as the braces.
-&lt;pre&gt;
-void foo()
- {
- if (a)
- {
- bar();
- }
- }
-&lt;/pre&gt;
-&lt;/li&gt;
-
-&lt;li&gt;GNU Style: Indent the braces for blocks in statements. The contents are indented twice.
-&lt;pre&gt;
-void foo()
-{
- if (a)
- {
- bar();
- }
-}
-&lt;/pre&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <item>
- <property name="text">
- <string>Exclude Braces</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Include Braces</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>GNU Style</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="tabKeyIndentLabel">
- <property name="text">
- <string>Tab key performs auto-indent:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QComboBox" name="tabKeyBehavior">
- <item>
- <property name="text">
- <string>Never</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Always</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>In Leading White Space</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="continuationAlignLabel">
- <property name="text">
- <string>Align continuation lines:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="continuationAlignBehavior">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
-Influences the indentation of continuation lines.
-
-&lt;ul&gt;
-&lt;li&gt;Not At All: Do not align at all. Lines will only be indented to the current logical indentation depth.
-&lt;pre&gt;
-(tab)int i = foo(a, b
-(tab)c, d);
-&lt;/pre&gt;
-&lt;/li&gt;
-
-&lt;li&gt;With Spaces: Always use spaces for alignment, regardless of the other indentation settings.
-&lt;pre&gt;
-(tab)int i = foo(a, b
-(tab) c, d);
-&lt;/pre&gt;
-&lt;/li&gt;
-
-&lt;li&gt;With Regular Indent: Use tabs and/or spaces for alignment, as configured above.
-&lt;pre&gt;
-(tab)int i = foo(a, b
-(tab)(tab)(tab) c, d);
-&lt;/pre&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <item>
- <property name="text">
- <string>Not At All</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>With Spaces</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>With Regular Indent</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="TextEditor::BehaviorSettingsWidget" name="behaviorWidget" native="true"/>
</item>
<item row="1" column="0">
- <widget class="QGroupBox" name="groupBoxStorageSettings">
- <property name="toolTip">
- <string>Cleanup actions which are automatically performed right before the file is saved to disk.</string>
- </property>
- <property name="title">
- <string>Cleanups Upon Saving</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QCheckBox" name="cleanWhitespace">
- <property name="toolTip">
- <string>Removes trailing whitespace upon saving.</string>
- </property>
- <property name="text">
- <string>&amp;Clean whitespace</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>30</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QCheckBox" name="inEntireDocument">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Clean whitespace in entire document instead of only for changed parts.</string>
- </property>
- <property name="text">
- <string>In entire &amp;document</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="cleanIndentationLayout">
- <item>
- <spacer name="cleanIndentationSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>30</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QCheckBox" name="cleanIndentation">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Correct leading whitespace according to tab settings.</string>
- </property>
- <property name="text">
- <string>Clean indentation</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="addFinalNewLine">
- <property name="text">
- <string>&amp;Ensure newline at end of file</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QGroupBox" name="groupBoxMouse">
- <property name="title">
- <string>Mouse</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QCheckBox" name="mouseNavigation">
- <property name="text">
- <string>Enable &amp;mouse navigation</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="scrollWheelZooming">
- <property name="text">
- <string>Enable scroll &amp;wheel zooming</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -431,187 +25,21 @@ Influences the indentation of continuation lines.
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>8</height>
+ <height>13</height>
</size>
</property>
</spacer>
</item>
- <item row="1" column="1">
- <widget class="QGroupBox" name="groupBoxEncodings">
- <property name="title">
- <string>File Encodings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QLabel" name="encodingLabel">
- <property name="text">
- <string>Default encoding: </string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_6">
- <item>
- <widget class="QComboBox" name="encodingBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToMinimumContentsLengthWithIcon</enum>
- </property>
- <property name="minimumContentsLength">
- <number>20</number>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_6">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>285</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="utf8BomLabel">
- <property name="text">
- <string>UTF-8 BOM:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QComboBox" name="utf8BomBox">
- <property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
-&lt;p&gt;How text editors should deal with UTF-8 Byte Order Marks. The options are:&lt;/p&gt;
-&lt;ul &gt;&lt;li&gt;&lt;i&gt;Add If Encoding Is UTF-8:&lt;/i&gt; always add a BOM when saving a file in UTF-8 encoding. Note that this will not work if the encoding is &lt;i&gt;System&lt;/i&gt;, as Qt Creator does not know what it actually is.&lt;/li&gt;
-&lt;li&gt;&lt;i&gt;Keep If Already Present: &lt;/i&gt;save the file with a BOM if it already had one when it was loaded.&lt;/li&gt;
-&lt;li&gt;&lt;i&gt;Always Delete:&lt;/i&gt; never write an UTF-8 BOM, possibly deleting a pre-existing one.&lt;/li&gt;&lt;/ul&gt;
-&lt;p&gt;Note that UTF-8 BOMs are uncommon and treated incorrectly by some editors, so it usually makes little sense to add any.&lt;/p&gt;
-&lt;p&gt;This setting does &lt;b&gt;not&lt;/b&gt; influence the use of UTF-16 and UTF-32 BOMs.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- <item>
- <property name="text">
- <string>Add If Encoding Is UTF-8</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Keep If Already Present</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Always Delete</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="2" column="0" colspan="2">
- <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>
- </layout>
- </widget>
- </item>
</layout>
</widget>
- <tabstops>
- <tabstop>insertSpaces</tabstop>
- <tabstop>tabSize</tabstop>
- <tabstop>autoIndent</tabstop>
- <tabstop>smartBackspace</tabstop>
- <tabstop>tabKeyBehavior</tabstop>
- <tabstop>cleanWhitespace</tabstop>
- <tabstop>inEntireDocument</tabstop>
- <tabstop>cleanIndentation</tabstop>
- <tabstop>addFinalNewLine</tabstop>
- </tabstops>
+ <customwidgets>
+ <customwidget>
+ <class>TextEditor::BehaviorSettingsWidget</class>
+ <extends>QWidget</extends>
+ <header>texteditor/behaviorsettingswidget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<resources/>
- <connections>
- <connection>
- <sender>cleanWhitespace</sender>
- <signal>toggled(bool)</signal>
- <receiver>inEntireDocument</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>87</x>
- <y>323</y>
- </hint>
- <hint type="destinationlabel">
- <x>205</x>
- <y>353</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>cleanWhitespace</sender>
- <signal>toggled(bool)</signal>
- <receiver>cleanIndentation</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>60</x>
- <y>323</y>
- </hint>
- <hint type="destinationlabel">
- <x>134</x>
- <y>384</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>insertSpaces</sender>
- <signal>toggled(bool)</signal>
- <receiver>autoInsertSpaces</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>105</x>
- <y>49</y>
- </hint>
- <hint type="destinationlabel">
- <x>105</x>
- <y>78</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>