summaryrefslogtreecommitdiffstats
path: root/playerwidget.cpp
diff options
context:
space:
mode:
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;