FakeVim: Widgets in preferences for 'scrolloff' and 'passnewline'

Change-Id: I257b1d01fa8c016c1680ee266cf87ce6298bea12
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hluk
2013-03-22 18:54:05 +01:00
committed by hjk
parent b2705f6dd0
commit 84d9069d94
2 changed files with 272 additions and 224 deletions

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>FakeVim::Internal::FakeVimOptionPage</class> <class>FakeVim::Internal::FakeVimOptionPage</class>
<widget class="QWidget" name="FakeVim::Internal::FakeVimOptionPage"> <widget class="QWidget" name="FakeVim::Internal::FakeVimOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>513</width>
<height>468</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="checkBoxUseFakeVim"> <widget class="QCheckBox" name="checkBoxUseFakeVim">
@@ -23,99 +15,143 @@
<property name="title"> <property name="title">
<string>Vim Behavior</string> <string>Vim Behavior</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="11" column="0"> <item>
<widget class="QLabel" name="labelIsKeyword"> <layout class="QGridLayout" name="gridLayout_3">
<item row="6" column="0">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text"> <property name="text">
<string>Keyword characters:</string> <string>Start of line</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="0"> <item row="4" column="0">
<widget class="QLabel" name="labelVimRcPath"> <widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text"> <property name="text">
<string>Location of .vimrc:</string> <string>Highlight search results</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="2"> <item row="1" column="0">
<widget class="QCheckBox" name="checkBoxReadVimRc"> <widget class="QCheckBox" name="checkBoxSmartIndent">
<property name="text"> <property name="text">
<string>Read .vimrc</string> <string>Smart indentation</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1" colspan="2"> <item row="3" column="0">
<widget class="QLineEdit" name="lineEditIsKeyword"/> <widget class="QCheckBox" name="checkBoxSmartTab">
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="checkBoxWrapScan">
<property name="text"> <property name="text">
<string>Use wrapscan</string> <string>Smart tabulators</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="2" column="0">
<widget class="QCheckBox" name="checkBoxAutoIndent"> <widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text"> <property name="text">
<string>Automatic indentation</string> <string>Expand tabulators</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0"> <item row="0" column="1">
<spacer name="verticalSpacer"> <widget class="QCheckBox" name="checkBoxIncSearch">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Incremental search</string>
</property> </property>
<property name="sizeType"> </widget>
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>17</width>
<height>10</height>
</size>
</property>
</spacer>
</item> </item>
<item row="1" column="2"> <item row="1" column="1">
<widget class="QCheckBox" name="checkBoxUseCoreSearch"> <widget class="QCheckBox" name="checkBoxUseCoreSearch">
<property name="text"> <property name="text">
<string>Use search dialog</string> <string>Use search dialog</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1" colspan="2"> <item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="QCheckBox" name="checkBoxSmartCase">
<item> <property name="text">
<widget class="QSpinBox" name="spinBoxShiftWidth"> <string>Use smartcase</string>
<property name="minimum">
<number>1</number>
</property> </property>
<property name="maximum"> </widget>
<number>80</number> </item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxWrapScan">
<property name="text">
<string>Use wrapscan</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBoxPassControlKey">
<property name="toolTip">
<string>Pass key sequences like Ctrl-S to Qt Creator core instead of interpreting them in FakeVim. This gives easier access to Qt Creator core functionality at the price of losing some features of FakeVim.</string>
</property>
<property name="text">
<string>Pass control key</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxAutoIndent">
<property name="text">
<string>Automatic indentation</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxIgnoreCase">
<property name="text">
<string>Use ignorecase</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxShowCmd">
<property name="text">
<string>Show partial command</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="checkBoxPassNewLine">
<property name="toolTip">
<string>Let Qt Creator handle new lines so that comments or code blocks can be properly completed and expanded.</string>
</property>
<property name="text">
<string>Pass new line</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="checkBoxShowMarks">
<property name="text">
<string>Show position of text marks</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBoxReadVimRc">
<property name="text">
<string>Read .vimrc</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
<property name="buddy">
<cstring>spinBoxShiftWidth</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <widget class="QSpinBox" name="spinBoxShiftWidth">
<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="9" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="spinBoxTabStop">
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
</property> </property>
@@ -137,26 +173,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> <item>
</item>
<item row="10" column="1" colspan="2">
<widget class="QLineEdit" name="lineEditBackspace"/>
</item>
<item row="10" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="labelTabulator"> <widget class="QLabel" name="labelTabulator">
<property name="toolTip"> <property name="toolTip">
<string>Vim tabstop option</string> <string>Vim tabstop option</string>
@@ -164,16 +181,104 @@
<property name="text"> <property name="text">
<string>Tabulator size:</string> <string>Tabulator size:</string>
</property> </property>
</widget> <property name="buddy">
</item> <cstring>spinBoxTabStop</cstring>
<item row="3" column="2">
<widget class="QCheckBox" name="checkBoxSmartCase">
<property name="text">
<string>Use smartcase</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="1" colspan="2"> <item>
<widget class="QSpinBox" name="spinBoxTabStop">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>80</number>
</property>
</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>
<item>
<widget class="QLabel" name="labelScrollOff">
<property name="text">
<string>Scroll offset:</string>
</property>
<property name="buddy">
<cstring>spinBoxScrollOff</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxScrollOff"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<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>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
</property>
<property name="buddy">
<cstring>lineEditBackspace</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditBackspace"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelIsKeyword">
<property name="text">
<string>Keyword characters:</string>
</property>
<property name="buddy">
<cstring>lineEditIsKeyword</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditIsKeyword"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelVimRcPath">
<property name="text">
<string>Location of .vimrc:</string>
</property>
<property name="buddy">
<cstring>lineEditVimRcPath</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutVimRcPath"> <layout class="QHBoxLayout" name="horizontalLayoutVimRcPath">
<item> <item>
<widget class="QLineEdit" name="lineEditVimRcPath"> <widget class="QLineEdit" name="lineEditVimRcPath">
@@ -191,7 +296,9 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="14" column="0" colspan="3"> </layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QPushButton" name="pushButtonCopyTextEditorSettings"> <widget class="QPushButton" name="pushButtonCopyTextEditorSettings">
@@ -229,84 +336,8 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="2">
<widget class="QCheckBox" name="checkBoxShowMarks">
<property name="text">
<string>Show position of text marks</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSmartIndent">
<property name="text">
<string>Smart indentation</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QCheckBox" name="checkBoxPassControlKey">
<property name="toolTip">
<string>Pass key sequences like Ctrl-S to Qt Creator core instead of interpreting them in FakeVim. This gives easier access to Qt Creator core functionality at the price of losing some features of FakeVim.</string>
</property>
<property name="text">
<string>Pass control key</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="checkBoxIgnoreCase">
<property name="text">
<string>Use ignorecase</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text">
<string>Expand tabulators</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text">
<string>Smart tabulators</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text">
<string>Highlight search results</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="checkBoxIncSearch">
<property name="text">
<string>Incremental search</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxShowCmd">
<property name="text">
<string>Show partial command</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text">
<string>Start of line</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@@ -320,6 +351,9 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
<tabstops> <tabstops>
<tabstop>checkBoxUseFakeVim</tabstop> <tabstop>checkBoxUseFakeVim</tabstop>
<tabstop>checkBoxAutoIndent</tabstop> <tabstop>checkBoxAutoIndent</tabstop>
@@ -329,6 +363,7 @@
<tabstop>checkBoxHlSearch</tabstop> <tabstop>checkBoxHlSearch</tabstop>
<tabstop>checkBoxShowCmd</tabstop> <tabstop>checkBoxShowCmd</tabstop>
<tabstop>checkBoxStartOfLine</tabstop> <tabstop>checkBoxStartOfLine</tabstop>
<tabstop>checkBoxPassNewLine</tabstop>
<tabstop>checkBoxIncSearch</tabstop> <tabstop>checkBoxIncSearch</tabstop>
<tabstop>checkBoxUseCoreSearch</tabstop> <tabstop>checkBoxUseCoreSearch</tabstop>
<tabstop>checkBoxIgnoreCase</tabstop> <tabstop>checkBoxIgnoreCase</tabstop>
@@ -339,6 +374,7 @@
<tabstop>checkBoxReadVimRc</tabstop> <tabstop>checkBoxReadVimRc</tabstop>
<tabstop>spinBoxShiftWidth</tabstop> <tabstop>spinBoxShiftWidth</tabstop>
<tabstop>spinBoxTabStop</tabstop> <tabstop>spinBoxTabStop</tabstop>
<tabstop>spinBoxScrollOff</tabstop>
<tabstop>lineEditBackspace</tabstop> <tabstop>lineEditBackspace</tabstop>
<tabstop>lineEditIsKeyword</tabstop> <tabstop>lineEditIsKeyword</tabstop>
<tabstop>lineEditVimRcPath</tabstop> <tabstop>lineEditVimRcPath</tabstop>

