1 /* ============================================================
2 * QuiteRSS is a open-source cross-platform RSS/Atom news feeds reader
3 * Copyright (C) 2011-2020 QuiteRSS Team <quiterssteam@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 * ============================================================ */
18 #ifndef SSLERRORDIALOG_H
19 #define SSLERRORDIALOG_H
20 
21 #include "dialog.h"
22 
23 #include <QSslCertificate>
24 
25 class SslErrorDialog : public Dialog
26 {
27   Q_OBJECT
28 
29 public:
30   enum Result { Yes, No, OnlyForThisSession };
31 
32   explicit SslErrorDialog(QWidget* parent = 0);
33   ~SslErrorDialog();
34 
35   void setText(const QString &text);
36   Result result();
37 
38   static QString certificateItemText(const QSslCertificate &cert);
39   static QString clearCertSpecialSymbols(const QString &string);
40   static QString clearCertSpecialSymbols(const QStringList &stringList);
41 
42 private slots:
43   void buttonClicked(QAbstractButton* button);
44 
45 private:
46   QLabel *errorLabel_;
47   Result result_;
48 
49 };
50 
51 #endif // SSLERRORDIALOG_H
52