mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
* Turn Latest Additions into a FlexibleView.
This commit is contained in:
@@ -509,12 +509,10 @@ SourceItem::latestAdditionsClicked()
|
|||||||
{
|
{
|
||||||
if ( !m_latestAdditionsPage )
|
if ( !m_latestAdditionsPage )
|
||||||
{
|
{
|
||||||
TrackView* cv = new TrackView( ViewManager::instance()->widget() );
|
FlexibleView* pv = new FlexibleView( ViewManager::instance()->widget() );
|
||||||
cv->setFrameShape( QFrame::NoFrame );
|
pv->setPixmap( QPixmap( RESPATH "images/new-additions.png" ) );
|
||||||
cv->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
|
||||||
|
|
||||||
RecentlyAddedModel* raModel = new RecentlyAddedModel( cv );
|
RecentlyAddedModel* raModel = new RecentlyAddedModel( pv );
|
||||||
cv->proxyModel()->setStyle( PlayableProxyModel::Large );
|
|
||||||
raModel->setTitle( tr( "Latest Additions" ) );
|
raModel->setTitle( tr( "Latest Additions" ) );
|
||||||
|
|
||||||
if ( m_source->isLocal() )
|
if ( m_source->isLocal() )
|
||||||
@@ -522,17 +520,17 @@ SourceItem::latestAdditionsClicked()
|
|||||||
else
|
else
|
||||||
raModel->setDescription( tr( "Latest additions to %1's collection" ).arg( m_source->friendlyName() ) );
|
raModel->setDescription( tr( "Latest additions to %1's collection" ).arg( m_source->friendlyName() ) );
|
||||||
|
|
||||||
PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::LatestAdditions, cv, cv->proxyModel() );
|
PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::LatestAdditions, pv->trackView(), pv->trackView()->proxyModel() );
|
||||||
connect( del, SIGNAL( updateIndex( QModelIndex ) ), cv, SLOT( update( QModelIndex ) ) );
|
connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv->trackView(), SLOT( update( QModelIndex ) ) );
|
||||||
cv->setItemDelegate( del );
|
pv->trackView()->setItemDelegate( del );
|
||||||
|
|
||||||
cv->setPlayableModel( raModel );
|
|
||||||
cv->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
|
|
||||||
cv->setEmptyTip( tr( "Sorry, we could not find any recent additions!" ) );
|
|
||||||
|
|
||||||
|
pv->setPlayableModel( raModel );
|
||||||
|
pv->trackView()->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
|
||||||
|
pv->detailedView()->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
|
||||||
|
pv->setEmptyTip( tr( "Sorry, we could not find any recent additions!" ) );
|
||||||
raModel->setSource( m_source );
|
raModel->setSource( m_source );
|
||||||
|
|
||||||
m_latestAdditionsPage = cv;
|
m_latestAdditionsPage = pv;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewManager::instance()->show( m_latestAdditionsPage );
|
ViewManager::instance()->show( m_latestAdditionsPage );
|
||||||
|
Reference in New Issue
Block a user