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:
@@ -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()
|
||||
{
|
||||
|
@@ -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 );
|
||||
|
@@ -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() );
|
||||
|
||||
|
Reference in New Issue
Block a user