mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 02:24:50 +02:00
* Bring back Radio sidebar item.
This commit is contained in:
committed by
Michael Zanetti
parent
99ef263ba2
commit
bbeeac9935
@@ -83,6 +83,7 @@ ViewManager::ViewManager( QObject* parent )
|
||||
, m_newReleasesWidget( 0 )
|
||||
, m_recentPlaysWidget( 0 )
|
||||
, m_inboxWidget( 0 )
|
||||
, m_radioView( 0 )
|
||||
, m_currentPage( 0 )
|
||||
, m_loaded( false )
|
||||
{
|
||||
@@ -383,6 +384,22 @@ ViewManager::showSuperCollection()
|
||||
}
|
||||
|
||||
|
||||
Tomahawk::ViewPage*
|
||||
ViewManager::showRadioPage()
|
||||
{
|
||||
if ( !m_radioView )
|
||||
{
|
||||
dynplaylist_ptr playlist = DynamicPlaylist::create( SourceList::instance()->getLocal(), uuid(), QString(), "", SourceList::instance()->getLocal()->friendlyName(), OnDemand, false, QString(), false, false );
|
||||
playlist->setMode( OnDemand );
|
||||
|
||||
m_radioView = new Tomahawk::DynamicQmlWidget( playlist, m_stack );
|
||||
}
|
||||
|
||||
setPage( m_radioView );
|
||||
return m_radioView;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ViewManager::playlistInterfaceChanged( Tomahawk::playlistinterface_ptr interface )
|
||||
{
|
||||
|
@@ -133,6 +133,7 @@ signals:
|
||||
void historyForwardAvailable( bool avail );
|
||||
|
||||
public slots:
|
||||
Tomahawk::ViewPage* showRadioPage();
|
||||
Tomahawk::ViewPage* showSuperCollection();
|
||||
Tomahawk::ViewPage* showWelcomePage();
|
||||
Tomahawk::ViewPage* showWhatsHotPage();
|
||||
@@ -191,6 +192,7 @@ private:
|
||||
NewReleasesWidget* m_newReleasesWidget;
|
||||
Tomahawk::ViewPage* m_recentPlaysWidget;
|
||||
Tomahawk::ViewPage* m_inboxWidget;
|
||||
Tomahawk::DynamicQmlWidget* m_radioView;
|
||||
InboxModel* m_inboxModel;
|
||||
|
||||
QList< Tomahawk::collection_ptr > m_superCollections;
|
||||
|
@@ -151,17 +151,22 @@ DynamicPlaylist::create( const Tomahawk::source_ptr& author,
|
||||
GeneratorMode mode,
|
||||
bool shared,
|
||||
const QString& type,
|
||||
bool autoLoad
|
||||
bool autoLoad,
|
||||
bool temporary
|
||||
)
|
||||
{
|
||||
dynplaylist_ptr dynplaylist = Tomahawk::dynplaylist_ptr( new DynamicPlaylist( author, guid, title, info, creator, type, mode, shared, autoLoad ), &QObject::deleteLater );
|
||||
dynplaylist->setWeakSelf( dynplaylist.toWeakRef() );
|
||||
|
||||
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
||||
connect( cmd, SIGNAL(finished()), dynplaylist.data(), SIGNAL(created()) );
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||
if ( autoLoad )
|
||||
dynplaylist->reportCreated( dynplaylist );
|
||||
if ( !temporary )
|
||||
{
|
||||
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
||||
connect( cmd, SIGNAL(finished()), dynplaylist.data(), SIGNAL(created()) );
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||
if ( autoLoad )
|
||||
dynplaylist->reportCreated( dynplaylist );
|
||||
}
|
||||
|
||||
return dynplaylist;
|
||||
}
|
||||
|
||||
|
@@ -85,7 +85,8 @@ public:
|
||||
GeneratorMode mode,
|
||||
bool shared,
|
||||
const QString& type = QString(),
|
||||
bool autoLoad = true
|
||||
bool autoLoad = true,
|
||||
bool temporary = false
|
||||
);
|
||||
|
||||
static void remove( const dynplaylist_ptr& playlist );
|
||||
|
@@ -309,29 +309,33 @@ SourcesModel::appendGroups()
|
||||
sc->setSortValue( 1 );
|
||||
|
||||
// browse section
|
||||
GenericPageItem* radio = new GenericPageItem( this, browse, tr( "Radio" ), ImageRegistry::instance()->icon( RESPATH "images/station.svg" ),
|
||||
boost::bind( &ViewManager::showRadioPage, ViewManager::instance() ),
|
||||
boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) );
|
||||
radio->setSortValue( 2 );
|
||||
|
||||
LovedTracksItem* loved = new LovedTracksItem( this, browse );
|
||||
loved->setSortValue( 2 );
|
||||
loved->setSortValue( 3 );
|
||||
|
||||
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::recentPlaysWidget, ViewManager::instance() ) );
|
||||
recent->setSortValue( 3 );
|
||||
recent->setSortValue( 4 );
|
||||
|
||||
GenericPageItem* hot = new GenericPageItem( this, browse, tr( "Charts" ), ImageRegistry::instance()->icon( RESPATH "images/charts.svg" ),
|
||||
boost::bind( &ViewManager::showWhatsHotPage, 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" ),
|
||||
boost::bind( &ViewManager::showNewReleasesPage, ViewManager::instance() ),
|
||||
boost::bind( &ViewManager::newReleasesWidget, ViewManager::instance() ) );
|
||||
newReleases->setSortValue( 5 );
|
||||
newReleases->setSortValue( 6 );
|
||||
|
||||
InboxItem* inbox = new InboxItem( this, browse );
|
||||
inbox->setSortValue( 6 );
|
||||
inbox->setSortValue( 7 );
|
||||
|
||||
m_collectionsGroup = new GroupItem( this, m_rootItem, tr( "Friends" ), 4 );
|
||||
|
||||
m_cloudGroup = new GroupItem( this, m_rootItem, tr( "Cloud" ), 5 );
|
||||
|
||||
endInsertRows();
|
||||
|
Reference in New Issue
Block a user