diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-08 16:48:24 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-06-12 09:49:58 +0000 |
commit | ee488785bf2843d38092d083b509782e77a8ce22 (patch) | |
tree | 0db23daf13f709d0ec1052c8e4a16449d32cb539 /src/plugins/coreplugin/locator/ilocatorfilter.cpp | |
parent | 0046562391fac5c2b22b4d46beee5a9261200041 (diff) |
Improved locator settings
* Added columns for name, prefix and default
* Made sortable
* Added filter input field
* Added inline editing of prefix and default state
* Changed "Limit to prefix" to "Include by default"
* Added some tool tips
Change-Id: I9ddfaf1bc9ff62e3fbe84c1b66bdd795aaa274fd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins/coreplugin/locator/ilocatorfilter.cpp')
-rw-r--r-- | src/plugins/coreplugin/locator/ilocatorfilter.cpp | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index ae93a8afb9..9ba022bb8a 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -30,8 +30,11 @@ #include "ilocatorfilter.h" +#include <coreplugin/coreconstants.h> + #include <QBoxLayout> #include <QCheckBox> +#include <QCoreApplication> #include <QDialog> #include <QDialogButtonBox> #include <QLabel> @@ -92,17 +95,20 @@ bool ILocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) Q_UNUSED(needsRefresh) QDialog dialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint); - dialog.setWindowTitle(tr("Filter Configuration")); + dialog.setWindowTitle(msgConfigureDialogTitle()); QVBoxLayout *vlayout = new QVBoxLayout(&dialog); QHBoxLayout *hlayout = new QHBoxLayout; QLineEdit *shortcutEdit = new QLineEdit(shortcutString()); - QCheckBox *limitCheck = new QCheckBox(tr("Limit to prefix")); - limitCheck->setChecked(!isIncludedByDefault()); + QCheckBox *includeByDefault = new QCheckBox(msgIncludeByDefault()); + includeByDefault->setToolTip(msgIncludeByDefaultToolTip()); + includeByDefault->setChecked(isIncludedByDefault()); - hlayout->addWidget(new QLabel(tr("Prefix:"))); + auto prefixLabel = new QLabel(msgPrefixLabel()); + prefixLabel->setToolTip(msgPrefixToolTip()); + hlayout->addWidget(prefixLabel); hlayout->addWidget(shortcutEdit); - hlayout->addWidget(limitCheck); + hlayout->addWidget(includeByDefault); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); @@ -115,7 +121,7 @@ bool ILocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) if (dialog.exec() == QDialog::Accepted) { setShortcutString(shortcutEdit->text().trimmed()); - setIncludedByDefault(!limitCheck->isChecked()); + setIncludedByDefault(includeByDefault->isChecked()); return true; } @@ -143,6 +149,31 @@ Qt::CaseSensitivity ILocatorFilter::caseSensitivity(const QString &str) return str == str.toLower() ? Qt::CaseInsensitive : Qt::CaseSensitive; } +QString ILocatorFilter::msgConfigureDialogTitle() +{ + return tr("Filter Configuration"); +} + +QString ILocatorFilter::msgPrefixLabel() +{ + return tr("Prefix:"); +} + +QString ILocatorFilter::msgPrefixToolTip() +{ + return tr("Type the prefix followed by a space and search term to restrict search to the filter."); +} + +QString ILocatorFilter::msgIncludeByDefault() +{ + return tr("Include by default"); +} + +QString ILocatorFilter::msgIncludeByDefaultToolTip() +{ + return tr("Include the filter when not using a prefix for searches."); +} + bool ILocatorFilter::isConfigurable() const { return m_isConfigurable; |