-
- // Spawn a thread and check if server supports CardDAV.
-
- CardDAV CardDAVConn;
-
- lblServerConnResult->SetLabel(_("Testing..."));
-
- UseSSL = chkUseSSL->GetValue();
-
- CardDAVConn.SetupConnection(txtServerAddress->GetValue(),
- wxAtoi(txtServerPort->GetValue()),
- txtUsername->GetValue(),
- txtPassword->GetValue(),
- UseSSL);
- CardDAVConn.SetupResultBools(&ServerResult, &ServerAction);
-
- std::thread ConnTest(&CardDAV::Connect, &CardDAVConn);
-
- ConnTest.join();
-
- if (ServerResult == FALSE){
-
- lblServerConnResult->SetLabel(_("Failed"));
- wxMessageBox(CardDAVConn.GetErrorMessage());
- return;
-
- } else {
-
- lblServerConnResult->SetLabel(_("Connected"));
-
- }
-
- if (CardDAVConn.HasValidResponse() == TRUE){
-
- lblServerResponse->SetLabel(_("Yes"));
-
- } else {
-
- lblServerResponse->SetLabel(_("No"));
-
- }
-
- if (CardDAVConn.CanDoSSL() == TRUE){
-
- lblCardDAVSupportResult->SetLabel(_("Used"));
-
- } else {
-
- lblServerSSLResult->SetLabel(_("Not Used"));
- lblServerSSLValid->SetLabel(_("Not Applicable"));
-
- }
-
- if (CardDAVConn.SSLVerify() == TRUE && CardDAVConn.CanDoSSL() == TRUE){
-
- lblCardDAVSupportResult->SetLabel(_("Verified"));
-
- } else if (CardDAVConn.SSLVerify() == FALSE && CardDAVConn.CanDoSSL() == TRUE) {
-
- lblServerSSLResult->SetLabel(_("Unable to verify"));
-
- }
-
- if (CardDAVConn.CanDoCardDAV() == TRUE){
-
- lblCardDAVSupportResult->SetLabel(_("Supported"));
-
- } else {
-
- lblCardDAVSupportResult->SetLabel(_("Unsupported"));
-
- }
-
- if (CardDAVConn.AbleToLogin() == TRUE){
-
- lblAbleToLoginResult->SetLabel(_("Yes"));
-
- } else {
-
- lblAbleToLoginResult->SetLabel(_("No"));
-
- }
-
- // Get the address to process CardDAV requests.
-
- ServerPrefix = CardDAVConn.GetDefaultAddressBookURL();
-
- wxMessageBox(ServerPrefix);
-
- if (ServerResult == TRUE && CardDAVConn.HasValidResponse() == TRUE &&
- //CardDAVConn.CanDoSSL() == TRUE && CardDAVConn.SSLVerify() == TRUE &&
- CardDAVConn.CanDoCardDAV() == TRUE && CardDAVConn.AbleToLogin() == TRUE){
-
- btnNext->Enable();
-
- lblConnectionResultText->SetLabel(_("Click on Next to set the account name."));
-
- } else {
-
- lblConnectionResultText->SetLabel(_("A problem has occured whilst connecting to the CardDAV server.\nPlease review the above information and change the server details if needed.\nIf there are still problems, please speak to your system administrator(s)."));
-
- }