QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgsauthauthoritieseditor.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsauthauthoritieseditor.h
3 ---------------------
4 begin : April 26, 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 QGSAUTHAUTHORITIESEDITOR_H
18#define QGSAUTHAUTHORITIESEDITOR_H
19
20#include "ui_qgsauthauthoritieseditor.h"
21
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsauthcertutils.h"
25#include "qgsauthmanager.h"
26
27#include <QSslCertificate>
28#include <QWidget>
29
30class QgsMessageBar;
31class QMenu;
32class QAction;
33
38class GUI_EXPORT QgsAuthAuthoritiesEditor : public QWidget, private Ui::QgsAuthAuthoritiesEditor
39{
40 Q_OBJECT
41
42 public:
47 explicit QgsAuthAuthoritiesEditor( QWidget *parent SIP_TRANSFERTHIS = nullptr );
48
49 private slots:
50 void populateCaCertsView();
51
52 void refreshCaCertsView();
53
54 void showCertInfo( QTreeWidgetItem *item );
55
57 void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
58
60 void checkSelection();
61
62 void handleDoubleClick( QTreeWidgetItem *item, int col );
63
64 void btnAddCa_clicked();
65
66 void btnRemoveCa_clicked();
67
68 void btnInfoCa_clicked();
69
70 void btnGroupByOrg_toggled( bool checked );
71
72 void editDefaultTrustPolicy();
73
74 void defaultTrustPolicyChanged( QgsAuthCertUtils::CertTrustPolicy trustpolicy );
75
76 void btnCaFile_clicked();
77
78 void btnCaFileClear_clicked();
79
80 void showTrustedCertificateAuthorities();
81
83 void logMessage( const QString &message, const QString &authtag, Qgis::MessageLevel level );
84
85 protected:
87 void showEvent( QShowEvent *e ) override;
88
89 private:
90 enum CaType
91 {
92 Section = 1000,
93 OrgName = 1001,
94 RootCaCert = 1002,
95 FileCaCert = 1003,
96 DbCaCert = 1004,
97 };
98
99 void setupCaCertsTree();
100
101 void populateDatabaseCaCerts();
102
103 void populateFileCaCerts();
104
105 void populateRootCaCerts();
106
107 void populateCaCertsSection( QTreeWidgetItem *item, const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype );
108
109 void appendCertsToGroup( const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype, QTreeWidgetItem *parent = nullptr );
110
111 void appendCertsToItem( const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype, QTreeWidgetItem *parent = nullptr );
112
113 void updateCertTrustPolicyCache();
114
115 void populateUtilitiesMenu();
116
117 QgsMessageBar *messageBar();
118 int messageTimeout();
119
120 QVBoxLayout *mAuthNotifyLayout = nullptr;
121 QLabel *mAuthNotify = nullptr;
122
123 QTreeWidgetItem *mRootCaSecItem = nullptr;
124 QTreeWidgetItem *mFileCaSecItem = nullptr;
125 QTreeWidgetItem *mDbCaSecItem = nullptr;
126
128 QMap<QgsAuthCertUtils::CertTrustPolicy, QStringList> mCertTrustCache;
129
130 QMenu *mUtilitiesMenu = nullptr;
131 bool mDisabled = false;
132 QAction *mActionDefaultTrustPolicy = nullptr;
133 QAction *mActionShowTrustedCAs = nullptr;
134};
135
136#endif // QGSAUTHAUTHORITIESEDITOR_H
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:156
void showEvent(QShowEvent *e) override
Overridden show event of base widget.
QgsAuthAuthoritiesEditor(QWidget *parent=nullptr)
Widget for viewing and editing certificate authorities directly in database.
CertTrustPolicy
Type of certificate trust policy.
A bar for displaying non-blocking messages to the user.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53