1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-13 09:34:53 +02:00

* Make global Recently Played a FlexibleView.

This commit is contained in:
Christian Muehlhaeuser
2012-07-14 10:30:21 +02:00
parent d06b0e824d
commit e21f2a5e87

View File

@@ -408,18 +408,19 @@ ViewManager::showRecentPlaysPage()
{ {
if ( !m_recentPlaysWidget ) if ( !m_recentPlaysWidget )
{ {
PlaylistView* pv = new PlaylistView( m_widget ); FlexibleView* pv = new FlexibleView( m_widget );
pv->setPixmap( QPixmap( RESPATH "images/recently-played.png" ) );
RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv ); RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv );
raModel->setTitle( tr( "Recently Played Tracks" ) ); raModel->setTitle( tr( "Recently Played Tracks" ) );
raModel->setDescription( tr( "Recently played tracks from all your friends" ) ); raModel->setDescription( tr( "Recently played tracks from all your friends" ) );
pv->proxyModel()->setStyle( PlayableProxyModel::Large );
PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv, pv->proxyModel() ); PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv->trackView(), pv->trackView()->proxyModel() );
connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv, SLOT( update( QModelIndex ) ) ); connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv->trackView(), SLOT( update( QModelIndex ) ) );
pv->setItemDelegate( del ); pv->trackView()->setItemDelegate( del );
pv->setPlaylistModel( raModel ); pv->setPlayableModel( raModel );
pv->setEmptyTip( tr( "Sorry, we could not find any recent plays!" ) );
raModel->setSource( source_ptr() ); raModel->setSource( source_ptr() );
m_recentPlaysWidget = pv; m_recentPlaysWidget = pv;