Skip to content
Snippets Groups Projects
Commit 394cad3f authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Override IOptionsPage::matches for ShortcutSettings page

It wasn't finding this page when looking for 'shortcut'.
parent 9c8079f0
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <utils/treewidgetcolumnstretcher.h> #include <utils/treewidgetcolumnstretcher.h>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QtGui/QShortcut> #include <QtGui/QShortcut>
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
...@@ -98,10 +97,21 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) ...@@ -98,10 +97,21 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0; m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0;
QWidget *w = CommandMappings::createPage(parent); QWidget *w = CommandMappings::createPage(parent);
setPageTitle(tr("Keyboard Shortcuts"));
setTargetLabelText(tr("Shortcut:")); const QString pageTitle = tr("Keyboard Shortcuts");
setTargetEditTitle(tr("Keyboard Shortcuts")); const QString targetLabelText = tr("Key sequence:");
setTargetHeader(tr("Shortcut")); 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; return w;
} }
...@@ -120,6 +130,11 @@ void ShortcutSettings::finish() ...@@ -120,6 +130,11 @@ void ShortcutSettings::finish()
CommandMappings::finish(); CommandMappings::finish();
} }
bool ShortcutSettings::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
bool ShortcutSettings::eventFilter(QObject *o, QEvent *e) bool ShortcutSettings::eventFilter(QObject *o, QEvent *e)
{ {
Q_UNUSED(o) Q_UNUSED(o)
......
...@@ -73,6 +73,7 @@ public: ...@@ -73,6 +73,7 @@ public:
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish(); void finish();
bool matches(const QString &s) const;
protected: protected:
bool eventFilter(QObject *o, QEvent *e); bool eventFilter(QObject *o, QEvent *e);
...@@ -97,6 +98,8 @@ private: ...@@ -97,6 +98,8 @@ private:
QList<ShortcutItem *> m_scitems; QList<ShortcutItem *> m_scitems;
int m_key[4], m_keyNum; int m_key[4], m_keyNum;
QString m_searchKeywords;
}; };
} // namespace Internal } // namespace Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment