forked from qt-creator/qt-creator
Polish the settings dialog.
Add a title label to the pages. Use QGroupBoxes throughout. Extend SavedAction to work with checkable QGroupBoxes. Polish UI files, use common layout for VCS plugins. Performance: Apply only visited settings pages. Add search keywords. Task-number: QTCREATOR-26
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
namespace Git {
|
||||
@@ -75,8 +76,21 @@ void SettingsPageWidget::setSystemPath()
|
||||
m_ui.pathLineEdit->setText(QLatin1String(qgetenv("PATH")));
|
||||
}
|
||||
|
||||
QString SettingsPageWidget::searchKeywords() const
|
||||
{
|
||||
QString rc;
|
||||
QTextStream(&rc) << ' ' << m_ui.pathlabel->text() << ' ' << m_ui.logCountLabel->text()
|
||||
<< ' ' << m_ui.timeoutLabel->text()
|
||||
<< ' ' << m_ui.promptToSubmitCheckBox->text()
|
||||
<< ' ' << m_ui.omitAnnotationDataCheckBox->text()
|
||||
<< ' ' << m_ui.environmentGroupBox->title();
|
||||
rc.remove(QLatin1Char('&'));
|
||||
return rc;
|
||||
}
|
||||
|
||||
// -------- SettingsPage
|
||||
SettingsPage::SettingsPage()
|
||||
SettingsPage::SettingsPage() :
|
||||
m_widget(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -104,6 +118,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
|
||||
{
|
||||
m_widget = new SettingsPageWidget(parent);
|
||||
m_widget->setSettings(GitPlugin::instance()->settings());
|
||||
if (m_searchKeywords.isEmpty())
|
||||
m_searchKeywords = m_widget->searchKeywords();
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
@@ -121,5 +137,11 @@ void SettingsPage::apply()
|
||||
|
||||
GitPlugin::instance()->setSettings(newSettings);
|
||||
}
|
||||
|
||||
bool SettingsPage::matches(const QString &s) const
|
||||
{
|
||||
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ public:
|
||||
GitSettings settings() const;
|
||||
void setSettings(const GitSettings &);
|
||||
|
||||
QString searchKeywords() const;
|
||||
|
||||
private slots:
|
||||
void setSystemPath();
|
||||
|
||||
@@ -76,8 +78,10 @@ public:
|
||||
QWidget *createPage(QWidget *parent);
|
||||
void apply();
|
||||
void finish() { }
|
||||
virtual bool matches(const QString &) const;
|
||||
|
||||
private:
|
||||
QString m_searchKeywords;
|
||||
SettingsPageWidget* m_widget;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>409</width>
|
||||
<height>251</height>
|
||||
<height>279</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@@ -66,59 +66,64 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="logCountLabel">
|
||||
<property name="text">
|
||||
<string>Log commit display count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="logCountSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>Note that huge amount of commits might take some time.</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="timeoutLabel">
|
||||
<property name="text">
|
||||
<string>Timeout (seconds):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSpinBox">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>300</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
||||
<property name="text">
|
||||
<string>Prompt to submit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="omitAnnotationDataCheckBox">
|
||||
<property name="text">
|
||||
<string>Omit date from annotation output</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Miscellaneous</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="logCountLabel">
|
||||
<property name="text">
|
||||
<string>Log commit display count:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="logCountSpinBox">
|
||||
<property name="toolTip">
|
||||
<string>Note that huge amount of commits might take some time.</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="timeoutLabel">
|
||||
<property name="text">
|
||||
<string>Timeout (seconds):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSpinBox">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>300</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="promptToSubmitCheckBox">
|
||||
<property name="text">
|
||||
<string>Prompt on submit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="omitAnnotationDataCheckBox">
|
||||
<property name="text">
|
||||
<string>Omit date from annotation output</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
|
||||
Reference in New Issue
Block a user