QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
Widget for entering authentication credentials both in the form username/password and by using QGIS Authentication Database and its authentication configurations. More...
#include <qgsauthsettingswidget.h>
Public Types | |
enum | WarningType { ProjectFile , UserSettings } |
The WarningType enum is used to determine the text of the message shown to the user about the destination of the stored clear-text credentials from the "Basic" tab: depending on the provider or the settings, the credentials are stored in the user settings and/or in the project file. More... | |
Public Slots | |
bool | convertToEncrypted () |
convertToEncrypted is called when the convert to encrypted button is clicked and it creates a Basic authentication configuration from username and password specified in the Basic tab | |
Signals | |
void | configIdChanged () |
Emitted when the auth configuration ID selected in the dialog is changed. | |
void | passwordChanged () |
Emitted when the plain text password defined in the dialog is changed. | |
void | usernameChanged () |
Emitted when the plain text username defined in the dialog is changed. | |
Public Member Functions | |
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, or creating/removing them from auth database. | |
bool | btnConvertToEncryptedIsEnabled () const |
convertButtonEnabled, mainly useful for unit tests | |
QString | configId () const |
configId | |
bool | configurationTabIsSelected () |
configurationTabIsSelected | |
QString | dataprovider () const |
dataprovider | |
QString | password () const |
password | |
void | setBasicText (const QString &basicText) |
setBasicText set the text of the warning label | |
void | setConfigId (const QString &configId) |
setConfigId set the authentication configuration id param configId the authentication configuration id | |
void | setDataprovider (const QString &dataprovider) |
setDataprovider set the data provider key for filtering compatible authentication configurations | |
void | setPassword (const QString &password) |
setPassword set the password | |
void | setStorePasswordChecked (bool checked) |
setStorePasswordCheched check the "Store" checkbox for the password | |
void | setStoreUsernameChecked (bool checked) |
setStoreUsernameChecked check the "Store" checkbox for the username | |
void | setUsername (const QString &username) |
setUsername set the username | |
void | setWarningText (const QString &warningText) |
setWarningText set the text of the warning label | |
void | showStoreCheckboxes (bool enabled) |
showStoreCheckboxes show the "Store" checkboxes for basic auth. | |
bool | storePasswordIsChecked () const |
storePassword | |
bool | storeUsernameIsChecked () const |
storeUsername | |
QString | username () const |
username | |
Static Public Member Functions | |
static QString | formattedWarning (WarningType warning) |
warning text message based upon where credentials are stored | |
Widget for entering authentication credentials both in the form username/password and by using QGIS Authentication Database and its authentication configurations.
The widget also offers the functionality to convert username/password credentials to an authentication configuration.
Definition at line 36 of file qgsauthsettingswidget.h.
The WarningType enum is used to determine the text of the message shown to the user about the destination of the stored clear-text credentials from the "Basic" tab: depending on the provider or the settings, the credentials are stored in the user settings and/or in the project file.
Enumerator | |
---|---|
ProjectFile | |
UserSettings |
Definition at line 50 of file qgsauthsettingswidget.h.
|
explicit |
Create a dialog for setting an associated authentication config, either from existing configs, or creating/removing them from auth database.
parent | Parent widget |
configId | authentication configuration id |
username | |
password | |
dataprovider | The key of the calling layer provider, if applicable |
Definition at line 23 of file qgsauthsettingswidget.cpp.
bool QgsAuthSettingsWidget::btnConvertToEncryptedIsEnabled | ( | ) | const |
convertButtonEnabled, mainly useful for unit tests
true
if the convert button is enabled Definition at line 125 of file qgsauthsettingswidget.cpp.
QString QgsAuthSettingsWidget::configId | ( | ) | const |
configId
Definition at line 120 of file qgsauthsettingswidget.cpp.
|
signal |
Emitted when the auth configuration ID selected in the dialog is changed.
bool QgsAuthSettingsWidget::configurationTabIsSelected | ( | ) |
configurationTabIsSelected
true
if the configuration tab is the currently selected tab Definition at line 164 of file qgsauthsettingswidget.cpp.
|
slot |
convertToEncrypted is called when the convert to encrypted button is clicked and it creates a Basic authentication configuration from username and password specified in the Basic tab
true
on success Definition at line 169 of file qgsauthsettingswidget.cpp.
QString QgsAuthSettingsWidget::dataprovider | ( | ) | const |
dataprovider
Definition at line 102 of file qgsauthsettingswidget.cpp.
|
static |
warning text message based upon where credentials are stored
warning | enum of warning type |
Definition at line 107 of file qgsauthsettingswidget.cpp.
QString QgsAuthSettingsWidget::password | ( | ) | const |
password
Definition at line 79 of file qgsauthsettingswidget.cpp.
|
signal |
Emitted when the plain text password defined in the dialog is changed.
void QgsAuthSettingsWidget::setBasicText | ( | const QString & | basicText | ) |
setBasicText set the text of the warning label
basicText | the text of the basic tab label |
Definition at line 61 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setConfigId | ( | const QString & | configId | ) |
setConfigId set the authentication configuration id param configId the authentication configuration id
Definition at line 90 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setDataprovider | ( | const QString & | dataprovider | ) |
setDataprovider set the data provider key for filtering compatible authentication configurations
dataprovider | data provider key |
Definition at line 96 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setPassword | ( | const QString & | password | ) |
setPassword set the password
password | the password |
Definition at line 84 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setStorePasswordChecked | ( | bool | checked | ) |
setStorePasswordCheched check the "Store" checkbox for the password
checked |
Definition at line 149 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setStoreUsernameChecked | ( | bool | checked | ) |
setStoreUsernameChecked check the "Store" checkbox for the username
checked |
Definition at line 144 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setUsername | ( | const QString & | username | ) |
setUsername set the username
username | the user name |
Definition at line 73 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::setWarningText | ( | const QString & | warningText | ) |
setWarningText set the text of the warning label
warningText | the text of the warning label |
Definition at line 56 of file qgsauthsettingswidget.cpp.
void QgsAuthSettingsWidget::showStoreCheckboxes | ( | bool | enabled | ) |
showStoreCheckboxes show the "Store" checkboxes for basic auth.
Some connection configurations allow the user to enter credentials for testing the connection without storing them in the project. "Store" checkboxes are disabled by default.
enabled |
Definition at line 130 of file qgsauthsettingswidget.cpp.
bool QgsAuthSettingsWidget::storePasswordIsChecked | ( | ) | const |
storePassword
true
if "Store" checkbox for the password is checked Definition at line 154 of file qgsauthsettingswidget.cpp.
bool QgsAuthSettingsWidget::storeUsernameIsChecked | ( | ) | const |
storeUsername
true
if "Store" checkbox for the username is checked Definition at line 159 of file qgsauthsettingswidget.cpp.
QString QgsAuthSettingsWidget::username | ( | ) | const |
username
Definition at line 68 of file qgsauthsettingswidget.cpp.
|
signal |
Emitted when the plain text username defined in the dialog is changed.