Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
4c61e9b289326697d9ea43b6c0ff945da404072d
[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 // TODO: Implement Accept
31 }
33 void frmInvalidSSLCertificate::Reject( wxCommandEvent& event )
34 {
35 // TODO: Implement Reject
36 }
38 void frmInvalidSSLCertificate::ViewCertificates( wxCommandEvent& event )
39 {
40         // Button 'View Certificates' was pressed.
41         
42         /*frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
43         frameSSLCert->StartCertFrom(0);
44         frameSSLCert->SetupCertsString(CertDataString);
45         frameSSLCert->ShowModal();
46                 
47         delete frameSSLCert;
48         frameSSLCert = NULL;*/
49 }
51 void frmInvalidSSLCertificate::LoadData(SSLCertCollection CertDataInc, 
52                                         wxString AccountNameInc)
53 {
55         // Load the invalid SSL certificate dialog.
56         
57         AccountName = AccountNameInc;
58         CertData = CertDataInc;
60         wxString SSLTextLabel;
61         
62         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
63         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
64         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
65         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
66         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
67         
68         lblSSLText->SetLabel(SSLTextLabel);
70 }
72 void frmInvalidSSLCertificate::LoadData(SSLCertCollectionString CertDataInc, 
73                                         wxString AccountNameInc)
74 {
76         // Load the invalid SSL certificate dialog.
77         
78         AccountName = AccountNameInc;
79         CertDataString = CertDataInc;
81         wxString SSLTextLabel;
82         
83         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
84         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
85         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
86         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect (you will be asked again on subsequent reconnections to the server).\n"));
87         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
88         
89         lblSSLText->SetLabel(SSLTextLabel);
91 }
93 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollection CertDataInc, 
94                                         wxString DomainNameInc)
95 {
97         // Load the invalid SSL certificate dialog for a new account.
98         
99         AccountName = DomainNameInc;
100         CertData = CertDataInc;
101         
102         wxString SSLTextLabel;
103         
104         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
105         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
106         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
107         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
108         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
109         
110         lblSSLText->SetLabel(SSLTextLabel);
111         
114 void frmInvalidSSLCertificate::LoadDataNew(SSLCertCollectionString CertDataInc, 
115                                         std::string DomainNameInc)
118         // Load the invalid SSL certificate dialog for a new account.
119         
120         AccountName = DomainNameInc;
121         CertDataString = CertDataInc;
122         
123         wxString SSLTextLabel;
124         
125         SSLTextLabel.Append(wxString::Format(_("An invalid SSL certificate was received from the server for the '%s' account.\n\n"), AccountName));
126         SSLTextLabel.Append(_("Click on one of the following buttons:\n\n"));
127         SSLTextLabel.Append(_("- Accept to accept the SSL certificate for this session and future sessions until the certificate changes.\n"));
128         SSLTextLabel.Append(_("- Reject to not use this certificate and disconnect.\n"));
129         SSLTextLabel.Append(_("- View Certificates to review the certificates that were received."));
130         
131         lblSSLText->SetLabel(SSLTextLabel);
132         
135 int frmInvalidSSLCertificate::GetResult()
138         // Get the result of which button was pressed in the dialog.
139         
140         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