From a8117c31f039307bfb248cb04ded1b7c55172a3b Mon Sep 17 00:00:00 2001 From: Ross Wolfson Date: Mon, 10 Jun 2013 21:57:57 -0400 Subject: [PATCH] Fix to prevent spinning status wheel if incomplete Subsonic credentials are supplied Fixes issue #3733 --- src/internet/subsonicservice.cpp | 3 +++ src/internet/subsonicservice.h | 1 + src/internet/subsonicsettingspage.cpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/internet/subsonicservice.cpp b/src/internet/subsonicservice.cpp index 9d80e7c63..f31dba7e9 100644 --- a/src/internet/subsonicservice.cpp +++ b/src/internet/subsonicservice.cpp @@ -173,6 +173,9 @@ void SubsonicService::Login() { if (IsConfigured()) { // Ping is enough to check credentials Ping(); + } else { + login_state_ = LoginState_IncompleteCredentials; + emit LoginStateChanged(login_state_); } } diff --git a/src/internet/subsonicservice.h b/src/internet/subsonicservice.h index 6eeb9bbc0..c6f1b0cc9 100644 --- a/src/internet/subsonicservice.h +++ b/src/internet/subsonicservice.h @@ -37,6 +37,7 @@ class SubsonicService : public InternetService LoginState_HostNotFound, LoginState_Timeout, LoginState_SslError, + LoginState_IncompleteCredentials, }; enum ApiError { diff --git a/src/internet/subsonicsettingspage.cpp b/src/internet/subsonicsettingspage.cpp index da78f24eb..05705ecce 100644 --- a/src/internet/subsonicsettingspage.cpp +++ b/src/internet/subsonicsettingspage.cpp @@ -123,6 +123,10 @@ void SubsonicSettingsPage::LoginStateChanged(SubsonicService::LoginState newstat "SSLv3 option below may workaround some issues.")); break; + case SubsonicService::LoginState_IncompleteCredentials: + ui_->login_state->SetAccountTypeText(tr("Incomplete configuration, please ensure all fields are populated.")); + break; + default: break; }