[vlc-commits] Qt: addons manager: add search box

Francois Cartegnie git at videolan.org
Thu Feb 27 03:38:37 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 27 03:38:13 2014 +0100| [c51eff1f3b2848d4f7a8fe913c075c80181e0f8c] | committer: Francois Cartegnie

Qt: addons manager: add search box

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c51eff1f3b2848d4f7a8fe913c075c80181e0f8c
---

 modules/gui/qt4/dialogs/plugins.cpp |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index a26c457..666fd37 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -349,6 +349,10 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
     leftPane->layout()->setMargin(0);
     leftPane->layout()->setSpacing(0);
 
+    SearchLineEdit *searchInput = new SearchLineEdit();
+    leftPane->layout()->addWidget( searchInput );
+    leftPane->layout()->addItem( new QSpacerItem( 0, 10 ) );
+
     QToolButton * button;
     QSignalMapper *mapper = new QSignalMapper();
     QImage icon( ":/addons/default" );
@@ -449,6 +453,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
     AddonsListModel *model = new AddonsListModel( AM, addonsView );
     addonsModel = new AddonsSortFilterProxyModel();
     addonsModel->setDynamicSortFilter( true );
+    addonsModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
     addonsModel->setSortRole( Qt::DisplayRole );
     addonsModel->sort( 0, Qt::AscendingOrder );
     addonsModel->setSourceModel( model );
@@ -457,6 +462,9 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
 
     CONNECT( mapper, mapped(int), addonsModel, setTypeFilter(int) );
 
+    CONNECT( searchInput, textChanged( const QString &),
+             addonsModel, setFilterFixedString( QString ) );
+
     CONNECT( addonsView->selectionModel(), currentChanged(QModelIndex,QModelIndex),
              addonsView, edit(QModelIndex) );
 



More information about the vlc-commits mailing list