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

@@ -4,6 +4,7 @@
#include <coreplugin/icore.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTextStream>
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.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;
}
void GdbOptionsPage::apply()
@@ -85,5 +93,10 @@ void GdbOptionsPage::finish()
m_group.finish();
}
bool GdbOptionsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
} // namespace Internal
} // namespace Debugger

View File

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

View File

@@ -2,30 +2,22 @@
<ui version="4.0">
<class>GdbOptionsPage</class>
<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">
<item>
<widget class="QGroupBox" name="groupBoxLocations">
<property name="title">
<string>Gdb interaction</string>
</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">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labelGdbLocation">
<property name="toolTip">
@@ -36,6 +28,9 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="gdbLocationChooser"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelEnvironment">
<property name="text">
@@ -46,6 +41,9 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="environmentEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelGdbStartupScript">
<property name="toolTip">
@@ -57,10 +55,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="Utils::PathChooser" name="scriptFileChooser" native="true"/>
</item>
<item row="0" column="1">
<widget class="Utils::PathChooser" name="gdbLocationChooser" native="true"/>
<widget class="Utils::PathChooser" name="scriptFileChooser"/>
</item>
</layout>
</widget>
@@ -133,6 +128,9 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>

View File

@@ -76,6 +76,8 @@ QWidget *TrkOptionsPage::createPage(QWidget *parent)
if (!m_widget)
m_widget = new TrkOptionsWidget(parent);
m_widget->setTrkOptions(*m_options);
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
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 Designer

View File

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

View File

@@ -32,6 +32,8 @@
#include "debuggerconstants.h"
#include "ui_trkoptionswidget.h"
#include <QtCore/QTextStream>
namespace Debugger {
namespace Internal {
@@ -88,5 +90,14 @@ TrkOptions TrkOptionsWidget::trkOptions() const
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 Designer

View File

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