mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
* Show loading spinner when loading charts.
This commit is contained in:
@@ -263,6 +263,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
|
|||||||
TreeModel* artistsModel = new TreeModel( ui->artistsViewLeft );
|
TreeModel* artistsModel = new TreeModel( ui->artistsViewLeft );
|
||||||
artistsModel->setMode( InfoSystemMode );
|
artistsModel->setMode( InfoSystemMode );
|
||||||
artistsModel->setStyle( PlayableModel::Collection );
|
artistsModel->setStyle( PlayableModel::Collection );
|
||||||
|
artistsModel->startLoading();
|
||||||
|
|
||||||
m_artistModels[ chartId ] = artistsModel;
|
m_artistModels[ chartId ] = artistsModel;
|
||||||
|
|
||||||
@@ -277,6 +278,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
|
|||||||
connect( loader, SIGNAL( albums( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ), this, SLOT( chartAlbumsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ) );
|
connect( loader, SIGNAL( albums( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ), this, SLOT( chartAlbumsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::album_ptr > ) ) );
|
||||||
|
|
||||||
PlayableModel* albumModel = new PlayableModel( ui->albumsView );
|
PlayableModel* albumModel = new PlayableModel( ui->albumsView );
|
||||||
|
albumModel->startLoading();
|
||||||
|
|
||||||
m_albumModels[ chartId ] = albumModel;
|
m_albumModels[ chartId ] = albumModel;
|
||||||
|
|
||||||
@@ -292,6 +294,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
|
|||||||
|
|
||||||
PlaylistModel* trackModel = new PlaylistModel( ui->tracksViewLeft );
|
PlaylistModel* trackModel = new PlaylistModel( ui->tracksViewLeft );
|
||||||
trackModel->setStyle( PlayableModel::Large );
|
trackModel->setStyle( PlayableModel::Large );
|
||||||
|
trackModel->startLoading();
|
||||||
|
|
||||||
m_trackModels[ chartId ] = trackModel;
|
m_trackModels[ chartId ] = trackModel;
|
||||||
|
|
||||||
@@ -486,6 +489,7 @@ WhatsHotWidget::chartArtistsLoaded( ChartDataLoader* loader, const QList< artist
|
|||||||
foreach( const artist_ptr& artist, artists )
|
foreach( const artist_ptr& artist, artists )
|
||||||
{
|
{
|
||||||
m_artistModels[ chartId ]->addArtists( artist );
|
m_artistModels[ chartId ]->addArtists( artist );
|
||||||
|
m_artistModels[ chartId ]->finishLoading();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,7 +501,6 @@ WhatsHotWidget::chartArtistsLoaded( ChartDataLoader* loader, const QList< artist
|
|||||||
void
|
void
|
||||||
WhatsHotWidget::chartTracksLoaded( ChartDataLoader* loader, const QList< query_ptr >& tracks )
|
WhatsHotWidget::chartTracksLoaded( ChartDataLoader* loader, const QList< query_ptr >& tracks )
|
||||||
{
|
{
|
||||||
|
|
||||||
QString chartId = loader->property( "chartid" ).toString();
|
QString chartId = loader->property( "chartid" ).toString();
|
||||||
Q_ASSERT( m_trackModels.contains( chartId ) );
|
Q_ASSERT( m_trackModels.contains( chartId ) );
|
||||||
|
|
||||||
@@ -505,6 +508,7 @@ WhatsHotWidget::chartTracksLoaded( ChartDataLoader* loader, const QList< query_p
|
|||||||
{
|
{
|
||||||
Pipeline::instance()->resolve( tracks );
|
Pipeline::instance()->resolve( tracks );
|
||||||
m_trackModels[ chartId ]->append( tracks );
|
m_trackModels[ chartId ]->append( tracks );
|
||||||
|
m_trackModels[ chartId ]->finishLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_workers.remove( loader );
|
m_workers.remove( loader );
|
||||||
@@ -519,7 +523,10 @@ WhatsHotWidget::chartAlbumsLoaded( ChartDataLoader* loader, const QList< album_p
|
|||||||
Q_ASSERT( m_albumModels.contains( chartId ) );
|
Q_ASSERT( m_albumModels.contains( chartId ) );
|
||||||
|
|
||||||
if ( m_albumModels.contains( chartId ) )
|
if ( m_albumModels.contains( chartId ) )
|
||||||
|
{
|
||||||
m_albumModels[ chartId ]->append( albums );
|
m_albumModels[ chartId ]->append( albums );
|
||||||
|
m_albumModels[ chartId ]->finishLoading();
|
||||||
|
}
|
||||||
|
|
||||||
m_workers.remove( loader );
|
m_workers.remove( loader );
|
||||||
loader->deleteLater();
|
loader->deleteLater();
|
||||||
|
Reference in New Issue
Block a user