1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* ArtistView now uses LoadingSpinner and new OverlayWidget.

This commit is contained in:
Christian Muehlhaeuser
2012-05-31 21:33:52 +02:00
parent 3e8d131c16
commit 2860bfc704
2 changed files with 7 additions and 6 deletions

View File

@@ -51,8 +51,7 @@ ArtistView::ArtistView( QWidget* parent )
, m_overlay( new OverlayWidget( this ) ) , m_overlay( new OverlayWidget( this ) )
, m_model( 0 ) , m_model( 0 )
, m_proxyModel( 0 ) , m_proxyModel( 0 )
// , m_delegate( 0 ) , m_loadingSpinner( new LoadingSpinner( this ) )
, m_loadingSpinner( new AnimatedSpinner( this ) )
, m_updateContextView( true ) , m_updateContextView( true )
, m_contextMenu( new ContextMenu( this ) ) , m_contextMenu( new ContextMenu( this ) )
, m_showModes( true ) , m_showModes( true )
@@ -137,8 +136,6 @@ ArtistView::setTreeModel( TreeModel* model )
m_proxyModel->sort( 0 ); m_proxyModel->sort( 0 );
} }
connect( m_model, SIGNAL( loadingStarted() ), m_loadingSpinner, SLOT( fadeIn() ) );
connect( m_model, SIGNAL( loadingFinished() ), m_loadingSpinner, SLOT( fadeOut() ) );
connect( m_proxyModel, SIGNAL( filteringStarted() ), SLOT( onFilteringStarted() ) ); connect( m_proxyModel, SIGNAL( filteringStarted() ), SLOT( onFilteringStarted() ) );
connect( m_proxyModel, SIGNAL( filteringFinished() ), m_loadingSpinner, SLOT( fadeOut() ) ); connect( m_proxyModel, SIGNAL( filteringFinished() ), m_loadingSpinner, SLOT( fadeOut() ) );
@@ -148,7 +145,7 @@ ArtistView::setTreeModel( TreeModel* model )
guid(); // this will set the guid on the header guid(); // this will set the guid on the header
if ( model->columnStyle() == TreeModel::TrackOnly ) if ( model->style() == PlayableModel::Large )
{ {
setHeaderHidden( true ); setHeaderHidden( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
@@ -158,6 +155,8 @@ ArtistView::setTreeModel( TreeModel* model )
setHeaderHidden( false ); setHeaderHidden( false );
setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded ); setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
} }
emit modelChanged();
} }

View File

@@ -83,6 +83,9 @@ public:
public slots: public slots:
void onItemActivated( const QModelIndex& index ); void onItemActivated( const QModelIndex& index );
signals:
void modelChanged();
protected: protected:
virtual void startDrag( Qt::DropActions supportedActions ); virtual void startDrag( Qt::DropActions supportedActions );
virtual void resizeEvent( QResizeEvent* event ); virtual void resizeEvent( QResizeEvent* event );
@@ -107,7 +110,6 @@ private:
OverlayWidget* m_overlay; OverlayWidget* m_overlay;
TreeModel* m_model; TreeModel* m_model;
TreeProxyModel* m_proxyModel; TreeProxyModel* m_proxyModel;
// PlaylistItemDelegate* m_delegate;
AnimatedSpinner* m_loadingSpinner; AnimatedSpinner* m_loadingSpinner;
bool m_updateContextView; bool m_updateContextView;