Beispiel #1
0
Tomahawk::ViewPage*
ViewManager::showRecentPlaysPage()
{
    if ( !m_recentPlaysWidget )
    {
        FlexibleView* pv = new FlexibleView( m_widget );
        pv->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );

        RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv );
        raModel->setTitle( tr( "Recently Played Tracks" ) );
        raModel->setDescription( tr( "Recently played tracks from all your friends" ) );

        PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv->trackView(), pv->trackView()->proxyModel() );
        connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv->trackView(), SLOT( update( QModelIndex ) ) );
        pv->trackView()->setItemDelegate( del );

        pv->setPlayableModel( raModel );
        pv->setEmptyTip( tr( "Sorry, we could not find any recent plays!" ) );
        raModel->setSource( source_ptr() );

        pv->setGuid( "recentlyplayed" );

        m_recentPlaysWidget = pv;
    }

    return show( m_recentPlaysWidget );
}
Beispiel #2
0
Tomahawk::ViewPage*
ViewManager::showRecentPlaysPage()
{
    if ( !m_recentPlaysWidget )
    {
        PlaylistView* pv = new PlaylistView( m_widget );
        pv->setFrameShape( QFrame::NoFrame );
        pv->setAttribute( Qt::WA_MacShowFocusRect, 0 );

        RecentlyPlayedModel* raModel = new RecentlyPlayedModel( source_ptr(), pv );
        raModel->setTitle( tr( "Recently Played Tracks" ) );
        raModel->setDescription( tr( "Recently played tracks from all your friends" ) );
        raModel->setStyle( TrackModel::Large );

        PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv, pv->proxyModel() );
        connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv, SLOT( update( QModelIndex ) ) );
        pv->setItemDelegate( del );

        pv->setPlaylistModel( raModel );

        m_recentPlaysWidget = pv;
    }

    return show( m_recentPlaysWidget );
}
Beispiel #3
0
Tomahawk::ViewPage*
ViewManager::showRecentPlaysPage()
{
    if ( !m_recentPlaysWidget )
    {
        PlaylistView* pv = new PlaylistView( m_widget );
        pv->setFrameShape( QFrame::NoFrame );
        pv->setAttribute( Qt::WA_MacShowFocusRect, 0 );

        RecentlyPlayedModel* raModel = new RecentlyPlayedModel( source_ptr(), pv );
        raModel->setStyle( TrackModel::Large );

        pv->setItemDelegate( new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv, pv->proxyModel() ) );
        pv->setPlaylistModel( raModel );

        m_recentPlaysWidget = pv;
    }

    return show( m_recentPlaysWidget );
}