QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsauthsettingswidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsauthsettingswidget.h - QgsAuthSettingsWidget
3
4 ---------------------
5 begin : 28.9.2017
6 copyright : (C) 2017 by Alessandro Pasotti
7 email : apasotti 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#ifndef QGSAUTHSETTINGSWIDGET_H
17#define QGSAUTHSETTINGSWIDGET_H
18
19#include "ui_qgsauthsettingswidget.h"
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23
24#include <QWidget>
25
35class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSettingsWidget
36{
37 Q_OBJECT
38
39 public:
40
53 Q_ENUM( WarningType )
54
55
64 explicit QgsAuthSettingsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &configId = QString(), const QString &username = QString(), const QString &password = QString(), const QString &dataprovider = QString() );
65
71 void removeBasicSettings();
72
78 void setWarningText( const QString &warningText );
79
84 void setBasicText( const QString &basicText );
85
90 QString username() const;
91
96 void setUsername( const QString &username );
97
102 QString password() const;
103
108 void setPassword( const QString &password );
109
114 QString configId() const;
115
120 void setConfigId( const QString &configId );
121
126 void setDataprovider( const QString &dataprovider );
127
132 QString dataprovider() const;
133
139 static QString formattedWarning( WarningType warning );
140
145 bool btnConvertToEncryptedIsEnabled() const;
146
154 void showStoreCheckboxes( bool enabled );
155
161 void setStoreUsernameChecked( bool checked );
162
168 void setStorePasswordChecked( bool checked );
169
174 bool storePasswordIsChecked() const;
175
180 bool storeUsernameIsChecked() const;
181
186 bool configurationTabIsSelected();
187
188 public slots:
189
196 bool convertToEncrypted();
197
198 signals:
199
206
213
220
221 private slots:
222
226 void userNameTextChanged( const QString &text );
227
231 void passwordTextChanged( const QString &text );
232
233 private:
234 // Mainly for tests
235 QString mDataprovider;
236
237 void updateConvertBtnState();
238
239 void updateSelectedTab();
240};
241
242#endif // QGSAUTHSETTINGSWIDGET_H
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
void usernameChanged()
Emitted when the plain text username defined in the dialog is changed.
void passwordChanged()
Emitted when the plain text password defined in the dialog is changed.
QgsAuthSettingsWidget(QWidget *parent=nullptr, const QString &configId=QString(), const QString &username=QString(), const QString &password=QString(), const QString &dataprovider=QString())
Create a dialog for setting an associated authentication config, either from existing configs,...
WarningType
The WarningType enum is used to determine the text of the message shown to the user about the destina...
void configIdChanged()
Emitted when the auth configuration ID selected in the dialog is changed.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53