mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
Add empty NetworkActivity page
This commit is contained in:
@@ -150,6 +150,7 @@ set( libGuiSources
|
|||||||
widgets/PlayableCover.cpp
|
widgets/PlayableCover.cpp
|
||||||
widgets/SocialPlaylistWidget.cpp
|
widgets/SocialPlaylistWidget.cpp
|
||||||
widgets/SourceTreePopupDialog.cpp
|
widgets/SourceTreePopupDialog.cpp
|
||||||
|
widgets/NetworkActivityWidget.cpp
|
||||||
widgets/infowidgets/SourceInfoWidget.cpp
|
widgets/infowidgets/SourceInfoWidget.cpp
|
||||||
widgets/infowidgets/ArtistInfoWidget.cpp
|
widgets/infowidgets/ArtistInfoWidget.cpp
|
||||||
widgets/infowidgets/AlbumInfoWidget.cpp
|
widgets/infowidgets/AlbumInfoWidget.cpp
|
||||||
@@ -364,6 +365,7 @@ set( libUI ${libUI}
|
|||||||
widgets/WhatsHotWidget.ui
|
widgets/WhatsHotWidget.ui
|
||||||
widgets/NewReleasesWidget.ui
|
widgets/NewReleasesWidget.ui
|
||||||
widgets/SocialPlaylistWidget.ui
|
widgets/SocialPlaylistWidget.ui
|
||||||
|
widgets/NetworkActivityWidget.ui
|
||||||
widgets/infowidgets/SourceInfoWidget.ui
|
widgets/infowidgets/SourceInfoWidget.ui
|
||||||
widgets/infowidgets/ArtistInfoWidget.ui
|
widgets/infowidgets/ArtistInfoWidget.ui
|
||||||
widgets/infowidgets/AlbumInfoWidget.ui
|
widgets/infowidgets/AlbumInfoWidget.ui
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
#include "widgets/NewReleasesWidget.h"
|
#include "widgets/NewReleasesWidget.h"
|
||||||
#include "widgets/WelcomeWidget.h"
|
#include "widgets/WelcomeWidget.h"
|
||||||
#include "widgets/WhatsHotWidget.h"
|
#include "widgets/WhatsHotWidget.h"
|
||||||
|
#include "widgets/NetworkActivityWidget.h"
|
||||||
#include "widgets/infowidgets/SourceInfoWidget.h"
|
#include "widgets/infowidgets/SourceInfoWidget.h"
|
||||||
#include "widgets/infowidgets/ArtistInfoWidget.h"
|
#include "widgets/infowidgets/ArtistInfoWidget.h"
|
||||||
#include "widgets/infowidgets/AlbumInfoWidget.h"
|
#include "widgets/infowidgets/AlbumInfoWidget.h"
|
||||||
@@ -82,6 +83,7 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
, m_newReleasesWidget( 0 )
|
, m_newReleasesWidget( 0 )
|
||||||
, m_recentPlaysWidget( 0 )
|
, m_recentPlaysWidget( 0 )
|
||||||
, m_inboxWidget( 0 )
|
, m_inboxWidget( 0 )
|
||||||
|
, m_networkActivityWidget( 0 )
|
||||||
, m_currentPage( 0 )
|
, m_currentPage( 0 )
|
||||||
, m_loaded( false )
|
, m_loaded( false )
|
||||||
{
|
{
|
||||||
@@ -129,6 +131,7 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
|
|
||||||
ViewManager::~ViewManager()
|
ViewManager::~ViewManager()
|
||||||
{
|
{
|
||||||
|
delete m_networkActivityWidget;
|
||||||
delete m_whatsHotWidget;
|
delete m_whatsHotWidget;
|
||||||
delete m_newReleasesWidget;
|
delete m_newReleasesWidget;
|
||||||
delete m_welcomeWidget;
|
delete m_welcomeWidget;
|
||||||
@@ -489,6 +492,17 @@ ViewManager::showInboxPage()
|
|||||||
return show( m_inboxWidget );
|
return show( m_inboxWidget );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ViewPage *ViewManager::showNetworkActivityPage()
|
||||||
|
{
|
||||||
|
if ( !m_networkActivityWidget )
|
||||||
|
{
|
||||||
|
m_networkActivityWidget = new NetworkActivityWidget( m_widget );
|
||||||
|
m_networkActivityWidget->fetchData();
|
||||||
|
}
|
||||||
|
|
||||||
|
return show( m_networkActivityWidget );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewManager::setFilter( const QString& filter )
|
ViewManager::setFilter( const QString& filter )
|
||||||
@@ -882,6 +896,11 @@ ViewManager::inboxWidget() const
|
|||||||
return m_inboxWidget;
|
return m_inboxWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ViewPage *ViewManager::networkActivityWidget() const
|
||||||
|
{
|
||||||
|
return m_networkActivityWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::ViewPage*
|
Tomahawk::ViewPage*
|
||||||
ViewManager::superCollectionView() const
|
ViewManager::superCollectionView() const
|
||||||
|
@@ -56,6 +56,7 @@ class WelcomeWidget;
|
|||||||
class WhatsHotWidget;
|
class WhatsHotWidget;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class InboxModel;
|
class InboxModel;
|
||||||
|
class NetworkActivityWidget;
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
@@ -94,6 +95,7 @@ public:
|
|||||||
Tomahawk::ViewPage* recentPlaysWidget() const;
|
Tomahawk::ViewPage* recentPlaysWidget() const;
|
||||||
Tomahawk::ViewPage* superCollectionView() const;
|
Tomahawk::ViewPage* superCollectionView() const;
|
||||||
Tomahawk::ViewPage* inboxWidget() const;
|
Tomahawk::ViewPage* inboxWidget() const;
|
||||||
|
Tomahawk::ViewPage* networkActivityWidget() const;
|
||||||
|
|
||||||
InboxModel* inboxModel();
|
InboxModel* inboxModel();
|
||||||
|
|
||||||
@@ -139,6 +141,7 @@ public slots:
|
|||||||
Tomahawk::ViewPage* showNewReleasesPage();
|
Tomahawk::ViewPage* showNewReleasesPage();
|
||||||
Tomahawk::ViewPage* showRecentPlaysPage();
|
Tomahawk::ViewPage* showRecentPlaysPage();
|
||||||
Tomahawk::ViewPage* showInboxPage();
|
Tomahawk::ViewPage* showInboxPage();
|
||||||
|
Tomahawk::ViewPage* showNetworkActivityPage();
|
||||||
void showCurrentTrack();
|
void showCurrentTrack();
|
||||||
|
|
||||||
// Returns the shown viewpage
|
// Returns the shown viewpage
|
||||||
@@ -192,6 +195,7 @@ private:
|
|||||||
Tomahawk::ViewPage* m_recentPlaysWidget;
|
Tomahawk::ViewPage* m_recentPlaysWidget;
|
||||||
Tomahawk::ViewPage* m_inboxWidget;
|
Tomahawk::ViewPage* m_inboxWidget;
|
||||||
InboxModel* m_inboxModel;
|
InboxModel* m_inboxModel;
|
||||||
|
NetworkActivityWidget* m_networkActivityWidget;
|
||||||
|
|
||||||
QList< Tomahawk::collection_ptr > m_superCollections;
|
QList< Tomahawk::collection_ptr > m_superCollections;
|
||||||
|
|
||||||
|
@@ -124,7 +124,8 @@ namespace TomahawkUtils
|
|||||||
Inbox,
|
Inbox,
|
||||||
Invalid,
|
Invalid,
|
||||||
InboxNewItem,
|
InboxNewItem,
|
||||||
Outbox
|
Outbox,
|
||||||
|
NetworkActivity
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ImageMode
|
enum ImageMode
|
||||||
|
@@ -722,6 +722,10 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
|
|||||||
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/outbox.svg", size );
|
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/outbox.svg", size );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NetworkActivity:
|
||||||
|
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/network-activity.svg", size );
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
90
src/libtomahawk/widgets/NetworkActivityWidget.cpp
Normal file
90
src/libtomahawk/widgets/NetworkActivityWidget.cpp
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
|
*
|
||||||
|
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
|
||||||
|
*
|
||||||
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Tomahawk is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NetworkActivityWidget.h"
|
||||||
|
#include "ui_NetworkActivityWidget.h"
|
||||||
|
|
||||||
|
#include "utils/AnimatedSpinner.h"
|
||||||
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
|
|
||||||
|
#include <QtConcurrentRun>
|
||||||
|
|
||||||
|
NetworkActivityWidget::NetworkActivityWidget( QWidget *parent )
|
||||||
|
: QWidget( parent )
|
||||||
|
, ui( new Ui::NetworkActivityWidget )
|
||||||
|
//, m_sortedProxy( 0 )
|
||||||
|
//, m_loading( true )
|
||||||
|
{
|
||||||
|
ui->setupUi( this );
|
||||||
|
|
||||||
|
TomahawkUtils::unmarginLayout( layout() );
|
||||||
|
TomahawkUtils::unmarginLayout( ui->stackLeft->layout() );
|
||||||
|
TomahawkUtils::unmarginLayout( ui->horizontalLayout->layout() );
|
||||||
|
TomahawkUtils::unmarginLayout( ui->breadCrumbLeft->layout() );
|
||||||
|
|
||||||
|
// m_crumbModelLeft = new QStandardItemModel( this );
|
||||||
|
// m_sortedProxy = new QSortFilterProxyModel( this );
|
||||||
|
// m_sortedProxy->setDynamicSortFilter( true );
|
||||||
|
// m_sortedProxy->setFilterCaseSensitivity( Qt::CaseInsensitive );
|
||||||
|
|
||||||
|
ui->breadCrumbLeft->setRootIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::NetworkActivity, TomahawkUtils::Original ) );
|
||||||
|
// connect( ui->breadCrumbLeft, SIGNAL( activateIndex( QModelIndex ) ), SLOT( leftCrumbIndexChanged( QModelIndex ) ) );
|
||||||
|
|
||||||
|
ui->tracksViewLeft->setHeaderHidden( true );
|
||||||
|
ui->tracksViewLeft->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
// PlaylistChartItemDelegate* del = new PlaylistChartItemDelegate( ui->tracksViewLeft, ui->tracksViewLeft->proxyModel() );
|
||||||
|
// ui->tracksViewLeft->setItemDelegate( del );
|
||||||
|
ui->tracksViewLeft->setUniformRowHeights( false );
|
||||||
|
|
||||||
|
m_playlistInterface = ui->tracksViewLeft->playlistInterface();
|
||||||
|
|
||||||
|
// Lets have a spinner until loaded
|
||||||
|
ui->breadCrumbLeft->setVisible( false );
|
||||||
|
m_spinner = QSharedPointer<AnimatedSpinner>( new AnimatedSpinner( ui->tracksViewLeft ) );
|
||||||
|
m_spinner->fadeIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
NetworkActivityWidget::~NetworkActivityWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tomahawk::playlistinterface_ptr
|
||||||
|
NetworkActivityWidget::playlistInterface() const
|
||||||
|
{
|
||||||
|
return m_playlistInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
NetworkActivityWidget::jumpToCurrentTrack()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetworkActivityWidget::fetchData()
|
||||||
|
{
|
||||||
|
// Do not block the UI thread
|
||||||
|
QtConcurrent::run( this, &NetworkActivityWidget::actualFetchData );
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NetworkActivityWidget::actualFetchData()
|
||||||
|
{
|
||||||
|
}
|
58
src/libtomahawk/widgets/NetworkActivityWidget.h
Normal file
58
src/libtomahawk/widgets/NetworkActivityWidget.h
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
|
*
|
||||||
|
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
|
||||||
|
*
|
||||||
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Tomahawk is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NETWORKACTIVITYWIDGET_H
|
||||||
|
#define NETWORKACTIVITYWIDGET_H
|
||||||
|
|
||||||
|
#include "ViewPage.h"
|
||||||
|
|
||||||
|
class AnimatedSpinner;
|
||||||
|
namespace Ui
|
||||||
|
{
|
||||||
|
class NetworkActivityWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class NetworkActivityWidget : public QWidget, public Tomahawk::ViewPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
NetworkActivityWidget(QWidget *parent = 0);
|
||||||
|
~NetworkActivityWidget();
|
||||||
|
|
||||||
|
virtual QWidget* widget() { return this; }
|
||||||
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
|
||||||
|
|
||||||
|
virtual QString title() const { return tr( "Network Activity" ); }
|
||||||
|
virtual QString description() const { return QString(); }
|
||||||
|
|
||||||
|
virtual bool jumpToCurrentTrack();
|
||||||
|
|
||||||
|
void fetchData();
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
private:
|
||||||
|
void actualFetchData();
|
||||||
|
|
||||||
|
Ui::NetworkActivityWidget* ui;
|
||||||
|
Tomahawk::playlistinterface_ptr m_playlistInterface;
|
||||||
|
QSharedPointer<AnimatedSpinner> m_spinner;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // NETWORKACTIVITYWIDGET_H
|
55
src/libtomahawk/widgets/NetworkActivityWidget.ui
Normal file
55
src/libtomahawk/widgets/NetworkActivityWidget.ui
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>NetworkActivityWidget</class>
|
||||||
|
<widget class="QWidget" name="NetworkActivityWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>875</width>
|
||||||
|
<height>513</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="Tomahawk::Breadcrumb" name="breadCrumbLeft" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QStackedWidget" name="stackLeft">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="PlaylistView" name="tracksViewLeft">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>320</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>PlaylistView</class>
|
||||||
|
<extends>QTreeView</extends>
|
||||||
|
<header>playlist/PlaylistView.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>Tomahawk::Breadcrumb</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>widgets/Breadcrumb.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@@ -312,23 +312,28 @@ SourcesModel::appendGroups()
|
|||||||
LovedTracksItem* loved = new LovedTracksItem( this, browse );
|
LovedTracksItem* loved = new LovedTracksItem( this, browse );
|
||||||
loved->setSortValue( 2 );
|
loved->setSortValue( 2 );
|
||||||
|
|
||||||
|
GenericPageItem* networkActivity = new GenericPageItem( this, browse, tr( "Network Activity" ), TomahawkUtils::defaultPixmap( TomahawkUtils::NetworkActivity, TomahawkUtils::Original ),
|
||||||
|
boost::bind( &ViewManager::showNetworkActivityPage, ViewManager::instance() ),
|
||||||
|
boost::bind( &ViewManager::networkActivityWidget, ViewManager::instance() ) );
|
||||||
|
networkActivity->setSortValue( 3 );
|
||||||
|
|
||||||
GenericPageItem* recent = new GenericPageItem( this, browse, tr( "Recently Played" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
|
GenericPageItem* recent = new GenericPageItem( this, browse, tr( "Recently Played" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
|
||||||
boost::bind( &ViewManager::showRecentPlaysPage, ViewManager::instance() ),
|
boost::bind( &ViewManager::showRecentPlaysPage, ViewManager::instance() ),
|
||||||
boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) );
|
boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) );
|
||||||
recent->setSortValue( 3 );
|
recent->setSortValue( 4 );
|
||||||
|
|
||||||
GenericPageItem* hot = new GenericPageItem( this, browse, tr( "Charts" ), ImageRegistry::instance()->icon( RESPATH "images/charts.svg" ),
|
GenericPageItem* hot = new GenericPageItem( this, browse, tr( "Charts" ), ImageRegistry::instance()->icon( RESPATH "images/charts.svg" ),
|
||||||
boost::bind( &ViewManager::showWhatsHotPage, ViewManager::instance() ),
|
boost::bind( &ViewManager::showWhatsHotPage, ViewManager::instance() ),
|
||||||
boost::bind( &ViewManager::whatsHotWidget, ViewManager::instance() ) );
|
boost::bind( &ViewManager::whatsHotWidget, ViewManager::instance() ) );
|
||||||
hot->setSortValue( 4 );
|
hot->setSortValue( 5 );
|
||||||
|
|
||||||
GenericPageItem* newReleases = new GenericPageItem( this, browse, tr( "New Releases" ), ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ),
|
GenericPageItem* newReleases = new GenericPageItem( this, browse, tr( "New Releases" ), ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ),
|
||||||
boost::bind( &ViewManager::showNewReleasesPage, ViewManager::instance() ),
|
boost::bind( &ViewManager::showNewReleasesPage, ViewManager::instance() ),
|
||||||
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
||||||
newReleases->setSortValue( 5 );
|
newReleases->setSortValue( 6 );
|
||||||
|
|
||||||
InboxItem* inbox = new InboxItem( this, browse );
|
InboxItem* inbox = new InboxItem( this, browse );
|
||||||
inbox->setSortValue( 6 );
|
inbox->setSortValue( 7 );
|
||||||
|
|
||||||
m_collectionsGroup = new GroupItem( this, m_rootItem, tr( "Friends" ), 4 );
|
m_collectionsGroup = new GroupItem( this, m_rootItem, tr( "Friends" ), 4 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user