From 7e1ebd90789ae1d9d9fdfc54988aad722667df4c Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 15 Oct 2017 07:30:00 +0200 Subject: Show URL and Description when selecting WebRadio --- playerwidget.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'playerwidget.cpp') 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(); -- cgit v1.2.3-70-g09d2