Fix #17444 : GeoNode data provider completely ignores authentication (#5634)

* Fix #17444 : GeoNode data provider completely ignores authentication - hide the authentication group until GeoNode API supports authentication.
This commit is contained in:
Tim Sutton 2017-11-15 11:55:25 +02:00 committed by GitHub
parent 6d01543527
commit 364ddc1de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -35,6 +35,7 @@ class QgsNewHttpConnection : QDialog
enum Flag
{
FlagShowTestConnection,
FlagHideAuthenticationGroup,
};
typedef QFlags<QgsNewHttpConnection::Flag> Flags;

View File

@ -121,6 +121,11 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
mGroupBox->layout()->removeWidget( mTestConnectionButton );
}
if ( flags & FlagHideAuthenticationGroup )
{
mAuthGroupBox->hide();
mGroupBox->layout()->removeWidget( mAuthGroupBox );
}
// Adjust height
int w = width();
adjustSize();

View File

@ -56,6 +56,7 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
enum Flag
{
FlagShowTestConnection = 1 << 1, //!< Display the 'test connection' button
FlagHideAuthenticationGroup = 1 << 2, //!< Hide the Authentication group
};
Q_DECLARE_FLAGS( Flags, Flag )

View File

@ -20,14 +20,18 @@
#include "qgsgeonodeconnection.h"
#include "qgsgeonoderequest.h"
/* For now we are hiding away authentication options since
there is no support yet for authentication in GeoNode's API.
We will re-enable this when this limitation changes.
See https://github.com/GeoNode/geonode/issues/3442 TS */
QgsGeoNodeNewConnection::QgsGeoNodeNewConnection( QWidget *parent, const QString &connName, Qt::WindowFlags fl )
: QgsNewHttpConnection( parent, QgsNewHttpConnection::ConnectionWfs | QgsNewHttpConnection::ConnectionWms,
QgsGeoNodeConnectionUtils::pathGeoNodeConnection() + '/', connName, QgsNewHttpConnection::FlagShowTestConnection, fl )
QgsGeoNodeConnectionUtils::pathGeoNodeConnection() + '/', connName,
QgsNewHttpConnection::FlagShowTestConnection | QgsNewHttpConnection::FlagHideAuthenticationGroup, fl )
{
setWindowTitle( tr( "Create a New GeoNode Connection" ) );
updateServiceSpecificSettings();
connect( testConnectButton(), &QPushButton::clicked, this, &QgsGeoNodeNewConnection::testConnection );
}