diff options
author | Arno <arno@disconnect.de> | 2017-10-15 07:30:00 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-10-15 07:30:00 +0200 |
commit | 7e1ebd90789ae1d9d9fdfc54988aad722667df4c (patch) | |
tree | a68ac9c286ac52a06765536cdce998580b85ba1a /playerwidget.cpp | |
parent | 24e36ccd5b97cc3b6e669b4c651d38b6c2f64906 (diff) | |
download | BeetPlayer-7e1ebd90789ae1d9d9fdfc54988aad722667df4c.tar.gz BeetPlayer-7e1ebd90789ae1d9d9fdfc54988aad722667df4c.tar.bz2 BeetPlayer-7e1ebd90789ae1d9d9fdfc54988aad722667df4c.zip |
Show URL and Description when selecting WebRadio
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r-- | playerwidget.cpp | 11 |
1 files changed, 11 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(); |