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

* Added ViewManager::createPageForList( queries ).

This commit is contained in:
Christian Muehlhaeuser
2013-04-23 15:47:46 +02:00
parent 839197e902
commit c52469ff1f
2 changed files with 24 additions and 0 deletions

View File

@@ -161,6 +161,28 @@ ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
}
FlexibleView*
ViewManager::createPageForList( const QString& title, const QList< query_ptr >& queries )
{
FlexibleView* view = new FlexibleView();
PlaylistModel* model = new PlaylistModel();
PlaylistView* pv = new PlaylistView();
view->setDetailedView( pv );
view->setPixmap( pv->pixmap() );
view->setEmptyTip( tr( "This playlist is empty!" ) );
// We need to set the model on the view before loading the playlist, so spinners & co are connected
view->setPlaylistModel( model );
pv->setPlaylistModel( model );
model->setTitle( title );
model->appendQueries( queries );
return view;
}
playlist_ptr
ViewManager::playlistForPage( ViewPage* page ) const
{

View File

@@ -109,6 +109,8 @@ public:
// linked to the sidebar. call it right after creating the playlist
FlexibleView* createPageForPlaylist( const Tomahawk::playlist_ptr& playlist );
FlexibleView* createPageForList( const QString& title, const QList< Tomahawk::query_ptr >& queries );
bool isTomahawkLoaded() const { return m_loaded; }
signals: