summaryrefslogtreecommitdiffstats
path: root/playerwidget.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-02-18 15:42:41 +0100
committerArno <arno@disconnect.de>2018-02-18 15:42:41 +0100
commita3577a6b0a7735eb4040431eccc2807a63b7f24e (patch)
tree2167ff6d09b6118d0b646ef70f4a3ee87223d944 /playerwidget.cpp
parent6f3ae187f8e818263dda4676508b109a3b5e291b (diff)
downloadBeetPlayer-a3577a6b0a7735eb4040431eccc2807a63b7f24e.tar.gz
BeetPlayer-a3577a6b0a7735eb4040431eccc2807a63b7f24e.tar.bz2
BeetPlayer-a3577a6b0a7735eb4040431eccc2807a63b7f24e.zip
Activate WebRadio playlist when selecting WebRadio Collection
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r--playerwidget.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp
index f90788b..df3c285 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -93,7 +93,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
int cIdx = mCollectionStack->addWidget(artistsView);
QAction *viewByArtistsA = new QAction(QIcon(":/artist.png"), tr("View by artist"), this);
viewByArtistsA->setCheckable(true);
- connect(viewByArtistsA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(viewByArtistsA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, false); });
bottomTBG->addAction(viewByArtistsA);
//albums view
CollectionAlbumsView *albumsView = new CollectionAlbumsView;
@@ -105,7 +105,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
cIdx = mCollectionStack->addWidget(albumsView);
mViewByAlbumsA = new QAction(QIcon(":/album.png"), tr("View by album"), this);
mViewByAlbumsA->setCheckable(true);
- connect(mViewByAlbumsA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(mViewByAlbumsA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, false); });
bottomTBG->addAction(mViewByAlbumsA);
//dates view
CollectionDatesView *datesView = new CollectionDatesView;;
@@ -117,7 +117,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
cIdx = mCollectionStack->addWidget(datesView);
QAction *viewByDatesA = new QAction(QIcon(":/sissyd.png"), tr("View by date"), this);
viewByDatesA->setCheckable(true);
- connect(viewByDatesA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(viewByDatesA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, false); });
bottomTBG->addAction(viewByDatesA);
//favorites view
CollectionFavoritesView *favoritesView = new CollectionFavoritesView;
@@ -129,7 +129,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
cIdx = mCollectionStack->addWidget(favoritesView);
QAction *viewByFavoritesA = new QAction(QIcon(":/male_chastity_belt.png"), tr("View by favorites"), this);
viewByFavoritesA->setCheckable(true);
- connect(viewByFavoritesA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(viewByFavoritesA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, false); });
bottomTBG->addAction(viewByFavoritesA);
//webradio view
CollectionWebradioView *webradioView = new CollectionWebradioView;
@@ -141,7 +141,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
cIdx = mCollectionStack->addWidget(webradioView);
QAction *viewByWebradioA = new QAction(QIcon(":/dog_hood.png"), tr("Webradio"), this);
viewByWebradioA->setCheckable(true);
- connect(viewByWebradioA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(viewByWebradioA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, true); });
bottomTBG->addAction(viewByWebradioA);
//folders view
CollectionFoldersView *foldersView = new CollectionFoldersView;
@@ -153,7 +153,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
cIdx = mCollectionStack->addWidget(foldersView);
QAction *viewByFoldersA = new QAction(QIcon(":/folder.png"), tr("View by folder"), this);
viewByFoldersA->setCheckable(true);
- connect(viewByFoldersA, &QAction::triggered, [this, cIdx] { mCollectionStack->setCurrentIndex(cIdx); });
+ connect(viewByFoldersA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, false); });
bottomTBG->addAction(viewByFoldersA);
for(QAction *a : bottomTBG->actions()){
bottomTB->addAction(a);
@@ -1026,3 +1026,14 @@ void PlayerWidget::gotoAlbum(){
}
}
}
+
+void PlayerWidget::setCollectionIndex(int collectionIndex, bool isWebradio){
+ mCollectionStack->setCurrentIndex(collectionIndex);
+ int plIdx = 0;
+ if(isWebradio){
+ plIdx = mPlaylistTab->indexOf(mWebRadioView);
+ }else{
+ plIdx = mPlaylistTab->indexOf(mSongView);
+ }
+ mPlaylistTab->setCurrentIndex(plIdx);
+}