Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmInvalidSSLCertificate: Build it and implemented accept/reject buttons
[xestiacalendar/.git] / source / forms / invalidsslcertificate / frmInvalidSSLCertificate.cpp
1 // frmInvalidSSLCertificate.cpp - frmInvalidSSLCertificate form functions
2 //
3 // (c) 2016-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
15 //
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 )
22 :
23 frmInvalidSSLCertificateADT( parent )
24 {
26 }
28 void frmInvalidSSLCertificate::Accept( wxCommandEvent& event )
29 {
30         // Button 'Accept' was pressed.
31         
32         intResult = 1;
33         Close();
34 }
36 void frmInvalidSSLCertificate::Reject( wxCommandEvent& event )
37 {
38         // Button 'Reject' was pressed.
39         
40         intResult = 2;
41         Close();
42 }
44 void frmInvalidSSLCertificate::ViewCertificates( wxCommandEvent& event )
45 {
46         // Button 'View Certificates' was pressed.
47         
48         /*frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
49         frameSSLCert->StartCertFrom(0);
50         frameSSLCert->SetupCertsString(CertDataString);
51         frameSSLCert->ShowModal();
52                 
53         delete frameSSLCert;
54         frameSSLCert = NULL;*/
55 }
57 void frmInvalidSSLCertificate::LoadData(SSLCertCollection CertDataInc, 
58                                         wxString AccountNameInc)
59 {
61         // Load the invalid SSL certificate dialog.
62         
63         AccountName = AccountNameInc;
64         CertData = CertDataInc;
66         wxString SSLTextLabel;
67         
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."));
73         
74         lblSSLText->SetLabel(SSLTextLabel);
76 }
78 void frmInvalidSSLCertificate::LoadData(SSLCertCollectionString CertDataInc, 
79                                         wxString AccountNameInc)
80 {
82         // Load the invalid SSL certificate dialog.
83         
84         AccountName = AccountNameInc;
85         CertDataString = CertDataInc;
87         wxString SSLTextLabel;
88         
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."));
94         
95         lblSSLText->SetLabel(SSLTextLabel);
97 }
99 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollection CertDataInc, 
100                                         wxString DomainNameInc)
103         // Load the invalid SSL certificate dialog for a new account.
104         
105         AccountName = DomainNameInc;
106         CertData = CertDataInc;
107         
108         wxString SSLTextLabel;
109         
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."));
115         
116         lblSSLText->SetLabel(SSLTextLabel);
117         
120 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollectionString CertDataInc, 
121                                         std::string DomainNameInc)
124         // Load the invalid SSL certificate dialog for a new account.
125         
126         AccountName = DomainNameInc;
127         CertDataString = CertDataInc;
128         
129         wxString SSLTextLabel;
130         
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."));
136         
137         lblSSLText->SetLabel(SSLTextLabel);
138         
141 int frmInvalidSSLCertificate::GetResult()
144         // Get the result of which button was pressed in the dialog.
145         
146         return intResult;
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