1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

don't hide the setup widget in static playlists

only try generating 20 preview tracks for stations, faster
This commit is contained in:
Leo Franchi
2011-03-10 21:36:35 -05:00
parent 0c97c9fc1e
commit c4a916e2e4
3 changed files with 12 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ DynamicModel::newTrackLoading()
void void
DynamicModel::tracksGenerated( const QList< query_ptr > entries, int limitResolvedTo ) DynamicModel::tracksGenerated( const QList< query_ptr > entries, int limitResolvedTo )
{ {
if( m_filterUnresolvable ) { // wait till we get them resolved if( m_filterUnresolvable && m_playlist->mode() == OnDemand ) { // wait till we get them resolved (for previewing stations)
m_limitResolvedTo = limitResolvedTo; m_limitResolvedTo = limitResolvedTo;
filterUnresolved( entries ); filterUnresolved( entries );
} else { } else {

View File

@@ -75,7 +75,7 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
m_setup = new DynamicSetupWidget( playlist, this ); m_setup = new DynamicSetupWidget( playlist, this );
m_setup->fadeIn(); m_setup->fadeIn();
connect( m_model, SIGNAL( tracksAdded() ), m_setup, SLOT( fadeOut() ) ); connect( m_model, SIGNAL( tracksAdded() ), this, SLOT( tracksAdded() ) );
loadDynamicPlaylist( playlist ); loadDynamicPlaylist( playlist );
@@ -262,6 +262,14 @@ DynamicWidget::trackStarted()
} }
} }
void
DynamicWidget::tracksAdded()
{
if( m_playlist->mode() == OnDemand && m_runningOnDemand && m_setup->isVisible() )
m_setup->fadeOut();
}
void void
DynamicWidget::stopStation( bool stopPlaying ) DynamicWidget::stopStation( bool stopPlaying )
{ {
@@ -349,7 +357,7 @@ void
DynamicWidget::showPreview() DynamicWidget::showPreview()
{ {
if( m_playlist->mode() == OnDemand && !m_runningOnDemand && m_model->rowCount( QModelIndex() ) == 0 ) { // if this is a not running station, preview matching tracks if( m_playlist->mode() == OnDemand && !m_runningOnDemand && m_model->rowCount( QModelIndex() ) == 0 ) { // if this is a not running station, preview matching tracks
generate( 40 ); // ask for more, we'll filter how many we actually want generate( 20 ); // ask for more, we'll filter how many we actually want
} }
} }

View File

@@ -89,6 +89,7 @@ public slots:
void stationFailed( const QString& ); void stationFailed( const QString& );
void playlistStopped( PlaylistInterface* ); void playlistStopped( PlaylistInterface* );
void tracksAdded();
private slots: private slots:
void generate( int = -1 ); void generate( int = -1 );