Skip to content

Commit

Permalink
[sensorthings] Remove option for basic authentication
Browse files Browse the repository at this point in the history
This is not supported by the provider, only authentication config
is supported

Fixes #59721
  • Loading branch information
nyalldawson committed Jan 31, 2025
1 parent 6bf6d04 commit e2c3611
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ from existing configs, or creating/removing them from auth database
:param username:
:param password:
:param dataprovider: The key of the calling layer provider, if applicable
%End

void removeBasicSettings();
%Docstring
Removes the basic authentication tab from the widget.

.. versionadded:: 3.42
%End

void setWarningText( const QString &warningText );
Expand Down
7 changes: 7 additions & 0 deletions python/gui/auto_generated/auth/qgsauthsettingswidget.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ from existing configs, or creating/removing them from auth database
:param username:
:param password:
:param dataprovider: The key of the calling layer provider, if applicable
%End

void removeBasicSettings();
%Docstring
Removes the basic authentication tab from the widget.

.. versionadded:: 3.42
%End

void setWarningText( const QString &warningText );
Expand Down
6 changes: 6 additions & 0 deletions src/gui/auth/qgsauthsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ QgsAuthSettingsWidget::QgsAuthSettingsWidget( QWidget *parent, const QString &co
updateConvertBtnState();
}

void QgsAuthSettingsWidget::removeBasicSettings()
{
tabAuth->removeTab( tabAuth->indexOf( tabBasic ) );
tabAuth->setCurrentIndex( tabAuth->indexOf( tabConfigurations ) );
}

void QgsAuthSettingsWidget::setWarningText( const QString &warningText )
{
lblWarning->setText( warningText );
Expand Down
7 changes: 7 additions & 0 deletions src/gui/auth/qgsauthsettingswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class GUI_EXPORT QgsAuthSettingsWidget : public QWidget, private Ui::QgsAuthSett
*/
explicit QgsAuthSettingsWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &configId = QString(), const QString &username = QString(), const QString &password = QString(), const QString &dataprovider = QString() );

/**
* Removes the basic authentication tab from the widget.
*
* \since QGIS 3.42
*/
void removeBasicSettings();

/**
* \brief setWarningText set the text of the warning label
* \param warningText the text of the warning label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ QgsSensorThingsConnectionWidget::QgsSensorThingsConnectionWidget( QWidget *paren
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsSensorThingsConnectionWidget::validate );
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsSensorThingsConnectionWidget::changed );

// only auth config supported, not basic auth
mAuthSettings->removeBasicSettings();

connect( mAuthSettings, &QgsAuthSettingsWidget::configIdChanged, this, &QgsSensorThingsConnectionWidget::changed );
connect( mAuthSettings, &QgsAuthSettingsWidget::usernameChanged, this, &QgsSensorThingsConnectionWidget::changed );
connect( mAuthSettings, &QgsAuthSettingsWidget::passwordChanged, this, &QgsSensorThingsConnectionWidget::changed );
Expand Down

0 comments on commit e2c3611

Please sign in to comment.