1 // frmInvalidSSLCertificate.cpp - frmInvalidSSLCertificate form functions
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Calendar 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.
11 // Xestia Calendar 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.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #include "frmInvalidSSLCertificate.h"
21 frmInvalidSSLCertificate::frmInvalidSSLCertificate( wxWindow* parent )
23 frmInvalidSSLCertificateADT( parent )
28 void frmInvalidSSLCertificate::Accept( wxCommandEvent& event )
30 // Button 'Accept' was pressed.
36 void frmInvalidSSLCertificate::Reject( wxCommandEvent& event )
38 // Button 'Reject' was pressed.
44 void frmInvalidSSLCertificate::ViewCertificates( wxCommandEvent& event )
46 // Button 'View Certificates' was pressed.
48 /*frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
49 frameSSLCert->StartCertFrom(0);
50 frameSSLCert->SetupCertsString(CertDataString);
51 frameSSLCert->ShowModal();
54 frameSSLCert = NULL;*/
57 void frmInvalidSSLCertificate::LoadData(SSLCertCollection CertDataInc,
58 wxString AccountNameInc)
61 // Load the invalid SSL certificate dialog.
63 AccountName = AccountNameInc;
64 CertData = CertDataInc;
66 wxString SSLTextLabel;
68 SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
69 SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
70 SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
71 SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
72 SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
74 lblSSLText->SetLabel(SSLTextLabel);
78 void frmInvalidSSLCertificate::LoadData(SSLCertCollectionString CertDataInc,
79 wxString AccountNameInc)
82 // Load the invalid SSL certificate dialog.
84 AccountName = AccountNameInc;
85 CertDataString = CertDataInc;
87 wxString SSLTextLabel;
89 SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
90 SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
91 SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
92 SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
93 SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
95 lblSSLText->SetLabel(SSLTextLabel);
99 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollection CertDataInc,
100 wxString DomainNameInc)
103 // Load the invalid SSL certificate dialog for a new account.
105 AccountName = DomainNameInc;
106 CertData = CertDataInc;
108 wxString SSLTextLabel;
110 SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
111 SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
112 SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
113 SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
114 SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
116 lblSSLText->SetLabel(SSLTextLabel);
120 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollectionString CertDataInc,
121 std::string DomainNameInc)
124 // Load the invalid SSL certificate dialog for a new account.
126 AccountName = DomainNameInc;
127 CertDataString = CertDataInc;
129 wxString SSLTextLabel;
131 SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
132 SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
133 SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
134 SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
135 SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
137 lblSSLText->SetLabel(SSLTextLabel);
141 int frmInvalidSSLCertificate::GetResult()
144 // Get the result of which button was pressed in the dialog.