QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsauthconfigselect.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsauthconfigselect.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 QGSAUTHCONFIGSELECT_H
18#define QGSAUTHCONFIGSELECT_H
19
20#include <QWidget>
21#include <QLabel>
22#include "qgis_sip.h"
23
24#include "ui_qgsauthconfigselect.h"
25#include "qgsauthconfig.h"
26#include "qgis_gui.h"
27
28
33class GUI_EXPORT QgsAuthConfigSelect : public QWidget, private Ui::QgsAuthConfigSelect
34{
35 Q_OBJECT
36
37 public:
44 explicit QgsAuthConfigSelect( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &dataprovider = QString() );
45
47 void setConfigId( const QString &authcfg );
48
50 const QString configId() const { return mAuthCfg; }
51
53 void setDataProviderKey( const QString &key );
54
55 signals:
57 void selectedConfigIdChanged( const QString &authcfg );
58
60 void selectedConfigIdRemoved( const QString &authcfg );
61
62 public slots:
64 void showMessage( const QString &msg );
65
67 void clearMessage();
68
69 private slots:
70 void loadConfig();
71 void clearConfig();
72 void validateConfig();
73 void populateConfigSelector();
74
75 void cmbConfigSelect_currentIndexChanged( int index );
76
77 void btnConfigAdd_clicked();
78
79 void btnConfigEdit_clicked();
80
81 void btnConfigRemove_clicked();
82
83 void btnConfigMsgClear_clicked();
84
85 private:
86 void loadAvailableConfigs();
87
88 QString mAuthCfg;
89 QString mDataProvider;
91
92 bool mDisabled = false;
93 QVBoxLayout *mAuthNotifyLayout = nullptr;
94 QLabel *mAuthNotify = nullptr;
95 bool mTemporarilyBlockLoad = false;
96};
97
98
100
101#include "ui_qgsauthconfiguriedit.h"
102
103class QPushButton;
104
109class GUI_EXPORT QgsAuthConfigUriEdit : public QDialog, private Ui::QgsAuthConfigUriEdit
110{
111 Q_OBJECT
112
113 public:
120 explicit QgsAuthConfigUriEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &datauri = QString(), const QString &dataprovider = QString() );
121
123 void setDataSourceUri( const QString &datauri );
124
126 QString dataSourceUri();
127
129 static bool hasConfigId( const QString &txt );
130
131 private slots:
132 void saveChanges();
133
134 void resetChanges();
135
136 void authCfgUpdated( const QString &authcfg );
137
138 void authCfgRemoved( const QString &authcfg );
139
140 private:
141 int authCfgIndex();
142
143 QString authCfgFromUri();
144
145 void selectAuthCfgInUri();
146
147 void updateUriWithAuthCfg();
148
149 void removeAuthCfgFromUri();
150
151 QString mAuthCfg;
152 QString mDataUri;
153 QString mDataUriOrig;
154
155 bool mDisabled = false;
156 QVBoxLayout *mAuthNotifyLayout = nullptr;
157 QLabel *mAuthNotify = nullptr;
158};
159
160#endif // QGSAUTHCONFIGSELECT_H
Selector widget for authentication configs.
void selectedConfigIdRemoved(const QString &authcfg)
Emitted when authentication config is removed.
void selectedConfigIdChanged(const QString &authcfg)
Emitted when authentication config is changed or missing.
const QString configId() const
Gets the authentication config id for the resource.
Dialog wrapper of select widget to edit an authcfg in a data source URI.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
QHash< QString, QgsAuthMethodConfig > QgsAuthMethodConfigsMap