Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
timers: minor code clean up
[xestiaab/.git] / source / frmMain.mm
1 // frmMain.mm - OS X specific functions for frmMain
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #import <Foundation/Foundation.h>
20 #import <SecurityInterface/SFCertificatePanel.h>
22 #include "frmMain.h"
24 void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, SecTrustRef SecurityTrustObject){
25     
26         // Delete existing data.
27     
28         AccountTrustData.erase(AccountID);
29         AccountSSLResult.erase(AccountID);
30     
31         // Insert new data.
32     
33         AccountTrustData.insert(std::make_pair(AccountID, SecurityTrustObject));
34         AccountSSLResult.insert(std::make_pair(AccountID, SSLStatus));
35     
36 }
38 void frmMain::DisplayCertificate(SecTrustRef SecurityTrustObject){
39         
40         SFCertificatePanel *SecCertPanel = [[SFCertificatePanel alloc] init];
41         
42         [SecCertPanel setParentWindow:(NSWindow*)this->GetHandle()];
43         [SecCertPanel setDefaultButtonTitle:@"Close"];
44         
45         [SecCertPanel runModalForTrust:SecurityTrustObject showGroup:YES];
46         
47 }
49 void frmMain::DisplayTrustPanel( wxCommandEvent &event ){
50         
51         SSLInvalidTrustNotifObj *SSLITNObj = (SSLInvalidTrustNotifObj*)event.GetClientData();
52         
53         NSInteger ResultValue;
54         
55         SFCertificateTrustPanel *secpanel = [SFCertificateTrustPanel sharedCertificateTrustPanel];
56         
57         [secpanel setDefaultButtonTitle:@"Accept"];
58         [secpanel setAlternateButtonTitle:@"Cancel"];
59         [secpanel setInformativeText: @"This certificate is not trusted. Someone could be trying to eavesdrop on your connection. Do you want to accept this certificate anyway?\n\nAccept and trusting the certificate will fetch and process information as required.\nCancel will close the connection."];
60         [secpanel setShowsHelp:YES];
61         
62         [secpanel setParentWindow:(NSWindow*)this->GetHandle()];
63         
64         ResultValue = [secpanel runModalForTrust:SSLITNObj->SecurityTrustObject message:@"Certificate not trusted"];
66         *SSLITNObj->ResultValue = (int)ResultValue;
67         *SSLITNObj->PausePtr = FALSE;
68         
69 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy