mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 00:54:20 +02:00
Add stub page to pull out again
This commit is contained in:
@@ -60,6 +60,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
#include <QMetaMethod>
|
#include <QMetaMethod>
|
||||||
|
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
, m_inboxWidget( 0 )
|
, m_inboxWidget( 0 )
|
||||||
, m_networkActivityWidget( 0 )
|
, m_networkActivityWidget( 0 )
|
||||||
, m_currentPage( 0 )
|
, m_currentPage( 0 )
|
||||||
|
, m_stubWidget( 0 )
|
||||||
, m_loaded( false )
|
, m_loaded( false )
|
||||||
{
|
{
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
@@ -907,6 +909,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*
|
Tomahawk::ViewPage*
|
||||||
ViewManager::superCollectionView() const
|
ViewManager::superCollectionView() const
|
||||||
{
|
{
|
||||||
|
@@ -58,6 +58,7 @@ class WhatsHotWidget;
|
|||||||
class QPushButton;
|
class QPushButton;
|
||||||
class InboxModel;
|
class InboxModel;
|
||||||
class NetworkActivityWidget;
|
class NetworkActivityWidget;
|
||||||
|
class StubWidget;
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
@@ -97,6 +98,7 @@ public:
|
|||||||
Tomahawk::ViewPage* superCollectionView() const;
|
Tomahawk::ViewPage* superCollectionView() const;
|
||||||
Tomahawk::ViewPage* inboxWidget() const;
|
Tomahawk::ViewPage* inboxWidget() const;
|
||||||
Tomahawk::ViewPage* networkActivityWidget() const;
|
Tomahawk::ViewPage* networkActivityWidget() const;
|
||||||
|
Tomahawk::ViewPage* stubWidget() const;
|
||||||
|
|
||||||
InboxModel* inboxModel();
|
InboxModel* inboxModel();
|
||||||
|
|
||||||
@@ -143,6 +145,9 @@ public slots:
|
|||||||
Tomahawk::ViewPage* showRecentPlaysPage();
|
Tomahawk::ViewPage* showRecentPlaysPage();
|
||||||
Tomahawk::ViewPage* showInboxPage();
|
Tomahawk::ViewPage* showInboxPage();
|
||||||
Tomahawk::ViewPage* showNetworkActivityPage();
|
Tomahawk::ViewPage* showNetworkActivityPage();
|
||||||
|
|
||||||
|
Tomahawk::ViewPage* showStub();
|
||||||
|
|
||||||
void showCurrentTrack();
|
void showCurrentTrack();
|
||||||
|
|
||||||
// Returns the shown viewpage
|
// Returns the shown viewpage
|
||||||
@@ -198,6 +203,8 @@ private:
|
|||||||
InboxModel* m_inboxModel;
|
InboxModel* m_inboxModel;
|
||||||
NetworkActivityWidget* m_networkActivityWidget;
|
NetworkActivityWidget* m_networkActivityWidget;
|
||||||
|
|
||||||
|
StubWidget* m_stubWidget;
|
||||||
|
|
||||||
QList< Tomahawk::collection_ptr > m_superCollections;
|
QList< Tomahawk::collection_ptr > m_superCollections;
|
||||||
|
|
||||||
QHash< Tomahawk::dynplaylist_ptr, QPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
|
QHash< Tomahawk::dynplaylist_ptr, QPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
|
||||||
|
@@ -332,6 +332,14 @@ SourcesModel::appendGroups()
|
|||||||
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
||||||
newReleases->setSortValue( 6 );
|
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 );
|
InboxItem* inbox = new InboxItem( this, browse );
|
||||||
inbox->setSortValue( 7 );
|
inbox->setSortValue( 7 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user