summaryrefslogtreecommitdiffstats
path: root/playerwidget.cpp
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 /playerwidget.cpp
parent7f1b41ddcfe6d8fea2d496ba497b0d2db02a6491 (diff)
downloadBeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.tar.gz
BeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.tar.bz2
BeetPlayer-1adac8a2f886c8b0bc1e3a73dfaa3ff881696fbb.zip
Add Action to View: clear and play
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r--playerwidget.cpp11
1 files changed, 11 insertions, 0 deletions
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;