When API version doesn't match, show error message (fixes #2)

This commit is contained in:
Danilo Bargen 2012-01-18 21:21:42 +01:00 committed by Alan Briolat
parent 6eb1e853a3
commit 551551b451
3 changed files with 8 additions and 0 deletions

View File

@ -242,6 +242,9 @@ void SubsonicService::onPingFinished()
case ApiError_Unlicensed:
login_state_ = LoginState_Unlicensed;
break;
case ApiError_OutdatedServer:
login_state_ = LoginState_OutdatedServer;
break;
default:
login_state_ = LoginState_OtherError;
break;

View File

@ -25,6 +25,7 @@ class SubsonicService : public InternetService
LoginState_BadServer,
LoginState_BadCredentials,
LoginState_Unlicensed,
LoginState_OutdatedServer,
LoginState_OtherError,
LoginState_Unknown,
};

View File

@ -76,6 +76,10 @@ void SubsonicSettingsPage::LoginStateChanged(SubsonicService::LoginState newstat
ui_->login_state->SetAccountTypeText(tr("The Subsonic API is only available on licensed servers."));
break;
case SubsonicService::LoginState_OutdatedServer:
ui_->login_state->SetAccountTypeText(tr("Incompatible Subsonic REST protocol version. Server must upgrade."));
break;
case SubsonicService::LoginState_OtherError:
ui_->login_state->SetAccountTypeText(tr("An unspecified error occurred."));
break;