QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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:
52 Q_ENUM( WarningType )
53
54
63 explicit QgsAuthSettingsWidget(
64 QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &configId = QString(), const QString &username = QString(), const QString &password = QString(), const QString &dataprovider = QString()
65 );
66
72 void removeBasicSettings();
73
79 void setWarningText( const QString &warningText );
80
85 void setBasicText( const QString &basicText );
86
91 QString username() const;
92
97 void setUsername( const QString &username );
98
103 QString password() const;
104
109 void setPassword( const QString &password );
110
115 QString configId() const;
116
121 void setConfigId( const QString &configId );
122
127 void setDataprovider( const QString &dataprovider );
128
133 QString dataprovider() const;
134
140 static QString formattedWarning( WarningType warning );
141
146 bool btnConvertToEncryptedIsEnabled() const;
147
155 void showStoreCheckboxes( bool enabled );
156
162 void setStoreUsernameChecked( bool checked );
163
169 void setStorePasswordChecked( bool checked );
170
175 bool storePasswordIsChecked() const;
176
181 bool storeUsernameIsChecked() const;
182
187 bool configurationTabIsSelected();
188
189 public slots:
190
197 bool convertToEncrypted();
198
199 signals:
200
207
214
221
222 private slots:
223
227 void userNameTextChanged( const QString &text );
228
232 void passwordTextChanged( const QString &text );
233
234 private:
235 // Mainly for tests
236 QString mDataprovider;
237
238 void updateConvertBtnState();
239
240 void updateSelectedTab();
241};
242
243#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:52