QGIS API Documentation 4.3.0-Master (c8cdfe19d7b)
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 "ui_qgsauthconfigselect.h"
21
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsauthconfig.h"
25
26#include <QLabel>
27#include <QWidget>
28
30
35class GUI_EXPORT QgsAuthConfigSelect : public QWidget, private Ui::QgsAuthConfigSelect
36{
37 Q_OBJECT
38
39 public:
46 explicit QgsAuthConfigSelect( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &dataprovider = QString() );
47
49 void setConfigId( const QString &authcfg );
50
52 const QString configId() const { return mAuthCfg; }
53
55 void setDataProviderKey( const QString &key );
56
59
60 signals:
62 void selectedConfigIdChanged( const QString &authcfg );
63
65 void selectedConfigIdRemoved( const QString &authcfg );
66
67 public slots:
69 void showMessage( const QString &msg );
70
72 void clearMessage();
73
74 private slots:
75 void loadConfig();
76 void clearConfig();
77 void validateConfig();
78 void populateConfigSelector();
79
80 void cmbConfigSelect_currentIndexChanged( int index );
81
82 void btnConfigAdd_clicked();
83
84 void btnConfigEdit_clicked();
85
86 void btnConfigRemove_clicked();
87
88 void btnConfigMsgClear_clicked();
89
90 private:
91 void loadAvailableConfigs();
93 bool authCfgDetailsDisplayed() const;
94
95 QString mAuthCfg;
96 QString mDataProvider;
98
99 bool mDisabled = false;
100 QVBoxLayout *mAuthNotifyLayout = nullptr;
101 QLabel *mAuthNotify = nullptr;
102 bool mTemporarilyBlockLoad = false;
103};
104
105
107
108#include "ui_qgsauthconfiguriedit.h"
109
110class QPushButton;
111
116class GUI_EXPORT QgsAuthConfigUriEdit : public QDialog, private Ui::QgsAuthConfigUriEdit
117{
118 Q_OBJECT
119
120 public:
127 explicit QgsAuthConfigUriEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &datauri = QString(), const QString &dataprovider = QString() );
128
130 void setDataSourceUri( const QString &datauri );
131
133 QString dataSourceUri();
134
136 static bool hasConfigId( const QString &txt );
137
138 private slots:
139 void saveChanges();
140
141 void resetChanges();
142
143 void authCfgUpdated( const QString &authcfg );
144
145 void authCfgRemoved( const QString &authcfg );
146
147 private:
148 int authCfgIndex();
149
150 QString authCfgFromUri();
151
152 void selectAuthCfgInUri();
153
154 void updateUriWithAuthCfg();
155
156 void removeAuthCfgFromUri();
157
158 QString mAuthCfg;
159 QString mDataUri;
160 QString mDataUriOrig;
161
162 bool mDisabled = false;
163 QVBoxLayout *mAuthNotifyLayout = nullptr;
164 QLabel *mAuthNotify = nullptr;
165};
166
167#endif // QGSAUTHCONFIGSELECT_H
void clearMessage()
Clear and hide small message bar.
void setConfigId(const QString &authcfg)
Sets the authentication config id for the resource.
void selectedConfigIdRemoved(const QString &authcfg)
Emitted when authentication config is removed.
QgsAuthConfigSelect(QWidget *parent=nullptr, const QString &dataprovider=QString())
Create a dialog for setting an associated authentication config, either from existing configs,...
static const QgsSettingsEntryStringList * settingsDetailsNotDisplayedAuthStores
Settings entry details not displayed auth stores.
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.
void showMessage(const QString &msg)
Show a small message bar with a close button.
void setDataSourceUri(const QString &datauri)
Sets the data source URI to parse.
static bool hasConfigId(const QString &txt)
Whether a string contains an authcfg ID.
QString dataSourceUri()
The returned, possibly edited data source URI.
QgsAuthConfigUriEdit(QWidget *parent=nullptr, const QString &datauri=QString(), const QString &dataprovider=QString())
Construct wrapper dialog for select widget to edit an authcfg in a data source URI.
A string list settings entry.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_SKIP
Definition qgis_sip.h:138
QHash< QString, QgsAuthMethodConfig > QgsAuthMethodConfigsMap