+void frmNewAccount::UpdateResults( wxCommandEvent& event )
+{
+
+ NewAccountResult *ResultDataPointer = static_cast<NewAccountResult*>(event.GetClientData());
+ NewAccountResult ResultData = (*ResultDataPointer);
+
+ delete(ResultDataPointer);
+ ResultDataPointer = nullptr;
+ bool ServerResult = true;
+
+ // Process the result if the server connected.
+
+ if (ResultData.Connected == false){
+ lblServerConnResult->SetLabel(_("Failed"));
+ ServerResult = false;
+ } else {
+ lblServerConnResult->SetLabel(_("Success"));
+ }
+
+ // Check the result if the server gave a valid response.
+
+ if (ResultData.ValidResponse == false){
+ lblServerResponse->SetLabel(_("No"));
+ ServerResult = false;
+ } else {
+ lblServerResponse->SetLabel(_("Yes"));
+ }
+
+ // Check the result if the server uses SSL.
+
+ if (ResultData.SSLStatus == false){
+ lblServerSSLResult->SetLabel(_("No"));
+ } else {
+ lblServerSSLResult->SetLabel(_("Yes"));
+ }
+
+ // Check the server has a valid SSL certificate.
+
+ switch(ResultData.SSLVerified){
+ case COSSL_VERIFIED:
+ lblServerSSLValid->SetLabel(_("Verified"));
+ break;
+ case COSSL_VERIFIED_USER:
+ lblServerSSLValid->SetLabel(_("Verified (User)"));
+ break;
+ case COSSL_UNABLETOVERIFY:
+ lblServerSSLValid->SetLabel(_("Unable to verify"));
+ ServerResult = false;
+ break;
+ case COSSL_NOTAPPLICABLE:
+ lblServerSSLValid->SetLabel(_("Not applicable"));
+ break;
+ }
+
+ // Check if able to log into the server.
+
+ if (ResultData.AuthPassed == false){
+ lblAbleToLoginResult->SetLabel(_("No"));
+ ServerResult = false;
+ } else {
+ lblAbleToLoginResult->SetLabel(_("Yes"));
+ }
+
+ // Check if server has CardDAV support.
+
+ if (ResultData.CanProcess == false){
+ lblCardDAVSupportResult->SetLabel(_("No"));
+ ServerResult = false;
+ } else {
+ lblCardDAVSupportResult->SetLabel(_("Yes"));
+ }
+
+ if (ServerResult == false){
+ lblConnectionResultText->SetLabel(wxString::Format(_("An error occured whilst connecting: %s"), ResultData.ErrorMessage));
+ } else {
+ btnNext->Enable();
+ lblConnectionResultText->SetLabel(_("Click on Next to set the account name."));
+ }
+
+ btnPrevious->Enable();
+
+}
+