Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / frmInvalidSSLCertificate.cpp
1 // frmInvalidSSLCertificate.cpp - Invalid SSL Certificate form.
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 #include "frmInvalidSSLCertificate.h"
20 #include "frmSSLCertificate.h"
22 frmInvalidSSLCertificate::frmInvalidSSLCertificate( wxWindow* parent )
23 :
24 frmInvalidSSLCertificateADT( parent )
25 {
27 }
29 void frmInvalidSSLCertificate::Accept( wxCommandEvent& event )
30 {
31         
32         // Button 'Accept' was pressed.
33         
34         intResult = 1;
35         Close();
36         
37 }
39 void frmInvalidSSLCertificate::Reject( wxCommandEvent& event )
40 {
41         
42         // Button 'Reject' was pressed.
43         
44         intResult = 2;
45         Close();
46         
47 }
49 void frmInvalidSSLCertificate::ViewCertificates( wxCommandEvent& event )
50 {
51         
52         // Button 'View Certificates' was pressed.
53         
54         frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
55         frameSSLCert->StartCertFrom(0);
56         frameSSLCert->SetupCertsString(CertDataString);
57         frameSSLCert->ShowModal();
58                 
59         delete frameSSLCert;
60         frameSSLCert = NULL;
61         
62 }
64 void frmInvalidSSLCertificate::LoadData(SSLCertCollection CertDataInc, 
65                                         wxString AccountNameInc)
66 {
68         // Load the invalid SSL certificate dialog.
69         
70         AccountName = AccountNameInc;
71         CertData = CertDataInc;
73         wxString SSLTextLabel;
74         
75         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
76         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
77         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
78         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
79         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
80         
81         lblSSLText->SetLabel(SSLTextLabel);
83 }
85 void frmInvalidSSLCertificate::LoadData(SSLCertCollectionString CertDataInc, 
86                                         wxString AccountNameInc)
87 {
89         // Load the invalid SSL certificate dialog.
90         
91         AccountName = AccountNameInc;
92         CertDataString = CertDataInc;
94         wxString SSLTextLabel;
95         
96         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
97         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
98         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
99         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
100         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
101         
102         lblSSLText->SetLabel(SSLTextLabel);
106 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollection CertDataInc, 
107                                         wxString DomainNameInc)
110         // Load the invalid SSL certificate dialog for a new account.
111         
112         AccountName = DomainNameInc;
113         CertData = CertDataInc;
114         
115         wxString SSLTextLabel;
116         
117         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
118         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
119         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
120         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
121         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
122         
123         lblSSLText->SetLabel(SSLTextLabel);
124         
127 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollectionString CertDataInc, 
128                                         std::string DomainNameInc)
131         // Load the invalid SSL certificate dialog for a new account.
132         
133         AccountName = DomainNameInc;
134         CertDataString = CertDataInc;
135         
136         wxString SSLTextLabel;
137         
138         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
139         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
140         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
141         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
142         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
143         
144         lblSSLText->SetLabel(SSLTextLabel);
145         
148 int frmInvalidSSLCertificate::GetResult()
151         // Get the result of which button was pressed in the dialog.
152         
153         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