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:
Friedemann Kleint
2009-11-24 15:05:02 +01:00
parent c49bed1199
commit 65e11062bb
68 changed files with 1444 additions and 1295 deletions

View File

@@ -42,6 +42,7 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QRadioButton> #include <QtGui/QRadioButton>
#include <QtGui/QSpinBox> #include <QtGui/QSpinBox>
#include <QtGui/QGroupBox>
using namespace Utils; using namespace Utils;
@@ -238,19 +239,17 @@ QAction *SavedAction::updatedAction(const QString &text0)
\sa settingsKey(), settingsGroup(), writeSettings() \sa settingsKey(), settingsGroup(), writeSettings()
*/ */
void SavedAction::readSettings(QSettings *settings) void SavedAction::readSettings(const QSettings *settings)
{ {
if (m_settingsGroup.isEmpty() || m_settingsKey.isEmpty()) if (m_settingsGroup.isEmpty() || m_settingsKey.isEmpty())
return; return;
settings->beginGroup(m_settingsGroup); QVariant var = settings->value(m_settingsGroup + QLatin1Char('/') + m_settingsKey, m_defaultValue);
QVariant var = settings->value(m_settingsKey, m_defaultValue);
// work around old ini files containing @Invalid() entries // work around old ini files containing @Invalid() entries
if (isCheckable() && !var.isValid()) if (isCheckable() && !var.isValid())
var = false; var = false;
setValue(var); setValue(var);
//qDebug() << "READING: " << var.isValid() << m_settingsKey << " -> " << m_value //qDebug() << "READING: " << var.isValid() << m_settingsKey << " -> " << m_value
// << " (default: " << m_defaultValue << ")" << var; // << " (default: " << m_defaultValue << ")" << var;
settings->endGroup();
} }
/* /*
@@ -314,6 +313,11 @@ void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode)
this, SLOT(pathChooserEditingFinished())); this, SLOT(pathChooserEditingFinished()));
connect(pathChooser, SIGNAL(browsingFinished()), connect(pathChooser, SIGNAL(browsingFinished()),
this, SLOT(pathChooserEditingFinished())); this, SLOT(pathChooserEditingFinished()));
} else if (QGroupBox *groupBox= qobject_cast<QGroupBox *>(widget)) {
if (!groupBox->isCheckable())
qDebug() << "connectWidget to non-checkable group box" << widget << toString();
groupBox->setChecked(m_value.toBool());
connect(groupBox, SIGNAL(toggled(bool)), this, SLOT(groupBoxToggled(bool)));
} else { } else {
qDebug() << "Cannot connect widget " << widget << toString(); qDebug() << "Cannot connect widget " << widget << toString();
} }
@@ -339,6 +343,8 @@ void SavedAction::apply(QSettings *s)
setValue(spinBox->value()); setValue(spinBox->value());
else if (PathChooser *pathChooser = qobject_cast<PathChooser *>(m_widget)) else if (PathChooser *pathChooser = qobject_cast<PathChooser *>(m_widget))
setValue(pathChooser->path()); setValue(pathChooser->path());
else if (const QGroupBox *groupBox= qobject_cast<QGroupBox *>(m_widget))
setValue(groupBox->isChecked());
if (s) if (s)
writeSettings(s); writeSettings(s);
} }
@@ -392,6 +398,12 @@ void SavedAction::pathChooserEditingFinished()
setValue(pathChooser->path()); setValue(pathChooser->path());
} }
void SavedAction::groupBoxToggled(bool checked)
{
if (m_applyMode == ImmediateApply)
setValue(QVariant(checked));
}
void SavedAction::actionTriggered(bool) void SavedAction::actionTriggered(bool)
{ {
if (isCheckable()) if (isCheckable())
@@ -436,3 +448,16 @@ void SavedActionSet::finish()
action->disconnectWidget(); action->disconnectWidget();
} }
QString SavedActionSet::searchKeyWords() const
{
const QChar blank = QLatin1Char(' ');
QString rc;
foreach (SavedAction *action, m_list) {
if (!rc.isEmpty())
rc += blank;
rc += action->text();
}
rc.remove(QLatin1Char('&'));
return rc;
}

View File

@@ -70,7 +70,7 @@ public:
virtual QString settingsGroup() const; virtual QString settingsGroup() const;
Q_SLOT virtual void setSettingsGroup(const QString &group); Q_SLOT virtual void setSettingsGroup(const QString &group);
virtual void readSettings(QSettings *settings); virtual void readSettings(const QSettings *settings);
Q_SLOT virtual void writeSettings(QSettings *settings); Q_SLOT virtual void writeSettings(QSettings *settings);
virtual void connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply); virtual void connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply);
@@ -93,6 +93,7 @@ private:
Q_SLOT void actionTriggered(bool); Q_SLOT void actionTriggered(bool);
Q_SLOT void spinBoxValueChanged(int); Q_SLOT void spinBoxValueChanged(int);
Q_SLOT void spinBoxValueChanged(QString); Q_SLOT void spinBoxValueChanged(QString);
Q_SLOT void groupBoxToggled(bool checked);
QVariant m_value; QVariant m_value;
QVariant m_defaultValue; QVariant m_defaultValue;
@@ -115,6 +116,9 @@ public:
void finish(); void finish();
void clear() { m_list.clear(); } void clear() { m_list.clear(); }
// Search keywords for options dialog search.
QString searchKeyWords() const;
private: private:
QList<SavedAction *> m_list; QList<SavedAction *> m_list;
}; };

View File

@@ -263,7 +263,7 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent)
{ {
QWidget *outerWidget = new QWidget(parent); QWidget *outerWidget = new QWidget(parent);
QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget); QVBoxLayout *outerLayout = new QVBoxLayout(outerWidget);
QGroupBox *groupBox = new QGroupBox(trCategory()); QGroupBox *groupBox = new QGroupBox;
outerLayout->addWidget(groupBox); outerLayout->addWidget(groupBox);
outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding)); outerLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
QFormLayout *formLayout = new QFormLayout(groupBox); QFormLayout *formLayout = new QFormLayout(groupBox);

View File

@@ -42,6 +42,11 @@
#include <QtGui/QSortFilterProxyModel> #include <QtGui/QSortFilterProxyModel>
#include <QtGui/QItemSelectionModel> #include <QtGui/QItemSelectionModel>
#include <QtGui/QIcon> #include <QtGui/QIcon>
#include <QtGui/QLabel>
#include <QtGui/QVBoxLayout>
#include <QtGui/QHBoxLayout>
#include <QtGui/QSpacerItem>
#include <QtGui/QStyle>
enum ItemType { CategoryItem, PageItem }; enum ItemType { CategoryItem, PageItem };
@@ -201,8 +206,37 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));
foreach(IOptionsPage *page, m_pages) // Create pages with title labels with a larger, bold font, left-aligned
stackedPages->addWidget(page->createPage(0)); // with the group boxes of the page.
const int pageCount = m_pages.size();
QFont titleLabelFont;
const int leftMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) +
qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
for (int i = 0; i < pageCount; i++) {
// Title bar
QHBoxLayout *titleLayout = new QHBoxLayout;
titleLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
QLabel *titleLabel = new QLabel(m_pages.at(i)->trName());
if (i == 0) { // Create a bold header font from the default label font.
titleLabelFont = titleLabel->font();
titleLabelFont.setBold(true);
// Paranoia: Should a font be set in pixels...
const int pointSize = titleLabelFont.pointSize();
if (pointSize > 0)
titleLabelFont.setPointSize(pointSize + 2);
}
titleLabel->setFont(titleLabelFont);
titleLayout->addWidget(titleLabel);
// Page
QWidget *pageContainer =new QWidget;
QVBoxLayout *pageLayout = new QVBoxLayout(pageContainer);
pageLayout->addLayout(titleLayout);
pageLayout->addSpacerItem(new QSpacerItem(0, 6, QSizePolicy::Ignored, QSizePolicy::Fixed));
pageLayout->addWidget(m_pages.at(i)->createPage(0));
stackedPages->addWidget(pageContainer);
}
// foreach(IOptionsPage *page, m_pages)
// stackedPages->addWidget();
splitter->setCollapsible(1, false); splitter->setCollapsible(1, false);
pageTree->header()->setVisible(false); pageTree->header()->setVisible(false);
@@ -247,10 +281,11 @@ void SettingsDialog::showPage(const QStandardItem *item)
// if a category was hit. // if a category was hit.
switch (itemTypeOfItem(item)) { switch (itemTypeOfItem(item)) {
case PageItem: { case PageItem: {
const IOptionsPage *page = pageOfItem(item); IOptionsPage *page = pageOfItem(item);
m_currentCategory = page->category(); m_currentCategory = page->category();
m_currentPage = page->id(); m_currentPage = page->id();
stackedPages->setCurrentIndex(indexOfItem(item)); stackedPages->setCurrentIndex(indexOfItem(item));
m_visitedPages.insert(page);
} }
break; break;
case CategoryItem: case CategoryItem:
@@ -318,10 +353,10 @@ void SettingsDialog::filter(const QString &text)
void SettingsDialog::accept() void SettingsDialog::accept()
{ {
m_applied = true; m_applied = true;
foreach (IOptionsPage *page, m_pages) { foreach (IOptionsPage *page, m_visitedPages)
page->apply(); page->apply();
foreach (IOptionsPage *page, m_pages)
page->finish(); page->finish();
}
done(QDialog::Accepted); done(QDialog::Accepted);
} }
@@ -334,7 +369,7 @@ void SettingsDialog::reject()
void SettingsDialog::apply() void SettingsDialog::apply()
{ {
foreach (IOptionsPage *page, m_pages) foreach (IOptionsPage *page, m_visitedPages)
page->apply(); page->apply();
m_applied = true; m_applied = true;
} }

View File

@@ -33,6 +33,7 @@
#include "ui_settingsdialog.h" #include "ui_settingsdialog.h"
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QSet>
#include "coreplugin/dialogs/ioptionspage.h" #include "coreplugin/dialogs/ioptionspage.h"
@@ -74,6 +75,8 @@ private:
void showPage(const QStandardItem *item); void showPage(const QStandardItem *item);
const QList<Core::IOptionsPage*> m_pages; const QList<Core::IOptionsPage*> m_pages;
QSet<Core::IOptionsPage*> m_visitedPages;
QSortFilterProxyModel *m_proxyModel; QSortFilterProxyModel *m_proxyModel;
QStandardItemModel *m_model; QStandardItemModel *m_model;
bool m_applied; bool m_applied;

View File

@@ -2,12 +2,17 @@
<ui version="4.0"> <ui version="4.0">
<class>Core::Internal::GeneralSettings</class> <class>Core::Internal::GeneralSettings</class>
<widget class="QWidget" name="Core::Internal::GeneralSettings"> <widget class="QWidget" name="Core::Internal::GeneralSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>363</width>
<height>296</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title">
<string>General settings</string>
</property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="rowWrapPolicy"> <property name="rowWrapPolicy">
<enum>QFormLayout::WrapLongRows</enum> <enum>QFormLayout::WrapLongRows</enum>

View File

@@ -74,7 +74,7 @@ QString CodePasterSettingsPage::trCategory() const
QWidget *CodePasterSettingsPage::createPage(QWidget *parent) QWidget *CodePasterSettingsPage::createPage(QWidget *parent)
{ {
QGroupBox *groupBox = new QGroupBox(category()); QGroupBox *groupBox = new QGroupBox();
QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox); QVBoxLayout *groupBoxLayout = new QVBoxLayout(groupBox);
QFormLayout *formLayout = new QFormLayout; QFormLayout *formLayout = new QFormLayout;
QLineEdit *lineedit = new QLineEdit(m_host); QLineEdit *lineedit = new QLineEdit(m_host);

View File

@@ -16,9 +16,6 @@
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title">
<string>PasteBin</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>CodePaster::SettingsPage</class> <class>CodePaster::SettingsPage</class>
<widget class="QWidget" name="CodePaster::SettingsPage"> <widget class="QWidget" name="CodePaster::SettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>320</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
@@ -19,9 +11,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title">
<string>General</string>
</property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="protocolLabel"> <widget class="QLabel" name="protocolLabel">
@@ -59,14 +48,14 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="userEdit"/> <widget class="QLineEdit" name="userEdit"/>
</item> </item>
<item row="2" column="1"> <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="clipboardBox"> <widget class="QCheckBox" name="clipboardBox">
<property name="text"> <property name="text">
<string>Copy Paste URL to clipboard</string> <string>Copy Paste URL to clipboard</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="displayBox"> <widget class="QCheckBox" name="displayBox">
<property name="text"> <property name="text">
<string>Display Output Pane after sending a post</string> <string>Display Output Pane after sending a post</string>

View File

@@ -13,9 +13,6 @@
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Code Completion</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="caseSensitive"> <widget class="QCheckBox" name="caseSensitive">

View File

@@ -243,7 +243,8 @@ QString CppFileSettingsWidget::searchKeywords() const
QString rc; QString rc;
QTextStream(&rc) << m_ui->headerSuffixLabel->text() QTextStream(&rc) << m_ui->headerSuffixLabel->text()
<< ' ' << m_ui->sourceSuffixLabel->text() << ' ' << m_ui->sourceSuffixLabel->text()
<< ' ' << m_ui->lowerCaseFileNamesCheckBox->text(); << ' ' << m_ui->lowerCaseFileNamesCheckBox->text()
<< ' ' << m_ui->licenseTemplateLabel->text();
rc.remove(QLatin1Char('&')); rc.remove(QLatin1Char('&'));
return rc; return rc;
} }

View File

@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>424</width> <width>441</width>
<height>503</height> <height>503</height>
</rect> </rect>
</property> </property>
@@ -19,9 +19,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title">
<string>File Naming Conventions</string>
</property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::ExpandingFieldsGrow</enum>
@@ -61,7 +58,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="Utils::PathChooser" name="licenseTemplatePathChooser" native="true"/> <widget class="Utils::PathChooser" name="licenseTemplatePathChooser"/>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@@ -37,6 +37,7 @@
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QTextStream>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
using namespace CVS::Internal; using namespace CVS::Internal;
@@ -70,6 +71,17 @@ void SettingsPageWidget::setSettings(const CVSSettings &s)
m_ui.describeByCommitIdCheckBox->setChecked(s.describeByCommitId); m_ui.describeByCommitIdCheckBox->setChecked(s.describeByCommitId);
} }
QString SettingsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << m_ui.promptToSubmitCheckBox->text()
<< ' ' << m_ui.describeByCommitIdCheckBox->text()
<< ' ' << m_ui.commandLabel->text()
<< ' ' << m_ui.rootLabel->text() << ' ' << m_ui.diffOptionsLabel->text();
rc.remove(QLatin1Char('&'));
return rc;
}
SettingsPage::SettingsPage() SettingsPage::SettingsPage()
{ {
} }
@@ -98,6 +110,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
{ {
m_widget = new SettingsPageWidget(parent); m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(CVSPlugin::cvsPluginInstance()->settings()); m_widget->setSettings(CVSPlugin::cvsPluginInstance()->settings());
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -105,3 +119,8 @@ void SettingsPage::apply()
{ {
CVSPlugin::cvsPluginInstance()->setSettings(m_widget->settings()); CVSPlugin::cvsPluginInstance()->setSettings(m_widget->settings());
} }
bool SettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -55,6 +55,8 @@ public:
CVSSettings settings() const; CVSSettings settings() const;
void setSettings(const CVSSettings &); void setSettings(const CVSSettings &);
QString searchKeywords() const;
private: private:
Ui::SettingsPage m_ui; Ui::SettingsPage m_ui;
}; };
@@ -75,8 +77,10 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &) const;
private: private:
QString m_searchKeywords;
SettingsPageWidget* m_widget; SettingsPageWidget* m_widget;
}; };

View File

@@ -2,59 +2,13 @@
<ui version="4.0"> <ui version="4.0">
<class>CVS::Internal::SettingsPage</class> <class>CVS::Internal::SettingsPage</class>
<widget class="QWidget" name="CVS::Internal::SettingsPage"> <widget class="QWidget" name="CVS::Internal::SettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>575</width>
<height>437</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout_3"> <widget class="QGroupBox" name="miscGroupBox">
<item row="0" column="0" colspan="2"> <property name="title">
<widget class="QCheckBox" name="promptToSubmitCheckBox"> <string>Configuration</string>
<property name="text">
<string>Prompt to submit</string>
</property> </property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="describeByCommitIdCheckBox">
<property name="toolTip">
<string>When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.</string>
</property>
<property name="text">
<string>Describe all files matching commit id:</string>
</property>
</widget>
</item>
<item>
<spacer name="topverticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="commandLabel"> <widget class="QLabel" name="commandLabel">
<property name="text"> <property name="text">
@@ -75,17 +29,44 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="rootLineEdit"/> <widget class="QLineEdit" name="rootLineEdit"/>
</item> </item>
<item row="2" column="0"> </layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="miscGroupBox_2">
<property name="title">
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="diffOptionsLabel"> <widget class="QLabel" name="diffOptionsLabel">
<property name="text"> <property name="text">
<string>Diff Options:</string> <string>Diff Options:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="diffOptionsLineEdit"/> <widget class="QLineEdit" name="diffOptionsLineEdit"/>
</item> </item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="describeByCommitIdCheckBox">
<property name="toolTip">
<string>When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed.</string>
</property>
<property name="text">
<string>Describe all files matching commit id</string>
</property>
</widget>
</item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
@@ -101,21 +82,6 @@
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>105</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@@ -35,6 +35,7 @@
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtCore/QTextStream>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
@@ -127,6 +128,16 @@ void CdbOptionsPageWidget::downLoadLinkActivated(const QString &link)
QDesktopServices::openUrl(QUrl(link)); QDesktopServices::openUrl(QUrl(link));
} }
QString CdbOptionsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << m_ui.pathLabel->text() << ' ' << m_ui.symbolPathLabel->text()
<< ' ' << m_ui.sourcePathLabel->text()
<< ' ' << m_ui.verboseSymbolLoadingCheckBox->text();
rc.remove(QLatin1Char('&'));
return rc;
}
// ---------- CdbOptionsPage // ---------- CdbOptionsPage
CdbOptionsPage::CdbOptionsPage(const QSharedPointer<CdbOptions> &options) : CdbOptionsPage::CdbOptionsPage(const QSharedPointer<CdbOptions> &options) :
m_options(options) m_options(options)
@@ -162,6 +173,8 @@ QWidget *CdbOptionsPage::createPage(QWidget *parent)
m_widget = new CdbOptionsPageWidget(parent); m_widget = new CdbOptionsPageWidget(parent);
m_widget->setOptions(*m_options); m_widget->setOptions(*m_options);
m_widget->setFailureMessage(m_failureMessage); m_widget->setFailureMessage(m_failureMessage);
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -188,5 +201,10 @@ void CdbOptionsPage::finish()
{ {
} }
bool CdbOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger

View File

@@ -53,6 +53,8 @@ public:
void setFailureMessage(const QString &); void setFailureMessage(const QString &);
QString searchKeywords() const;
private slots: private slots:
void autoDetect(); void autoDetect();
void downLoadLinkActivated(const QString &); void downLoadLinkActivated(const QString &);
@@ -78,6 +80,7 @@ public:
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();
virtual void finish(); virtual void finish();
virtual bool matches(const QString &) const;
static QString settingsId(); static QString settingsId();
@@ -92,6 +95,7 @@ private:
const QSharedPointer<CdbOptions> m_options; const QSharedPointer<CdbOptions> m_options;
QPointer<CdbOptionsPageWidget> m_widget; QPointer<CdbOptionsPageWidget> m_widget;
QString m_failureMessage; QString m_failureMessage;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -2,22 +2,14 @@
<ui version="4.0"> <ui version="4.0">
<class>CommonOptionsPage</class> <class>CommonOptionsPage</class>
<widget class="QWidget" name="CommonOptionsPage"> <widget class="QWidget" name="CommonOptionsPage">
<property name="geometry"> <layout class="QVBoxLayout" name="verticalLayout">
<rect>
<x>0</x>
<y>0</y>
<width>379</width>
<height>243</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>User interface</string> <string>User interface</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QFormLayout" name="formLayout">
<item> <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxListSourceFiles"> <widget class="QCheckBox" name="checkBoxListSourceFiles">
<property name="toolTip"> <property name="toolTip">
<string>Checking this will populate the source file view automatically but might slow down debugger startup considerably.</string> <string>Checking this will populate the source file view automatically but might slow down debugger startup considerably.</string>
@@ -27,28 +19,28 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals"> <widget class="QCheckBox" name="checkBoxUseMessageBoxForSignals">
<property name="text"> <property name="text">
<string>Show a message box when receiving a signal</string> <string>Show a message box when receiving a signal</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseAlternatingRowColors"> <widget class="QCheckBox" name="checkBoxUseAlternatingRowColors">
<property name="text"> <property name="text">
<string>Use alternating row colors in debug views</string> <string>Use alternating row colors in debug views</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseToolTipsInMainEditor"> <widget class="QCheckBox" name="checkBoxUseToolTipsInMainEditor">
<property name="text"> <property name="text">
<string>Use tooltips in main editor while debugging</string> <string>Use tooltips in main editor while debugging</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSkipKnownFrames"> <widget class="QCheckBox" name="checkBoxSkipKnownFrames">
<property name="toolTip"> <property name="toolTip">
<string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic <string>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic
@@ -59,30 +51,25 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxEnableReverseDebugging"> <widget class="QCheckBox" name="checkBoxEnableReverseDebugging">
<property name="text"> <property name="text">
<string>Enable reverse debugging</string> <string>Enable reverse debugging</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelMaximalStackDepth"> <widget class="QLabel" name="labelMaximalStackDepth">
<property name="text"> <property name="text">
<string>Maximal stack depth:</string> <string>Maximal stack depth:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="6" column="1">
<widget class="QSpinBox" name="spinBoxMaximalStackDepth"> <widget class="QSpinBox" name="spinBoxMaximalStackDepth">
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="specialValueText"> <property name="specialValueText">
<string>&lt;unlimited&gt;</string> <string>&lt;unlimited&gt;</string>
</property> </property>
@@ -97,21 +84,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<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>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@@ -62,6 +62,7 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <coreplugin/manhattanstyle.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
@@ -328,10 +329,12 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply() { m_group.apply(settings()); } void apply() { m_group.apply(settings()); }
void finish() { m_group.finish(); } void finish() { m_group.finish(); }
virtual bool matches(const QString &s) const;
private: private:
Ui::CommonOptionsPage m_ui; Ui::CommonOptionsPage m_ui;
Utils::SavedActionSet m_group; Utils::SavedActionSet m_group;
QString m_searchKeywords;
}; };
QWidget *CommonOptionsPage::createPage(QWidget *parent) QWidget *CommonOptionsPage::createPage(QWidget *parent)
@@ -364,9 +367,25 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_ui.checkBoxEnableReverseDebugging->hide(); m_ui.checkBoxEnableReverseDebugging->hide();
#endif #endif
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords) << ' ' << m_ui.checkBoxListSourceFiles->text()
<< ' ' << m_ui.checkBoxUseMessageBoxForSignals->text()
<< ' ' << m_ui.checkBoxUseAlternatingRowColors->text()
<< ' ' << m_ui.checkBoxUseToolTipsInMainEditor->text()
<< ' ' << m_ui.checkBoxSkipKnownFrames->text()
<< ' ' << m_ui.checkBoxEnableReverseDebugging->text()
<< ' ' << m_ui.labelMaximalStackDepth->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
bool CommonOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger
@@ -377,6 +396,13 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
static inline bool oxygenStyle()
{
if (const ManhattanStyle *ms = qobject_cast<const ManhattanStyle *>(qApp->style()))
return !qstrcmp("OxygenStyle", ms->systemStyle()->metaObject()->className());
return false;
}
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -396,14 +422,12 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply() { m_group.apply(settings()); } void apply() { m_group.apply(settings()); }
void finish() { m_group.finish(); } void finish() { m_group.finish(); }
virtual bool matches(const QString &s) const;
private: private:
Q_SLOT void updateState();
friend class DebuggerPlugin;
Ui::DebuggingHelperOptionPage m_ui; Ui::DebuggingHelperOptionPage m_ui;
Utils::SavedActionSet m_group; Utils::SavedActionSet m_group;
QString m_searchKeywords;
}; };
QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent) QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
@@ -416,16 +440,15 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
m_ui.dumperLocationChooser->setInitialBrowsePathBackup( m_ui.dumperLocationChooser->setInitialBrowsePathBackup(
Core::ICore::instance()->resourcePath() + "../../lib"); Core::ICore::instance()->resourcePath() + "../../lib");
connect(m_ui.checkBoxUseDebuggingHelpers, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
connect(m_ui.checkBoxUseCustomDebuggingHelperLocation, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
m_group.clear(); m_group.clear();
m_group.insert(theDebuggerAction(UseDebuggingHelpers), m_group.insert(theDebuggerAction(UseDebuggingHelpers),
m_ui.checkBoxUseDebuggingHelpers); m_ui.debuggingHelperGroupBox);
m_group.insert(theDebuggerAction(UseCustomDebuggingHelperLocation), m_group.insert(theDebuggerAction(UseCustomDebuggingHelperLocation),
m_ui.checkBoxUseCustomDebuggingHelperLocation); m_ui.customLocationGroupBox);
// Suppress Oxygen style's giving flat group boxes bold titles
if (oxygenStyle())
m_ui.customLocationGroupBox->setStyleSheet(QLatin1String("QGroupBox::title { font: ; }"));
m_group.insert(theDebuggerAction(CustomDebuggingHelperLocation), m_group.insert(theDebuggerAction(CustomDebuggingHelperLocation),
m_ui.dumperLocationChooser); m_ui.dumperLocationChooser);
@@ -439,9 +462,6 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
m_ui.checkBoxDebugDebuggingHelpers->hide(); m_ui.checkBoxDebugDebuggingHelpers->hide();
#endif #endif
m_ui.dumperLocationChooser->
setEnabled(theDebuggerAction(UseCustomDebuggingHelperLocation)->value().toBool());
#ifndef QT_DEBUG #ifndef QT_DEBUG
#if 0 #if 0
cmd = am->registerAction(m_manager->m_dumpLogAction, cmd = am->registerAction(m_manager->m_dumpLogAction,
@@ -451,19 +471,22 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
mdebug->addAction(cmd); mdebug->addAction(cmd);
#endif #endif
#endif #endif
updateState();
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords)
<< ' ' << m_ui.debuggingHelperGroupBox->title()
<< ' ' << m_ui.customLocationGroupBox->title()
<< ' ' << m_ui.dumperLocationLabel->text()
<< ' ' << m_ui.checkBoxUseCodeModel->text()
<< ' ' << m_ui.checkBoxDebugDebuggingHelpers->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
void DebuggingHelperOptionPage::updateState() bool DebuggingHelperOptionPage::matches(const QString &s) const
{ {
m_ui.checkBoxUseCustomDebuggingHelperLocation->setEnabled( return m_searchKeywords.contains(s, Qt::CaseInsensitive);
m_ui.checkBoxUseDebuggingHelpers->isChecked());
bool locationEnabled = m_ui.checkBoxUseDebuggingHelpers->isChecked()
&& m_ui.checkBoxUseCustomDebuggingHelperLocation->isChecked();
m_ui.dumperLocationChooser->setEnabled(locationEnabled);
m_ui.dumperLocationLabel->setEnabled(locationEnabled);
} }
} // namespace Internal } // namespace Internal

View File

@@ -6,86 +6,44 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>432</width> <width>417</width>
<height>434</height> <height>203</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="debuggingHelperGroupBox">
<property name="title"> <property name="title">
<string>Debugging helper</string> <string>Use Debugging helper</string>
</property>
<property name="checkable">
<bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QCheckBox" name="checkBoxUseDebuggingHelpers"> <widget class="QGroupBox" name="customLocationGroupBox">
<property name="toolTip"> <property name="title">
<string>This will enable nice display of Qt and Standard Library objects in the Locals&amp;Watchers view</string>
</property>
<property name="text">
<string>Use debugging helper</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCustomDebuggingHelperLocation">
<property name="toolTip">
<string>This will load a dumper library</string>
</property>
<property name="text">
<string>Use debugging helper from custom location</string> <string>Use debugging helper from custom location</string>
</property> </property>
</widget> <property name="flat">
</item> <bool>true</bool>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="checkable">
<enum>QSizePolicy::Fixed</enum> <bool>true</bool>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QFormLayout" name="formLayout">
<size> <item row="0" column="0">
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="dumperLocationLabel"> <widget class="QLabel" name="dumperLocationLabel">
<property name="text"> <property name="text">
<string>Location: </string> <string>Location: </string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="Utils::PathChooser" name="dumperLocationChooser"/> <widget class="Utils::PathChooser" name="dumperLocationChooser"/>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBoxUseCodeModel"> <widget class="QCheckBox" name="checkBoxUseCodeModel">

View File

@@ -4,6 +4,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QTextStream>
const char * const GDB_SETTINGS_ID = QT_TRANSLATE_NOOP("Debugger::Internal::GdbOptionsPage", "Gdb"); const char * const GDB_SETTINGS_ID = QT_TRANSLATE_NOOP("Debugger::Internal::GdbOptionsPage", "Gdb");
@@ -73,6 +74,13 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
m_ui.environmentEdit->hide(); m_ui.environmentEdit->hide();
m_ui.labelEnvironment->hide(); m_ui.labelEnvironment->hide();
if (m_searchKeywords.isEmpty()) {
// TODO: Add breakpoints, environment?
QTextStream(&m_searchKeywords) << ' ' << m_ui.labelGdbLocation->text()
<< ' ' << m_ui.labelEnvironment->text()
<< ' ' << m_ui.labelGdbStartupScript->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
void GdbOptionsPage::apply() void GdbOptionsPage::apply()
@@ -85,5 +93,10 @@ void GdbOptionsPage::finish()
m_group.finish(); m_group.finish();
} }
bool GdbOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger

View File

@@ -23,12 +23,14 @@ public:
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();
virtual void finish(); virtual void finish();
virtual bool matches(const QString &) const;
static QString settingsId(); static QString settingsId();
private: private:
Ui::GdbOptionsPage m_ui; Ui::GdbOptionsPage m_ui;
Utils::SavedActionSet m_group; Utils::SavedActionSet m_group;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -2,30 +2,22 @@
<ui version="4.0"> <ui version="4.0">
<class>GdbOptionsPage</class> <class>GdbOptionsPage</class>
<widget class="QWidget" name="GdbOptionsPage"> <widget class="QWidget" name="GdbOptionsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>429</width>
<height>452</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBoxLocations"> <widget class="QGroupBox" name="groupBoxLocations">
<property name="title"> <property name="title">
<string>Gdb interaction</string> <string>Gdb interaction</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QFormLayout" name="formLayout">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<property name="margin"> <property name="margin">
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelGdbLocation"> <widget class="QLabel" name="labelGdbLocation">
<property name="toolTip"> <property name="toolTip">
@@ -36,6 +28,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="gdbLocationChooser"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelEnvironment"> <widget class="QLabel" name="labelEnvironment">
<property name="text"> <property name="text">
@@ -46,6 +41,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelGdbStartupScript"> <widget class="QLabel" name="labelGdbStartupScript">
<property name="toolTip"> <property name="toolTip">
@@ -57,10 +55,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="Utils::PathChooser" name="scriptFileChooser" native="true"/> <widget class="Utils::PathChooser" name="scriptFileChooser"/>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="gdbLocationChooser" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -133,6 +128,9 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>10</width> <width>10</width>

View File

@@ -76,6 +76,8 @@ QWidget *TrkOptionsPage::createPage(QWidget *parent)
if (!m_widget) if (!m_widget)
m_widget = new TrkOptionsWidget(parent); m_widget = new TrkOptionsWidget(parent);
m_widget->setTrkOptions(*m_options); m_widget->setTrkOptions(*m_options);
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -94,5 +96,10 @@ void TrkOptionsPage::finish()
{ {
} }
bool TrkOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace Designer } // namespace Designer

View File

@@ -60,11 +60,13 @@ public:
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();
virtual void finish(); virtual void finish();
virtual bool matches(const QString &) const;
static QString settingsId(); static QString settingsId();
private: private:
const TrkOptionsPtr m_options; const TrkOptionsPtr m_options;
QPointer<TrkOptionsWidget> m_widget; QPointer<TrkOptionsWidget> m_widget;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -32,6 +32,8 @@
#include "debuggerconstants.h" #include "debuggerconstants.h"
#include "ui_trkoptionswidget.h" #include "ui_trkoptionswidget.h"
#include <QtCore/QTextStream>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -88,5 +90,14 @@ TrkOptions TrkOptionsWidget::trkOptions() const
return rc; return rc;
} }
QString TrkOptionsWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << ui->gdbLabel->text() << ' ' << ui->serialLabel->text()
<< ' ' << ui->blueToothLabel->text();
rc.remove(QLatin1Char('&'));
return rc;
}
} // namespace Internal } // namespace Internal
} // namespace Designer } // namespace Designer

View File

@@ -50,6 +50,8 @@ public:
void setTrkOptions(const TrkOptions &); void setTrkOptions(const TrkOptions &);
TrkOptions trkOptions() const; TrkOptions trkOptions() const;
QString searchKeywords() const;
protected: protected:
void changeEvent(QEvent *e); void changeEvent(QEvent *e);

View File

@@ -31,6 +31,7 @@
#include "designerconstants.h" #include "designerconstants.h"
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QTextStream>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
namespace Designer { namespace Designer {
@@ -84,6 +85,18 @@ void CppSettingsPageWidget::setUiEmbedding(int v)
} }
} }
QString CppSettingsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << m_ui.ptrAggregationRadioButton->text()
<< ' ' << m_ui.aggregationButton->text()
<< ' ' << m_ui.multipleInheritanceButton->text()
<< ' ' << m_ui.retranslateCheckBox->text()
<< ' ' << m_ui.includeQtModuleCheckBox->text();
rc.remove(QLatin1Char('&'));
return rc;
}
// ---------- CppSettingsPage // ---------- CppSettingsPage
CppSettingsPage::CppSettingsPage(QObject *parent) : Core::IOptionsPage(parent) CppSettingsPage::CppSettingsPage(QObject *parent) : Core::IOptionsPage(parent)
{ {
@@ -114,6 +127,8 @@ QWidget *CppSettingsPage::createPage(QWidget *parent)
{ {
m_widget = new CppSettingsPageWidget(parent); m_widget = new CppSettingsPageWidget(parent);
m_widget->setParameters(m_parameters); m_widget->setParameters(m_parameters);
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -132,5 +147,10 @@ void CppSettingsPage::finish()
{ {
} }
bool CppSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace Designer } // namespace Designer

View File

@@ -49,6 +49,8 @@ public:
FormClassWizardGenerationParameters parameters() const; FormClassWizardGenerationParameters parameters() const;
void setParameters(const FormClassWizardGenerationParameters &p); void setParameters(const FormClassWizardGenerationParameters &p);
QString searchKeywords() const;
private: private:
int uiEmbedding() const; int uiEmbedding() const;
void setUiEmbedding(int); void setUiEmbedding(int);
@@ -69,10 +71,12 @@ public:
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();
virtual void finish(); virtual void finish();
virtual bool matches(const QString &s) const;
private: private:
QPointer<CppSettingsPageWidget> m_widget; QPointer<CppSettingsPageWidget> m_widget;
FormClassWizardGenerationParameters m_parameters; FormClassWizardGenerationParameters m_parameters;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -2,19 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>Designer::Internal::CppSettingsPageWidget</class> <class>Designer::Internal::CppSettingsPageWidget</class>
<widget class="QWidget" name="Designer::Internal::CppSettingsPageWidget"> <widget class="QWidget" name="Designer::Internal::CppSettingsPageWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>526</width>
<height>369</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QGroupBox" name="uiclassGroupBox"> <widget class="QGroupBox" name="uiclassGroupBox">
@@ -80,25 +70,13 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeType">
<size> <enum>QSizePolicy::MinimumExpanding</enum>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>169</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>

View File

@@ -6,123 +6,22 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>394</width> <width>519</width>
<height>322</height> <height>392</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBoxUseFakeVim">
<property name="text">
<string>Use FakeVim</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Vim style settings</string> <string>Vim style settings</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <property name="checkable">
<item row="2" column="0"> <bool>true</bool>
<widget class="QLabel" name="labelExpandTab">
<property name="toolTip">
<string>vim's &quot;expandtab&quot; option</string>
</property> </property>
<property name="text"> <layout class="QVBoxLayout" name="verticalLayout">
<string>Expand tabulators:</string> <item>
</property> <layout class="QFormLayout" name="formLayout">
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelHlSearch">
<property name="text">
<string>Highlight search results:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEditShiftWidth"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelSmartTab">
<property name="text">
<string>Smart tabulators:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="labelStartOfLine">
<property name="text">
<string>Start of line:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
<string>vim's &quot;tabstop&quot; option</string>
</property>
<property name="text">
<string>Tabulator size:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEditTabStop"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="lineEditBackspace"/>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBoxAutoIndent">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelAutoIndent"> <widget class="QLabel" name="labelAutoIndent">
<property name="toolTip"> <property name="toolTip">
@@ -133,23 +32,137 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="0" column="1">
<widget class="QCheckBox" name="checkBoxAutoIndent">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelExpandTab">
<property name="toolTip">
<string>vim's &quot;expandtab&quot; option</string>
</property>
<property name="text">
<string>Expand tabulators:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkBoxExpandTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelHlSearch">
<property name="text">
<string>Highlight search results:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxHlSearch">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelIncSearch"> <widget class="QLabel" name="labelIncSearch">
<property name="text"> <property name="text">
<string>Incremental search:</string> <string>Incremental search:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="3" column="1">
<widget class="QCheckBox" name="checkBoxIncSearch"> <widget class="QCheckBox" name="checkBoxIncSearch">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="4" column="0">
<widget class="QLabel" name="labelShiftWidth">
<property name="text">
<string>Shift width:</string>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEditShiftWidth"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelSmartTab">
<property name="text">
<string>Smart tabulators:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="checkBoxSmartTab">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelStartOfLine">
<property name="text">
<string>Start of line:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBoxStartOfLine">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="tabulatorLabel">
<property name="toolTip">
<string>vim's &quot;tabstop&quot; option</string>
</property>
<property name="text">
<string>Tabulator size:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="lineEditTabStop"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="labelBackspace">
<property name="text">
<string>Backspace:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEditBackspace"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>17</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
@@ -188,15 +201,18 @@
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>1</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>

View File

@@ -68,6 +68,7 @@
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QPoint> #include <QtCore/QPoint>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QTextStream>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QPlainTextEdit> #include <QtGui/QPlainTextEdit>
@@ -118,6 +119,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply() { m_group.apply(ICore::instance()->settings()); } void apply() { m_group.apply(ICore::instance()->settings()); }
void finish() { m_group.finish(); } void finish() { m_group.finish(); }
virtual bool matches(const QString &) const;
private slots: private slots:
void copyTextEditorSettings(); void copyTextEditorSettings();
@@ -127,7 +129,7 @@ private slots:
private: private:
friend class DebuggerPlugin; friend class DebuggerPlugin;
Ui::FakeVimOptionPage m_ui; Ui::FakeVimOptionPage m_ui;
QString m_searchKeywords;
Utils::SavedActionSet m_group; Utils::SavedActionSet m_group;
}; };
@@ -138,7 +140,7 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
m_group.clear(); m_group.clear();
m_group.insert(theFakeVimSetting(ConfigUseFakeVim), m_group.insert(theFakeVimSetting(ConfigUseFakeVim),
m_ui.checkBoxUseFakeVim); m_ui.groupBox);
m_group.insert(theFakeVimSetting(ConfigExpandTab), m_group.insert(theFakeVimSetting(ConfigExpandTab),
m_ui.checkBoxExpandTab); m_ui.checkBoxExpandTab);
@@ -167,7 +169,15 @@ QWidget *FakeVimOptionPage::createPage(QWidget *parent)
this, SLOT(setQtStyle())); this, SLOT(setQtStyle()));
connect(m_ui.pushButtonSetPlainStyle, SIGNAL(clicked()), connect(m_ui.pushButtonSetPlainStyle, SIGNAL(clicked()),
this, SLOT(setPlainStyle())); this, SLOT(setPlainStyle()));
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords)
<< ' ' << m_ui.labelAutoIndent->text() << ' ' << m_ui.labelExpandTab->text()
<< ' ' << m_ui.labelHlSearch->text() << ' ' << m_ui.labelIncSearch->text()
<< ' ' << m_ui.labelShiftWidth->text() << ' ' << m_ui.labelSmartTab->text()
<< ' ' << m_ui.labelStartOfLine->text() << ' ' << m_ui.tabulatorLabel->text()
<< ' ' << m_ui.labelBackspace->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
@@ -188,25 +198,32 @@ void FakeVimOptionPage::copyTextEditorSettings()
void FakeVimOptionPage::setQtStyle() void FakeVimOptionPage::setQtStyle()
{ {
m_ui.checkBoxExpandTab->setChecked(true); m_ui.checkBoxExpandTab->setChecked(true);
m_ui.lineEditTabStop->setText("4"); const QString four = QString(QLatin1Char('4'));
m_ui.lineEditShiftWidth->setText("4"); m_ui.lineEditTabStop->setText(four);
m_ui.lineEditShiftWidth->setText(four);
m_ui.checkBoxSmartTab->setChecked(true); m_ui.checkBoxSmartTab->setChecked(true);
m_ui.checkBoxAutoIndent->setChecked(true); m_ui.checkBoxAutoIndent->setChecked(true);
m_ui.checkBoxIncSearch->setChecked(true); m_ui.checkBoxIncSearch->setChecked(true);
m_ui.lineEditBackspace->setText("indent,eol,start"); m_ui.lineEditBackspace->setText(QLatin1String("indent,eol,start"));
} }
void FakeVimOptionPage::setPlainStyle() void FakeVimOptionPage::setPlainStyle()
{ {
m_ui.checkBoxExpandTab->setChecked(false); m_ui.checkBoxExpandTab->setChecked(false);
m_ui.lineEditTabStop->setText("8"); const QString eight = QString(QLatin1Char('4'));
m_ui.lineEditShiftWidth->setText("8"); m_ui.lineEditTabStop->setText(eight);
m_ui.lineEditShiftWidth->setText(eight);
m_ui.checkBoxSmartTab->setChecked(false); m_ui.checkBoxSmartTab->setChecked(false);
m_ui.checkBoxAutoIndent->setChecked(false); m_ui.checkBoxAutoIndent->setChecked(false);
m_ui.checkBoxIncSearch->setChecked(false); m_ui.checkBoxIncSearch->setChecked(false);
m_ui.lineEditBackspace->setText(QString()); m_ui.lineEditBackspace->setText(QString());
} }
bool FakeVimOptionPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal } // namespace Internal
} // namespace FakeVim } // namespace FakeVim

View File

@@ -36,6 +36,7 @@
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QTextStream>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
namespace Git { namespace Git {
@@ -75,8 +76,21 @@ void SettingsPageWidget::setSystemPath()
m_ui.pathLineEdit->setText(QLatin1String(qgetenv("PATH"))); 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::SettingsPage() :
m_widget(0)
{ {
} }
@@ -104,6 +118,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
{ {
m_widget = new SettingsPageWidget(parent); m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(GitPlugin::instance()->settings()); m_widget->setSettings(GitPlugin::instance()->settings());
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -121,5 +137,11 @@ void SettingsPage::apply()
GitPlugin::instance()->setSettings(newSettings); GitPlugin::instance()->setSettings(newSettings);
} }
bool SettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} }
} }

View File

@@ -54,6 +54,8 @@ public:
GitSettings settings() const; GitSettings settings() const;
void setSettings(const GitSettings &); void setSettings(const GitSettings &);
QString searchKeywords() const;
private slots: private slots:
void setSystemPath(); void setSystemPath();
@@ -76,8 +78,10 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &) const;
private: private:
QString m_searchKeywords;
SettingsPageWidget* m_widget; SettingsPageWidget* m_widget;
}; };

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>409</width> <width>409</width>
<height>251</height> <height>279</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@@ -66,6 +66,10 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="logCountLabel"> <widget class="QLabel" name="logCountLabel">
@@ -107,7 +111,7 @@
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox"> <widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text"> <property name="text">
<string>Prompt to submit</string> <string>Prompt on submit</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -119,6 +123,7 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">

View File

@@ -75,7 +75,8 @@ QWidget *DocSettingsPage::createPage(QWidget *parent)
m_ui.docsListWidget->addItems(m_helpEngine->registeredDocumentations()); m_ui.docsListWidget->addItems(m_helpEngine->registeredDocumentations());
m_registeredDocs = false; m_registeredDocs = false;
m_removeDocs.clear(); m_removeDocs.clear();
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_ui.groupBox->title();
return w; return w;
} }
@@ -126,6 +127,11 @@ void DocSettingsPage::apply()
emit dialogAccepted(); emit dialogAccepted();
} }
bool DocSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
bool DocSettingsPage::applyChanges() bool DocSettingsPage::applyChanges()
{ {
QStringList::const_iterator it = m_removeDocs.constBegin(); QStringList::const_iterator it = m_removeDocs.constBegin();

View File

@@ -56,6 +56,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &s) const;
bool applyChanges(); bool applyChanges();
@@ -72,6 +73,7 @@ private:
bool m_registeredDocs; bool m_registeredDocs;
QStringList m_removeDocs; QStringList m_removeDocs;
Ui::DocSettingsPage m_ui; Ui::DocSettingsPage m_ui;
QString m_searchKeywords;
}; };
} // namespace Help } // namespace Help

View File

@@ -78,6 +78,9 @@ QWidget *FilterSettingsPage::createPage(QWidget *parent)
SLOT(removeFilter())); SLOT(removeFilter()));
updateFilterPage(); updateFilterPage();
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_ui.filterGroupBox->title() + QLatin1Char(' ') + m_ui.attributesGroupBox->title();
return m_currentPage; return m_currentPage;
} }
@@ -220,3 +223,10 @@ bool FilterSettingsPage::applyChanges()
} }
return false; return false;
} }
bool FilterSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -55,6 +55,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &s) const;
bool applyChanges(); bool applyChanges();
@@ -72,6 +73,7 @@ private:
QMap<QString, QStringList> m_filterMap; QMap<QString, QStringList> m_filterMap;
QStringList m_removedFilters; QStringList m_removedFilters;
QWidget *m_currentPage; QWidget *m_currentPage;
QString m_searchKeywords;
}; };
} // namespace Help } // namespace Help

View File

@@ -12,9 +12,9 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="mainHorizontalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="filterGroupBox">
<property name="title"> <property name="title">
<string>Filters</string> <string>Filters</string>
</property> </property>
@@ -26,7 +26,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="attributesGroupBox">
<property name="title"> <property name="title">
<string>Attributes</string> <string>Attributes</string>
</property> </property>
@@ -55,7 +55,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="buttonHorizontalLayout">
<item> <item>
<widget class="QPushButton" name="filterAddButton"> <widget class="QPushButton" name="filterAddButton">
<property name="text"> <property name="text">
@@ -71,7 +71,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="buttonHorizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>

View File

@@ -127,6 +127,12 @@ QWidget *GeneralSettingsPage::createPage(QWidget *parent)
connect(m_ui.importButton, SIGNAL(clicked()), this, SLOT(importBookmarks())); connect(m_ui.importButton, SIGNAL(clicked()), this, SLOT(importBookmarks()));
connect(m_ui.exportButton, SIGNAL(clicked()), this, SLOT(exportBookmarks())); connect(m_ui.exportButton, SIGNAL(clicked()), this, SLOT(exportBookmarks()));
if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords) << ' ' << m_ui.contextHelpLabel->text()
<< ' ' << m_ui.startPageLabel->text() << ' ' << m_ui.homePageLabel->text()
<< ' ' << m_ui.bookmarkGroupBox->title();
m_searchKeywords.remove(QLatin1Char('&'));
}
return m_currentPage; return m_currentPage;
} }
@@ -324,3 +330,8 @@ int GeneralSettingsPage::closestPointSizeIndex(int desiredPointSize) const
} }
return closestIndex; return closestIndex;
} }
bool GeneralSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -63,6 +63,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish(); void finish();
virtual bool matches(const QString &s) const;
signals: signals:
void fontChanged(); void fontChanged();
@@ -90,6 +91,7 @@ private:
QFontDatabase fontDatabase; QFontDatabase fontDatabase;
Ui::GeneralSettingsPage m_ui; Ui::GeneralSettingsPage m_ui;
QString m_searchKeywords;
}; };
} // Internal } // Internal

View File

@@ -2,26 +2,18 @@
<ui version="4.0"> <ui version="4.0">
<class>GeneralSettingsPage</class> <class>GeneralSettingsPage</class>
<widget class="QWidget" name="GeneralSettingsPage"> <widget class="QWidget" name="GeneralSettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>593</width>
<height>371</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="fontGroupBox">
<property name="title"> <property name="title">
<string>Font</string> <string>Font</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="familyLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -53,7 +45,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="styleLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -92,7 +84,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="sizeLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -131,7 +123,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="startupGroupBox">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -140,9 +132,9 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QFormLayout" name="startupFormLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="contextHelpLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -179,21 +171,8 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<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 row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="startPageLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -230,18 +209,14 @@
</item> </item>
</widget> </widget>
</item> </item>
</layout> <item row="2" column="0">
</item> <widget class="QLabel" name="homePageLabel">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Home Page:</string> <string>Home Page:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="1">
<widget class="QLineEdit" name="homePageLineEdit"/> <widget class="QLineEdit" name="homePageLineEdit"/>
</item> </item>
</layout> </layout>
@@ -288,13 +263,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="bookmarkGroupBox">
<property name="title"> <property name="title">
<string>Help Bookmarks</string> <string>Help Bookmarks</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="bookmarkHorizontalLayout">
<item> <item>
<spacer name="horizontalSpacer_4"> <spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
@@ -363,9 +338,6 @@
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="text">
<string/>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -376,10 +348,13 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>126</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>

View File

@@ -90,6 +90,10 @@ QWidget *SettingsPage::createPage(QWidget *parent)
m_customFilters = m_plugin->customFilters(); m_customFilters = m_plugin->customFilters();
saveFilterStates(); saveFilterStates();
updateFilterList(); updateFilterList();
if (m_searchKeywords.isEmpty()) {
m_searchKeywords = m_ui.refreshIntervalLabel->text();
m_searchKeywords.remove(QLatin1Char('&'));
}
return m_page; return m_page;
} }
@@ -220,3 +224,8 @@ void SettingsPage::removeCustomFilter()
} }
updateFilterList(); updateFilterList();
} }
bool SettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -63,6 +63,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish(); void finish();
virtual bool matches(const QString &) const;
private slots: private slots:
void updateButtonStates(); void updateButtonStates();
@@ -85,6 +86,7 @@ private:
QList<ILocatorFilter *> m_customFilters; QList<ILocatorFilter *> m_customFilters;
QList<ILocatorFilter *> m_refreshFilters; QList<ILocatorFilter *> m_refreshFilters;
QHash<ILocatorFilter *, QByteArray> m_filterStates; QHash<ILocatorFilter *, QByteArray> m_filterStates;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -15,10 +15,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="configurationGroupBox">
<property name="title">
<string>Configure Filters</string>
</property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QListWidget" name="filterList"> <widget class="QListWidget" name="filterList">
@@ -77,7 +74,7 @@
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="refreshIntervalLabel">
<property name="text"> <property name="text">
<string>Refresh Interval:</string> <string>Refresh Interval:</string>
</property> </property>

View File

@@ -36,6 +36,7 @@
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#include <QtCore/QTextStream>
using namespace Perforce::Internal; using namespace Perforce::Internal;
using namespace Utils; using namespace Utils;
@@ -66,7 +67,7 @@ Settings SettingsPageWidget::settings() const
{ {
Settings settings; Settings settings;
settings.p4Command = m_ui.pathChooser->path(); settings.p4Command = m_ui.pathChooser->path();
settings.defaultEnv = m_ui.defaultCheckBox->isChecked(); settings.defaultEnv = !m_ui.environmentGroupBox->isChecked();
settings.p4Port = m_ui.portLineEdit->text(); settings.p4Port = m_ui.portLineEdit->text();
settings.p4User = m_ui.userLineEdit->text(); settings.p4User = m_ui.userLineEdit->text();
settings.p4Client= m_ui.clientLineEdit->text(); settings.p4Client= m_ui.clientLineEdit->text();
@@ -77,7 +78,7 @@ Settings SettingsPageWidget::settings() const
void SettingsPageWidget::setSettings(const PerforceSettings &s) void SettingsPageWidget::setSettings(const PerforceSettings &s)
{ {
m_ui.pathChooser->setPath(s.p4Command()); m_ui.pathChooser->setPath(s.p4Command());
m_ui.defaultCheckBox->setChecked(s.defaultEnv()); m_ui.environmentGroupBox->setChecked(!s.defaultEnv());
m_ui.portLineEdit->setText(s.p4Port()); m_ui.portLineEdit->setText(s.p4Port());
m_ui.clientLineEdit->setText(s.p4Client()); m_ui.clientLineEdit->setText(s.p4Client());
m_ui.userLineEdit->setText(s.p4User()); m_ui.userLineEdit->setText(s.p4User());
@@ -92,6 +93,17 @@ void SettingsPageWidget::setStatusText(bool ok, const QString &t)
m_ui.errorLabel->setText(t); m_ui.errorLabel->setText(t);
} }
QString SettingsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << m_ui.promptToSubmitCheckBox->text()
<< ' ' << m_ui.commandLabel << m_ui.environmentGroupBox->title()
<< ' ' << m_ui.clientLabel->text() << ' ' << m_ui.userLabel->text()
<< ' ' << m_ui.portLabel->text();
rc.remove(QLatin1Char('&'));
return rc;
}
SettingsPage::SettingsPage() SettingsPage::SettingsPage()
{ {
} }
@@ -120,6 +132,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
{ {
m_widget = new SettingsPageWidget(parent); m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(PerforcePlugin::perforcePluginInstance()->settings()); m_widget->setSettings(PerforcePlugin::perforcePluginInstance()->settings());
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -127,3 +141,8 @@ void SettingsPage::apply()
{ {
PerforcePlugin::perforcePluginInstance()->setSettings(m_widget->settings()); PerforcePlugin::perforcePluginInstance()->setSettings(m_widget->settings());
} }
bool SettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -51,6 +51,8 @@ public:
void setSettings(const PerforceSettings &); void setSettings(const PerforceSettings &);
Settings settings() const; Settings settings() const;
QString searchKeywords() const;
private slots: private slots:
void slotTest(); void slotTest();
@@ -75,8 +77,10 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &) const;
private: private:
QString m_searchKeywords;
SettingsPageWidget* m_widget; SettingsPageWidget* m_widget;
}; };

View File

@@ -2,47 +2,13 @@
<ui version="4.0"> <ui version="4.0">
<class>Perforce::Internal::SettingsPage</class> <class>Perforce::Internal::SettingsPage</class>
<widget class="QWidget" name="Perforce::Internal::SettingsPage"> <widget class="QWidget" name="Perforce::Internal::SettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>423</width>
<height>463</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QFormLayout" name="formLayout_2"> <widget class="QGroupBox" name="configGroupBox">
<item row="0" column="0" colspan="2"> <property name="title">
<widget class="QCheckBox" name="promptToSubmitCheckBox"> <string>Configuration</string>
<property name="text">
<string>Prompt to submit</string>
</property> </property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="commandLabel"> <widget class="QLabel" name="commandLabel">
<property name="text"> <property name="text">
@@ -53,17 +19,11 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="Utils::PathChooser" name="pathChooser"/> <widget class="Utils::PathChooser" name="pathChooser"/>
</item> </item>
<item row="1" column="0" colspan="2"> </layout>
<widget class="QCheckBox" name="defaultCheckBox">
<property name="text">
<string>Use default P4 environment variables</string>
</property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="environmentGroupBox">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -71,6 +31,9 @@
<string>Environment variables</string> <string>Environment variables</string>
</property> </property>
<property name="checkable"> <property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
@@ -113,6 +76,38 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="miscgroupBox">
<property name="title">
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
@@ -144,8 +139,8 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>141</width> <width>20</width>
<height>20</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@@ -173,22 +168,5 @@
<tabstop>userLineEdit</tabstop> <tabstop>userLineEdit</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections> <connections/>
<connection>
<sender>defaultCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>groupBox</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>134</x>
<y>51</y>
</hint>
<hint type="destinationlabel">
<x>139</x>
<y>65</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>

View File

@@ -37,18 +37,14 @@
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal; using namespace ProjectExplorer::Internal;
ProjectExplorerSettingsPage::ProjectExplorerSettingsPage() ProjectExplorerSettingsPage::ProjectExplorerSettingsPage() :
m_searchKeywords(QLatin1String("jom"))
{ {
}
ProjectExplorerSettingsPage::~ProjectExplorerSettingsPage()
{
} }
QString ProjectExplorerSettingsPage::id() const QString ProjectExplorerSettingsPage::id() const
{ {
return Constants::PROJECTEXPLORER_PAGE; return QLatin1String(Constants::PROJECTEXPLORER_PAGE);
} }
QString ProjectExplorerSettingsPage::trName() const QString ProjectExplorerSettingsPage::trName() const
@@ -58,7 +54,7 @@ QString ProjectExplorerSettingsPage::trName() const
QString ProjectExplorerSettingsPage::category() const QString ProjectExplorerSettingsPage::category() const
{ {
return Constants::PROJECTEXPLORER_PAGE; return QLatin1String(Constants::PROJECTEXPLORER_PAGE);
} }
QString ProjectExplorerSettingsPage::trCategory() const QString ProjectExplorerSettingsPage::trCategory() const
@@ -101,3 +97,8 @@ void ProjectExplorerSettingsPage::finish()
{ {
// Nothing to do // Nothing to do
} }
bool ProjectExplorerSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -41,7 +41,6 @@ class ProjectExplorerSettingsPage : public Core::IOptionsPage
Q_OBJECT Q_OBJECT
public: public:
ProjectExplorerSettingsPage(); ProjectExplorerSettingsPage();
~ProjectExplorerSettingsPage();
virtual QString id() const; virtual QString id() const;
virtual QString trName() const; virtual QString trName() const;
@@ -51,7 +50,10 @@ public:
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();
virtual void finish(); virtual void finish();
virtual bool matches(const QString &s) const;
private: private:
const QString m_searchKeywords;
Ui::ProjectExplorerSettingsPageUi m_ui; Ui::ProjectExplorerSettingsPageUi m_ui;
}; };

View File

@@ -12,10 +12,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="buildAndRunGroupBox">
<property name="title">
<string>Build and Run</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="saveAllFilesCheckBox"> <widget class="QCheckBox" name="saveAllFilesCheckBox">

View File

@@ -6,21 +6,17 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>282</width>
<height>300</height> <height>296</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="titleLabel"> <widget class="QGroupBox" name="groupBox">
<property name="text"> <layout class="QVBoxLayout" name="verticalLayout">
<string>Installed S60 SDKs:</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QTreeWidget" name="list"> <widget class="QTreeWidget" name="list">
<property name="indentation"> <property name="indentation">
@@ -92,6 +88,9 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -16,6 +16,7 @@
#include <QtCore/QtConcurrentRun> #include <QtCore/QtConcurrentRun>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QTextStream>
#include <QtCore/QDateTime> #include <QtCore/QDateTime>
#include <QtGui/QHelpEvent> #include <QtGui/QHelpEvent>
#include <QtGui/QToolTip> #include <QtGui/QToolTip>
@@ -84,6 +85,8 @@ QWidget *QtOptionsPage::createPage(QWidget *parent)
{ {
QtVersionManager *vm = QtVersionManager::instance(); QtVersionManager *vm = QtVersionManager::instance();
m_widget = new QtOptionsPageWidget(parent, vm->versions(), vm->defaultVersion()); m_widget = new QtOptionsPageWidget(parent, vm->versions(), vm->defaultVersion());
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -99,6 +102,11 @@ void QtOptionsPage::apply()
vm->setNewQtVersions(versions, m_widget->defaultVersion()); vm->setNewQtVersions(versions, m_widget->defaultVersion());
} }
bool QtOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
//----------------------------------------------------- //-----------------------------------------------------
@@ -728,3 +736,16 @@ int QtOptionsPageWidget::defaultVersion() const
{ {
return m_defaultVersion; return m_defaultVersion;
} }
QString QtOptionsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << ' ' << m_ui->mingwLabel->text()
<< ' ' << m_ui->msvcLabel->text()
<< ' ' << m_ui->gcceLabel->text()
<< ' ' << m_ui->mwcLabel->text()
<< ' ' << m_ui->debuggingHelperLabel->text()
<< ' ' << m_ui->versionListGroupBox->title();
rc.remove(QLatin1Char('&'));
return rc;
}

View File

@@ -81,6 +81,7 @@ public:
QList<QSharedPointerQtVersion> versions() const; QList<QSharedPointerQtVersion> versions() const;
int defaultVersion() const; int defaultVersion() const;
void finish(); void finish();
QString searchKeywords() const;
virtual bool eventFilter(QObject *o, QEvent *e); virtual bool eventFilter(QObject *o, QEvent *e);
@@ -142,8 +143,11 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &) const;
private: private:
QtOptionsPageWidget *m_widget; QtOptionsPageWidget *m_widget;
QString m_searchKeywords;
}; };
} //namespace Internal } //namespace Internal

View File

@@ -2,22 +2,41 @@
<ui version="4.0"> <ui version="4.0">
<class>Qt4ProjectManager::Internal::QtVersionManager</class> <class>Qt4ProjectManager::Internal::QtVersionManager</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::QtVersionManager"> <widget class="QWidget" name="Qt4ProjectManager::Internal::QtVersionManager">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>577</width>
<height>507</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="versionListGroupBox">
<property name="title"> <property name="title">
<string>Qt versions</string> <string>Qt versions</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item row="0" column="2"> <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeWidget" name="qtdirList">
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="columnCount">
<number>3</number>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>QMake Location</string>
</property>
</column>
<column>
<property name="text">
<string>Debugging Helper</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@@ -66,11 +85,49 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="1"> </layout>
<layout class="QHBoxLayout" name="horizontalLayout"> </item>
<property name="spacing"> <item>
<number>0</number> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="versionNameLabel">
<property name="text">
<string>Version Name:</string>
</property> </property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="pathLabel">
<property name="text">
<string>QMake Location:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="qmakePath"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mingwLabel">
<property name="text">
<string>MinGW Directory:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="mingwPath"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="msvcLabel">
<property name="text">
<string>MSVC Version:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="msvcHorizontalLayout">
<item> <item>
<widget class="QComboBox" name="msvcComboBox"> <widget class="QComboBox" name="msvcComboBox">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -100,8 +157,45 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="8" column="1"> <item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <widget class="QLabel" name="s60SDKLabel">
<property name="text">
<string>S60 SDK:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Utils::PathChooser" name="s60SDKPath"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="gcceLabel">
<property name="text">
<string>CSL/GCCE Directory:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Utils::PathChooser" name="gccePath"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mwcLabel">
<property name="text">
<string>Carbide Directory:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Utils::PathChooser" name="mwcPath"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="debuggingHelperLabel">
<property name="text">
<string>Debugging Helper:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="debuggingHelperHorizontalLayout">
<item> <item>
<widget class="QLabel" name="debuggingHelperStateLabel"> <widget class="QLabel" name="debuggingHelperStateLabel">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -131,106 +225,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="8" column="0" colspan="2">
<widget class="QTreeWidget" name="qtdirList">
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="columnCount">
<number>3</number>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>QMake Location</string>
</property>
</column>
<column>
<property name="text">
<string>Debugging Helper</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="versionNameLabel">
<property name="text">
<string>Version Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="nameEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="pathLabel">
<property name="text">
<string>QMake Location:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="qmakePath" native="true"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mingwLabel">
<property name="text">
<string>MinGW Directory:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="mingwPath" native="true"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="msvcLabel">
<property name="text">
<string>MSVC Version:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="s60SDKLabel">
<property name="text">
<string>S60 SDK:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Utils::PathChooser" name="s60SDKPath" native="true"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="gcceLabel">
<property name="text">
<string>CSL/GCCE Directory:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Utils::PathChooser" name="gccePath" native="true"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mwcLabel">
<property name="text">
<string>Carbide Directory:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="Utils::PathChooser" name="mwcPath" native="true"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="debuggingHelperLabel">
<property name="text">
<string>Debugging Helper:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="errorLabel"> <widget class="QLabel" name="errorLabel">
<property name="text"> <property name="text">
<string/> <string/>
@@ -238,18 +233,20 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QFormLayout" name="defaultFormLayout">
<item> <item row="0" column="0">
<widget class="QLabel" name="defaultLabel"> <widget class="QLabel" name="defaultLabel">
<property name="text"> <property name="text">
<string>Default Qt Version:</string> <string>Default Qt Version:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QComboBox" name="defaultCombo"> <widget class="QComboBox" name="defaultCombo">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">

View File

@@ -37,6 +37,7 @@
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QTextStream>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
using namespace Subversion::Internal; using namespace Subversion::Internal;
@@ -72,7 +73,19 @@ void SettingsPageWidget::setSettings(const SubversionSettings &s)
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit); m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
} }
SettingsPage::SettingsPage() QString SettingsPageWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << m_ui.commandLabel->text()
<< ' ' << m_ui.usernameLabel->text()
<< ' ' << m_ui.passwordLabel->text()
<< ' ' << m_ui.userGroupBox->title();
rc.remove(QLatin1Char('&'));
return rc;
}
SettingsPage::SettingsPage() :
m_widget(0)
{ {
} }
@@ -100,6 +113,8 @@ QWidget *SettingsPage::createPage(QWidget *parent)
{ {
m_widget = new SettingsPageWidget(parent); m_widget = new SettingsPageWidget(parent);
m_widget->setSettings(SubversionPlugin::subversionPluginInstance()->settings()); m_widget->setSettings(SubversionPlugin::subversionPluginInstance()->settings());
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget; return m_widget;
} }
@@ -107,3 +122,8 @@ void SettingsPage::apply()
{ {
SubversionPlugin::subversionPluginInstance()->setSettings(m_widget->settings()); SubversionPlugin::subversionPluginInstance()->setSettings(m_widget->settings());
} }
bool SettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -55,6 +55,8 @@ public:
SubversionSettings settings() const; SubversionSettings settings() const;
void setSettings(const SubversionSettings &); void setSettings(const SubversionSettings &);
QString searchKeywords() const;
private: private:
Ui::SettingsPage m_ui; Ui::SettingsPage m_ui;
}; };
@@ -75,8 +77,10 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &) const;
private: private:
QString m_searchKeywords;
SettingsPageWidget* m_widget; SettingsPageWidget* m_widget;
}; };

View File

@@ -6,45 +6,17 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>575</width> <width>473</width>
<height>437</height> <height>295</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="generalGroupBox">
<property name="title">
<string>Configuration</string>
</property>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt to submit</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="topverticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="commandLabel"> <widget class="QLabel" name="commandLabel">
<property name="text"> <property name="text">
@@ -56,6 +28,7 @@
<widget class="Utils::PathChooser" name="pathChooser"/> <widget class="Utils::PathChooser" name="pathChooser"/>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="userGroupBox"> <widget class="QGroupBox" name="userGroupBox">
@@ -93,6 +66,22 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="miscGroupBox">
<property name="title">
<string>Miscellaneous</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="promptToSubmitCheckBox">
<property name="text">
<string>Prompt on submit</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
@@ -107,21 +96,6 @@
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>105</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@@ -35,6 +35,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QTextStream>
using namespace TextEditor; using namespace TextEditor;
@@ -46,6 +47,7 @@ struct BehaviorSettingsPage::BehaviorSettingsPagePrivate
Ui::BehaviorSettingsPage m_page; Ui::BehaviorSettingsPage m_page;
TabSettings m_tabSettings; TabSettings m_tabSettings;
StorageSettings m_storageSettings; StorageSettings m_storageSettings;
QString m_searchKeywords;
}; };
BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate
@@ -95,6 +97,15 @@ QWidget *BehaviorSettingsPage::createPage(QWidget *parent)
QWidget *w = new QWidget(parent); QWidget *w = new QWidget(parent);
m_d->m_page.setupUi(w); m_d->m_page.setupUi(w);
settingsToUI(); settingsToUI();
if (m_d->m_searchKeywords.isEmpty()) {
QTextStream(&m_d->m_searchKeywords) << m_d->m_page.insertSpaces->text()
<< ' ' << m_d->m_page.smartBackspace->text()
<< ' ' << m_d->m_page.cleanWhitespace->text()
<< ' ' << m_d->m_page.addFinalNewLine->text()
<< ' ' << m_d->m_page.groupBoxTabAndIndentSettings->title()
<< ' ' << m_d->m_page.groupBoxStorageSettings->title();
m_d->m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
@@ -167,3 +178,8 @@ StorageSettings BehaviorSettingsPage::storageSettings() const
{ {
return m_d->m_storageSettings; return m_d->m_storageSettings;
} }
bool BehaviorSettingsPage::matches(const QString &s) const
{
return m_d->m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -70,6 +70,8 @@ public:
TabSettings tabSettings() const; TabSettings tabSettings() const;
StorageSettings storageSettings() const; StorageSettings storageSettings() const;
virtual bool matches(const QString &s) const;
signals: signals:
void tabSettingsChanged(const TextEditor::TabSettings &); void tabSettingsChanged(const TextEditor::TabSettings &);
void storageSettingsChanged(const TextEditor::StorageSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &);

View File

@@ -138,7 +138,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="tabKeyIndentLabel">
<property name="text"> <property name="text">
<string>Tab key performs auto-indent:</string> <string>Tab key performs auto-indent:</string>
</property> </property>

View File

@@ -34,6 +34,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QTextStream>
using namespace TextEditor; using namespace TextEditor;
@@ -44,6 +45,7 @@ struct DisplaySettingsPage::DisplaySettingsPagePrivate
const DisplaySettingsPageParameters m_parameters; const DisplaySettingsPageParameters m_parameters;
Ui::DisplaySettingsPage m_page; Ui::DisplaySettingsPage m_page;
DisplaySettings m_displaySettings; DisplaySettings m_displaySettings;
QString m_searchKeywords;
}; };
DisplaySettingsPage::DisplaySettingsPagePrivate::DisplaySettingsPagePrivate DisplaySettingsPage::DisplaySettingsPagePrivate::DisplaySettingsPagePrivate
@@ -92,6 +94,17 @@ QWidget *DisplaySettingsPage::createPage(QWidget *parent)
QWidget *w = new QWidget(parent); QWidget *w = new QWidget(parent);
m_d->m_page.setupUi(w); m_d->m_page.setupUi(w);
settingsToUI(); settingsToUI();
if (m_d->m_searchKeywords.isEmpty()) {
QTextStream(&m_d->m_searchKeywords) << m_d->m_page.displayLineNumbers->text()
<< ' ' << m_d->m_page.highlightCurrentLine->text()
<< ' ' << m_d->m_page.displayFoldingMarkers->text()
<< ' ' << m_d->m_page.highlightBlocks->text()
<< ' ' << m_d->m_page.visualizeWhitespace->text()
<< ' ' << m_d->m_page.animateMatchingParentheses->text()
<< ' ' << m_d->m_page.enableTextWrapping->text()
<< ' ' << m_d->m_page.mouseNavigation->text();
m_d->m_searchKeywords.remove(QLatin1Char('&'));
}
return w; return w;
} }
@@ -160,3 +173,8 @@ void DisplaySettingsPage::setDisplaySettings(const DisplaySettings &newDisplaySe
emit displaySettingsChanged(newDisplaySettings); emit displaySettingsChanged(newDisplaySettings);
} }
} }
bool DisplaySettingsPage::matches(const QString &s) const
{
return m_d->m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -65,6 +65,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish() { } void finish() { }
virtual bool matches(const QString &s) const;
DisplaySettings displaySettings() const; DisplaySettings displaySettings() const;
void setDisplaySettings(const DisplaySettings &); void setDisplaySettings(const DisplaySettings &);

View File

@@ -133,6 +133,7 @@ public:
Ui::FontSettingsPage ui; Ui::FontSettingsPage ui;
SchemeListModel *m_schemeListModel; SchemeListModel *m_schemeListModel;
bool m_refreshingSchemeList; bool m_refreshingSchemeList;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal
@@ -367,6 +368,8 @@ QWidget *FontSettingsPage::createPage(QWidget *parent)
updatePointSizes(); updatePointSizes();
refreshColorSchemeList(); refreshColorSchemeList();
d_ptr->m_lastValue = d_ptr->m_value; d_ptr->m_lastValue = d_ptr->m_value;
if (d_ptr->m_searchKeywords.isEmpty())
d_ptr->m_searchKeywords = d_ptr->ui.fontGroupBox->title() + QLatin1Char(' ') + d_ptr->ui.colorSchemeGroupBox->title();
return w; return w;
} }
@@ -618,3 +621,8 @@ const FontSettings &FontSettingsPage::fontSettings() const
{ {
return d_ptr->m_value; return d_ptr->m_value;
} }
bool FontSettingsPage::matches(const QString &s) const
{
return d_ptr->m_searchKeywords.contains(s, Qt::CaseInsensitive);
}

View File

@@ -97,6 +97,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish(); void finish();
virtual bool matches(const QString &) const;
void saveSettings(); void saveSettings();

View File

@@ -12,13 +12,13 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="fontGroupBox">
<property name="title"> <property name="title">
<string>Font</string> <string>Font</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="familyLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -57,7 +57,7 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="sizeLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -103,7 +103,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="colorSchemeGroupBox">
<property name="title"> <property name="title">
<string>Color Scheme</string> <string>Color Scheme</string>
</property> </property>

View File

@@ -2,39 +2,68 @@
<ui version="4.0"> <ui version="4.0">
<class>VCSBaseSettingsPage</class> <class>VCSBaseSettingsPage</class>
<widget class="QWidget" name="VCSBaseSettingsPage"> <widget class="QWidget" name="VCSBaseSettingsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>536</width>
<height>407</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Common</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QGroupBox" name="commonGroupBox">
<item> <layout class="QFormLayout" name="formLayout">
<property name="rowWrapPolicy">
<enum>QFormLayout::WrapLongRows</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="submitMessageCheckScriptLabel">
<property name="toolTip">
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
</property>
<property name="text">
<string>Submit message check script:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="submitMessageCheckScriptChooser"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
<string>A file listing user names and email addresses in a 4-column mailmap format:
name &lt;email&gt; alias &lt;email&gt;</string>
</property>
<property name="text">
<string>User/alias configuration file:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="nickNameMailMapChooser"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="nickNameFieldsFileLabel">
<property name="toolTip">
<string>A simple file containing lines with field names like &quot;Reviewed-By:&quot; which will be added below the submit editor.</string>
</property>
<property name="text">
<string>User fields configuration file:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="nickNameFieldsFileChooser"/>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="lineWrapCheckBox"> <widget class="QCheckBox" name="lineWrapCheckBox">
<property name="text"> <property name="text">
<string>Wrap submit message at:</string> <string>Wrap submit message at:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QSpinBox" name="lineWrapSpinBox"> <widget class="QSpinBox" name="lineWrapSpinBox">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="suffix">
<string>characters</string>
</property>
<property name="minimum"> <property name="minimum">
<number>40</number> <number>40</number>
</property> </property>
@@ -46,72 +75,6 @@
</property> </property>
</widget> </widget>
</item> </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>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="rowWrapPolicy">
<enum>QFormLayout::WrapLongRows</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="submitMessageCheckScriptLabel">
<property name="toolTip">
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
</property>
<property name="text">
<string>Submit message check script:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="submitMessageCheckScriptChooser" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="nickNameMailMapLabel">
<property name="toolTip">
<string>A file listing user names and email addresses in a 4-column mailmap format:
name &lt;email&gt; alias &lt;email&gt;</string>
</property>
<property name="text">
<string>User/alias configuration file:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="nickNameMailMapChooser" native="true"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="nickNameFieldsFileLabel">
<property name="toolTip">
<string>A simple file containing lines with field names like &quot;Reviewed-By:&quot; which will be added below the submit editor.</string>
</property>
<property name="text">
<string>User fields configuration file:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -120,10 +83,13 @@ name &lt;email&gt; alias &lt;email&gt;</string>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>0</width>
<height>307</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@@ -139,22 +105,5 @@ name &lt;email&gt; alias &lt;email&gt;</string>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections> <connections/>
<connection>
<sender>lineWrapCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>lineWrapSpinBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>186</x>
<y>58</y>
</hint>
<hint type="destinationlabel">
<x>225</x>
<y>58</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>