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

Move Dashboard to libtomahawk-widgets

This commit is contained in:
Dominik Schmidt 2013-06-30 23:30:00 +02:00
parent 62f1fde90a
commit edbc60f274
8 changed files with 23 additions and 30 deletions

View File

@ -47,7 +47,6 @@
#include "playlist/dynamic/widgets/DynamicWidget.h"
#include "widgets/NewReleasesWidget.h"
#include "widgets/Dashboard.h"
#include "widgets/WhatsHotWidget.h"
#include "widgets/infowidgets/SourceInfoWidget.h"
#include "widgets/infowidgets/ArtistInfoWidget.h"
@ -57,6 +56,7 @@
#include "widgets/AnimatedSplitter.h"
#include "utils/Logger.h"
#include "utils/TomahawkUtilsGui.h"
#include <QVBoxLayout>
#include <QMetaMethod>
@ -79,7 +79,6 @@ ViewManager::instance()
ViewManager::ViewManager( QObject* parent )
: QObject( parent )
, m_widget( new QWidget() )
, m_dashboard( new Dashboard() )
, m_whatsHotWidget( 0 )
, m_newReleasesWidget( 0 )
, m_recentPlaysWidget( 0 )
@ -130,7 +129,6 @@ ViewManager::~ViewManager()
{
delete m_whatsHotWidget;
delete m_newReleasesWidget;
delete m_dashboard;
delete m_recentPlaysWidget;
delete m_inboxWidget;
delete m_contextWidget;
@ -401,13 +399,6 @@ ViewManager::playlistInterfaceChanged( Tomahawk::playlistinterface_ptr interface
}
Tomahawk::ViewPage*
ViewManager::showDashboard()
{
return show( m_dashboard );
}
Tomahawk::ViewPage*
ViewManager::showWhatsHotPage()
{
@ -849,13 +840,6 @@ ViewManager::showCurrentTrack()
}
Tomahawk::ViewPage*
ViewManager::dashboard() const
{
return m_dashboard;
}
Tomahawk::ViewPage*
ViewManager::whatsHotWidget() const
{

View File

@ -56,7 +56,6 @@ class SourceInfoWidget;
class InfoBar;
class TrackInfoWidget;
class NewReleasesWidget;
class Dashboard;
class WhatsHotWidget;
class QPushButton;
class InboxModel;
@ -92,7 +91,6 @@ public:
Tomahawk::ViewPage* show( Tomahawk::ViewPage* page );
Tomahawk::ViewPage* dashboard() const;
Tomahawk::ViewPage* whatsHotWidget() const;
Tomahawk::ViewPage* newReleasesWidget() const;
Tomahawk::ViewPage* recentPlaysWidget() const;
@ -138,7 +136,6 @@ signals:
public slots:
Tomahawk::ViewPage* showSuperCollection();
Tomahawk::ViewPage* showDashboard();
Tomahawk::ViewPage* showWhatsHotPage();
Tomahawk::ViewPage* showNewReleasesPage();
Tomahawk::ViewPage* showRecentPlaysPage();
@ -192,7 +189,6 @@ private:
TreeModel* m_superCollectionModel;
TreeWidget* m_superCollectionView;
QueueView* m_queue;
Dashboard* m_dashboard;
WhatsHotWidget* m_whatsHotWidget;
NewReleasesWidget* m_newReleasesWidget;
Tomahawk::ViewPage* m_recentPlaysWidget;

View File

@ -47,6 +47,7 @@
#define HISTORY_TRACK_ITEMS 15
using namespace Tomahawk;
using namespace Tomahawk::Widgets;
Dashboard::Dashboard( QWidget* parent )

View File

@ -44,6 +44,11 @@ namespace Ui
class Dashboard;
}
namespace Tomahawk
{
namespace Widgets
{
class DLLEXPORT PlaylistDelegate : public QStyledItemDelegate
{
Q_OBJECT
@ -124,4 +129,6 @@ private:
Tomahawk::playlistinterface_ptr m_playlistInterface;
};
}; // Widgets
}; // Tomahawk
#endif // DASHBOARD_H

View File

@ -261,7 +261,7 @@
</widget>
</item>
<item>
<widget class="PlaylistWidget" name="playlistWidget"/>
<widget class="Tomahawk::Widgets::PlaylistWidget" name="playlistWidget"/>
</item>
</layout>
</widget>
@ -296,7 +296,7 @@
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>PlaylistWidget</class>
<class>Tomahawk::Widgets::PlaylistWidget</class>
<extends>QListWidget</extends>
<header>widgets/Dashboard.h</header>
</customwidget>

View File

@ -50,7 +50,7 @@
</widget>
</item>
<item>
<widget class="PlaylistWidget" name="mostPlayedPlaylists"/>
<widget class="Tomahawk::Widgets::PlaylistWidget" name="mostPlayedPlaylists"/>
</item>
</layout>
</widget>
@ -97,7 +97,7 @@
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>PlaylistWidget</class>
<class>Tomahawk::Widgets::PlaylistWidget</class>
<extends>QListWidget</extends>
<header>widgets/Dashboard.h</header>
</customwidget>

View File

@ -150,7 +150,6 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
audioStopped();
vm->setQueue( m_queueView );
vm->showDashboard();
if ( TomahawkSettings::instance()->fullscreenEnabled() )
{

View File

@ -34,6 +34,7 @@
#include "Source.h"
#include "ViewManager.h"
#include "widgets/NetworkActivityWidget.h"
#include "widgets/Dashboard.h"
#include "GlobalActionManager.h"
#include "DropJob.h"
#include "items/PlaylistItems.h"
@ -302,10 +303,6 @@ SourcesModel::appendGroups()
// new SourceTreeItem( this, m_rootItem, SourcesModel::Divider, 2 );
m_myMusicGroup = new GroupItem( this, m_rootItem, tr( "My Music" ), 3 );
GenericPageItem* dashboard = new GenericPageItem( this, m_browse, tr( "Dashboard" ), ImageRegistry::instance()->icon( RESPATH "images/dashboard.svg" ),
boost::bind( &ViewManager::showDashboard, ViewManager::instance() ),
boost::bind( &ViewManager::dashboard, ViewManager::instance() ) );
dashboard->setSortValue( 0 );
// super collection
GenericPageItem* sc = new GenericPageItem( this, m_browse, tr( "SuperCollection" ), ImageRegistry::instance()->icon( RESPATH "images/supercollection.svg" ),
@ -343,6 +340,15 @@ SourcesModel::appendGroups()
endInsertRows();
// addDynamicPage takes care of begin/endInsertRows itself
ViewManager::instance()->addDynamicPage("dashboard",
tr( "Dashboard" ),
ImageRegistry::instance()->icon( RESPATH "images/dashboard.svg" ),
boost::lambda::bind( boost::lambda::new_ptr< Tomahawk::Widgets::Dashboard >() )
);
//HACK: this may not belong here, but adding the pages probably doesn't belong here either
//TODO: find a good place for this
ViewManager::instance()->showDynamicPage("dashboard");
ViewManager::instance()->addDynamicPage("network_activity",
tr( "Network Activity" ),
TomahawkUtils::defaultPixmap( TomahawkUtils::NetworkActivity, TomahawkUtils::Original ),