When current song is from an online-service (Jamendo, Magnatune, etc) then only show cover and tite in context view. No attempt is made to get artist, album, or song information - as these are likely to fail anyway.
This commit is contained in:
committed by
craig.p.drummond
parent
549cd48898
commit
40926020df
@@ -317,7 +317,8 @@ if (ENABLE_ONLINE_SERVICES)
|
||||
set(CANTATA_SRCS ${CANTATA_SRCS} online/onlineservicespage.cpp online/onlineservice.cpp online/jamendoservice.cpp
|
||||
online/jamendosettingsdialog.cpp online/magnatuneservice.cpp online/magnatunesettingsdialog.cpp online/soundcloudservice.cpp
|
||||
online/podcastservice.cpp online/rssparser.cpp online/opmlparser.cpp online/podcastsearchdialog.cpp online/onlinesettings.cpp
|
||||
online/podcastsettingsdialog.cpp models/onlineservicesmodel.cpp models/musiclibraryitempodcast.cpp)
|
||||
online/podcastsettingsdialog.cpp models/onlineservicesmodel.cpp models/musiclibraryitempodcast.cpp
|
||||
context/onlineview.cpp)
|
||||
set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} online/onlineservice.h online/onlineservicespage.h online/jamendoservice.h
|
||||
online/magnatuneservice.h online/magnatunesettingsdialog.h online/magnatuneservice.h online/magnatunesettingsdialog.h
|
||||
online/soundcloudservice.h online/podcastservice.h online/podcastsearchdialog.h online/podcastsettingsdialog.h
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
copy/delete dialog - just dont allow setting to be changed.
|
||||
41. Remove artist image support for online-services.
|
||||
42. Update context-view when artist, or album, image is updated.
|
||||
43. When current song is from an online-service (Jamendo, Magnatune, etc) then
|
||||
only show cover and tite in context view. No attempt is made to get artist,
|
||||
album, or song information - as these are likely to fail anyway.
|
||||
|
||||
1.3.3
|
||||
-----
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "artistview.h"
|
||||
#include "albumview.h"
|
||||
#include "songview.h"
|
||||
#ifdef ENABLE_ONLINE_SERVICES
|
||||
#include "onlineview.h"
|
||||
#endif
|
||||
#include "song.h"
|
||||
#include "utils.h"
|
||||
#include "covers.h"
|
||||
@@ -278,17 +281,26 @@ ContextWidget::ContextWidget(QWidget *parent)
|
||||
, fadeValue(0)
|
||||
, isWide(false)
|
||||
, stack(0)
|
||||
#ifdef ENABLE_ONLINE_SERVICES
|
||||
, onlineContext(0)
|
||||
#endif
|
||||
, splitter(0)
|
||||
, viewSelector(0)
|
||||
, creator(0)
|
||||
{
|
||||
QHBoxLayout *layout=new QHBoxLayout(this);
|
||||
mainStack=new QStackedWidget(this);
|
||||
standardContext=new QWidget(mainStack);
|
||||
mainStack->addWidget(standardContext);
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(mainStack);
|
||||
animator.setPropertyName("fade");
|
||||
animator.setTargetObject(this);
|
||||
|
||||
appLinkColor=QApplication::palette().color(QPalette::Link);
|
||||
artist = new ArtistView(this);
|
||||
album = new AlbumView(this);
|
||||
song = new SongView(this);
|
||||
artist = new ArtistView(standardContext);
|
||||
album = new AlbumView(standardContext);
|
||||
song = new SongView(standardContext);
|
||||
minWidth=album->picSize().width()*2.5;
|
||||
|
||||
artist->addEventFilter(this);
|
||||
@@ -338,11 +350,11 @@ void ContextWidget::setWide(bool w)
|
||||
|
||||
isWide=w;
|
||||
if (w) {
|
||||
if (layout()) {
|
||||
delete layout();
|
||||
if (standardContext->layout()) {
|
||||
delete standardContext->layout();
|
||||
}
|
||||
QHBoxLayout *l=new QHBoxLayout(this);
|
||||
setLayout(l);
|
||||
QHBoxLayout *l=new QHBoxLayout(standardContext);
|
||||
standardContext->setLayout(l);
|
||||
int m=l->margin()/2;
|
||||
l->setMargin(0);
|
||||
if (stack) {
|
||||
@@ -359,7 +371,7 @@ void ContextWidget::setWide(bool w)
|
||||
QByteArray state;
|
||||
bool resetSplitter=splitter;
|
||||
if (!splitter) {
|
||||
splitter=new ThinSplitter(this);
|
||||
splitter=new ThinSplitter(standardContext);
|
||||
state=Settings::self()->contextSplitterState();
|
||||
}
|
||||
l->addWidget(splitter);
|
||||
@@ -376,19 +388,19 @@ void ContextWidget::setWide(bool w)
|
||||
splitter->restoreState(state);
|
||||
}
|
||||
} else {
|
||||
if (layout()) {
|
||||
delete layout();
|
||||
if (standardContext->layout()) {
|
||||
delete standardContext->layout();
|
||||
}
|
||||
QGridLayout *l=new QGridLayout(this);
|
||||
setLayout(l);
|
||||
QGridLayout *l=new QGridLayout(standardContext);
|
||||
standardContext->setLayout(l);
|
||||
int m=l->margin()/2;
|
||||
l->setMargin(0);
|
||||
l->setSpacing(0);
|
||||
if (!stack) {
|
||||
stack=new QStackedWidget(this);
|
||||
stack=new QStackedWidget(standardContext);
|
||||
}
|
||||
if (!viewSelector) {
|
||||
viewSelector=new ViewSelector(this);
|
||||
viewSelector=new ViewSelector(standardContext);
|
||||
viewSelector->addItem(i18n("&Artist"), "artist");
|
||||
viewSelector->addItem(i18n("Al&bum"), "album");
|
||||
viewSelector->addItem(i18n("&Lyrics"), "song");
|
||||
@@ -646,6 +658,29 @@ void ContextWidget::update(const Song &s)
|
||||
if (s.albumArtist()!=currentSong.albumArtist()) {
|
||||
cancel();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ONLINE_SERVICES
|
||||
if (Song::OnlineSvrTrack==sng.type) {
|
||||
if (!onlineContext) {
|
||||
QWidget *onlinePage=new QWidget(mainStack);
|
||||
QHBoxLayout *onlineLayout=new QHBoxLayout(onlinePage);
|
||||
int m=onlineLayout->margin()/2;
|
||||
onlineLayout->setMargin(0);
|
||||
onlineLayout->addItem(new QSpacerItem(m, m, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
onlineContext=new OnlineView(onlinePage);
|
||||
onlineLayout->addWidget(onlineContext);
|
||||
mainStack->addWidget(onlinePage);
|
||||
}
|
||||
onlineContext->update(sng);
|
||||
mainStack->setCurrentIndex(1);
|
||||
updateArtist=QString();
|
||||
if (isVisible() && PlayQueueView::BI_Cover==backdropType) {
|
||||
updateBackdrop();
|
||||
}
|
||||
return;
|
||||
}
|
||||
mainStack->setCurrentIndex(0);
|
||||
#endif
|
||||
artist->update(sng);
|
||||
album->update(sng);
|
||||
song->update(sng);
|
||||
|
||||
@@ -46,6 +46,9 @@ class QImage;
|
||||
class QToolButton;
|
||||
class QButtonGroup;
|
||||
class QWheelEvent;
|
||||
#ifdef ENABLE_ONLINE_SERVICES
|
||||
class OnlineView;
|
||||
#endif
|
||||
|
||||
class ViewSelector : public QWidget
|
||||
{
|
||||
@@ -167,7 +170,12 @@ private:
|
||||
QPropertyAnimation animator;
|
||||
int minWidth;
|
||||
bool isWide;
|
||||
QStackedWidget *mainStack;
|
||||
QStackedWidget *stack;
|
||||
QWidget *standardContext;
|
||||
#ifdef ENABLE_ONLINE_SERVICES
|
||||
OnlineView *onlineContext;
|
||||
#endif
|
||||
ThinSplitter *splitter;
|
||||
ViewSelector *viewSelector;
|
||||
BackdropCreator *creator;
|
||||
|
||||
Reference in New Issue
Block a user