Example #1
0
bool
PlaylistManager::show( const Tomahawk::playlist_ptr& playlist )
{
    PlaylistView* view;
    if ( !m_playlistViews.contains( playlist ) )
    {
        view = new PlaylistView();
        PlaylistModel* model = new PlaylistModel();
        view->setModel( model );
        view->setFrameShape( QFrame::NoFrame );
        view->setAttribute( Qt::WA_MacShowFocusRect, 0 );
        model->loadPlaylist( playlist );
        playlist->resolve();

        m_playlistViews.insert( playlist, view );
    }
    else
    {
        view = m_playlistViews.value( playlist );
    }
    
    setPage( view );
    TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( playlist );
    emit numSourcesChanged( SourceList::instance()->count() );

    return true;
}
Example #2
0
PlaylistView*
ViewManager::createPageForPlaylist( const playlist_ptr& pl )
{
    PlaylistView* view = new PlaylistView();
    PlaylistModel* model = new PlaylistModel();
    view->setPlaylistModel( model );
    model->loadPlaylist( pl );
    pl->resolve();

    m_playlistViews.insert( pl, view );
    return view;
}
Example #3
0
PlaylistViewPage*
ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
{
    PlaylistViewPage* view = new PlaylistViewPage();
    PlaylistModel* model = new PlaylistModel();

    // We need to set the model on the view before loading the playlist, so spinners & co are connected
    view->view()->trackView()->setPlayableModel( model );

    model->loadPlaylist( playlist );
    playlist->resolve();

    return view;
}
Example #4
0
PlaylistView*
ViewManager::createPageForPlaylist( const playlist_ptr& pl )
{
    PlaylistView* view = new PlaylistView();
    PlaylistModel* model = new PlaylistModel();
    view->setPlaylistModel( model );
    model->loadPlaylist( pl );
    view->setFrameShape( QFrame::NoFrame );
    view->setAttribute( Qt::WA_MacShowFocusRect, 0 );
    pl->resolve();

    m_playlistViews.insert( pl, view );
    return view;
}
Example #5
0
FlexibleView*
ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
{
    FlexibleView* view = new FlexibleView();
    PlaylistModel* model = new PlaylistModel();

    PlaylistView* pv = new PlaylistView();
    pv->setPlaylistModel( model );
    view->setDetailedView( pv );
    view->setPixmap( pv->pixmap() );

    model->loadPlaylist( playlist );
    view->setPlayableModel( model );
    playlist->resolve();

    return view;
}
Example #6
0
FlexibleView*
ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
{
    FlexibleView* view = new FlexibleView();
    PlaylistModel* model = new PlaylistModel();

    PlaylistView* pv = new PlaylistView();
    view->setDetailedView( pv );
    view->setPixmap( pv->pixmap() );

    // 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->loadPlaylist( playlist );
    playlist->resolve();

    return view;
}