QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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 "ui_qgsauthconfigeditor.h"
21
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsauthmanager.h"
25
26#include <QSqlTableModel>
27#include <QWidget>
28
29class QgsMessageBar;
30
35class GUI_EXPORT QgsAuthConfigEditor : public QWidget, private Ui::QgsAuthConfigEditor
36{
37 Q_OBJECT
38
39 public:
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 authMessageLog( const QString &message, const QString &authtag, Qgis::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 bool mIsReadOnly = false;
128};
129
130#endif // QGSAUTHCONFIGEDITOR_H
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:156
QgsAuthConfigEditor(QWidget *parent=nullptr, bool showUtilities=true, bool relayMessages=true)
Widget for editing authentication configurations directly in database.
void setRelayMessages(bool relay=true)
Sets whether to relay auth manager messages to internal message bar, e.g. when embedding.
void setShowUtilitiesButton(bool show=true)
Sets whether to show the widget's utilities button, e.g. when embedding.
QStringList selectedAuthenticationConfigIds() const
Returns the list of selected authentication configuration IDs.
void toggleTitleVisibility(bool visible)
Hide the widget's title, e.g. when embedding.
A bar for displaying non-blocking messages to the user.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53