diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index 42c7906959657f5a4dc2f86b99f97dd02fbf77f1..39a244126104d8f952fd47d8e5afa342dd5ff28f 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -39,7 +39,6 @@ #include <utils/treewidgetcolumnstretcher.h> - #include <QtGui/QKeyEvent> #include <QtGui/QShortcut> #include <QtGui/QHeaderView> @@ -98,10 +97,21 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0; QWidget *w = CommandMappings::createPage(parent); - setPageTitle(tr("Keyboard Shortcuts")); - setTargetLabelText(tr("Shortcut:")); - setTargetEditTitle(tr("Keyboard Shortcuts")); - setTargetHeader(tr("Shortcut")); + + const QString pageTitle = tr("Keyboard Shortcuts"); + const QString targetLabelText = tr("Key sequence:"); + const QString editTitle = tr("Shortcut"); + + setPageTitle(pageTitle); + setTargetLabelText(targetLabelText); + setTargetEditTitle(editTitle); + setTargetHeader(editTitle); + + if (m_searchKeywords.isEmpty()) { + QTextStream(&m_searchKeywords) << ' ' << pageTitle + << ' ' << targetLabelText + << ' ' << editTitle; + } return w; } @@ -120,6 +130,11 @@ void ShortcutSettings::finish() CommandMappings::finish(); } +bool ShortcutSettings::matches(const QString &s) const +{ + return m_searchKeywords.contains(s, Qt::CaseInsensitive); +} + bool ShortcutSettings::eventFilter(QObject *o, QEvent *e) { Q_UNUSED(o) @@ -369,7 +384,7 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item) continue; } - foreach(int context, currentItem->m_cmd->context()) { + foreach (int context, currentItem->m_cmd->context()) { // conflict if context is identical, OR if one // of the contexts is the global context diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.h b/src/plugins/coreplugin/dialogs/shortcutsettings.h index d9a816a63c67c2b46d2a54599443d7ab61b84c78..f4013a187f352a9a4b3ef53aa9d014bd3e7b52bc 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.h +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.h @@ -73,6 +73,7 @@ public: QWidget *createPage(QWidget *parent); void apply(); void finish(); + bool matches(const QString &s) const; protected: bool eventFilter(QObject *o, QEvent *e); @@ -97,6 +98,8 @@ private: QList<ShortcutItem *> m_scitems; int m_key[4], m_keyNum; + + QString m_searchKeywords; }; } // namespace Internal