summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2017-03-05 02:35:21 +0100
committerArno <arno@disconnect.de>2017-03-05 02:35:21 +0100
commit1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb (patch)
tree34140bcaabf69ae30ad4e64ad18932bd309461cf
parent7f1b41ddcfe6d8fea2d496ba497b0d2db02a6491 (diff)
downloadBeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.tar.gz
BeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.tar.bz2
BeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.zip
Add Action to View: clear and play
-rw-r--r--beetplayer.qrc1
-rw-r--r--belly_right_and_clear.pngbin0 -> 10396 bytes
-rw-r--r--playerwidget.cpp11
-rw-r--r--playerwidget.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/beetplayer.qrc b/beetplayer.qrc
index 0954138..7fb02ef 100644
--- a/beetplayer.qrc
+++ b/beetplayer.qrc
@@ -20,5 +20,6 @@
<file>genre.png</file>
<file>stomp.png</file>
<file>clean_tampon.png</file>
+ <file>belly_right_and_clear.png</file>
</qresource>
</RCC>
diff --git a/belly_right_and_clear.png b/belly_right_and_clear.png
new file mode 100644
index 0000000..7576007
--- /dev/null
+++ b/belly_right_and_clear.png
Binary files differ
diff --git a/playerwidget.cpp b/playerwidget.cpp
index 65cafb7..91654ae 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -200,6 +200,8 @@ void PlayerWidget::createActions(){
connect(nextA, SIGNAL(triggered()), this, SLOT(next()));
QAction *addToPlayListA = new QAction(QIcon(":/belly_right.png"), tr("Add to playlist"), this);
connect(addToPlayListA, SIGNAL(triggered()), this, SLOT(addToPlayList()));
+ QAction *addToPlayListAndClearA = new QAction(QIcon(":/belly_right_and_clear.png"), tr("Clear and add"), this);
+ connect(addToPlayListAndClearA, SIGNAL(triggered()), this, SLOT(addToPlayListAndClear()));
QAction *removeFromPlayListA = new QAction(QIcon(":/belly_left.png"), tr("Remove from playlist"), this);
connect(removeFromPlayListA, SIGNAL(triggered()), this, SLOT(removeFromPlayList()));
QAction *clearPlayListA = new QAction(QIcon(":/delete.png"), tr("Clear Playlist"), this);
@@ -215,6 +217,10 @@ void PlayerWidget::createActions(){
connect(muteA, SIGNAL(triggered(bool)), this, SLOT(mute(bool)));
QAction *configA = Globals::instance()->action(Globals::ConfigAction);
mView->addAction(addToPlayListA);
+ mView->addAction(addToPlayListAndClearA);
+ QAction *mViewAS1 = new QAction(this);
+ mViewAS1->setSeparator(true);
+ mView->addAction(mViewAS1);
mView->addAction(randomPlayA);
mPlayListView->addAction(removeFromPlayListA);
mPlayListView->addAction(shufflePlayistA);
@@ -556,6 +562,11 @@ void PlayerWidget::addToPlayList(){
}
}
+void PlayerWidget::addToPlayListAndClear(){
+ clearPlayList();
+ addToPlayList();
+}
+
void PlayerWidget::removeFromPlayList(){
QModelIndexList sel = mPlayListView->selectionModel()->selectedRows();
QList<QPersistentModelIndex> persistent;
diff --git a/playerwidget.h b/playerwidget.h
index bc6ad81..e2ac24d 100644
--- a/playerwidget.h
+++ b/playerwidget.h
@@ -33,6 +33,7 @@ class PlayerWidget : public QWidget {
void clearFilter();
void reindex();
void addToPlayList();
+ void addToPlayListAndClear();
void removeFromPlayList();
void clearPlayList();
void shufflePlayList();