From 6ebcf9f1c7499ed577f18b999ec38ce1c50659af Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 11 May 2018 19:54:39 +0200 Subject: Minor fixes for WebRadio 1. Start playing on doubleClick 2. show the stream in statusBar 3. Clear everything that doesn't belong --- playerwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playerwidget.cpp b/playerwidget.cpp index cc921ea..9f15524 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -178,6 +178,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){ QAction *editA = new QAction(QIcon(":/quadd.png"), tr("Edit..."), this); connect(editA, &QAction::triggered, [this, refreshA] { WebRadioDialog dlg(this); dlg.exec(); refreshA->trigger(); }); curW->view()->addAction(editA); + connect(curW->view(), &BeetView::doubleClicked, playA, &QAction::trigger); }else{ QAction *addToPlayListA = new QAction(QIcon(":/belly_right.png"), tr("Add to playlist"), this); connect(addToPlayListA, &QAction::triggered, this, &PlayerWidget::addToPlayList); @@ -861,6 +862,7 @@ void PlayerWidget::doMetadataChange(const QString &key, const QVariant &value){ nowP->setData(title, CollectionWidget::TitleRole); nowP->setText(np); plRoot->appendRow(nowP); + mWebRadioView->scrollTo(mWebRadioModel->indexFromItem(nowP), QAbstractItemView::EnsureVisible); mCurrentTE->clear(); mCurrentTE->append(QString("%1 %2").arg(tr("Artist:"), -20).arg(artist)); mCurrentTE->append(QString("%1 %2").arg(tr("Title:"), -20).arg(title)); @@ -936,6 +938,11 @@ void PlayerWidget::playUrl(const QModelIndex &idx){ mPlayA->setChecked(true); mTrayIcon->setIcon(QIcon(":/play.png")); emit playModeChanged(tr("Playing")); + QString msg = QString(tr("Streaming: %1").arg(idx.data(CollectionWidget::UrlRole).toString())); + emit message(msg); + emit numFilesChanged(0); + emit playListLengthChanged(0); + mRightTE->clear(); } void PlayerWidget::volumeChanged(int volume){ -- cgit v1.2.3-70-g09d2