QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 <QWidget>
22 
23 #include "ui_qgsauthconfigeditor.h"
24 #include "qgsauthmanager.h"
25 
26 class QgsMessageBar;
27 
31 class GUI_EXPORT QgsAuthConfigEditor : public QWidget, private Ui::QgsAuthConfigEditor
32 {
33  Q_OBJECT
34 
35  public:
42  explicit QgsAuthConfigEditor( QWidget *parent = nullptr, bool showUtilities = true, bool relayMessages = true );
44 
46  void toggleTitleVisibility( bool visible );
47 
48  public slots:
50  void setShowUtilitiesButton( bool show = true );
51 
53  void setRelayMessages( bool relay = true );
54 
55  private slots:
57  void refreshTableView();
58 
60  void setMasterPassword();
61 
63  void clearCachedMasterPassword();
64 
66  void resetMasterPassword();
67 
69  void clearCachedAuthenticationConfigs();
70 
72  void removeAuthenticationConfigs();
73 
75  void eraseAuthenticationDatabase();
76 
78  void authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level );
79 
81  void selectionChanged( const QItemSelection& selected, const QItemSelection& deselected );
82 
84  void checkSelection();
85 
86  void on_btnAddConfig_clicked();
87 
88  void on_btnEditConfig_clicked();
89 
90  void on_btnRemoveConfig_clicked();
91 
92  private:
93  bool mRelayMessages;
94  QgsMessageBar * messageBar();
95  int messageTimeout();
96  QString selectedConfigId();
97 
98  QSqlTableModel *mConfigModel;
99 
100  QMenu *mAuthUtilitiesMenu;
101  QAction *mActionSetMasterPassword;
102  QAction *mActionClearCachedMasterPassword;
103  QAction *mActionResetMasterPassword;
104  QAction *mActionClearCachedAuthConfigs;
105  QAction *mActionRemoveAuthConfigs;
106  QAction *mActionEraseAuthDatabase;
107 
108  bool mDisabled;
109  QVBoxLayout *mAuthNotifyLayout;
110  QLabel *mAuthNotify;
111 };
112 
113 #endif // QGSAUTHCONFIGEDITOR_H
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:42
Widget for editing authentication configuration database.
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)