QGIS API Documentation  3.24.2-Tisler (13c1a02865)
qgsauthconfigeditor.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthconfigeditor.h
3  ---------------------
4  begin : October 5, 2014
5  copyright : (C) 2014 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 QGSAUTHCONFIGEDITOR_H
18 #define QGSAUTHCONFIGEDITOR_H
19 
20 #include <QSqlTableModel>
21 #include "qgis_sip.h"
22 #include <QWidget>
23 
24 #include "ui_qgsauthconfigeditor.h"
25 #include "qgsauthmanager.h"
26 #include "qgis_gui.h"
27 
28 class QgsMessageBar;
29 
34 class GUI_EXPORT QgsAuthConfigEditor : public QWidget, private Ui::QgsAuthConfigEditor
35 {
36  Q_OBJECT
37 
38  public:
39 
46  explicit QgsAuthConfigEditor( QWidget *parent SIP_TRANSFERTHIS = nullptr, bool showUtilities = true, bool relayMessages = true );
47 
49  void toggleTitleVisibility( bool visible );
50 
55  QStringList selectedAuthenticationConfigIds() const;
56 
57  public slots:
59  void setShowUtilitiesButton( bool show = true );
60 
62  void setRelayMessages( bool relay = true );
63 
64  private slots:
66  void refreshTableView();
67 
69  void importAuthenticationConfigs();
70 
72  void exportSelectedAuthenticationConfigs();
73 
75  void setMasterPassword();
76 
78  void clearCachedMasterPassword();
79 
81  void resetMasterPassword();
82 
84  void clearCachedAuthenticationConfigs();
85 
87  void removeAuthenticationConfigs();
88 
90  void eraseAuthenticationDatabase();
91 
93  void authMessageOut( const QString &message, const QString &authtag, QgsAuthManager::MessageLevel level );
94 
96  void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
97 
99  void checkSelection();
100 
101  void btnAddConfig_clicked();
102 
103  void btnEditConfig_clicked();
104 
105  void btnRemoveConfig_clicked();
106 
107  private:
108  bool mRelayMessages;
109  QgsMessageBar *messageBar();
110  QString selectedConfigId();
111 
112  QSqlTableModel *mConfigModel = nullptr;
113 
114  QMenu *mAuthUtilitiesMenu = nullptr;
115  QAction *mActionImportAuthenticationConfigs = nullptr;
116  QAction *mActionExportSelectedAuthenticationConfigs = nullptr;
117  QAction *mActionSetMasterPassword = nullptr;
118  QAction *mActionClearCachedMasterPassword = nullptr;
119  QAction *mActionResetMasterPassword = nullptr;
120  QAction *mActionClearCachedAuthConfigs = nullptr;
121  QAction *mActionRemoveAuthConfigs = nullptr;
122  QAction *mActionEraseAuthDatabase = nullptr;
123 
124  bool mDisabled = false;
125  QVBoxLayout *mAuthNotifyLayout = nullptr;
126  QLabel *mAuthNotify = nullptr;
127 };
128 
129 #endif // QGSAUTHCONFIGEDITOR_H
Widget for editing authentication configuration database.
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:61
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53