Skip to content

Commit

Permalink
Fix #17444 : GeoNode data provider completely ignores authentication (#…
Browse files Browse the repository at this point in the history
…5634)

* Fix #17444 : GeoNode data provider completely ignores authentication - hide the authentication group until GeoNode API supports authentication.
  • Loading branch information
timlinux committed Nov 15, 2017
1 parent 6d01543 commit 364ddc1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions python/gui/qgsnewhttpconnection.sip
Expand Up @@ -35,6 +35,7 @@ class QgsNewHttpConnection : QDialog
enum Flag enum Flag
{ {
FlagShowTestConnection, FlagShowTestConnection,
FlagHideAuthenticationGroup,
}; };
typedef QFlags<QgsNewHttpConnection::Flag> Flags; typedef QFlags<QgsNewHttpConnection::Flag> Flags;


Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgsnewhttpconnection.cpp
Expand Up @@ -121,6 +121,11 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
mGroupBox->layout()->removeWidget( mTestConnectionButton ); mGroupBox->layout()->removeWidget( mTestConnectionButton );
} }


if ( flags & FlagHideAuthenticationGroup )
{
mAuthGroupBox->hide();
mGroupBox->layout()->removeWidget( mAuthGroupBox );
}
// Adjust height // Adjust height
int w = width(); int w = width();
adjustSize(); adjustSize();
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsnewhttpconnection.h
Expand Up @@ -56,6 +56,7 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
enum Flag enum Flag
{ {
FlagShowTestConnection = 1 << 1, //!< Display the 'test connection' button FlagShowTestConnection = 1 << 1, //!< Display the 'test connection' button
FlagHideAuthenticationGroup = 1 << 2, //!< Hide the Authentication group
}; };
Q_DECLARE_FLAGS( Flags, Flag ) Q_DECLARE_FLAGS( Flags, Flag )


Expand Down
10 changes: 7 additions & 3 deletions src/providers/geonode/qgsgeonodenewconnection.cpp
Expand Up @@ -20,14 +20,18 @@
#include "qgsgeonodeconnection.h" #include "qgsgeonodeconnection.h"
#include "qgsgeonoderequest.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 ) QgsGeoNodeNewConnection::QgsGeoNodeNewConnection( QWidget *parent, const QString &connName, Qt::WindowFlags fl )
: QgsNewHttpConnection( parent, QgsNewHttpConnection::ConnectionWfs | QgsNewHttpConnection::ConnectionWms, : 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" ) ); setWindowTitle( tr( "Create a New GeoNode Connection" ) );

updateServiceSpecificSettings(); updateServiceSpecificSettings();

connect( testConnectButton(), &QPushButton::clicked, this, &QgsGeoNodeNewConnection::testConnection ); connect( testConnectButton(), &QPushButton::clicked, this, &QgsGeoNodeNewConnection::testConnection );
} }


Expand Down

0 comments on commit 364ddc1

Please sign in to comment.