1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

Fetches artistdata from infosystem

This commit is contained in:
Hugo Lindström
2012-01-11 01:22:22 +01:00
parent d6a533527e
commit 82a2ff900b
2 changed files with 9 additions and 8 deletions

View File

@@ -57,8 +57,8 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
{ {
ui->setupUi( this ); ui->setupUi( this );
ui->additionsView->setFrameShape( QFrame::NoFrame ); ui->albumsView->setFrameShape( QFrame::NoFrame );
ui->additionsView->setAttribute( Qt::WA_MacShowFocusRect, 0 ); ui->albumsView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
TomahawkUtils::unmarginLayout( layout() ); TomahawkUtils::unmarginLayout( layout() );
TomahawkUtils::unmarginLayout( ui->stackLeft->layout() ); TomahawkUtils::unmarginLayout( ui->stackLeft->layout() );
@@ -91,7 +91,7 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
ui->artistsViewLeft->setAttribute( Qt::WA_MacShowFocusRect, 0 ); ui->artistsViewLeft->setAttribute( Qt::WA_MacShowFocusRect, 0 );
ui->artistsViewLeft->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); ui->artistsViewLeft->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->artistsViewLeft->header()->setVisible( false ); ui->artistsViewLeft->header()->setVisible( true );
m_playlistInterface = Tomahawk::playlistinterface_ptr( new ChartsPlaylistInterface( this ) ); m_playlistInterface = Tomahawk::playlistinterface_ptr( new ChartsPlaylistInterface( this ) );
@@ -257,7 +257,8 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
connect( loader, SIGNAL( artists( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ), this, SLOT( chartArtistsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ) ); connect( loader, SIGNAL( artists( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ), this, SLOT( chartArtistsLoaded( Tomahawk::ChartDataLoader*, QList< Tomahawk::artist_ptr > ) ) );
TreeModel* artistsModel = new TreeModel( ui->artistsViewLeft ); TreeModel* artistsModel = new TreeModel( ui->artistsViewLeft );
artistsModel->setColumnStyle( TreeModel::TrackOnly ); artistsModel->setMode( InfoSystemMode );
artistsModel->setColumnStyle( TreeModel::AllColumns );
m_artistModels[ chartId ] = artistsModel; m_artistModels[ chartId ] = artistsModel;
@@ -272,7 +273,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 > ) ) );
AlbumModel* albumModel = new AlbumModel( ui->additionsView ); AlbumModel* albumModel = new AlbumModel( ui->albumsView );
m_albumModels[ chartId ] = albumModel; m_albumModels[ chartId ] = albumModel;
@@ -448,8 +449,8 @@ WhatsHotWidget::parseNode( QStandardItem* parentItem, const QString &label, cons
void void
WhatsHotWidget::setLeftViewAlbums( AlbumModel* model ) WhatsHotWidget::setLeftViewAlbums( AlbumModel* model )
{ {
ui->additionsView->setAlbumModel( model ); ui->albumsView->setAlbumModel( model );
ui->additionsView->proxyModel()->sort( -1 ); // disable sorting, must be called after artistsViewLeft->setTreeModel ui->albumsView->proxyModel()->sort( -1 ); // disable sorting, must be called after artistsViewLeft->setTreeModel
ui->stackLeft->setCurrentIndex( 2 ); ui->stackLeft->setCurrentIndex( 2 );
} }

View File

@@ -47,7 +47,7 @@
<widget class="QWidget" name="page2"> <widget class="QWidget" name="page2">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="AlbumView" name="additionsView"> <widget class="AlbumView" name="albumsView">
<property name="dragEnabled"> <property name="dragEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>