mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Rework QgsGeoNodeNewConnection to inherit from QgsNewHttpConnection
Avoids a lot of duplicate code. Note that while this refactoring was done to allow WFS and WMS settings to be simultaneously visible, I've removed the settings from the GeoNode connection for now. Looking into this they were being stored, but not used at all when loading the layers from the GeoNode instance.
This commit is contained in:
parent
90237fa3bf
commit
ffaafa6229
@ -55,11 +55,42 @@ class QgsNewHttpConnection : QDialog
|
||||
and appearance.
|
||||
%End
|
||||
|
||||
QString name() const;
|
||||
%Docstring
|
||||
Returns the current connection name.
|
||||
.. versionadded:: 3.0
|
||||
:rtype: str
|
||||
%End
|
||||
|
||||
QString url() const;
|
||||
%Docstring
|
||||
Returns the current connection url.
|
||||
.. versionadded:: 3.0
|
||||
:rtype: str
|
||||
%End
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void accept();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool validate();
|
||||
%Docstring
|
||||
Returns true if dialog settings are valid, or false if current
|
||||
settings are not valid and the dialog should not be acceptable.
|
||||
.. versionadded:: 3.0
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
QPushButton *testConnectButton();
|
||||
%Docstring
|
||||
Returns the "test connection" button.
|
||||
.. versionadded:: 3.0
|
||||
:rtype: QPushButton
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
QFlags<QgsNewHttpConnection::ConnectionType> operator|(QgsNewHttpConnection::ConnectionType f1, QFlags<QgsNewHttpConnection::ConnectionType> f2);
|
||||
|
@ -16,243 +16,22 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QUrl>
|
||||
#include "qgslogger.h"
|
||||
|
||||
#include "qgsgeonodenewconnection.h"
|
||||
#include "qgsauthmanager.h"
|
||||
#include "qgsdatasourceuri.h"
|
||||
#include "qgsgeonodeconnection.h"
|
||||
#include "qgssettings.h"
|
||||
#include "qgsgeonoderequest.h"
|
||||
|
||||
QgsGeoNodeNewConnection::QgsGeoNodeNewConnection( QWidget *parent, const QString &connName, Qt::WindowFlags fl )
|
||||
: QDialog( parent, fl )
|
||||
, mOriginalConnName( connName )
|
||||
, mAuthConfigSelect( nullptr )
|
||||
: QgsNewHttpConnection( parent, 0, QgsGeoNodeConnectionUtils::pathGeoNodeConnection(), connName, QgsNewHttpConnection::FlagShowTestConnection, fl )
|
||||
{
|
||||
setupUi( this );
|
||||
setWindowTitle( tr( "Create a New GeoNode Connection" ) );
|
||||
|
||||
mBaseKey = QgsGeoNodeConnectionUtils::pathGeoNodeConnection();
|
||||
mCredentialsBaseKey = QgsGeoNodeConnectionUtils::pathGeoNodeConnection();
|
||||
|
||||
mAuthConfigSelect = new QgsAuthConfigSelect( this );
|
||||
tabAuth->insertTab( 1, mAuthConfigSelect, tr( "Configurations" ) );
|
||||
|
||||
cmbDpiMode->clear();
|
||||
cmbDpiMode->addItem( tr( "all" ) );
|
||||
cmbDpiMode->addItem( tr( "off" ) );
|
||||
cmbDpiMode->addItem( tr( "QGIS" ) );
|
||||
cmbDpiMode->addItem( tr( "UMN" ) );
|
||||
cmbDpiMode->addItem( tr( "GeoServer" ) );
|
||||
|
||||
cmbVersion->clear();
|
||||
cmbVersion->addItem( tr( "Auto-detect" ) );
|
||||
cmbVersion->addItem( tr( "1.0" ) );
|
||||
cmbVersion->addItem( tr( "1.1" ) );
|
||||
cmbVersion->addItem( tr( "2.0" ) );
|
||||
|
||||
if ( !connName.isEmpty() )
|
||||
{
|
||||
// populate the dialog with the information stored for the connection
|
||||
// populate the fields with the stored setting parameters
|
||||
QgsSettings settings;
|
||||
|
||||
QString key = mBaseKey + '/' + connName;
|
||||
QString credentialsKey = mCredentialsBaseKey + '/' + connName;
|
||||
txtName->setText( connName );
|
||||
txtUrl->setText( settings.value( key + "/url", "", QgsSettings::Providers ).toString() );
|
||||
|
||||
cbxIgnoreGetMapURI->setChecked( settings.value( key + "/wms/ignoreGetMapURI", false, QgsSettings::Providers ).toBool() );
|
||||
cbxWfsIgnoreAxisOrientation->setChecked( settings.value( key + "/wfs/ignoreAxisOrientation", false, QgsSettings::Providers ).toBool() );
|
||||
cbxWmsIgnoreAxisOrientation->setChecked( settings.value( key + "/wms/ignoreAxisOrientation", false, QgsSettings::Providers ).toBool() );
|
||||
cbxWfsInvertAxisOrientation->setChecked( settings.value( key + "/wfs/invertAxisOrientation", false, QgsSettings::Providers ).toBool() );
|
||||
cbxWmsInvertAxisOrientation->setChecked( settings.value( key + "/wms/invertAxisOrientation", false, QgsSettings::Providers ).toBool() );
|
||||
cbxIgnoreGetFeatureInfoURI->setChecked( settings.value( key + "/wms/ignoreGetFeatureInfoURI", false, QgsSettings::Providers ).toBool() );
|
||||
cbxSmoothPixmapTransform->setChecked( settings.value( key + "/wms/smoothPixmapTransform", false, QgsSettings::Providers ).toBool() );
|
||||
|
||||
int dpiIdx;
|
||||
switch ( settings.value( key + "/dpiMode", 7, QgsSettings::Providers ).toInt() )
|
||||
{
|
||||
case 0: // off
|
||||
dpiIdx = 1;
|
||||
break;
|
||||
case 1: // QGIS
|
||||
dpiIdx = 2;
|
||||
break;
|
||||
case 2: // UMN
|
||||
dpiIdx = 3;
|
||||
break;
|
||||
case 4: // GeoServer
|
||||
dpiIdx = 4;
|
||||
break;
|
||||
default: // other => all
|
||||
dpiIdx = 0;
|
||||
break;
|
||||
}
|
||||
cmbDpiMode->setCurrentIndex( dpiIdx );
|
||||
|
||||
QString version = settings.value( key + "/version", QLatin1String( "1.0.0" ), QgsSettings::Providers ).toString();
|
||||
int versionIdx = 0; // AUTO
|
||||
if ( version == QLatin1String( "1.0.0" ) )
|
||||
versionIdx = 1;
|
||||
else if ( version == QLatin1String( "1.1.0" ) )
|
||||
versionIdx = 2;
|
||||
else if ( version == QLatin1String( "2.0.0" ) )
|
||||
versionIdx = 3;
|
||||
cmbVersion->setCurrentIndex( versionIdx );
|
||||
|
||||
txtReferer->setText( settings.value( key + "/referer", "", QgsSettings::Providers ).toString() );
|
||||
txtMaxNumFeatures->setText( settings.value( key + "/maxnumfeatures", QgsSettings::Providers ).toString() );
|
||||
|
||||
txtUserName->setText( settings.value( credentialsKey + "/username", "", QgsSettings::Providers ).toString() );
|
||||
txtPassword->setText( settings.value( credentialsKey + "/password", "", QgsSettings::Providers ).toString() );
|
||||
|
||||
QString authcfg = settings.value( credentialsKey + "/authcfg", "", QgsSettings::Providers ).toString();
|
||||
mAuthConfigSelect->setConfigId( authcfg );
|
||||
if ( !authcfg.isEmpty() )
|
||||
{
|
||||
tabAuth->setCurrentIndex( tabAuth->indexOf( mAuthConfigSelect ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust height
|
||||
int w = width();
|
||||
adjustSize();
|
||||
resize( w, height() );
|
||||
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
|
||||
connect( txtName, &QLineEdit::textChanged, this, &QgsGeoNodeNewConnection::okButtonBehavior );
|
||||
connect( txtUrl, &QLineEdit::textChanged, this, &QgsGeoNodeNewConnection::okButtonBehavior );
|
||||
connect( btnConnect, &QPushButton::clicked, this, &QgsGeoNodeNewConnection::testConnection );
|
||||
}
|
||||
|
||||
QString QgsGeoNodeNewConnection::name() const
|
||||
{
|
||||
return txtName->text();
|
||||
}
|
||||
|
||||
void QgsGeoNodeNewConnection::accept()
|
||||
{
|
||||
QgsSettings settings;
|
||||
QString key = mBaseKey + '/' + txtName->text();
|
||||
QString credentialsKey = mCredentialsBaseKey + '/' + txtName->text();
|
||||
|
||||
// warn if entry was renamed to an existing connection
|
||||
if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
|
||||
settings.contains( key + "/url", QgsSettings::Providers ) &&
|
||||
QMessageBox::question( this,
|
||||
tr( "Save connection" ),
|
||||
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
|
||||
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !txtPassword->text().isEmpty() &&
|
||||
QMessageBox::question( this,
|
||||
tr( "Saving passwords" ),
|
||||
trUtf8( "WARNING: You have entered a password. It will be stored in unsecured plain text in your project files and your home directory (Unix-like OS) or user profile (Windows). If you want to avoid this, press Cancel and either:\n\na) Don't provide a password in the connection settings — it will be requested interactively when needed;\nb) Use the Configuration tab to add your credentials in an HTTP Basic Authentication method and store them in an encrypted database." ),
|
||||
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// on rename delete original entry first
|
||||
if ( !mOriginalConnName.isNull() && mOriginalConnName != key )
|
||||
{
|
||||
// Manually add Section here
|
||||
settings.remove( "providers/" + mBaseKey + '/' + mOriginalConnName );
|
||||
settings.remove( "providers/qgis//" + mCredentialsBaseKey + '/' + mOriginalConnName );
|
||||
settings.sync();
|
||||
}
|
||||
|
||||
if ( !txtUrl->text().contains( "://" ) &&
|
||||
QMessageBox::information(
|
||||
this,
|
||||
tr( "Invalid URL" ),
|
||||
tr( "Your URL doesn't contains protocol (e.g. http or https). Please add the protocol." ) ) == QMessageBox::Ok )
|
||||
{
|
||||
return;
|
||||
}
|
||||
QUrl url( txtUrl->text() );
|
||||
|
||||
settings.setValue( key + "/url", url.toString(), QgsSettings::Providers );
|
||||
|
||||
settings.setValue( key + "/wfs/ignoreAxisOrientation", cbxWfsIgnoreAxisOrientation->isChecked(), QgsSettings::Providers );
|
||||
settings.setValue( key + "/wms/ignoreAxisOrientation", cbxWmsIgnoreAxisOrientation->isChecked(), QgsSettings::Providers );
|
||||
settings.setValue( key + "/wfs/invertAxisOrientation", cbxWfsInvertAxisOrientation->isChecked(), QgsSettings::Providers );
|
||||
settings.setValue( key + "/wms/invertAxisOrientation", cbxWmsInvertAxisOrientation->isChecked(), QgsSettings::Providers );
|
||||
|
||||
settings.setValue( key + "/wms/ignoreGetMapURI", cbxIgnoreGetMapURI->isChecked(), QgsSettings::Providers );
|
||||
settings.setValue( key + "/wms/smoothPixmapTransform", cbxSmoothPixmapTransform->isChecked(), QgsSettings::Providers );
|
||||
settings.setValue( key + "/wms/ignoreGetFeatureInfoURI", cbxIgnoreGetFeatureInfoURI->isChecked(), QgsSettings::Providers );
|
||||
|
||||
int dpiMode = 0;
|
||||
switch ( cmbDpiMode->currentIndex() )
|
||||
{
|
||||
case 0: // all => QGIS|UMN|GeoServer
|
||||
dpiMode = 7;
|
||||
break;
|
||||
case 1: // off
|
||||
dpiMode = 0;
|
||||
break;
|
||||
case 2: // QGIS
|
||||
dpiMode = 1;
|
||||
break;
|
||||
case 3: // UMN
|
||||
dpiMode = 2;
|
||||
break;
|
||||
case 4: // GeoServer
|
||||
dpiMode = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
settings.setValue( key + "/wms/dpiMode", dpiMode, QgsSettings::Providers );
|
||||
settings.setValue( key + "/wms/referer", txtReferer->text(), QgsSettings::Providers );
|
||||
|
||||
QString version = QStringLiteral( "auto" );
|
||||
switch ( cmbVersion->currentIndex() )
|
||||
{
|
||||
case 0:
|
||||
version = QStringLiteral( "auto" );
|
||||
break;
|
||||
case 1:
|
||||
version = QStringLiteral( "1.0.0" );
|
||||
break;
|
||||
case 2:
|
||||
version = QStringLiteral( "1.1.0" );
|
||||
break;
|
||||
case 3:
|
||||
version = QStringLiteral( "2.0.0" );
|
||||
break;
|
||||
}
|
||||
|
||||
settings.setValue( key + "/wfs/version", version, QgsSettings::Providers );
|
||||
settings.setValue( key + "/wfs/maxnumfeatures", txtMaxNumFeatures->text(), QgsSettings::Providers );
|
||||
|
||||
settings.setValue( credentialsKey + "/username", txtUserName->text(), QgsSettings::Providers );
|
||||
settings.setValue( credentialsKey + "/password", txtPassword->text(), QgsSettings::Providers );
|
||||
|
||||
settings.setValue( credentialsKey + "/authcfg", mAuthConfigSelect->configId(), QgsSettings::Providers );
|
||||
|
||||
settings.setValue( mBaseKey + "/selected", txtName->text(), QgsSettings::Providers );
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void QgsGeoNodeNewConnection::okButtonBehavior( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !txtName->text().isEmpty() && !txtUrl->text().isEmpty() );
|
||||
connect( testConnectButton(), &QPushButton::clicked, this, &QgsGeoNodeNewConnection::testConnection );
|
||||
}
|
||||
|
||||
void QgsGeoNodeNewConnection::testConnection()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::BusyCursor );
|
||||
QString url = txtUrl->text();
|
||||
QgsGeoNodeRequest geonodeRequest( url, true );
|
||||
QgsGeoNodeRequest geonodeRequest( url(), true );
|
||||
|
||||
QList<QgsGeoNodeRequest::ServiceLayerDetail> layers = geonodeRequest.fetchLayersBlocking();
|
||||
QApplication::restoreOverrideCursor();
|
||||
@ -261,12 +40,25 @@ void QgsGeoNodeNewConnection::testConnection()
|
||||
{
|
||||
QMessageBox::information( this,
|
||||
tr( "Test connection" ),
|
||||
tr( "\nConnection to %1 was successful, \n\n%1 is a valid geonode instance.\n\n" ).arg( txtUrl->text() ) );
|
||||
tr( "\nConnection to %1 was successful, \n\n%1 is a valid geonode instance.\n\n" ).arg( url() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information( this,
|
||||
tr( "Test connection" ),
|
||||
tr( "\nConnection failed, \n\nplease check whether %1 is a valid geonode instance.\n\n" ).arg( txtUrl->text() ) );
|
||||
tr( "\nConnection failed, \n\nplease check whether %1 is a valid geonode instance.\n\n" ).arg( url() ) );
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsGeoNodeNewConnection::validate()
|
||||
{
|
||||
if ( !url().contains( "://" ) )
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this,
|
||||
tr( "Invalid URL" ),
|
||||
tr( "Your URL doesn't contain a protocol (e.g. http or https). Please add the protocol." ) );
|
||||
return false;
|
||||
}
|
||||
return QgsNewHttpConnection::validate();
|
||||
}
|
||||
|
@ -18,11 +18,9 @@
|
||||
#ifndef QGSGEONODENEWCONNECTION_H
|
||||
#define QGSGEONODENEWCONNECTION_H
|
||||
|
||||
#include "ui_qgsnewgeonodeconnectionbase.h"
|
||||
#include "qgsguiutils.h"
|
||||
#include "qgsauthconfigselect.h"
|
||||
#include "qgsnewhttpconnection.h"
|
||||
|
||||
class QgsGeoNodeNewConnection : public QDialog, private Ui::QgsNewGeoNodeConnectionBase
|
||||
class QgsGeoNodeNewConnection : public QgsNewHttpConnection
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -30,20 +28,15 @@ class QgsGeoNodeNewConnection : public QDialog, private Ui::QgsNewGeoNodeConnect
|
||||
//! Constructor
|
||||
QgsGeoNodeNewConnection( QWidget *parent = nullptr, const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
|
||||
|
||||
//! Returns the new connection name
|
||||
QString name() const;
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
void okButtonBehavior( const QString & );
|
||||
|
||||
//! Test the connection using the parameters supplied
|
||||
void testConnection();
|
||||
|
||||
private:
|
||||
QString mBaseKey;
|
||||
QString mCredentialsBaseKey;
|
||||
QString mOriginalConnName; //store initial name to delete entry in case of rename
|
||||
QgsAuthConfigSelect *mAuthConfigSelect = nullptr;
|
||||
protected:
|
||||
|
||||
bool validate() override;
|
||||
|
||||
};
|
||||
|
||||
#endif //QGSGEONODENEWCONNECTION_H
|
||||
|
@ -190,9 +190,23 @@ QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes typ
|
||||
connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
|
||||
connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
|
||||
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
|
||||
connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
|
||||
connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
|
||||
|
||||
nameChanged( connectionName );
|
||||
}
|
||||
|
||||
QString QgsNewHttpConnection::name() const
|
||||
{
|
||||
return txtName->text();
|
||||
}
|
||||
|
||||
QString QgsNewHttpConnection::url() const
|
||||
{
|
||||
return txtUrl->text();
|
||||
}
|
||||
|
||||
void QgsNewHttpConnection::nameChanged( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
@ -205,11 +219,16 @@ void QgsNewHttpConnection::urlChanged( const QString &text )
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
|
||||
}
|
||||
|
||||
void QgsNewHttpConnection::accept()
|
||||
void QgsNewHttpConnection::updateOkButtonState()
|
||||
{
|
||||
bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
|
||||
}
|
||||
|
||||
bool QgsNewHttpConnection::validate()
|
||||
{
|
||||
QgsSettings settings;
|
||||
QString key = mBaseKey + txtName->text();
|
||||
QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + txtName->text();
|
||||
|
||||
// warn if entry was renamed to an existing connection
|
||||
if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( txtName->text(), Qt::CaseInsensitive ) != 0 ) &&
|
||||
@ -219,7 +238,7 @@ void QgsNewHttpConnection::accept()
|
||||
tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
|
||||
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !txtPassword->text().isEmpty() &&
|
||||
@ -228,9 +247,26 @@ void QgsNewHttpConnection::accept()
|
||||
trUtf8( "WARNING: You have entered a password. It will be stored in unsecured plain text in your project files and your home directory (Unix-like OS) or user profile (Windows). If you want to avoid this, press Cancel and either:\n\na) Don't provide a password in the connection settings — it will be requested interactively when needed;\nb) Use the Configuration tab to add your credentials in an HTTP Basic Authentication method and store them in an encrypted database." ),
|
||||
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QPushButton *QgsNewHttpConnection::testConnectButton()
|
||||
{
|
||||
return mTestConnectionButton;
|
||||
}
|
||||
|
||||
void QgsNewHttpConnection::accept()
|
||||
{
|
||||
QgsSettings settings;
|
||||
QString key = mBaseKey + txtName->text();
|
||||
QString credentialsKey = "qgis/" + mCredentialsBaseKey + '/' + txtName->text();
|
||||
|
||||
if ( !validate() )
|
||||
return;
|
||||
|
||||
// on rename delete original entry first
|
||||
if ( !mOriginalConnName.isNull() && mOriginalConnName != key )
|
||||
{
|
||||
|
@ -74,6 +74,18 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
|
||||
QgsNewHttpConnection::Flags flags = 0,
|
||||
Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
|
||||
|
||||
/**
|
||||
* Returns the current connection name.
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
QString name() const;
|
||||
|
||||
/**
|
||||
* Returns the current connection url.
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
QString url() const;
|
||||
|
||||
public slots:
|
||||
|
||||
void accept() override;
|
||||
@ -82,6 +94,22 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
|
||||
|
||||
void nameChanged( const QString & );
|
||||
void urlChanged( const QString & );
|
||||
void updateOkButtonState();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Returns true if dialog settings are valid, or false if current
|
||||
* settings are not valid and the dialog should not be acceptable.
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
virtual bool validate();
|
||||
|
||||
/**
|
||||
* Returns the "test connection" button.
|
||||
* \since QGIS 3.0
|
||||
*/
|
||||
QPushButton *testConnectButton();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1,355 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsNewGeoNodeConnectionBase</class>
|
||||
<widget class="QDialog" name="QgsNewGeoNodeConnectionBase">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>448</width>
|
||||
<height>475</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create a new Geonode connection</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="mGroupBox">
|
||||
<property name="title">
|
||||
<string>Connection details</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>WFS Options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblVersion">
|
||||
<property name="text">
|
||||
<string>Version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cmbVersion">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Select protocol version</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblMaxNumFeatures">
|
||||
<property name="text">
|
||||
<string>Max. number of features</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="txtMaxNumFeatures">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter a number to limit the maximum number of features retrieved in a single GetFeature request. If let to empty, server default will apply.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="btnConnect">
|
||||
<property name="text">
|
||||
<string>&Test Connection</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="cbxWfsIgnoreAxisOrientation">
|
||||
<property name="text">
|
||||
<string>Ignore axis orientation (WFS 1.1/WFS 2.0)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QTabWidget" name="tabAuth">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Authentication</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>If the service requires basic authentication, enter a user name and optional password</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>&User name</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtUserName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="txtUserName"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtPassword</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QgsPasswordLineEdit" name="txtPassword">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QCheckBox" name="cbxWmsIgnoreAxisOrientation">
|
||||
<property name="text">
|
||||
<string>Ignore axis orientation (WMS 1.3/WMTS)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0">
|
||||
<widget class="QCheckBox" name="cbxWmsInvertAxisOrientation">
|
||||
<property name="text">
|
||||
<string>Invert axis orientation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>WMS Options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="txtReferer"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblReferer">
|
||||
<property name="text">
|
||||
<string>Referer</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtReferer</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cmbDpiMode"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblDpiMode">
|
||||
<property name="text">
|
||||
<string>DPI-Mode</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>cmbDpiMode</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QCheckBox" name="cbxWfsInvertAxisOrientation">
|
||||
<property name="text">
|
||||
<string>Invert axis orientation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QCheckBox" name="cbxIgnoreGetFeatureInfoURI">
|
||||
<property name="text">
|
||||
<string>Ignore GetFeatureInfo URI reported in capabilities</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="TextLabel1_2">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtName</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="txtName">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Name of the new connection</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="TextLabel1">
|
||||
<property name="text">
|
||||
<string>URL</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>txtUrl</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="txtUrl">
|
||||
<property name="toolTip">
|
||||
<string>HTTP address of the Web Map Server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QCheckBox" name="cbxIgnoreGetMapURI">
|
||||
<property name="text">
|
||||
<string>Ignore GetMap/GetTile URI reported in capabilities</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<widget class="QCheckBox" name="cbxSmoothPixmapTransform">
|
||||
<property name="text">
|
||||
<string>Smooth pixmap transform</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QgsPasswordLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>qgspasswordlineedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabAuth</tabstop>
|
||||
<tabstop>txtUserName</tabstop>
|
||||
<tabstop>txtPassword</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QgsNewGeoNodeConnectionBase</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>421</x>
|
||||
<y>453</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>430</x>
|
||||
<y>98</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QgsNewGeoNodeConnectionBase</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>330</x>
|
||||
<y>453</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>426</x>
|
||||
<y>38</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
x
Reference in New Issue
Block a user