QGIS API Documentation  3.6.0-Noosa (5873452)
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 
51  public slots:
53  void setShowUtilitiesButton( bool show = true );
54 
56  void setRelayMessages( bool relay = true );
57 
58  private slots:
60  void refreshTableView();
61 
63  void setMasterPassword();
64 
66  void clearCachedMasterPassword();
67 
69  void resetMasterPassword();
70 
72  void clearCachedAuthenticationConfigs();
73 
75  void removeAuthenticationConfigs();
76 
78  void eraseAuthenticationDatabase();
79 
81  void authMessageOut( const QString &message, const QString &authtag, QgsAuthManager::MessageLevel level );
82 
84  void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
85 
87  void checkSelection();
88 
89  void btnAddConfig_clicked();
90 
91  void btnEditConfig_clicked();
92 
93  void btnRemoveConfig_clicked();
94 
95  private:
96  bool mRelayMessages;
97  QgsMessageBar *messageBar();
98  int messageTimeout();
99  QString selectedConfigId();
100 
101  QSqlTableModel *mConfigModel = nullptr;
102 
103  QMenu *mAuthUtilitiesMenu = nullptr;
104  QAction *mActionSetMasterPassword = nullptr;
105  QAction *mActionClearCachedMasterPassword = nullptr;
106  QAction *mActionResetMasterPassword = nullptr;
107  QAction *mActionClearCachedAuthConfigs = nullptr;
108  QAction *mActionRemoveAuthConfigs = nullptr;
109  QAction *mActionEraseAuthDatabase = nullptr;
110 
111  bool mDisabled = false;
112  QVBoxLayout *mAuthNotifyLayout = nullptr;
113  QLabel *mAuthNotify = nullptr;
114 };
115 
116 #endif // QGSAUTHCONFIGEDITOR_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:45
Widget for editing authentication configuration database.
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)