QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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 "qgis_gui.h"
20#include "qgis_sip.h"
21
22#include "ui_qgsauthsettingswidget.h"
23
24#include <QWidget>
25
35class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSettingsWidget
36{
37 Q_OBJECT
38
39 public:
48 {
50 UserSettings
51 };
52 Q_ENUM( WarningType )
53
54
63 explicit QgsAuthSettingsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &configId = QString(), const QString &username = QString(), const QString &password = QString(), const QString &dataprovider = QString() );
64
70 void setWarningText( const QString &warningText );
71
76 void setBasicText( const QString &basicText );
77
82 QString username() const;
83
88 void setUsername( const QString &username );
89
94 QString password() const;
95
100 void setPassword( const QString &password );
101
106 QString configId() const;
107
112 void setConfigId( const QString &configId );
113
118 void setDataprovider( const QString &dataprovider );
119
124 QString dataprovider() const;
125
131 static QString formattedWarning( WarningType warning );
132
137 bool btnConvertToEncryptedIsEnabled() const;
138
146 void showStoreCheckboxes( bool enabled );
147
153 void setStoreUsernameChecked( bool checked );
154
160 void setStorePasswordChecked( bool checked );
161
166 bool storePasswordIsChecked() const;
167
172 bool storeUsernameIsChecked() const;
173
178 bool configurationTabIsSelected();
179
180 public slots:
181
188 bool convertToEncrypted();
189
190 signals:
191
198
205
212
213 private slots:
214
218 void userNameTextChanged( const QString &text );
219
223 void passwordTextChanged( const QString &text );
224
225 private:
226 // Mainly for tests
227 QString mDataprovider;
228
229 void updateConvertBtnState();
230
231 void updateSelectedTab();
232};
233
234#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.
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