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: case ApiError_Unlicensed:
login_state_ = LoginState_Unlicensed; login_state_ = LoginState_Unlicensed;
break; break;
case ApiError_OutdatedServer:
login_state_ = LoginState_OutdatedServer;
break;
default: default:
login_state_ = LoginState_OtherError; login_state_ = LoginState_OtherError;
break; break;

View File

@ -25,6 +25,7 @@ class SubsonicService : public InternetService
LoginState_BadServer, LoginState_BadServer,
LoginState_BadCredentials, LoginState_BadCredentials,
LoginState_Unlicensed, LoginState_Unlicensed,
LoginState_OutdatedServer,
LoginState_OtherError, LoginState_OtherError,
LoginState_Unknown, 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.")); ui_->login_state->SetAccountTypeText(tr("The Subsonic API is only available on licensed servers."));
break; break;
case SubsonicService::LoginState_OutdatedServer:
ui_->login_state->SetAccountTypeText(tr("Incompatible Subsonic REST protocol version. Server must upgrade."));
break;
case SubsonicService::LoginState_OtherError: case SubsonicService::LoginState_OtherError:
ui_->login_state->SetAccountTypeText(tr("An unspecified error occurred.")); ui_->login_state->SetAccountTypeText(tr("An unspecified error occurred."));
break; break;