From: APTX Date: Mon, 23 Jul 2012 15:48:42 +0000 (+0200) Subject: Add filter type combo box X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=4c4528a4ff9ab5973efb0c2a338d281be6365622;p=localmylist.git Add filter type combo box --- diff --git a/management-gui/mainwindow.cpp b/management-gui/mainwindow.cpp index a662e21..3649419 100644 --- a/management-gui/mainwindow.cpp +++ b/management-gui/mainwindow.cpp @@ -56,6 +56,11 @@ MainWindow::MainWindow(QWidget *parent) : ui->myListView->header()->setStretchLastSection(false); ui->myListView->header()->resizeSection(4, 200); + ui->filterType->addItems(QStringList() + << tr("Fixed String") + << tr("Wildcard") + << tr("Regexp")); + connect(ui->myListView, SIGNAL(renameTest(int)), this, SLOT(openRenameScriptEditor(int))); setAcceptDrops(true); @@ -379,5 +384,22 @@ void MainWindow::dropEvent(QDropEvent *event) void MainWindow::on_filterInput_textChanged(const QString &filter) { - myListFilterModel->setFilterFixedString(filter); + switch (ui->filterType->currentIndex()) + { + case 1: + myListFilterModel->setFilterWildcard(filter); + break; + case 2: + myListFilterModel->setFilterRegExp(filter); + break; + case 0: + default: + myListFilterModel->setFilterFixedString(filter); + break; + } +} + +void MainWindow::on_filterType_currentIndexChanged(int) +{ + on_filterInput_textChanged(ui->filterInput->text()); } diff --git a/management-gui/mainwindow.h b/management-gui/mainwindow.h index ee8774c..96f4c09 100644 --- a/management-gui/mainwindow.h +++ b/management-gui/mainwindow.h @@ -63,6 +63,8 @@ private slots: void on_actionAddRelatedEpisodeInfo_triggered(); void on_filterInput_textChanged(const QString &filter); + void on_filterType_currentIndexChanged(int); + protected: void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); diff --git a/management-gui/mainwindow.ui b/management-gui/mainwindow.ui index 94f10ff..68a1963 100644 --- a/management-gui/mainwindow.ui +++ b/management-gui/mainwindow.ui @@ -16,7 +16,14 @@ - + + + + + + + + @@ -241,6 +248,12 @@
mylistview.h
+ + filterInput + filterType + myListView + refreshButton +