mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Add stub page to pull out again
This commit is contained in:
committed by
Michael Zanetti
parent
67fc355f16
commit
4b29d34278
@@ -61,6 +61,7 @@
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMetaMethod>
|
||||
|
||||
|
||||
@@ -89,6 +90,7 @@ ViewManager::ViewManager( QObject* parent )
|
||||
, m_radioView( 0 )
|
||||
, m_networkActivityWidget( 0 )
|
||||
, m_currentPage( 0 )
|
||||
, m_stubWidget( 0 )
|
||||
, m_loaded( false )
|
||||
{
|
||||
s_instance = this;
|
||||
@@ -925,6 +927,42 @@ ViewPage *ViewManager::networkActivityWidget() const
|
||||
}
|
||||
|
||||
|
||||
class StubWidget : public ViewPage
|
||||
{
|
||||
public:
|
||||
StubWidget(QObject* parent)
|
||||
// : ViewPage(parent)
|
||||
{
|
||||
m_widget = (QWidget*) (new QLabel("Foobar"));
|
||||
}
|
||||
|
||||
virtual QWidget* widget() { return m_widget; }
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||
virtual QString title() const { return QString("Great title"); }
|
||||
virtual QString description() const { return QString("Great description"); }
|
||||
virtual bool jumpToCurrentTrack() { return false; }
|
||||
|
||||
private:
|
||||
QWidget* m_widget;
|
||||
};
|
||||
|
||||
ViewPage* ViewManager::stubWidget() const
|
||||
{
|
||||
return m_stubWidget;
|
||||
}
|
||||
|
||||
|
||||
ViewPage* ViewManager::showStub()
|
||||
{
|
||||
if ( !m_stubWidget )
|
||||
{
|
||||
m_stubWidget = new StubWidget( m_widget );
|
||||
}
|
||||
|
||||
return show( m_stubWidget );
|
||||
}
|
||||
|
||||
|
||||
Tomahawk::ViewPage*
|
||||
ViewManager::superCollectionView() const
|
||||
{
|
||||
|
@@ -58,6 +58,7 @@ class WhatsHotWidget;
|
||||
class QPushButton;
|
||||
class InboxModel;
|
||||
class NetworkActivityWidget;
|
||||
class StubWidget;
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
@@ -97,6 +98,7 @@ public:
|
||||
Tomahawk::ViewPage* superCollectionView() const;
|
||||
Tomahawk::ViewPage* inboxWidget() const;
|
||||
Tomahawk::ViewPage* networkActivityWidget() const;
|
||||
Tomahawk::ViewPage* stubWidget() const;
|
||||
|
||||
InboxModel* inboxModel();
|
||||
|
||||
@@ -144,6 +146,9 @@ public slots:
|
||||
Tomahawk::ViewPage* showRecentPlaysPage();
|
||||
Tomahawk::ViewPage* showInboxPage();
|
||||
Tomahawk::ViewPage* showNetworkActivityPage();
|
||||
|
||||
Tomahawk::ViewPage* showStub();
|
||||
|
||||
void showCurrentTrack();
|
||||
|
||||
// Returns the shown viewpage
|
||||
@@ -200,6 +205,8 @@ private:
|
||||
InboxModel* m_inboxModel;
|
||||
NetworkActivityWidget* m_networkActivityWidget;
|
||||
|
||||
StubWidget* m_stubWidget;
|
||||
|
||||
QList< Tomahawk::collection_ptr > m_superCollections;
|
||||
|
||||
QHash< Tomahawk::dynplaylist_ptr, QPointer<Tomahawk::DynamicQmlWidget> > m_dynamicWidgets;
|
||||
|
@@ -337,6 +337,14 @@ SourcesModel::appendGroups()
|
||||
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
||||
newReleases->setSortValue( 6 );
|
||||
|
||||
|
||||
GenericPageItem* stub = new GenericPageItem( this, browse, tr( "Stub page" ), ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ),
|
||||
boost::bind( &ViewManager::showStub, ViewManager::instance() ),
|
||||
boost::bind( &ViewManager::stubWidget, ViewManager::instance() ) );
|
||||
stub->setSortValue( 7 );
|
||||
|
||||
|
||||
|
||||
InboxItem* inbox = new InboxItem( this, browse );
|
||||
inbox->setSortValue( 7 );
|
||||
|
||||
|
Reference in New Issue
Block a user