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