View File

@@ -292,8 +292,12 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
m_ui.checkBoxSmartTab); m_ui.checkBoxSmartTab);
m_group.insert(theFakeVimSetting(ConfigStartOfLine), m_group.insert(theFakeVimSetting(ConfigStartOfLine),
m_ui.checkBoxStartOfLine); m_ui.checkBoxStartOfLine);
m_group.insert(theFakeVimSetting(ConfigPassNewLine),
m_ui.checkBoxPassNewLine);
m_group.insert(theFakeVimSetting(ConfigTabStop), m_group.insert(theFakeVimSetting(ConfigTabStop),
m_ui.spinBoxTabStop); m_ui.spinBoxTabStop);
m_group.insert(theFakeVimSetting(ConfigScrollOff),
m_ui.spinBoxScrollOff);
m_group.insert(theFakeVimSetting(ConfigBackspace), m_group.insert(theFakeVimSetting(ConfigBackspace),
m_ui.lineEditBackspace); m_ui.lineEditBackspace);
m_group.insert(theFakeVimSetting(ConfigIsKeyword), m_group.insert(theFakeVimSetting(ConfigIsKeyword),
@@ -348,10 +352,16 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
<< sep << m_ui.checkBoxSmartCase->text() << sep << m_ui.checkBoxSmartCase->text()
<< sep << m_ui.checkBoxShowMarks->text() << sep << m_ui.checkBoxShowMarks->text()
<< sep << m_ui.checkBoxPassControlKey->text() << sep << m_ui.checkBoxPassControlKey->text()
<< sep << m_ui.checkBoxPassNewLine->text()
<< sep << m_ui.checkBoxIgnoreCase->text()
<< sep << m_ui.checkBoxWrapScan->text()
<< sep << m_ui.checkBoxShowCmd->text()
<< sep << m_ui.labelShiftWidth->text() << sep << m_ui.labelShiftWidth->text()
<< sep << m_ui.labelTabulator->text() << sep << m_ui.labelTabulator->text()
<< sep << m_ui.labelBackspace->text() << sep << m_ui.labelBackspace->text()
<< sep << m_ui.labelIsKeyword->text(); << sep << m_ui.labelIsKeyword->text()
<< sep << m_ui.labelScrollOff->text()
<< sep << m_ui.lineEditVimRcPath->text();
m_searchKeywords.remove(QLatin1Char('&')); m_searchKeywords.remove(QLatin1Char('&'));
} }
return w; return w;
@@ -381,6 +391,7 @@ void FakeVimOptionPage::setQtStyle()
m_ui.checkBoxSmartIndent->setChecked(true); m_ui.checkBoxSmartIndent->setChecked(true);
m_ui.checkBoxIncSearch->setChecked(true); m_ui.checkBoxIncSearch->setChecked(true);
m_ui.lineEditBackspace->setText(_("indent,eol,start")); m_ui.lineEditBackspace->setText(_("indent,eol,start"));
m_ui.checkBoxPassNewLine->setChecked(true);
} }
void FakeVimOptionPage::setPlainStyle() void FakeVimOptionPage::setPlainStyle()
@@ -393,6 +404,7 @@ void FakeVimOptionPage::setPlainStyle()
m_ui.checkBoxSmartIndent->setChecked(false); m_ui.checkBoxSmartIndent->setChecked(false);
m_ui.checkBoxIncSearch->setChecked(false); m_ui.checkBoxIncSearch->setChecked(false);
m_ui.lineEditBackspace->setText(QString()); m_ui.lineEditBackspace->setText(QString());
m_ui.checkBoxPassNewLine->setChecked(false);
} }
void FakeVimOptionPage::openVimRc() void FakeVimOptionPage::openVimRc()