QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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
38 Q_OBJECT
39
40 public:
41
50 {
52 UserSettings
53 };
54 Q_ENUM( WarningType )
55
56
65 explicit QgsAuthSettingsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr,
66 const QString &configId = QString(),
67 const QString &username = QString(),
68 const QString &password = QString(),
69 const QString &dataprovider = QString() );
70
76 void setWarningText( const QString &warningText );
77
82 void setBasicText( const QString &basicText );
83
88 QString username() const;
89
94 void setUsername( const QString &username );
95
100 QString password() const;
101
106 void setPassword( const QString &password );
107
112 QString configId() const;
113
118 void setConfigId( const QString &configId );
119
124 void setDataprovider( const QString &dataprovider );
125
130 QString dataprovider() const;
131
137 static QString formattedWarning( WarningType warning );
138
143 bool btnConvertToEncryptedIsEnabled() const;
144
152 void showStoreCheckboxes( bool enabled );
153
159 void setStoreUsernameChecked( bool checked );
160
166 void setStorePasswordChecked( bool checked );
167
172 bool storePasswordIsChecked() const;
173
178 bool storeUsernameIsChecked() const;
179
184 bool configurationTabIsSelected();
185
186 public slots:
187
194 bool convertToEncrypted();
195
196 signals:
197
204
211
218
219 private slots:
220
224 void userNameTextChanged( const QString &text );
225
229 void passwordTextChanged( const QString &text );
230
231 private:
232
233 // Mainly for tests
234 QString mDataprovider;
235
236 void updateConvertBtnState();
237
238 void updateSelectedTab();
239
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.
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