1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-19 15:37:01 +01:00

* Adjust to new ViewPage interface.

This commit is contained in:
Christian Muehlhaeuser 2012-07-04 04:56:21 +02:00
parent c99cfe54ed
commit 1309334f99
17 changed files with 9 additions and 45 deletions

View File

@ -96,7 +96,6 @@ ViewManager::ViewManager( QObject* parent )
m_superCollectionView->proxyModel()->setStyle( PlayableProxyModel::Collection );
m_superCollectionModel = new TreeModel( m_superCollectionView );
m_superCollectionView->setTreeModel( m_superCollectionModel );
m_superCollectionView->setShowModes( false );
// m_superCollectionView->proxyModel()->setShowOfflineResults( false );
m_stack->setContentsMargins( 0, 0, 0, 0 );
@ -657,11 +656,6 @@ ViewManager::updateView()
emit filterAvailable( currentPage()->showFilter() );
/* if ( !currentPage()->showStatsBar() && !currentPage()->showModes() && !currentPage()->showFilter() )
m_topbar->setVisible( false );
else
m_topbar->setVisible( true );*/
m_infobar->setVisible( currentPage()->showInfoBar() );
m_infobar->setCaption( currentPage()->title() );
m_infobar->setUpdaters( currentPage()->updaters() );

View File

