2017-09-29 12:16:28 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-09-30 08:59:07 +02:00
|
|
|
* src/gui/auth/qgsauthsettingswidget.h *
|
2017-09-29 12:16:28 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-30 08:59:07 +02:00
|
|
|
class QgsAuthSettingsWidget : QWidget
|
2017-09-29 12:16:28 +02:00
|
|
|
{
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Widget for entering authentication credentials both in the form username/password
|
|
|
|
and by using QGIS Authentication Database and its authentication configurations.
|
2017-10-05 08:50:06 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
The widget also offers the functionality to convert username/password credentials
|
|
|
|
to an authentication configuration.
|
2017-10-05 08:50:06 +02:00
|
|
|
|
2017-09-29 22:46:32 +02:00
|
|
|
.. versionadded:: 3.0
|
2017-09-29 12:16:28 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
2017-09-30 08:59:07 +02:00
|
|
|
#include "qgsauthsettingswidget.h"
|
2017-09-29 12:16:28 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-10-04 13:58:50 -06:00
|
|
|
enum WarningType
|
|
|
|
{
|
|
|
|
ProjectFile,
|
|
|
|
UserSettings
|
|
|
|
};
|
|
|
|
|
2017-09-30 08:59:07 +02:00
|
|
|
explicit QgsAuthSettingsWidget( QWidget *parent /TransferThis/ = 0,
|
2017-09-30 09:49:35 +02:00
|
|
|
const QString &configId = QString(),
|
|
|
|
const QString &username = QString(),
|
|
|
|
const QString &password = QString(),
|
|
|
|
const QString &dataprovider = QString() );
|
2017-09-29 12:16:28 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Create a dialog for setting an associated authentication config, either
|
|
|
|
from existing configs, or creating/removing them from auth database
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param parent: Parent widget
|
|
|
|
:param configId: authentication configuration id
|
|
|
|
:param username:
|
|
|
|
:param password:
|
|
|
|
:param dataprovider: The key of the calling layer provider, if applicable
|
2017-09-29 12:16:28 +02:00
|
|
|
%End
|
|
|
|
|
2017-09-29 17:34:59 +02:00
|
|
|
void setWarningText( const QString &warningText );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setWarningText set the text of the warning label
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param warningText: the text of the warning label
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`formattedWarning`
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setBasicText( const QString &basicText );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setBasicText set the text of the warning label
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param basicText: the text of the basic tab label
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
const QString username( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
username
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: basic authentication username
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 14:20:44 +02:00
|
|
|
void setUsername( const QString &username );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setUsername set the username
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param username: the user name
|
2017-10-02 14:20:44 +02:00
|
|
|
%End
|
|
|
|
|
2017-09-29 17:34:59 +02:00
|
|
|
const QString password( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
password
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: basic authentication password
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 14:20:44 +02:00
|
|
|
void setPassword( const QString &password );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setPassword set the password
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param password: the password
|
2017-10-02 14:20:44 +02:00
|
|
|
%End
|
|
|
|
|
2017-09-29 17:34:59 +02:00
|
|
|
const QString configId( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
configId
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: authentication configuration id
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 14:43:22 +02:00
|
|
|
void setConfigId( const QString &configId );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setConfigId set the authentication configuration id
|
2017-12-15 10:36:55 -04:00
|
|
|
param configId the authentication configuration id
|
2017-10-02 14:43:22 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 16:39:31 +02:00
|
|
|
void setDataprovider( const QString &dataprovider );
|
2017-09-29 17:34:59 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setDataprovider set the data provider key for filtering compatible authentication configurations
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param dataprovider: data provider key
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
const QString dataprovider( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
dataprovider
|
2017-12-15 10:36:55 -04:00
|
|
|
|
|
|
|
:return: the data provider key used to filter compatible authentication configurations
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-04 13:58:50 -06:00
|
|
|
static const QString formattedWarning( WarningType warning );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
warning text message based upon where credentials are stored
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param warning: enum of warning type
|
|
|
|
|
|
|
|
:return: pre-formatted warning text
|
2017-10-04 13:58:50 -06:00
|
|
|
%End
|
|
|
|
|
2017-09-29 17:34:59 +02:00
|
|
|
bool btnConvertToEncryptedIsEnabled( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
convertButtonEnabled, mainly useful for unit tests
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` if the convert button is enabled
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 16:39:31 +02:00
|
|
|
void showStoreCheckboxes( bool enabled );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
showStoreCheckboxes show the "Store" checkboxes for basic auth.
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param enabled:
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 17:12:02 +02:00
|
|
|
void setStoreUsernameChecked( bool checked );
|
2017-10-02 16:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setStoreUsernameChecked check the "Store" checkbox for the username
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param checked:
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`showStoreCheckboxes`
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
2017-10-02 17:12:02 +02:00
|
|
|
void setStorePasswordChecked( bool checked );
|
2017-10-02 16:39:31 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
setStorePasswordCheched check the "Store" checkbox for the password
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param checked:
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`showStoreCheckboxes`
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool storePasswordIsChecked( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
storePassword
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` if "Store" checkbox for the password is checked
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool storeUsernameIsChecked( ) const;
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
storeUsername
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` if "Store" checkbox for the username is checked
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool configurationTabIsSelected( );
|
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
configurationTabIsSelected
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: ``True`` if the configuration tab is the currently selected tab
|
2017-10-02 16:39:31 +02:00
|
|
|
%End
|
|
|
|
|
2017-09-29 17:34:59 +02:00
|
|
|
public slots:
|
|
|
|
|
2017-10-02 12:26:15 +02:00
|
|
|
bool convertToEncrypted( );
|
2017-09-29 17:34:59 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
convertToEncrypted is called when the convert to encrypted button is
|
2017-12-15 10:36:55 -04:00
|
|
|
clicked and it creates a Basic authentication configuration from
|
|
|
|
username and password specified in the Basic tab
|
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:return: return ``True`` on success
|
2017-09-29 17:34:59 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-29 12:16:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-09-30 08:59:07 +02:00
|
|
|
* src/gui/auth/qgsauthsettingswidget.h *
|
2017-09-29 12:16:28 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|