Skip to content
Permalink
Browse files

Merge pull request #3925 from alexbruy/shortcuts-search

[FEATURE] add search bar to the Configure Shortcuts dialog (fix #12681)
  • Loading branch information
alexbruy committed Jan 3, 2017
2 parents a643f4b + 1fb9ef6 commit 47130a67584246f163b13c24197d129433f2ea4c
@@ -28,6 +28,7 @@
#include <QFileDialog>
#include <QTextStream>
#include <QSettings>
#include <QDebug>

QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget* parent, QgsShortcutsManager* manager )
: QDialog( parent )
@@ -480,3 +481,19 @@ void QgsConfigureShortcutsDialog::setCurrentActionShortcut( const QKeySequence&

actionChanged( treeActions->currentItem(), nullptr );
}

void QgsConfigureShortcutsDialog::on_mLeFilter_textChanged( const QString& text )
{
for ( int i = 0; i < treeActions->topLevelItemCount(); i++ )
{
QTreeWidgetItem* item = treeActions->topLevelItem( i );
if ( !item->text( 0 ).contains( text, Qt::CaseInsensitive ) && !item->text( 1 ).contains( text, Qt::CaseInsensitive ) )
{
item->setHidden( true );
}
else
{
item->setHidden( false );
}
}
}
@@ -54,6 +54,7 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo
void setNoShortcut();
void saveShortcuts();
void loadShortcuts();
void on_mLeFilter_textChanged( const QString& text );

void actionChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous );

@@ -14,6 +14,13 @@
<string>Keyboard shortcuts</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QgsFilterLineEdit" name="mLeFilter">
<property name="placeholderText">
<string>Search...</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="treeActions">
<property name="rootIsDecorated">
@@ -110,6 +117,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsFilterLineEdit</class>
<extends>QLineEdit</extends>
<header>qgsfilterlineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>treeActions</tabstop>
<tabstop>btnSetNoShortcut</tabstop>

0 comments on commit 47130a6

Please sign in to comment.
You can’t perform that action at this time.