@ -31,7 +31,8 @@ class DLLEXPORT CustomPlaylistView : public PlaylistView
{
Q_OBJECT
public:
enum PlaylistType {
enum PlaylistType
{
SourceLovedTracks,
TopLovedTracks
};
@ -40,7 +41,6 @@ public:
virtual ~CustomPlaylistView();
virtual bool showFilter() const { return true; }
virtual bool showStatsBar() const { return false; }
virtual QString title() const;
virtual QPixmap pixmap() const;

View File

@ -47,12 +47,7 @@ public:
virtual QString description() const;
virtual QPixmap pixmap() const;
virtual bool showStatsBar() const { return false; }
virtual bool showFilter() const { return true; }
// virtual void setShowModes( bool b ) { m_showModes = b; }
virtual bool showModes() const { return false; }
virtual bool setFilter( const QString& filter );
virtual bool jumpToCurrentTrack();

View File

@ -69,8 +69,6 @@ public:
virtual QString title() const { return m_model->title(); }
virtual QString description() const { return m_model->description(); }
virtual bool showModes() const { return true; }
virtual bool setFilter( const QString& filter );
virtual bool jumpToCurrentTrack() { return false; }

View File

@ -69,9 +69,7 @@ public:
virtual QString description() const;
virtual QPixmap pixmap() const;
virtual bool showModes() const { return true; }
virtual bool showFilter() const { return true; }
virtual bool setFilter( const QString& filter );
virtual bool jumpToCurrentTrack();

View File

@ -54,7 +54,6 @@ TreeView::TreeView( QWidget* parent )
, m_loadingSpinner( new LoadingSpinner( this ) )
, m_updateContextView( true )
, m_contextMenu( new ContextMenu( this ) )
, m_showModes( true )
{
setFrameShape( QFrame::NoFrame );
setAttribute( Qt::WA_MacShowFocusRect, 0 );

View File

@ -70,12 +70,7 @@ public:
virtual QString description() const { return m_model->description(); }
virtual QPixmap pixmap() const { return m_model->icon(); }
virtual bool showStatsBar() const { return false; }
virtual bool showFilter() const { return true; }
virtual void setShowModes( bool b ) { m_showModes = b; }
virtual bool showModes() const { return m_showModes; }
virtual bool setFilter( const QString& filter );
virtual bool jumpToCurrentTrack();
@ -128,7 +123,6 @@ private:
Tomahawk::ContextMenu* m_contextMenu;
QString m_emptyTip;
bool m_showModes;
QTimer m_timer;
mutable QString m_guid;
};

View File

@ -50,8 +50,6 @@ public:
virtual QString title() const { return tr( "Create a new playlist" ); }
virtual QString description() const { return QString(); }
virtual bool showStatsBar() const { return false; }
virtual bool jumpToCurrentTrack() { return false; }
protected:

View File

@ -71,11 +71,10 @@ public:
virtual QString title() const { return tr( "New Releases" ); }
virtual QString description() const { return QString(); }
virtual bool showStatsBar() const { return false; }
virtual bool showInfoBar() const { return false; }
virtual bool isBeingPlayed() const;
virtual bool jumpToCurrentTrack();
virtual bool isBeingPlayed() const;
protected:
void changeEvent( QEvent* e );

View File

@ -49,13 +49,12 @@ public:
virtual QWidget* widget() { return this; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
virtual bool isTemporaryPage() const { return true; }
virtual QString title() const { return QString( tr( "Search: %1" ) ).arg( m_search ); }
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/search-icon.png" ); }
virtual bool showStatsBar() const { return false; }
virtual bool isTemporaryPage() const { return true; }
virtual bool jumpToCurrentTrack();

View File

@ -62,9 +62,6 @@ public:
virtual QString description() const { return m_description; }
virtual QString longDescription() const { return m_longDescription; }
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
virtual bool showStatsBar() const { return false; }
virtual bool jumpToCurrentTrack() { return false; }
signals:

View File

@ -73,7 +73,7 @@ public:
PlaylistWidget( QWidget* parent = 0 );
OverlayWidget* overlay() const { return m_overlay; }
virtual void setModel( QAbstractItemModel* model );
signals:
@ -98,11 +98,10 @@ public:
virtual QString title() const { return tr( "Welcome to Tomahawk" ); }
virtual QString description() const { return QString(); }
virtual bool showStatsBar() const { return false; }
virtual bool showInfoBar() const { return false; }
virtual bool isBeingPlayed() const;
virtual bool jumpToCurrentTrack();
virtual bool isBeingPlayed() const;
protected:
void changeEvent( QEvent* e );

View File

@ -69,11 +69,10 @@ public:
virtual QString title() const { return tr( "Charts" ); }
virtual QString description() const { return QString(); }
virtual bool showStatsBar() const { return false; }
virtual bool showInfoBar() const { return false; }
virtual bool isBeingPlayed() const;
virtual bool jumpToCurrentTrack();
virtual bool isBeingPlayed() const;
protected:
void changeEvent( QEvent* e );

View File

@ -68,10 +68,9 @@ public:
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
virtual bool isTemporaryPage() const { return true; }
virtual bool showStatsBar() const { return false; }
virtual bool isBeingPlayed() const;
virtual bool jumpToCurrentTrack() { return false; }
virtual bool isBeingPlayed() const;
public slots:
/** \brief Loads information for a given album.

View File

@ -77,7 +77,6 @@ public:
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
virtual bool isTemporaryPage() const { return true; }
virtual bool showStatsBar() const { return false; }
virtual bool showInfoBar() const { return false; }
virtual bool jumpToCurrentTrack();

View File

@ -52,8 +52,6 @@ public:
virtual QString description() const { return m_description; }
virtual QPixmap pixmap() const { return m_pixmap; }
virtual bool showStatsBar() const { return false; }
virtual bool jumpToCurrentTrack() { return false; }
protected:

View File

@ -64,12 +64,11 @@ public:
virtual QString longDescription() const { return QString(); }
virtual QPixmap pixmap() const { if ( m_pixmap.isNull() ) return Tomahawk::ViewPage::pixmap(); else return m_pixmap; }
virtual bool isBeingPlayed() const;
virtual bool isTemporaryPage() const { return true; }
virtual bool showStatsBar() const { return false; }
virtual bool showInfoBar() const { return false; }
virtual bool jumpToCurrentTrack() { return false; }
virtual bool isBeingPlayed() const;
public slots:
void load( const Tomahawk::query_ptr& query );