summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--beetplayer.qrc1
-rw-r--r--gaping_ass.pngbin0 -> 884 bytes
-rw-r--r--playerwidget.cpp19
-rw-r--r--playerwidget.h1
4 files changed, 16 insertions, 5 deletions
diff --git a/beetplayer.qrc b/beetplayer.qrc
index ab28cba..7688f96 100644
--- a/beetplayer.qrc
+++ b/beetplayer.qrc
@@ -23,5 +23,6 @@
<file>belly_right_and_clear.png</file>
<file>folder.png</file>
<file>splash.png</file>
+ <file>gaping_ass.png</file>
</qresource>
</RCC>
diff --git a/gaping_ass.png b/gaping_ass.png
new file mode 100644
index 0000000..18feb02
--- /dev/null
+++ b/gaping_ass.png
Binary files differ
diff --git a/playerwidget.cpp b/playerwidget.cpp
index b9152d1..62ab6e1 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -75,6 +75,11 @@ void PlayerWidget::setupGui(){
viewByFolderA->setCheckable(true);
viewAG->addAction(viewByFolderA);
connect(viewByFolderA, SIGNAL(triggered()), this, SLOT(doPopulateByFolder()));
+ viewAG->addAction(Helper::createSeparator(this));
+ mSearchA = new QAction(QIcon(":/gaping_ass.png"), tr("View search"), this);
+ mSearchA->setCheckable(true);
+ viewAG->addAction(mSearchA);
+ connect(mSearchA, SIGNAL(triggered()), this, SLOT(doFilter()));
viewTB->addActions(viewAG->actions());
//filter
@@ -653,15 +658,19 @@ void PlayerWidget::doPopulateBySong(){
void PlayerWidget::doFilter(){
QString filter = mSearch->text();
- if(filter.isEmpty()){
- mView->setModel(mViewModel);
- return;
- }
- qApp->setOverrideCursor(Qt::BusyCursor);
mSearchModel->clear();
mSearchModel->setHorizontalHeaderLabels(QStringList() << tr("Name"));
mView->setModel(mSearchModel);
mCurrentModel = mSearchModel;
+ emit viewModeChanged(tr("Search"));
+ mSearchA->setChecked(true);
+ if(filter.isEmpty()){
+ emit message(QString(tr("No search term set! Cowardly refusing to do anything!")));
+ return;
+ }
+ QString msg = QString(tr("Searching for \"%1\"")).arg(filter);
+ emit message(msg);
+ qApp->setOverrideCursor(Qt::BusyCursor);
QStandardItem *root = mSearchModel->invisibleRootItem();
populateByArtist(root, filter);
populateByAlbum(root, filter, FilterType);
diff --git a/playerwidget.h b/playerwidget.h
index b2b8c5e..5713cd0 100644
--- a/playerwidget.h
+++ b/playerwidget.h
@@ -92,6 +92,7 @@ class PlayerWidget : public QWidget {
QAction *mPlayA;
QAction *mStopA;
QAction *mPauseA;
+ QAction *mSearchA;
qint64 mDurSecs;
quint64 mPlayListLength;
};