diff --git a/src/scrobbler/audioscrobbler.cpp b/src/scrobbler/audioscrobbler.cpp index 8c292b113..e43e5ac61 100644 --- a/src/scrobbler/audioscrobbler.cpp +++ b/src/scrobbler/audioscrobbler.cpp @@ -48,7 +48,7 @@ AudioScrobbler::AudioScrobbler(Application *app, QObject *parent) : love_button_(false), submit_delay_(0), prefer_albumartist_(false), - show_auth_error_(false) + show_error_dialog_(false) { scrobbler_services_->AddService(new LastFMScrobbler(app_, scrobbler_services_)); @@ -75,7 +75,7 @@ void AudioScrobbler::ReloadSettings() { love_button_ = s.value("love_button", false).toBool(); submit_delay_ = s.value("submit", 0).toInt(); prefer_albumartist_ = s.value("albumartist", false).toBool(); - show_auth_error_ = s.value("show_auth_error", true).toBool(); + show_error_dialog_ = s.value("show_error_dialog", true).toBool(); s.endGroup(); emit ScrobblingEnabledChanged(enabled_); diff --git a/src/scrobbler/audioscrobbler.h b/src/scrobbler/audioscrobbler.h index 096609776..614533769 100644 --- a/src/scrobbler/audioscrobbler.h +++ b/src/scrobbler/audioscrobbler.h @@ -46,7 +46,7 @@ class AudioScrobbler : public QObject { bool LoveButton() const { return love_button_; } int SubmitDelay() const { return submit_delay_; } bool PreferAlbumArtist() const { return prefer_albumartist_; } - bool ShowAuthError() const { return show_auth_error_; } + bool ShowErrorDialog() const { return show_error_dialog_; } void UpdateNowPlaying(const Song &song); void ClearPlaying(); @@ -86,7 +86,7 @@ class AudioScrobbler : public QObject { bool love_button_; int submit_delay_; bool prefer_albumartist_; - bool show_auth_error_; + bool show_error_dialog_; }; diff --git a/src/scrobbler/scrobblingapi20.cpp b/src/scrobbler/scrobblingapi20.cpp index 16bda346b..37f4de07f 100644 --- a/src/scrobbler/scrobblingapi20.cpp +++ b/src/scrobbler/scrobblingapi20.cpp @@ -525,7 +525,7 @@ void ScrobblingAPI20::Scrobble(const Song &song) { if (app_->scrobbler()->IsOffline()) return; if (!IsAuthenticated()) { - if (app_->scrobbler()->ShowAuthError()) { emit ErrorMessage(tr("Scrobbler %1 is not authenticated!").arg(name_)); } + if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 is not authenticated!").arg(name_)); } return; } @@ -987,6 +987,8 @@ void ScrobblingAPI20::Error(const QString &error, const QVariant &debug) { qLog(Error) << name_ << error; if (debug.isValid()) qLog(Debug) << debug; + if (app_->scrobbler()->ShowErrorDialog()) { emit ErrorMessage(tr("Scrobbler %1 error: %2").arg(name_).arg(error)); } + } QString ScrobblingAPI20::ErrorString(const ScrobbleErrorCode error) const { diff --git a/src/settings/scrobblersettingspage.cpp b/src/settings/scrobblersettingspage.cpp index fe9fa5364..20db22bb6 100644 --- a/src/settings/scrobblersettingspage.cpp +++ b/src/settings/scrobblersettingspage.cpp @@ -94,7 +94,7 @@ void ScrobblerSettingsPage::Load() { ui_->checkbox_offline->setChecked(scrobbler_->IsOffline()); ui_->spinbox_submit->setValue(scrobbler_->SubmitDelay()); ui_->checkbox_albumartist->setChecked(scrobbler_->PreferAlbumArtist()); - ui_->checkbox_show_auth_error->setChecked(scrobbler_->ShowAuthError()); + ui_->checkbox_show_error_dialog->setChecked(scrobbler_->ShowErrorDialog()); ui_->checkbox_lastfm_enable->setChecked(lastfmscrobbler_->IsEnabled()); ui_->checkbox_lastfm_https->setChecked(lastfmscrobbler_->IsUseHTTPS()); @@ -122,7 +122,7 @@ void ScrobblerSettingsPage::Save() { s.setValue("offline", ui_->checkbox_offline->isChecked()); s.setValue("submit", ui_->spinbox_submit->value()); s.setValue("albumartist", ui_->checkbox_albumartist->isChecked()); - s.setValue("show_auth_error", ui_->checkbox_show_auth_error->isChecked()); + s.setValue("show_error_dialog", ui_->checkbox_show_error_dialog->isChecked()); s.endGroup(); s.beginGroup(LastFMScrobbler::kSettingsGroup); diff --git a/src/settings/scrobblersettingspage.ui b/src/settings/scrobblersettingspage.ui index 36ebddfb0..1cad9fd29 100644 --- a/src/settings/scrobblersettingspage.ui +++ b/src/settings/scrobblersettingspage.ui @@ -110,9 +110,9 @@ - + - Show error dialog if scrobbler is enabled without being authenticated + Show dialog for errors