1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 08:34:34 +02:00

Keep the dynamic playlist description up to date when it is changed

This commit is contained in:
Leo Franchi
2011-04-04 14:21:47 -04:00
parent fdc2f5d3e9
commit 9cc74abccc
3 changed files with 14 additions and 0 deletions

View File

@@ -345,6 +345,8 @@ DynamicWidget::controlsChanged()
return;
m_playlist->createNewRevision();
m_seqRevLaunched++;
emit descriptionChanged( m_playlist->generator()->sentenceSummary() );
}
void
@@ -356,6 +358,8 @@ DynamicWidget::controlChanged( const Tomahawk::dyncontrol_ptr& control )
m_seqRevLaunched++;
showPreview();
emit descriptionChanged( m_playlist->generator()->sentenceSummary() );
}
void

View File

@@ -94,6 +94,9 @@ public slots:
void playlistChanged( PlaylistInterface* );
void tracksAdded();
signals:
void descriptionChanged( const QString& caption );
private slots:
void generate( int = -1 );
void tracksGenerated( const QList< Tomahawk::query_ptr>& queries );

View File

@@ -553,6 +553,13 @@ PlaylistManager::setPage( ViewPage* page, bool trackHistory )
if ( !AudioEngine::instance()->isPlaying() )
AudioEngine::instance()->setPlaylist( currentPlaylistInterface() );
// UGH!
if( QObject* obj = dynamic_cast< QObject* >( currentPage() ) ) {
// qDebug() << SIGNAL( descriptionChanged( QString ) ) << QMetaObject::normalizedSignature( SIGNAL( descriptionChanged( QString ) ) ) << obj->metaObject()->indexOfSignal( QMetaObject::normalizedSignature( SIGNAL( descriptionChanged( QString ) ) ) );
// if( obj->metaObject()->indexOfSignal( QMetaObject::normalizedSignature( SIGNAL( descriptionChanged( QString ) ) ) ) > -1 ) // if the signal exists (just to hide the qobject runtime warning...)
connect( obj, SIGNAL( descriptionChanged( QString ) ), m_infobar, SLOT( setDescription( QString ) ) );
}
m_stack->setCurrentWidget( page->widget() );
updateView();
}