QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsauthtrustedcasdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthtrustedcasdialog.h
3  ---------------------
4  begin : May 9, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSAUTHTRUSTEDCASDIALOG_H
18 #define QGSAUTHTRUSTEDCASDIALOG_H
19 
20 #include <QDialog>
21 #include "qgis.h"
22 #include "ui_qgsauthtrustedcasdialog.h"
23 
24 #include <QSslCertificate>
25 
26 #include "qgsauthmanager.h"
27 #include "qgis_gui.h"
28 
29 class QgsMessageBar;
30 
35 class GUI_EXPORT QgsAuthTrustedCAsDialog : public QDialog, private Ui::QgsAuthTrustedCAsDialog
36 {
37  Q_OBJECT
38 
39  public:
40 
46  explicit QgsAuthTrustedCAsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr,
47  const QList<QSslCertificate> &trustedCAs = QList<QSslCertificate>() );
48 
49  private slots:
50  void populateCaCertsView();
51 
52  void showCertInfo( QTreeWidgetItem *item );
53 
55  void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
56 
58  void checkSelection();
59 
60  void handleDoubleClick( QTreeWidgetItem *item, int col );
61 
62  void btnInfoCa_clicked();
63 
64  void btnGroupByOrg_toggled( bool checked );
65 
67  void authMessageOut( const QString &message, const QString &authtag, QgsAuthManager::MessageLevel level );
68 
69  protected:
70 
71  void showEvent( QShowEvent *e ) override;
72 
73  private:
74  enum CaType
75  {
76  Section = 1000,
77  OrgName = 1001,
78  CaCert = 1002,
79  };
80 
81  void setupCaCertsTree();
82 
83  void populateCaCertsSection( QTreeWidgetItem *item, const QList<QSslCertificate> &certs,
84  QgsAuthTrustedCAsDialog::CaType catype );
85 
86  void appendCertsToGroup( const QList<QSslCertificate> &certs,
87  QgsAuthTrustedCAsDialog::CaType catype,
88  QTreeWidgetItem *parent = nullptr );
89 
90  void appendCertsToItem( const QList<QSslCertificate> &certs,
91  QgsAuthTrustedCAsDialog::CaType catype,
92  QTreeWidgetItem *parent = nullptr );
93 
94  QgsMessageBar *messageBar();
95  int messageTimeout();
96 
97  QList<QSslCertificate> mTrustedCAs;
98  bool mDisabled = false;
99  QVBoxLayout *mAuthNotifyLayout = nullptr;
100  QLabel *mAuthNotify = nullptr;
101 
102  QTreeWidgetItem *mRootCaSecItem = nullptr;
103 };
104 
105 #endif // QGSAUTHTRUSTEDCASDIALOG_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:45
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)
Widget for listing trusted Certificate (Intermediate) Authorities used in secure connections.