Commit c51eff1f authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: addons manager: add search box

parent d0d1f57e
......@@ -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) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment