X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmEditAccount.cpp;h=488362589f5fc393029faa5296e255c989195240;hb=7463b9071a5aa395e59737cbdfd3445832ff016c;hp=8e53f99397c4976bfad1f0e95432d3ac76e2bb97;hpb=8279895c2ecfc6691d474d6b3e033db336307dc8;p=xestiaab%2F.git diff --git a/source/frmEditAccount.cpp b/source/frmEditAccount.cpp index 8e53f99..4883625 100644 --- a/source/frmEditAccount.cpp +++ b/source/frmEditAccount.cpp @@ -19,6 +19,7 @@ #include "frmEditAccount.h" #include "frmInvalidSSLCertificate.h" #include "carddav/carddav.h" +#include "common/svrblist.h" frmEditAccount::frmEditAccount( wxWindow* parent ) : @@ -92,7 +93,7 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) if (sslcode == CURLE_OK){ - + // Certificate is okay. Do nothing. } else if (sslcode == CURLE_SSL_CACERT || sslcode == CURLE_SSL_CONNECT_ERROR){ @@ -156,13 +157,16 @@ void frmEditAccount::DetectAddressBook( wxCommandEvent& event ) void frmEditAccount::LoadPointers( wxFileConfig* cfgin ){ + // Setup the account configuration file pointer. + cfgfile = cfgin; } void frmEditAccount::LoadSettings( wxString AccNameIn ){ - // Get the data from the accounts settings file. + // Get the data from the accounts settings file and + // fill in the account fields. AccName = AccNameIn; long itemindex = 0; @@ -218,6 +222,19 @@ void frmEditAccount::LoadSettings( wxString AccNameIn ){ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) { + // Check if server address matches against the blacklist. + // Bring up warning message if it does. + + if (CheckBlacklist(txtAddress->GetValue())){ + + int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this); + + if (MessageBoxResult == wxNO){ + return; + } + + } + // Update the settings for the account. long itemindex = 0; @@ -276,6 +293,8 @@ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) } + // Set the dialog result to true and close the window. + DialogResult = true; this->Close(); @@ -283,11 +302,17 @@ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) void frmEditAccount::CloseWindow( wxCommandEvent& event ) { + + // Set the dialog result to false and close the window. + DialogResult = false; this->Close(); + } bool frmEditAccount::GetDialogResult(){ + + // Get the result of the dialog. return DialogResult;