1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-01 09:53:57 +02:00
This commit is contained in:
Michael Zanetti
2012-11-26 01:38:34 +01:00
parent 1046b495b6
commit 5f6bccc44b
3 changed files with 25 additions and 0 deletions

View File

@@ -8,6 +8,16 @@ Item {
signal backClicked()
Image {
id: busyIndicator
source: "../images/loading-animation.gif"
anchors.centerIn: parent
height: backButton.height
width: height
visible: rootView.loading
RotationAnimation { target: busyIndicator; from: 360; to: 0; duration: 1500; running: visible; loops: Animation.Infinite }
}
CoverFlip {
id: coverView
anchors.fill: parent
@@ -61,6 +71,7 @@ Item {
spacing: titleText.height * 2
RoundedButton {
id: backButton
text: "<"
height: titleText.height * 3
width: height

View File

@@ -58,6 +58,8 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
connect( m_model, SIGNAL( currentItemChanged(QPersistentModelIndex)), SLOT( currentIndexChanged( QPersistentModelIndex ) ) );
connect( m_model, SIGNAL( loadingStarted() ), SIGNAL(loadingChanged() ) );
connect( m_model, SIGNAL( loadingFinished() ), SIGNAL(loadingChanged() ) );
connect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
connect( m_playlist->generator().data(), SIGNAL( nextTrackGenerated( Tomahawk::query_ptr ) ), this, SLOT( nextTrackGenerated( Tomahawk::query_ptr ) ) );
connect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( onRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ) );
@@ -115,6 +117,11 @@ playlist_ptr DynamicQmlWidget::playlist() const
return m_model->playlist();
}
bool DynamicQmlWidget::loading()
{
return m_model->isLoading();
}
void DynamicQmlWidget::playItem(int index)
{
tDebug() << "playItem called for cover" << index;
@@ -134,6 +141,7 @@ void DynamicQmlWidget::startStationFromArtist(const QString &artist)
void DynamicQmlWidget::startStationFromGenre(const QString &genre)
{
tDebug() << "should start startion from genre" << genre;
m_model->clear();
m_playlist->generator()->startFromGenre( genre );
}

View File

@@ -37,6 +37,7 @@ class DynamicQmlWidget : public QDeclarativeView, public Tomahawk::ViewPage
Q_OBJECT
Q_PROPERTY(QString title READ title)
Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged)
public:
explicit DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent = 0 );
@@ -57,6 +58,11 @@ public:
playlist_ptr playlist() const;
bool loading();
signals:
void loadingChanged();
public slots:
void playItem(int index);
void pause();