mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 11:50:37 +02:00
* Disable previous and next buttons when those functions are not available to AudioEngine.
This commit is contained in:
@@ -264,6 +264,9 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result )
|
|||||||
ui->loveButton->setToolTip( tr( "Love" ) );
|
ui->loveButton->setToolTip( tr( "Love" ) );
|
||||||
ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) );
|
ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) );
|
||||||
|
|
||||||
|
ui->prevButton->setEnabled( AudioEngine::instance()->canGoPrevious() );
|
||||||
|
ui->nextButton->setEnabled( AudioEngine::instance()->canGoNext() );
|
||||||
|
|
||||||
QPixmap sourceIcon = result->sourceIcon( Result::Plain, ui->ownerButton->size() );
|
QPixmap sourceIcon = result->sourceIcon( Result::Plain, ui->ownerButton->size() );
|
||||||
if ( !sourceIcon.isNull() )
|
if ( !sourceIcon.isNull() )
|
||||||
ui->ownerButton->setPixmap( sourceIcon );
|
ui->ownerButton->setPixmap( sourceIcon );
|
||||||
@@ -393,6 +396,9 @@ AudioControls::onPlaybackStopped()
|
|||||||
ui->socialButton->setToolTip( "" );
|
ui->socialButton->setToolTip( "" );
|
||||||
ui->loveButton->setToolTip( "" );
|
ui->loveButton->setToolTip( "" );
|
||||||
ui->ownerButton->setToolTip( "" );
|
ui->ownerButton->setToolTip( "" );
|
||||||
|
|
||||||
|
ui->prevButton->setEnabled( AudioEngine::instance()->canGoPrevious() );
|
||||||
|
ui->nextButton->setEnabled( AudioEngine::instance()->canGoNext() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user