diff --git a/src/playlist.cpp b/src/playlist.cpp index 963fda3a3..a2a826a63 100644 --- a/src/playlist.cpp +++ b/src/playlist.cpp @@ -560,6 +560,12 @@ void Playlist::createActions() { prevAct = new MyAction(Qt::Key_P /*Qt::Key_Less*/, this, "pl_prev", false); connect( prevAct, SIGNAL(triggered()), this, SLOT(playPrev()) ); + firstAct = new MyAction(this, "pl_first", false); + connect( firstAct, SIGNAL(triggered()), this, SLOT(playFirst()) ); + + lastAct = new MyAction(this, "pl_last", false); + connect( lastAct, SIGNAL(triggered()), this, SLOT(playLast()) ); + moveUpAct = new MyAction(this, "pl_move_up", false); connect( moveUpAct, SIGNAL(triggered()), this, SLOT(upItem()) ); @@ -780,6 +786,9 @@ void Playlist::retranslateStrings() { nextAct->change( tr("&Next") ); prevAct->change( tr("Pre&vious") ); + firstAct->change( tr("&First") ); + lastAct->change( tr("&Last") ); + playAct->setIcon( Images::icon("play") ); pauseAct->setIcon( Images::icon("pause") ); nextAct->setIcon( Images::icon("next") ); @@ -1722,6 +1731,16 @@ void Playlist::playPrev() { } } +void Playlist::playFirst() { + qDebug("Playlist::playFirst"); + playItem(0); +} + +void Playlist::playLast() { + qDebug("Playlist::playLast"); + playItem(proxy->rowCount()-1); +} + void Playlist::playNextAuto() { qDebug("Playlist::playNextAuto"); if (automatically_play_next) { diff --git a/src/playlist.h b/src/playlist.h index 8c1810949..0c9155323 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -136,6 +136,9 @@ public slots: void playNext(); void playPrev(); + void playFirst(); + void playLast(); + void playNextAuto(); // Called from GUI when a file finished void resumePlay(); @@ -358,6 +361,8 @@ protected slots: MyAction * pauseAct; MyAction * prevAct; MyAction * nextAct; + MyAction * firstAct; + MyAction * lastAct; MyAction * repeatAct; MyAction * shuffleAct; MyAction * showSearchAct;