1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-15 10:33:59 +02:00

Show station description in header, and if it's read-only, hide the controls

This commit is contained in:
Leo Franchi
2011-02-27 15:52:19 -05:00
parent 063dd30ba5
commit b03912ef84
3 changed files with 16 additions and 0 deletions

View File

@@ -50,6 +50,13 @@ DynamicModel::loadPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
PlaylistModel::loadPlaylist( m_playlist, !m_onDemandRunning );
}
QString
DynamicModel::description() const
{
return m_playlist->generator()->sentenceSummary();
}
void
DynamicModel::startOnDemand()
{

View File

@@ -40,6 +40,8 @@ public:
void stopOnDemand( bool stopPlaying = true );
void changeStation();
virtual QString description() const;
void loadPlaylist( const dynplaylist_ptr& playlist );
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );

View File

@@ -142,6 +142,13 @@ DynamicWidget::loadDynamicPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
m_controlsChanged = false;
m_setup->setPlaylist( m_playlist );
if( !m_playlist->author()->isLocal() ) { // hide controls, as we show the description in the summary
m_layout->removeWidget( m_controls );
} else if( m_layout->indexOf( m_controls ) == -1 ) {
m_layout->insertWidget( 0, m_controls );
}
if( !m_playlist.isNull() )
m_controls->setControls( m_playlist, m_playlist->author()->isLocal() );