QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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 <QWidget>
21#include "qgis_sip.h"
22#include <QSslCertificate>
23
24#include "ui_qgsauthauthoritieseditor.h"
25#include "qgsauthcertutils.h"
26#include "qgsauthmanager.h"
27#include "qgis_gui.h"
28
29class QgsMessageBar;
30class QMenu;
31class QAction;
32
37class GUI_EXPORT QgsAuthAuthoritiesEditor : public QWidget, private Ui::QgsAuthAuthoritiesEditor
38{
39 Q_OBJECT
40
41 public:
46 explicit QgsAuthAuthoritiesEditor( QWidget *parent SIP_TRANSFERTHIS = nullptr );
47
48 private slots:
49 void populateCaCertsView();
50
51 void refreshCaCertsView();
52
53 void showCertInfo( QTreeWidgetItem *item );
54
56 void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
57
59 void checkSelection();
60
61 void handleDoubleClick( QTreeWidgetItem *item, int col );
62
63 void btnAddCa_clicked();
64
65 void btnRemoveCa_clicked();
66
67 void btnInfoCa_clicked();
68
69 void btnGroupByOrg_toggled( bool checked );
70
71 void editDefaultTrustPolicy();
72
73 void defaultTrustPolicyChanged( QgsAuthCertUtils::CertTrustPolicy trustpolicy );
74
75 void btnCaFile_clicked();
76
77 void btnCaFileClear_clicked();
78
79 void showTrustedCertificateAuthorities();
80
82 void logMessage( const QString &message, const QString &authtag, Qgis::MessageLevel level );
83
84 protected:
86 void showEvent( QShowEvent *e ) override;
87
88 private:
89 enum CaType
90 {
91 Section = 1000,
92 OrgName = 1001,
93 RootCaCert = 1002,
94 FileCaCert = 1003,
95 DbCaCert = 1004,
96 };
97
98 void setupCaCertsTree();
99
100 void populateDatabaseCaCerts();
101
102 void populateFileCaCerts();
103
104 void populateRootCaCerts();
105
106 void populateCaCertsSection( QTreeWidgetItem *item, const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype );
107
108 void appendCertsToGroup( const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype, QTreeWidgetItem *parent = nullptr );
109
110 void appendCertsToItem( const QList<QSslCertificate> &certs, QgsAuthAuthoritiesEditor::CaType catype, QTreeWidgetItem *parent = nullptr );
111
112 void updateCertTrustPolicyCache();
113
114 void populateUtilitiesMenu();
115
116 QgsMessageBar *messageBar();
117 int messageTimeout();
118
119 QVBoxLayout *mAuthNotifyLayout = nullptr;
120 QLabel *mAuthNotify = nullptr;
121
122 QTreeWidgetItem *mRootCaSecItem = nullptr;
123 QTreeWidgetItem *mFileCaSecItem = nullptr;
124 QTreeWidgetItem *mDbCaSecItem = nullptr;
125
127 QMap<QgsAuthCertUtils::CertTrustPolicy, QStringList> mCertTrustCache;
128
129 QMenu *mUtilitiesMenu = nullptr;
130 bool mDisabled = false;
131 QAction *mActionDefaultTrustPolicy = nullptr;
132 QAction *mActionShowTrustedCAs = nullptr;
133};
134
135#endif // QGSAUTHAUTHORITIESEDITOR_H
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:154
Widget for viewing and editing authentication identities 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