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

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