QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "ui_qgsauthtrustedcasdialog.h"
22 
23 #include <QSslCertificate>
24 
25 #include "qgsauthmanager.h"
26 
27 class QgsMessageBar;
28 
32 class GUI_EXPORT QgsAuthTrustedCAsDialog : public QDialog, private Ui::QgsAuthTrustedCAsDialog
33 {
34  Q_OBJECT
35 
36  public:
42  explicit QgsAuthTrustedCAsDialog( QWidget *parent = nullptr,
43  const QList<QSslCertificate>& trustedCAs = QList<QSslCertificate>() );
45 
46  private slots:
47  void populateCaCertsView();
48 
49  void showCertInfo( QTreeWidgetItem *item );
50 
52  void selectionChanged( const QItemSelection& selected, const QItemSelection& deselected );
53 
55  void checkSelection();
56 
57  void handleDoubleClick( QTreeWidgetItem* item, int col );
58 
59  void on_btnInfoCa_clicked();
60 
61  void on_btnGroupByOrg_toggled( bool checked );
62 
64  void authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level );
65 
66  protected:
68  void showEvent( QShowEvent *e ) override;
69 
70  private:
71  enum CaType
72  {
73  Section = 1000,
74  OrgName = 1001,
75  CaCert = 1002,
76  };
77 
78  void setupCaCertsTree();
79 
80  void populateCaCertsSection( QTreeWidgetItem *item, const QList<QSslCertificate>& certs,
81  QgsAuthTrustedCAsDialog::CaType catype );
82 
83  void appendCertsToGroup( const QList<QSslCertificate>& certs,
84  QgsAuthTrustedCAsDialog::CaType catype,
85  QTreeWidgetItem *parent = nullptr );
86 
87  void appendCertsToItem( const QList<QSslCertificate>& certs,
88  QgsAuthTrustedCAsDialog::CaType catype,
89  QTreeWidgetItem *parent = nullptr );
90 
91  QgsMessageBar * messageBar();
92  int messageTimeout();
93 
94  QList<QSslCertificate> mTrustedCAs;
95  bool mDisabled;
96  QVBoxLayout *mAuthNotifyLayout;
97  QLabel *mAuthNotify;
98 
99  QTreeWidgetItem * mRootCaSecItem;
100 };
101 
102 #endif // QGSAUTHTRUSTEDCASDIALOG_H
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:42
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)
virtual void showEvent(QShowEvent *event)
Widget for listing trusted Certificate (Intermediate) Authorities used in secure connections.