From a1148ece05ea0322838705cc071f1c66088b5fe2 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 29 Dec 2012 18:43:55 +0100 Subject: [PATCH] * Add Radio item to sidebar. --- src/libtomahawk/ViewManager.cpp | 17 +++++++++++++++++ src/libtomahawk/ViewManager.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/libtomahawk/ViewManager.cpp b/src/libtomahawk/ViewManager.cpp index 0e7c57919..015303d02 100644 --- a/src/libtomahawk/ViewManager.cpp +++ b/src/libtomahawk/ViewManager.cpp @@ -76,6 +76,7 @@ ViewManager::ViewManager( QObject* parent ) , m_whatsHotWidget( new WhatsHotWidget() ) , m_newReleasesWidget( new NewReleasesWidget() ) , m_recentPlaysWidget( 0 ) + , m_radioView( 0 ) , m_currentPage( 0 ) , m_loaded( false ) { @@ -348,6 +349,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 ) { diff --git a/src/libtomahawk/ViewManager.h b/src/libtomahawk/ViewManager.h index 86b6311a1..9f8ebae00 100644 --- a/src/libtomahawk/ViewManager.h +++ b/src/libtomahawk/ViewManager.h @@ -129,6 +129,7 @@ signals: void historyForwardAvailable( bool avail ); public slots: + Tomahawk::ViewPage* showRadioPage(); Tomahawk::ViewPage* showSuperCollection(); Tomahawk::ViewPage* showWelcomePage(); Tomahawk::ViewPage* showWhatsHotPage(); @@ -193,6 +194,7 @@ private: WhatsHotWidget* m_whatsHotWidget; NewReleasesWidget* m_newReleasesWidget; Tomahawk::ViewPage* m_recentPlaysWidget; + Tomahawk::DynamicQmlWidget* m_radioView; QList< Tomahawk::collection_ptr > m_superCollections;