1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02:00

don't show an error on loading an empty station

This commit is contained in:
Leo Franchi
2011-03-23 17:56:37 -04:00
parent 068391cd58
commit f9954dbb7e
3 changed files with 10 additions and 7 deletions

View File

@@ -54,6 +54,9 @@ DynamicModel::loadPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
connect( m_playlist->generator().data(), SIGNAL( nextTrackGenerated( Tomahawk::query_ptr ) ), this, SLOT( newTrackGenerated( Tomahawk::query_ptr ) ) );
PlaylistModel::loadPlaylist( m_playlist, m_playlist->mode() == Static );
if( m_playlist->mode() == OnDemand )
emit trackCountChanged( rowCount( QModelIndex() ) );
}
QString

View File

@@ -131,10 +131,10 @@ DynamicView::onTrackCountChanged( unsigned int tracks )
if ( tracks == 0 && !m_working )
{
if( m_onDemand ) {
if( m_readOnly )
overlay()->setText( tr( "Press play to begin listening to this custom station!" ) );
if( !m_readOnly )
overlay()->setText( tr( "Add some filters above to seed this station!" ) );
else
overlay()->setText( tr( "Add some filters above, and press play to begin listening to this custom station!" ) );
return; // when viewing a read-only station, don't show anything
} else
if( m_readOnly )
overlay()->setText( tr( "Press Generate to get started!" ) );

View File

@@ -153,12 +153,12 @@ DynamicWidget::loadDynamicPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
m_layout->insertWidget( 0, m_controls );
}
if( m_playlist->mode() == OnDemand && !m_playlist->generator()->controls().isEmpty() )
showPreview();
if( !m_playlist.isNull() )
m_controls->setControls( m_playlist, m_playlist->author()->isLocal() );
if( m_playlist->mode() == OnDemand )
showPreview();
connect( m_playlist->generator().data(), SIGNAL( generated( QList<Tomahawk::query_ptr> ) ), this, SLOT( tracksGenerated( QList<Tomahawk::query_ptr> ) ) );
connect( m_playlist.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), this, SLOT( onRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ) );
connect( m_playlist->generator().data(), SIGNAL( error( QString, QString ) ), this, SLOT( generatorError( QString, QString ) ) );
@@ -360,7 +360,7 @@ DynamicWidget::showPreview()
{
if( m_playlist->mode() == OnDemand && !m_runningOnDemand && m_model->rowCount( QModelIndex() ) == 0 ) { // if this is a not running station, preview matching tracks
generate( 20 ); // ask for more, we'll filter how many we actually want
}
}
}