m_page->caseSensitivity->setCurrentIndex(caseSensitivityIndex);
m_page->completionTrigger->setCurrentIndex(completionTriggerIndex);
m_page->autoInsertBrackets->setChecked(settings.m_autoInsertBrackets);
+ m_page->surroundSelectedText->setChecked(settings.m_surroundingAutoBrackets);
m_page->partiallyComplete->setChecked(settings.m_partiallyComplete);
m_page->spaceAfterFunctionName->setChecked(settings.m_spaceAfterFunctionName);
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords) << m_page->caseSensitivityLabel->text()
<< ' ' << m_page->autoInsertBrackets->text()
+ << ' ' << m_page->surroundSelectedText->text()
<< ' ' << m_page->completionTriggerLabel->text()
<< ' ' << m_page->partiallyComplete->text()
<< ' ' << m_page->spaceAfterFunctionName->text();
settings.m_caseSensitivity = caseSensitivity();
settings.m_completionTrigger = completionTrigger();
settings.m_autoInsertBrackets = m_page->autoInsertBrackets->isChecked();
+ settings.m_surroundingAutoBrackets = m_page->surroundSelectedText->isChecked();
settings.m_partiallyComplete = m_page->partiallyComplete->isChecked();
settings.m_spaceAfterFunctionName = m_page->spaceAfterFunctionName->isChecked();
<rect>
<x>0</x>
<y>0</y>
- <width>359</width>
- <height>244</height>
+ <width>363</width>
+ <height>241</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
</property>
</widget>
</item>
- <item row="0" column="2">
+ <item row="0" column="1">
<widget class="QComboBox" name="caseSensitivity">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
</item>
</widget>
</item>
- <item row="0" column="3" colspan="2">
+ <item row="0" column="2" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="1" column="0" colspan="2">
+ <item row="1" column="0">
<widget class="QLabel" name="completionTriggerLabel">
<property name="text">
<string>Activate completion:</string>
</property>
</widget>
</item>
- <item row="1" column="2" colspan="2">
+ <item row="1" column="1" colspan="2">
<widget class="QComboBox" name="completionTrigger">
<item>
<property name="text">
</item>
</widget>
</item>
- <item row="1" column="4">
+ <item row="1" column="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="3" column="0" colspan="3">
- <widget class="QCheckBox" name="autoInsertBrackets">
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="partiallyComplete">
<property name="toolTip">
- <string>Automatically insert brackets and semicolons when appropriate.</string>
+ <string>Insert the common prefix of available completion items.</string>
</property>
<property name="text">
- <string>&Automatically insert brackets</string>
+ <string>Autocomplete common &prefix</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="5" column="0" colspan="3">
- <widget class="QCheckBox" name="spaceAfterFunctionName">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>Insert &space after function name</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="partiallyComplete">
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="autoInsertBrackets">
<property name="toolTip">
- <string>Insert the common prefix of available completion items.</string>
+ <string>Automatically insert brackets and semicolons when appropriate.</string>
</property>
<property name="text">
- <string>Autocomplete common &prefix</string>
+ <string>&Automatically insert brackets</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <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="surroundSelectedText">
+ <property name="toolTip">
+ <string>Automatically surround text selections with brackets.</string>
+ </property>
+ <property name="text">
+ <string>Surround selected &text</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="5" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <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="spaceAfterFunctionName">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Insert &space after function name</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</item>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>248</x>
- <y>132</y>
+ <x>267</x>
+ <y>131</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>265</x>
+ <y>182</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>autoInsertBrackets</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>surroundSelectedText</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>109</x>
+ <y>123</y>
</hint>
<hint type="destinationlabel">
- <x>246</x>
- <y>164</y>
+ <x>119</x>
+ <y>156</y>
</hint>
</hints>
</connection>
static const char caseSensitivityKey[] = "CaseSensitivity";
static const char completionTriggerKey[] = "CompletionTrigger";
static const char autoInsertBracesKey[] = "AutoInsertBraces";
+static const char surroundingAutoBracketsKey[] = "SurroundingAutoBrackets";
static const char partiallyCompleteKey[] = "PartiallyComplete";
static const char spaceAfterFunctionNameKey[] = "SpaceAfterFunctionName";
: m_caseSensitivity(CaseInsensitive)
, m_completionTrigger(AutomaticCompletion)
, m_autoInsertBrackets(true)
+ , m_surroundingAutoBrackets(true)
, m_partiallyComplete(true)
, m_spaceAfterFunctionName(false)
{
s->setValue(QLatin1String(caseSensitivityKey), (int) m_caseSensitivity);
s->setValue(QLatin1String(completionTriggerKey), (int) m_completionTrigger);
s->setValue(QLatin1String(autoInsertBracesKey), m_autoInsertBrackets);
+ s->setValue(QLatin1String(surroundingAutoBracketsKey), m_surroundingAutoBrackets);
s->setValue(QLatin1String(partiallyCompleteKey), m_partiallyComplete);
s->setValue(QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName);
s->endGroup();
m_caseSensitivity = (CaseSensitivity) s->value(group + QLatin1String(caseSensitivityKey), m_caseSensitivity).toInt();
m_completionTrigger = (CompletionTrigger) s->value(group + QLatin1String(completionTriggerKey), m_completionTrigger).toInt();
m_autoInsertBrackets = s->value(group + QLatin1String(autoInsertBracesKey), m_autoInsertBrackets).toBool();
+ m_surroundingAutoBrackets = s->value(group + QLatin1String(surroundingAutoBracketsKey), m_surroundingAutoBrackets).toBool();
m_partiallyComplete = s->value(group + QLatin1String(partiallyCompleteKey), m_partiallyComplete).toBool();
m_spaceAfterFunctionName = s->value(group + QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName).toBool();
}
return m_caseSensitivity == cs.m_caseSensitivity
&& m_completionTrigger == cs.m_completionTrigger
&& m_autoInsertBrackets == cs.m_autoInsertBrackets
+ && m_surroundingAutoBrackets == cs.m_surroundingAutoBrackets
&& m_partiallyComplete == cs.m_partiallyComplete
&& m_spaceAfterFunctionName == cs.m_spaceAfterFunctionName
;