More logic for enabling ban and love buttons when the user logs in to Last.fm

This commit is contained in:
David Sansome 2009-12-30 04:14:29 +00:00
parent daaec56b4b
commit d63001af02
1 changed files with 6 additions and 2 deletions

View File

@ -253,7 +253,7 @@ void MainWindow::MediaPlaying() {
ui_.action_play_pause->setEnabled(
! (playlist_->current_item_options() & PlaylistItem::PauseDisabled));
bool is_lastfm = playlist_->current_item_options() & PlaylistItem::LastFMControls;
bool is_lastfm = (playlist_->current_item_options() & PlaylistItem::LastFMControls);
LastFMService* lastfm = radio_model_->GetLastFMService();
ui_.action_ban->setEnabled(lastfm->IsScrobblingEnabled() && is_lastfm);
@ -264,7 +264,11 @@ void MainWindow::MediaPlaying() {
}
void MainWindow::ScrobblingEnabledChanged(bool value) {
ui_.action_ban->setEnabled(value);
if (!player_->GetState() == Engine::Idle)
return;
bool is_lastfm = (playlist_->current_item_options() & PlaylistItem::LastFMControls);
ui_.action_ban->setEnabled(value && is_lastfm);
ui_.action_love->setEnabled(value);
}