forked from qt-creator/qt-creator
Mercurial: Polish settings dialog.
Task-number: QTCREATOR-26
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <vcsbase/vcsbaseconstants.h>
|
#include <vcsbase/vcsbaseconstants.h>
|
||||||
|
|
||||||
|
#include <QtCore/QTextStream>
|
||||||
|
|
||||||
using namespace Mercurial::Internal;
|
using namespace Mercurial::Internal;
|
||||||
using namespace Mercurial;
|
using namespace Mercurial;
|
||||||
|
|
||||||
@@ -68,6 +70,19 @@ void OptionsPageWidget::setSettings(const MercurialSettings &s)
|
|||||||
m_ui.promptOnSubmitCheckBox->setChecked(s.prompt());
|
m_ui.promptOnSubmitCheckBox->setChecked(s.prompt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString OptionsPageWidget::searchKeywords() const
|
||||||
|
{
|
||||||
|
QString rc;
|
||||||
|
QTextStream(&rc) << ' ' << m_ui.mercurialCommandLabel->text()
|
||||||
|
<< ' ' << m_ui.showLogEntriesLabel->text()
|
||||||
|
<< ' ' << m_ui.timeoutSecondsLabel->text()
|
||||||
|
<< ' ' << m_ui.promptOnSubmitCheckBox->text()
|
||||||
|
<< ' ' << m_ui.defaultUsernameLabel->text()
|
||||||
|
<< ' ' << m_ui.defaultEmailLabel->text();
|
||||||
|
rc.remove(QLatin1Char('&'));
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
OptionsPage::OptionsPage()
|
OptionsPage::OptionsPage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -97,6 +112,8 @@ QWidget *OptionsPage::createPage(QWidget *parent)
|
|||||||
if (!optionsPageWidget)
|
if (!optionsPageWidget)
|
||||||
optionsPageWidget = new OptionsPageWidget(parent);
|
optionsPageWidget = new OptionsPageWidget(parent);
|
||||||
optionsPageWidget->setSettings(MercurialPlugin::instance()->settings());
|
optionsPageWidget->setSettings(MercurialPlugin::instance()->settings());
|
||||||
|
if (m_searchKeywords.isEmpty())
|
||||||
|
m_searchKeywords = optionsPageWidget->searchKeywords();
|
||||||
return optionsPageWidget;
|
return optionsPageWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,3 +131,7 @@ void OptionsPage::apply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OptionsPage::matches(const QString &s) const
|
||||||
|
{
|
||||||
|
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
|
|
||||||
MercurialSettings settings() const;
|
MercurialSettings settings() const;
|
||||||
void setSettings(const MercurialSettings &s);
|
void setSettings(const MercurialSettings &s);
|
||||||
|
QString searchKeywords() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::OptionsPage m_ui;
|
Ui::OptionsPage m_ui;
|
||||||
@@ -70,11 +71,13 @@ public:
|
|||||||
QWidget *createPage(QWidget *parent);
|
QWidget *createPage(QWidget *parent);
|
||||||
void apply();
|
void apply();
|
||||||
void finish() { }
|
void finish() { }
|
||||||
|
bool matches(const QString &s) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QString m_searchKeywords;
|
||||||
QPointer<OptionsPageWidget> optionsPageWidget;
|
QPointer<OptionsPageWidget> optionsPageWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,110 +6,138 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>392</width>
|
||||||
<height>300</height>
|
<height>359</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="QGroupBox" name="configgroupBox">
|
||||||
<item>
|
<property name="title">
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<string>Configuration</string>
|
||||||
<property name="fieldGrowthPolicy">
|
</property>
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
<layout class="QFormLayout" name="formLayout_3">
|
||||||
</property>
|
<item row="0" column="0">
|
||||||
<item row="0" column="0">
|
<widget class="QLabel" name="mercurialCommandLabel">
|
||||||
<widget class="QLabel" name="mercurialCommandLabel">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Command:</string>
|
||||||
<string>Mercurial Command:</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="0" column="1">
|
||||||
<item row="0" column="1">
|
<widget class="Utils::PathChooser" name="commandChooser"/>
|
||||||
<widget class="Utils::PathChooser" name="commandChooser" native="true"/>
|
</item>
|
||||||
</item>
|
</layout>
|
||||||
<item row="3" column="0">
|
</widget>
|
||||||
<widget class="QLabel" name="showLogEntriesLabel">
|
</item>
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Show Log Entries:</string>
|
<widget class="QGroupBox" name="userGroupBox">
|
||||||
</property>
|
<property name="title">
|
||||||
</widget>
|
<string>User</string>
|
||||||
</item>
|
</property>
|
||||||
<item row="3" column="1">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<widget class="QSpinBox" name="logEntriesCount">
|
<item row="0" column="0">
|
||||||
<property name="toolTip">
|
<widget class="QLabel" name="defaultUsernameLabel">
|
||||||
<string>The number of recent commit logs to show, choose 0 to see all enteries</string>
|
<property name="toolTip">
|
||||||
</property>
|
<string>Username to use by default on commit.</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="4" column="0">
|
<string>Default username:</string>
|
||||||
<widget class="QLabel" name="timeoutSecondsLabel">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Timeout (Seconds):</string>
|
</item>
|
||||||
</property>
|
<item row="0" column="1">
|
||||||
</widget>
|
<widget class="QLineEdit" name="defaultUsernameLineEdit">
|
||||||
</item>
|
<property name="toolTip">
|
||||||
<item row="4" column="1">
|
<string>Username to use by default on commit.</string>
|
||||||
<widget class="QSpinBox" name="timeout">
|
</property>
|
||||||
<property name="value">
|
</widget>
|
||||||
<number>30</number>
|
</item>
|
||||||
</property>
|
<item row="1" column="0">
|
||||||
</widget>
|
<widget class="QLabel" name="defaultEmailLabel">
|
||||||
</item>
|
<property name="toolTip">
|
||||||
<item row="5" column="0">
|
<string>Email to use by default on commit.</string>
|
||||||
<widget class="QLabel" name="promptOnSubmitLabel">
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prompt On Submit</string>
|
<string>Default Email:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QCheckBox" name="promptOnSubmitCheckBox">
|
<widget class="QLineEdit" name="defaultEmailLineEdit">
|
||||||
<property name="checked">
|
<property name="toolTip">
|
||||||
<bool>true</bool>
|
<string>Email to use by default on commit.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
</layout>
|
||||||
<widget class="QLabel" name="defaultUsernameLabel">
|
</widget>
|
||||||
<property name="toolTip">
|
</item>
|
||||||
<string>Username to use by default on commit.</string>
|
<item>
|
||||||
</property>
|
<widget class="QGroupBox" name="miscGroupBox">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string>Default Username:</string>
|
<string>Miscellaneous</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
</item>
|
<item row="0" column="0">
|
||||||
<item row="1" column="1">
|
<widget class="QLabel" name="showLogEntriesLabel">
|
||||||
<widget class="QLineEdit" name="defaultUsernameLineEdit">
|
<property name="text">
|
||||||
<property name="toolTip">
|
<string>Show log entries:</string>
|
||||||
<string>Username to use by default on commit.</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="0" column="1">
|
||||||
<item row="2" column="0">
|
<widget class="QSpinBox" name="logEntriesCount">
|
||||||
<widget class="QLabel" name="defaultEmailLabel">
|
<property name="toolTip">
|
||||||
<property name="toolTip">
|
<string>The number of recent commit logs to show, choose 0 to see all enteries</string>
|
||||||
<string>Email to use by default on commit.</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="text">
|
</item>
|
||||||
<string>Default Email:</string>
|
<item row="1" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="timeoutSecondsLabel">
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string>Timeout:</string>
|
||||||
<item row="2" column="1">
|
</property>
|
||||||
<widget class="QLineEdit" name="defaultEmailLineEdit">
|
</widget>
|
||||||
<property name="toolTip">
|
</item>
|
||||||
<string>Email to use by default on commit.</string>
|
<item row="1" column="1">
|
||||||
</property>
|
<widget class="QSpinBox" name="timeout">
|
||||||
</widget>
|
<property name="suffix">
|
||||||
</item>
|
<string>s</string>
|
||||||
</layout>
|
</property>
|
||||||
</item>
|
<property name="value">
|
||||||
</layout>
|
<number>30</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="promptOnSubmitCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Prompt on submit</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<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>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user