X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmMain.cpp;h=96859290e4bb48ec8940014156481d9cfd5cf814;hb=93e56b6b6222c68d1fba49974b564f362a08d1bd;hp=fc9ba070208ee32f44a7fb338079064b9278ffec;hpb=27392ed361e1665fe56cdbd64a6d13e187090202;p=xestiaab%2F.git diff --git a/source/frmMain.cpp b/source/frmMain.cpp index fc9ba07..9685929 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -90,6 +90,9 @@ DEFINE_EVENT_TYPE(SYNCACCOUNT); DEFINE_EVENT_TYPE(IMPORT_RESULTSSHOW); DEFINE_EVENT_TYPE(RELOADCONTACTLIST); DEFINE_EVENT_TYPE(REFRESHADDRESSBOOK); +#if defined(__APPLE__) +DEFINE_EVENT_TYPE(INVALIDSSLTRUST); +#endif // Setup the event table using the event types. @@ -119,6 +122,9 @@ EVT_COMMAND(wxID_ANY, SYNCACCOUNT, frmMain::SyncAccount) EVT_COMMAND(wxID_ANY, IMPORT_RESULTSSHOW, frmMain::ShowImportResults) EVT_COMMAND(wxID_ANY, RELOADCONTACTLIST, frmMain::ReloadContactList) EVT_COMMAND(wxID_ANY, REFRESHADDRESSBOOK, frmMain::RefreshAddressBook) +#if defined(__APPLE__) +EVT_COMMAND(wxID_ANY, INVALIDSSLTRUST, frmMain::DisplayTrustPanel) +#endif END_EVENT_TABLE() frmMain::frmMain( wxWindow* parent ) @@ -477,7 +483,7 @@ void frmMain::OpenNewABDialog( wxCommandEvent& event) // the application. this->LoadPreferences(); - + } } @@ -645,7 +651,7 @@ void frmMain::LoadContactList( wxTreeEvent& event ) if (vCardFilename.Right(4) == wxT(".vcf") || vCardFilename.Right(4) == wxT(".VCF") || - vCardFlename.Right(5) == wxT(".vcard") || + vCardFilename.Right(5) == wxT(".vcard") || vCardFilename.Right(5) == wxT(".VCARD")){ vCard Person; @@ -1395,7 +1401,7 @@ void frmMain::LoadPreferences(){ } AccountSyncTimers.clear(); - + wxString AccDir; wxString AccDirFull; wxString AccDirFullSfx; @@ -1408,6 +1414,10 @@ void frmMain::LoadPreferences(){ wxTreeItemId AccountTreeId; wxTreeItemId GroupTreeId; int intGroupID = 0; + + // Relaod the accounts for the ETagProcTimer. + + ETagProcTimer.ReloadAccounts(); for (int i = 0; i < preferences.accounts.GetCount(); i++){ @@ -2480,8 +2490,52 @@ void frmMain::ShowSSLCertificates( wxCommandEvent &event ){ wxString AccTypeLower; wxString AccType; bool AccountSSL; - std::map::iterator SSLColIter; +#if defined(__APPLE__) + + std::map::iterator SSLTrustIter; + + for (int i = 0; i < prefaccounts.GetCount(); i++){ + + SeekAccount.Append(prefaccounts.GetAccountDirectory(i)); + AccType.Append(prefaccounts.GetAccountType(i)); + AccountSSL = prefaccounts.GetAccountSSL(i); + AccTypeLower = AccType.MakeLower(); + SeekAccount.Append(wxT(".")); + SeekAccount.Append(AccTypeLower); + + if (SeekAccount == ActiveAccount){ + + if (AccTypeLower == wxT("local")){ + + return; + + } + + if (AccountSSL == false){ + + return; + + } + + SSLTrustIter = AccountTrustData.find(i); + + // Setup and display the form. + + DisplayCertificate(SSLTrustIter->second); + + } + + SeekAccount.Clear(); + AccTypeLower.Clear(); + AccType.clear(); + + } + +#else + + std::map::iterator SSLColIter; + for (int i = 0; i < prefaccounts.GetCount(); i++){ SeekAccount.Append(prefaccounts.GetAccountDirectory(i)); @@ -2524,6 +2578,8 @@ void frmMain::ShowSSLCertificates( wxCommandEvent &event ){ AccType.clear(); } + +#endif } @@ -2553,61 +2609,6 @@ void frmMain::UpdateConnectionStatus( wxCommandEvent &event ){ } -void frmMain::SetupSSLStatus( int AccountID ){ - - // Check if account ID given is - // the active account and if not, do nothing. - - wxString AccType; - wxString AccTypeLower; - - AccType = prefaccounts.GetAccountType(AccountID); - AccTypeLower = AccType.MakeLower(); - - wxString AccountIDName = prefaccounts.GetAccountDirectory(AccountID) + wxT(".") + - AccTypeLower; - - if (AccountIDName != ActiveAccount){ - - return; - - } - - // Check if the account has SSL enabled. - - bool SSLInUse = prefaccounts.GetAccountSSL(AccountID); - - if (SSLInUse == FALSE){ - - SSLToolTip->SetTip(wxT("SSL is not enabled for this account")); - imgSSLStatus->SetBitmap(*imgNoSSL); - - } else { - - // Get the SSL Collection Data. - - std::map::iterator SSLResultIter = AccountSSLResult.find(AccountID); - - if (SSLResultIter->second == 1){ - - imgSSLStatus->SetBitmap(*imgSSLWarning); - SSLToolTip->SetTip(wxT("Invalid certificate(s) received for '") + - prefaccounts.GetAccountName(AccountID) + - wxT("' (Connection denied by user)\n\nDouble click for more information.")); - - } else if (SSLResultIter->second == 0){ - - imgSSLStatus->SetBitmap(*imgSSL); - SSLToolTip->SetTip(wxT("Account '") + - prefaccounts.GetAccountName(AccountID) + - wxT("' secured using SSL\n\nDouble click for more information.")); - - } - - } - -} - void frmMain::InvalidSSLCertificate( wxCommandEvent &event ){ // Display the form for showing an invalid SSL certificate. @@ -2630,6 +2631,7 @@ void frmMain::InvalidSSLCertificate( wxCommandEvent &event ){ frmActivityMgr *frameActMgr = static_cast(ActMgrPtr); wxPostEvent(frameActMgr, event2); + } void frmMain::PauseAllTimers(){ @@ -2658,6 +2660,26 @@ void frmMain::ResumeAllTimers(){ } +#if defined(__APPLE__) + +#elif defined(__WIN32__) + +void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, CERT_CONTEXT CertificateContext){ + + // Delete existing data. + + AccountCertificateData.erase(AccountID); + AccountSSLResult.erase(AccountID); + + // Insert new data. + + AccountCertificateData.insert(std::make_pair(AccountID, CertificateContext)); + AccountSSLResult.insert(std::make_pair(AccountID, SSLStatus)); + +} + +#else + void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc){ // Delete existing data. @@ -2672,6 +2694,63 @@ void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollec } +#endif + +void frmMain::SetupSSLStatus( int AccountID ){ + + // Check if account ID given is + // the active account and if not, do nothing. + + wxString AccType; + wxString AccTypeLower; + + AccType = prefaccounts.GetAccountType(AccountID); + AccTypeLower = AccType.MakeLower(); + + wxString AccountIDName = prefaccounts.GetAccountDirectory(AccountID) + wxT(".") + + AccTypeLower; + + if (AccountIDName != ActiveAccount){ + + return; + + } + + // Check if the account has SSL enabled. + + bool SSLInUse = prefaccounts.GetAccountSSL(AccountID); + + if (SSLInUse == FALSE){ + + SSLToolTip->SetTip(wxT("SSL is not enabled for this account")); + imgSSLStatus->SetBitmap(*imgNoSSL); + + } else { + + // Get the SSL Collection Data. + + std::map::iterator SSLResultIter = AccountSSLResult.find(AccountID); + + if (SSLResultIter->second == 1){ + + imgSSLStatus->SetBitmap(*imgSSLWarning); + SSLToolTip->SetTip(wxT("Invalid certificate(s) received for '") + + prefaccounts.GetAccountName(AccountID) + + wxT("' (Connection denied by user)\n\nDouble click for more information.")); + + } else if (SSLResultIter->second == 0){ + + imgSSLStatus->SetBitmap(*imgSSL); + SSLToolTip->SetTip(wxT("Account '") + + prefaccounts.GetAccountName(AccountID) + + wxT("' secured using SSL\n\nDouble click for more information.")); + + } + + } + +} + void frmMain::CheckUpdates( wxCommandEvent& event ){ // Check for updates to Xestia Address Book.