summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playerwidget.cpp11
-rw-r--r--playerwidget.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp
index 7814f02..3637560 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -804,6 +804,7 @@ void PlayerWidget::doPopulateByWebradio(){
mView->setModel(mWebRadioModel);
emit viewModeChanged("WebRadio");
emit modelChanged();
+ connect(mView->selectionModel(), &QItemSelectionModel::currentChanged, this, &PlayerWidget::leftCurrentChanged);
}
void PlayerWidget::doPopulateByFavorites(){
@@ -914,6 +915,16 @@ void PlayerWidget::rightCurrentChanged(const QModelIndex &cur, const QModelIndex
fillWithText(mRightTE, file);
}
+void PlayerWidget::leftCurrentChanged(const QModelIndex &cur, const QModelIndex &prev){
+ Q_UNUSED(prev)
+ if(mModelType == WebRadio){
+ QString descr = cur.data(Qt::DisplayRole).toString();
+ QString url = cur.data(UrlRole).toString();
+ QString text = QString("%1\n%2").arg(descr).arg(url);
+ mRightTE->setText(text);
+ }
+}
+
void PlayerWidget::doPlay(){
if(mPlayer->state() == QMediaPlayer::PausedState || mIsStream){
mPlayer->play();
diff --git a/playerwidget.h b/playerwidget.h
index e5764e5..4fa8490 100644
--- a/playerwidget.h
+++ b/playerwidget.h
@@ -48,6 +48,7 @@ class PlayerWidget : public QWidget {
void doModelChanged();
void viewDoubleClicked(const QModelIndex &idx);
void rightCurrentChanged(const QModelIndex &cur, const QModelIndex &prev);
+ void leftCurrentChanged(const QModelIndex &cur, const QModelIndex &prev);
void doPlay();
void doStop();
void doPause();