From: Steve Brokenshire Date: Mon, 11 Apr 2016 20:49:13 +0000 (+0100) Subject: Added OS X specific functions to frmNewAccount X-Git-Tag: release-0.12~19 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=d9da091bdf055f07cc97a1f3661a12b6420ad26b Added OS X specific functions to frmNewAccount --- diff --git a/source/frmNewAccount.mm b/source/frmNewAccount.mm new file mode 100644 index 0000000..690d1f2 --- /dev/null +++ b/source/frmNewAccount.mm @@ -0,0 +1,52 @@ +// frmNewAccount.mm - OS X specific functions for frmNewAccount +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + +#import +#import + +#include "frmNewAccount.h" +#include "carddav/carddav.h" + +int frmNewAccount::DisplayTrustPanel(CardDAV *Connection){ + + NSInteger ResultValue; + + SFCertificateTrustPanel *secpanel = [SFCertificateTrustPanel sharedCertificateTrustPanel]; + + [secpanel setDefaultButtonTitle:@"Accept"]; + [secpanel setAlternateButtonTitle:@"Cancel"]; + [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."]; + [secpanel setShowsHelp:YES]; + + [secpanel setParentWindow:(NSWindow*)this->GetHandle()]; + + ResultValue = [secpanel runModalForTrust:Connection->GetTrustObject() message:@"Certificate not trusted"]; + + return (int)ResultValue; + +} + +SecTrustResultType frmNewAccount::ProcessResultType(CardDAV *Connection){ + + SecTrustResultType EvalResult; + + SecTrustEvaluate(Connection->GetTrustObject(), &EvalResult); + + return EvalResult; + +} \ No newline at end of file