QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsauthidentitieseditor.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthidentitieseditor.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 QGSAUTHIDENTITIESEDITOR_H
18 #define QGSAUTHIDENTITIESEDITOR_H
19 
20 #include <QWidget>
21 #include <QSslCertificate>
22 
23 #include "ui_qgsauthidentitieseditor.h"
24 #include "qgsauthmanager.h"
25 
26 class QgsMessageBar;
27 
31 class GUI_EXPORT QgsAuthIdentitiesEditor : public QWidget, private Ui::QgsAuthIdentitiesEditor
32 {
33  Q_OBJECT
34 
35  public:
40  explicit QgsAuthIdentitiesEditor( QWidget *parent = nullptr );
42 
43  private slots:
44  void populateIdentitiesView();
45 
46  void refreshIdentitiesView();
47 
48  void showCertInfo( QTreeWidgetItem *item );
49 
51  void selectionChanged( const QItemSelection& selected, const QItemSelection& deselected );
52 
54  void checkSelection();
55 
56  void handleDoubleClick( QTreeWidgetItem* item, int col );
57 
58  void on_btnAddIdentity_clicked();
59 
60  void on_btnRemoveIdentity_clicked();
61 
62  void on_btnInfoIdentity_clicked();
63 
64  void on_btnGroupByOrg_toggled( bool checked );
65 
67  void authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level );
68 
69  protected:
71  void showEvent( QShowEvent *e ) override;
72 
73  private:
74  enum IdentityType
75  {
76  Section = 1000,
77  OrgName = 1001,
78  CertIdentity = 1002,
79  };
80 
81  void setupIdentitiesTree();
82 
83  void populateIdentitiesSection( QTreeWidgetItem *item, const QList<QSslCertificate>& certs,
84  QgsAuthIdentitiesEditor::IdentityType identype );
85 
86  void appendIdentitiesToGroup( const QList<QSslCertificate>& certs,
87  QgsAuthIdentitiesEditor::IdentityType identype,
88  QTreeWidgetItem *parent = nullptr );
89 
90  void appendIdentitiesToItem( const QList<QSslCertificate>& certs,
91  QgsAuthIdentitiesEditor::IdentityType identype,
92  QTreeWidgetItem *parent = nullptr );
93 
94  QgsMessageBar * messageBar();
95  int messageTimeout();
96 
97  bool mDisabled;
98  QVBoxLayout *mAuthNotifyLayout;
99  QLabel *mAuthNotify;
100 
101  QTreeWidgetItem *mRootCertIdentItem;
102 };
103 
104 #endif // QGSAUTHIDENTITIESEDITOR_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 viewing and editing authentication identities database.