mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 23:39:42 +01:00
* Renamed FlexibleView to PlaylistViewPage.
This commit is contained in:
parent
e52b55943d
commit
f8fd06a2db
@ -40,7 +40,7 @@ set( libGuiSources
|
||||
playlist/InboxModel.cpp
|
||||
playlist/InboxView.cpp
|
||||
playlist/ContextView.cpp
|
||||
playlist/FlexibleView.cpp
|
||||
playlist/PlaylistViewPage.cpp
|
||||
playlist/FlexibleTreeView.cpp
|
||||
playlist/TreeModel.cpp
|
||||
playlist/TreeProxyModel.cpp
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "infobar/InfoBar.h"
|
||||
|
||||
#include "playlist/FlexibleView.h"
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
#include "playlist/ContextView.h"
|
||||
#include "playlist/FlexibleTreeView.h"
|
||||
#include "playlist/TreeModel.h"
|
||||
@ -128,10 +128,10 @@ ViewManager::~ViewManager()
|
||||
}
|
||||
|
||||
|
||||
FlexibleView*
|
||||
PlaylistViewPage*
|
||||
ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
|
||||
{
|
||||
FlexibleView* view = new FlexibleView();
|
||||
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
|
||||
@ -144,10 +144,10 @@ ViewManager::createPageForPlaylist( const playlist_ptr& playlist )
|
||||
}
|
||||
|
||||
|
||||
FlexibleView*
|
||||
PlaylistViewPage*
|
||||
ViewManager::createPageForList( const QString& title, const QList< query_ptr >& queries )
|
||||
{
|
||||
FlexibleView* view = new FlexibleView();
|
||||
PlaylistViewPage* view = new PlaylistViewPage();
|
||||
PlaylistModel* model = new PlaylistModel();
|
||||
|
||||
view->setTemporaryPage( true );
|
||||
@ -167,7 +167,7 @@ ViewManager::playlistForPage( ViewPage* page ) const
|
||||
{
|
||||
playlist_ptr p;
|
||||
|
||||
FlexibleView* fv = dynamic_cast< FlexibleView* >( page );
|
||||
PlaylistViewPage* fv = dynamic_cast< PlaylistViewPage* >( page );
|
||||
if ( fv && fv->view()->trackView()->model() )
|
||||
{
|
||||
PlaylistModel* m = dynamic_cast< PlaylistModel* >( fv->view()->trackView()->model() );
|
||||
@ -189,7 +189,7 @@ ViewManager::show( const Tomahawk::playlist_ptr& playlist )
|
||||
if ( !playlist->loaded() )
|
||||
playlist->loadRevision();
|
||||
|
||||
FlexibleView* view;
|
||||
PlaylistViewPage* view;
|
||||
|
||||
if ( !m_playlistViews.contains( playlist ) || m_playlistViews.value( playlist ).isNull() )
|
||||
{
|
||||
@ -741,7 +741,7 @@ ViewManager::currentPage() const
|
||||
Tomahawk::playlist_ptr
|
||||
ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
foreach ( QPointer<FlexibleView> view, m_playlistViews.values() )
|
||||
foreach ( QPointer<PlaylistViewPage> view, m_playlistViews.values() )
|
||||
{
|
||||
if ( !view.isNull() && view.data()->playlistInterface() == interface )
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ class AlbumInfoWidget;
|
||||
class ArtistInfoWidget;
|
||||
class TreeWidget;
|
||||
class CollectionModel;
|
||||
class FlexibleView;
|
||||
class PlaylistViewPage;
|
||||
class FlexibleTreeView;
|
||||
class PlaylistModel;
|
||||
class TrackProxyModel;
|
||||
@ -100,15 +100,15 @@ public:
|
||||
Tomahawk::ViewPage* pageForPlaylist( const Tomahawk::playlist_ptr& pl ) const;
|
||||
Tomahawk::ViewPage* pageForDynPlaylist( const Tomahawk::dynplaylist_ptr& pl ) const;
|
||||
|
||||
/// Get a playlist (or dynamic playlist ) from a ViewPage* if the page is FlexibleView or DynamicWidget.
|
||||
/// Get a playlist (or dynamic playlist ) from a ViewPage* if the page is PlaylistViewPage or DynamicWidget.
|
||||
/// Lives here but used by SourcesModel
|
||||
Tomahawk::playlist_ptr playlistForPage( Tomahawk::ViewPage* ) const;
|
||||
|
||||
// only use this is you need to create a playlist and show it directly and want it to be
|
||||
// linked to the sidebar. call it right after creating the playlist
|
||||
FlexibleView* createPageForPlaylist( const Tomahawk::playlist_ptr& playlist );
|
||||
PlaylistViewPage* createPageForPlaylist( const Tomahawk::playlist_ptr& playlist );
|
||||
|
||||
FlexibleView* createPageForList( const QString& title, const QList< Tomahawk::query_ptr >& queries );
|
||||
PlaylistViewPage* createPageForList( const QString& title, const QList< Tomahawk::query_ptr >& queries );
|
||||
|
||||
void addDynamicPage( Tomahawk::ViewPagePlugin* viewPage, const QString& pageName = QString() );
|
||||
|
||||
@ -194,7 +194,7 @@ private:
|
||||
QHash< Tomahawk::artist_ptr, QPointer<ArtistInfoWidget> > m_artistViews;
|
||||
QHash< Tomahawk::album_ptr, QPointer<AlbumInfoWidget> > m_albumViews;
|
||||
QHash< Tomahawk::query_ptr, QPointer<TrackInfoWidget> > m_trackViews;
|
||||
QHash< Tomahawk::playlist_ptr, QPointer<FlexibleView> > m_playlistViews;
|
||||
QHash< Tomahawk::playlist_ptr, QPointer<PlaylistViewPage> > m_playlistViews;
|
||||
QHash< Tomahawk::source_ptr, QPointer<SourceInfoWidget> > m_sourceViews;
|
||||
|
||||
QList<Tomahawk::ViewPage*> m_pageHistoryBack;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
|
||||
InboxView::InboxView( QWidget* parent ) :
|
||||
TrackView( parent )
|
||||
{
|
||||
@ -76,8 +77,8 @@ InboxView::onMenuTriggered( int action )
|
||||
}
|
||||
|
||||
|
||||
InboxPage::InboxPage( QWidget* parent ) :
|
||||
FlexibleView( parent )
|
||||
InboxPage::InboxPage( QWidget* parent )
|
||||
: PlaylistViewPage( parent )
|
||||
{
|
||||
view()->setCaption( tr( "Inbox Details" ) );
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define INBOXVIEW_H
|
||||
|
||||
#include "TrackView.h"
|
||||
#include "FlexibleView.h"
|
||||
#include "PlaylistViewPage.h"
|
||||
|
||||
class InboxView : public TrackView
|
||||
{
|
||||
@ -39,7 +39,7 @@ public slots:
|
||||
virtual void onMenuTriggered( int action );
|
||||
};
|
||||
|
||||
class InboxPage : public FlexibleView
|
||||
class InboxPage : public PlaylistViewPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "FlexibleView.h"
|
||||
#include "PlaylistViewPage.h"
|
||||
|
||||
#include <QRadioButton>
|
||||
#include <QStackedWidget>
|
||||
@ -33,7 +33,7 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
||||
FlexibleView::FlexibleView( QWidget* parent, QWidget* extraHeader )
|
||||
PlaylistViewPage::PlaylistViewPage( QWidget* parent, QWidget* extraHeader )
|
||||
: QWidget( parent )
|
||||
, m_header( new FilterHeader( this ) )
|
||||
, m_view( new ContextView( this ) )
|
||||
@ -56,49 +56,49 @@ FlexibleView::FlexibleView( QWidget* parent, QWidget* extraHeader )
|
||||
}
|
||||
|
||||
|
||||
FlexibleView::~FlexibleView()
|
||||
PlaylistViewPage::~PlaylistViewPage()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
|
||||
Tomahawk::playlistinterface_ptr
|
||||
FlexibleView::playlistInterface() const
|
||||
PlaylistViewPage::playlistInterface() const
|
||||
{
|
||||
return m_view->playlistInterface();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
FlexibleView::title() const
|
||||
PlaylistViewPage::title() const
|
||||
{
|
||||
return m_view->trackView()->title();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
FlexibleView::description() const
|
||||
PlaylistViewPage::description() const
|
||||
{
|
||||
return m_view->trackView()->description();
|
||||
}
|
||||
|
||||
|
||||
QPixmap
|
||||
FlexibleView::pixmap() const
|
||||
PlaylistViewPage::pixmap() const
|
||||
{
|
||||
return m_pixmap;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleView::jumpToCurrentTrack()
|
||||
PlaylistViewPage::jumpToCurrentTrack()
|
||||
{
|
||||
return m_view->jumpToCurrentTrack();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleView::setFilter( const QString& pattern )
|
||||
PlaylistViewPage::setFilter( const QString& pattern )
|
||||
{
|
||||
ViewPage::setFilter( pattern );
|
||||
|
||||
@ -107,7 +107,7 @@ FlexibleView::setFilter( const QString& pattern )
|
||||
|
||||
|
||||
void
|
||||
FlexibleView::setPixmap( const QPixmap& pixmap )
|
||||
PlaylistViewPage::setPixmap( const QPixmap& pixmap )
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
m_header->setPixmap( pixmap );
|
||||
@ -115,7 +115,7 @@ FlexibleView::setPixmap( const QPixmap& pixmap )
|
||||
|
||||
|
||||
void
|
||||
FlexibleView::onModelChanged()
|
||||
PlaylistViewPage::onModelChanged()
|
||||
{
|
||||
m_header->setCaption( m_view->trackView()->model()->title() );
|
||||
m_header->setDescription( m_view->trackView()->model()->description() );
|
||||
@ -123,7 +123,7 @@ FlexibleView::onModelChanged()
|
||||
|
||||
|
||||
void
|
||||
FlexibleView::onWidgetDestroyed( QWidget* widget )
|
||||
PlaylistViewPage::onWidgetDestroyed( QWidget* widget )
|
||||
{
|
||||
Q_UNUSED( widget );
|
||||
emit destroyed( this );
|
||||
@ -131,28 +131,28 @@ FlexibleView::onWidgetDestroyed( QWidget* widget )
|
||||
|
||||
|
||||
bool
|
||||
FlexibleView::isTemporaryPage() const
|
||||
PlaylistViewPage::isTemporaryPage() const
|
||||
{
|
||||
return m_temporary;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FlexibleView::setTemporaryPage( bool b )
|
||||
PlaylistViewPage::setTemporaryPage( bool b )
|
||||
{
|
||||
m_temporary = b;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FlexibleView::isBeingPlayed() const
|
||||
PlaylistViewPage::isBeingPlayed() const
|
||||
{
|
||||
return m_view->isBeingPlayed();
|
||||
}
|
||||
|
||||
|
||||
ContextView*
|
||||
FlexibleView::view() const
|
||||
PlaylistViewPage::view() const
|
||||
{
|
||||
return m_view;
|
||||
}
|
@ -16,8 +16,8 @@
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef FLEXIBLEVIEW_H
|
||||
#define FLEXIBLEVIEW_H
|
||||
#ifndef PLAYLISTVIEWPAGE_H
|
||||
#define PLAYLISTVIEWPAGE_H
|
||||
|
||||
#include "ViewPage.h"
|
||||
#include "PlaylistInterface.h"
|
||||
@ -28,13 +28,13 @@ class QStackedWidget;
|
||||
class ContextView;
|
||||
class FilterHeader;
|
||||
|
||||
class DLLEXPORT FlexibleView : public QWidget, public Tomahawk::ViewPage
|
||||
class DLLEXPORT PlaylistViewPage : public QWidget, public Tomahawk::ViewPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FlexibleView( QWidget* parent = 0, QWidget* extraHeader = 0 );
|
||||
~FlexibleView();
|
||||
explicit PlaylistViewPage( QWidget* parent = 0, QWidget* extraHeader = 0 );
|
||||
~PlaylistViewPage();
|
||||
|
||||
virtual QWidget* widget() { return this; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||
@ -70,4 +70,4 @@ private:
|
||||
bool m_temporary;
|
||||
};
|
||||
|
||||
#endif // FLEXIBLEVIEW_H
|
||||
#endif // PLAYLISTVIEWPAGE_H
|
@ -34,7 +34,7 @@ using namespace Tomahawk;
|
||||
|
||||
|
||||
QueueView::QueueView( QWidget* parent )
|
||||
: FlexibleView( parent )
|
||||
: PlaylistViewPage( parent )
|
||||
{
|
||||
view()->setCaption( tr( "Queue Details" ) );
|
||||
|
||||
|
@ -19,11 +19,11 @@
|
||||
#ifndef QUEUEVIEW_H
|
||||
#define QUEUEVIEW_H
|
||||
|
||||
#include "playlist/FlexibleView.h"
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
|
||||
#include "DllMacro.h"
|
||||
|
||||
class DLLEXPORT QueueView : public FlexibleView
|
||||
class DLLEXPORT QueueView : public PlaylistViewPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
HistoryWidget::HistoryWidget( const source_ptr& source, QWidget* parent )
|
||||
: FlexibleView( parent )
|
||||
: PlaylistViewPage( parent )
|
||||
{
|
||||
setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#ifndef HISTORY_WIDGET_H
|
||||
#define HISTORY_WIDGET_H
|
||||
|
||||
#include "playlist/FlexibleView.h"
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
#include "Query.h"
|
||||
#include "Source.h"
|
||||
#include "DllMacro.h"
|
||||
@ -28,7 +28,7 @@ class QCalendarWidget;
|
||||
class QDateEdit;
|
||||
class RecentlyPlayedModel;
|
||||
|
||||
class DLLEXPORT HistoryWidget : public FlexibleView
|
||||
class DLLEXPORT HistoryWidget : public PlaylistViewPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "DropJob.h"
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include "playlist/FlexibleView.h"
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
#include "playlist/ContextView.h"
|
||||
#include "playlist/TrackView.h"
|
||||
#include "playlist/TopLovedTracksModel.h"
|
||||
@ -74,7 +74,7 @@ LovedTracksItem::activate()
|
||||
if ( !m_lovedTracksPage )
|
||||
{
|
||||
SourceItem* par = dynamic_cast< SourceItem* >( parent() );
|
||||
FlexibleView* pv = new FlexibleView( ViewManager::instance()->widget() );
|
||||
PlaylistViewPage* pv = new PlaylistViewPage( ViewManager::instance()->widget() );
|
||||
pv->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::LovedPlaylist, TomahawkUtils::Original, QSize( 128, 128 ) ) );
|
||||
|
||||
TopLovedTracksModel* raModel = new TopLovedTracksModel( pv );
|
||||
|
@ -150,7 +150,7 @@ void
|
||||
PlaylistItem::doubleClicked()
|
||||
{
|
||||
ViewPage* p = ViewManager::instance()->currentPage();
|
||||
if ( FlexibleView* view = dynamic_cast< FlexibleView* >( p ) )
|
||||
if ( PlaylistViewPage* view = dynamic_cast< PlaylistViewPage* >( p ) )
|
||||
{
|
||||
view->view()->trackView()->startPlayingFromStart();
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "Source.h"
|
||||
#include "SourceList.h"
|
||||
#include "playlist/ContextView.h"
|
||||
#include "playlist/FlexibleView.h"
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
#include "playlist/TrackView.h"
|
||||
#include "playlist/RecentlyAddedModel.h"
|
||||
#include "playlist/RecentlyPlayedModel.h"
|
||||
@ -606,7 +606,7 @@ SourceItem::latestAdditionsClicked()
|
||||
{
|
||||
if ( !m_latestAdditionsPage )
|
||||
{
|
||||
FlexibleView* pv = new FlexibleView( ViewManager::instance()->widget() );
|
||||
PlaylistViewPage* pv = new PlaylistViewPage( ViewManager::instance()->widget() );
|
||||
pv->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::NewAdditions,
|
||||
TomahawkUtils::Original,
|
||||
TomahawkUtils::DpiScaler::scaled( pv, 80, 80 ) ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user