mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 15:16:34 +02:00
* Added ViewManager::createPageForList( queries ).
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user