QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsnewhttpconnection.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsnewhttpconnection.cpp - selector for a new HTTP server for WMS, etc.
3 -------------------
4 begin : 3 April 2005
5 copyright : (C) 2005 by Brendan Morley
6 email : morb at ozemail dot com dot au
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
19#include "qgssettings.h"
20#include "qgshelp.h"
21#include "qgsgui.h"
23#include "qgsowsconnection.h"
26
27#include <QMessageBox>
28#include <QUrl>
29#include <QPushButton>
30#include <QRegularExpression>
31#include <QRegularExpressionValidator>
32#include <QUrlQuery>
33
34QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes types, const QString &serviceName, const QString &connectionName, QgsNewHttpConnection::Flags flags, Qt::WindowFlags fl )
35 : QDialog( parent, fl )
36 , mTypes( types )
37 , mServiceName( serviceName )
38 , mOriginalConnName( connectionName )
39{
40 setupUi( this );
41
42 // compatibility fix with former API (pre 3.26) when serviceName was a setting key instead
43 if ( mServiceName.startsWith( QLatin1String( "qgis/" ) ) )
44 {
45 // It would be obviously much better to use mBaseKey also for credentials,
46 // but for some strange reason a different hardcoded key was used instead.
47 // WFS and WMS credentials were mixed with the same key WMS.
48 // Only WMS and WFS providers are using QgsNewHttpConnection at this moment
49 // using connection-wms and connection-wfs -> parse credential key from it.
50 mServiceName = mServiceName.split( '-' ).last().toUpper();
51 }
52
53 if ( !( flags & FlagShowHttpSettings ) )
54 mHttpHeaders->hide();
55
57
58 connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewHttpConnection::showHelp );
59
60 QString connectionType = mServiceName;
61 if ( mServiceName == QLatin1String( "WMS" ) )
62 {
63 connectionType = QStringLiteral( "WMS/WMTS" );
64 }
65 setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
66
67 txtName->setValidator( new QRegularExpressionValidator( QRegularExpression( "[^\\/]+" ), txtName ) );
68
69 cmbDpiMode->clear();
70 cmbDpiMode->addItem( tr( "all" ), static_cast<int>( Qgis::DpiMode::All ) );
71 cmbDpiMode->addItem( tr( "off" ), static_cast<int>( Qgis::DpiMode::Off ) );
72 cmbDpiMode->addItem( tr( "QGIS" ), static_cast<int>( Qgis::DpiMode::QGIS ) );
73 cmbDpiMode->addItem( tr( "UMN" ), static_cast<int>( Qgis::DpiMode::UMN ) );
74 cmbDpiMode->addItem( tr( "GeoServer" ), static_cast<int>( Qgis::DpiMode::GeoServer ) );
75
76 cmbTilePixelRatio->clear();
77 cmbTilePixelRatio->addItem( tr( "Undefined (not scaled)" ), static_cast<int>( Qgis::TilePixelRatio::Undefined ) );
78 cmbTilePixelRatio->addItem( tr( "Standard (96 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::StandardDpi ) );
79 cmbTilePixelRatio->addItem( tr( "High (192 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::HighDpi ) );
80
81 cmbVersion->clear();
82 cmbVersion->addItem( tr( "Maximum" ) );
83 cmbVersion->addItem( tr( "1.0" ) );
84 cmbVersion->addItem( tr( "1.1" ) );
85 cmbVersion->addItem( tr( "2.0" ) );
86 cmbVersion->addItem( tr( "OGC API - Features" ) );
87 connect( cmbVersion,
88 static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
89 this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );
90
91 cmbFeaturePaging->clear();
92 cmbFeaturePaging->addItem( tr( "Default (trust server capabilities)" ) );
93 cmbFeaturePaging->addItem( tr( "Enabled" ) );
94 cmbFeaturePaging->addItem( tr( "Disabled" ) );
95 connect( cmbFeaturePaging,
96 static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
97 this, &QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged );
98
99 if ( !connectionName.isEmpty() )
100 {
101 // populate the dialog with the information stored for the connection
102 // populate the fields with the stored setting parameters
103
104 txtName->setText( connectionName );
105 const QStringList detailParameters { mServiceName.toLower(), connectionName };
106 txtUrl->setText( QgsOwsConnection::settingsUrl->value( detailParameters ) );
107 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( detailParameters ) ) );
108
110
111 // Authentication
112 mAuthSettings->setUsername( QgsOwsConnection::settingsUsername->value( detailParameters ) );
113 mAuthSettings->setPassword( QgsOwsConnection::settingsPassword->value( detailParameters ) );
114 mAuthSettings->setConfigId( QgsOwsConnection::settingsAuthCfg->value( detailParameters ) );
115 }
116 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
117
118 if ( !( mTypes & ConnectionWms ) && !( mTypes & ConnectionWcs ) )
119 {
120 mWmsOptionsGroupBox->setVisible( false );
121 mGroupBox->layout()->removeWidget( mWmsOptionsGroupBox );
122 }
123 if ( !( mTypes & ConnectionWfs ) )
124 {
125 mWfsOptionsGroupBox->setVisible( false );
126 mGroupBox->layout()->removeWidget( mWfsOptionsGroupBox );
127 }
128 else
129 {
130 txtUrl->setToolTip( tr( "HTTP address of the WFS service, or landing page of a OGC API service<br>(an ending slash might be needed for some OGC API servers)" ) );
131 }
132
133 if ( mTypes & ConnectionWcs )
134 {
135 cbxIgnoreGetMapURI->setText( tr( "Ignore GetCoverage URI reported in capabilities" ) );
136 cbxWmsIgnoreAxisOrientation->setText( tr( "Ignore axis orientation" ) );
137 if ( !( mTypes & ConnectionWms ) )
138 {
139 mWmsOptionsGroupBox->setTitle( tr( "WCS Options" ) );
140
141 cbxIgnoreGetFeatureInfoURI->setVisible( false );
142 mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
143
144 cmbDpiMode->setVisible( false );
145 mGroupBox->layout()->removeWidget( cmbDpiMode );
146 lblDpiMode->setVisible( false );
147 mGroupBox->layout()->removeWidget( lblDpiMode );
148 cmbTilePixelRatio->setVisible( false );
149 mGroupBox->layout()->removeWidget( cmbTilePixelRatio );
150 lblTilePixelRatio->setVisible( false );
151 mGroupBox->layout()->removeWidget( lblTilePixelRatio );
152 }
153 }
154
155 if ( !( flags & FlagShowTestConnection ) )
156 {
157 mTestConnectionButton->hide();
158 mGroupBox->layout()->removeWidget( mTestConnectionButton );
159 }
160
161 if ( flags & FlagHideAuthenticationGroup )
162 {
163 mAuthGroupBox->hide();
164 mGroupBox->layout()->removeWidget( mAuthGroupBox );
165 }
166 // Adjust height
167 const int w = width();
168 adjustSize();
169 resize( w, height() );
170
171 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
172 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
173
174 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
175 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
176 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
177
178 nameChanged( connectionName );
179}
180
181void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
182{
183 // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
184 cmbFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
185 const bool pagingNotDisabled = cmbFeaturePaging->currentIndex() != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
186 lblPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
187 txtPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
188 cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
189 cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
190 wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
191}
192
193void QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged( int index )
194{
195 const bool pagingNotDisabled = index != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
196 lblPageSize->setEnabled( pagingNotDisabled );
197 txtPageSize->setEnabled( pagingNotDisabled );
198}
199
201{
202 return txtName->text();
203}
204
206{
207 return txtUrl->text();
208}
209
210void QgsNewHttpConnection::nameChanged( const QString &text )
211{
212 Q_UNUSED( text )
213 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
214}
215
216void QgsNewHttpConnection::urlChanged( const QString &text )
217{
218 Q_UNUSED( text )
219 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
220 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
221}
222
223void QgsNewHttpConnection::updateOkButtonState()
224{
225 const bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
226 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
227}
228
230{
231 const QString newConnectionName = txtName->text();
232
233 bool urlExists = QgsOwsConnection::settingsUrl->exists( {mServiceName.toLower(), newConnectionName} );
234
235 // warn if entry was renamed to an existing connection
236 if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( newConnectionName, Qt::CaseInsensitive ) != 0 ) &&
237 urlExists &&
238 QMessageBox::question( this,
239 tr( "Save Connection" ),
240 tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
241 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
242 {
243 return false;
244 }
245
246 if ( ! mAuthSettings->password().isEmpty() &&
247 QMessageBox::question( this,
248 tr( "Saving Passwords" ),
249 tr( "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." ),
250 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
251 {
252 return false;
253 }
254
255 return true;
256}
257
259{
260 return mTestConnectionButton;
261}
262
264{
265 return mAuthSettings;
266}
267
269{
270 return mWfsVersionDetectButton;
271}
272
274{
275 return cmbVersion;
276}
277
279{
280 return cmbFeaturePaging;
281}
282
284{
285 return cbxWfsUseGml2EncodingForTransactions;
286}
287
289{
290 return txtPageSize;
291}
292
293QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
294{
295 return base + connectionName;
296}
297
298QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
299{
300 return base + connectionName;
301}
302
304{
305 QStringList detailsParameters = { mServiceName.toLower(), mOriginalConnName };
306
307 cbxIgnoreGetMapURI->setChecked( QgsOwsConnection::settingsIgnoreGetMapURI->value( detailsParameters ) );
308 cbxWmsIgnoreReportedLayerExtents->setChecked( QgsOwsConnection::settingsReportedLayerExtents->value( detailsParameters ) );
309 cbxWfsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
310 cbxWfsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
311 cbxWfsUseGml2EncodingForTransactions->setChecked( QgsOwsConnection::settingsPreferCoordinatesForWfsT11->value( detailsParameters ) );
312
313 cbxWmsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
314 cbxWmsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
315 cbxIgnoreGetFeatureInfoURI->setChecked( QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->value( detailsParameters ) );
316 cbxSmoothPixmapTransform->setChecked( QgsOwsConnection::settingsSmoothPixmapTransform->value( detailsParameters ) );
317
318 Qgis::DpiMode dpiMode = QgsOwsConnection::settingsDpiMode->value( detailsParameters );
319 cmbDpiMode->setCurrentIndex( cmbDpiMode->findData( static_cast<int>( dpiMode ) ) );
320 Qgis::TilePixelRatio tilePixelRatio = QgsOwsConnection::settingsTilePixelRatio->value( detailsParameters );
321 cmbTilePixelRatio->setCurrentIndex( cmbTilePixelRatio->findData( static_cast<int>( tilePixelRatio ) ) );
322
323 const QString version = QgsOwsConnection::settingsVersion->value( detailsParameters );
324 int versionIdx = WFS_VERSION_MAX; // AUTO
325 if ( version == QLatin1String( "1.0.0" ) )
326 versionIdx = WFS_VERSION_1_0;
327 else if ( version == QLatin1String( "1.1.0" ) )
328 versionIdx = WFS_VERSION_1_1;
329 else if ( version == QLatin1String( "2.0.0" ) )
330 versionIdx = WFS_VERSION_2_0;
331 else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
332 versionIdx = WFS_VERSION_API_FEATURES_1_0;
333 cmbVersion->setCurrentIndex( versionIdx );
334
335 // Enable/disable these items per WFS versions
336 wfsVersionCurrentIndexChanged( versionIdx );
337
338 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( {mServiceName.toLower(), mOriginalConnName} ) ) );
339
340 txtMaxNumFeatures->setText( QgsOwsConnection::settingsMaxNumFeatures->value( detailsParameters ) );
341
342 // Only default to paging enabled if WFS 2.0.0 or higher
343 const QString pagingEnabled = QgsOwsConnection::settingsPagingEnabled->value( detailsParameters );
344 if ( pagingEnabled == QLatin1String( "enabled" ) )
345 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::ENABLED ) );
346 else if ( pagingEnabled == QLatin1String( "disabled" ) )
347 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED ) );
348 else
349 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DEFAULT ) );
350
351 txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
352}
353
355{
356 QUrl url( txtUrl->text().trimmed() );
357 QUrlQuery query( url );
358 const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
359 QHash< QString, QPair<QString, QString> > params;
360 for ( const QPair<QString, QString> &it : items )
361 {
362 params.insert( it.first.toUpper(), it );
363 }
364
365 if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
366 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
367 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
368 {
369 query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
370 query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
371 query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
372 }
373
374 url.setQuery( query );
375
376 if ( url.path( QUrl::FullyEncoded ).isEmpty() )
377 {
378 url.setPath( fromEncodedComponent_helper( "/" ) );
379 }
380 return url;
381}
382
384{
385 const QString newConnectionName = txtName->text();
386
387 if ( !validate() )
388 return;
389
390 QgsSettings settings;
391
392 // on rename delete original entry first
393 if ( !mOriginalConnName.isNull() && mOriginalConnName != newConnectionName )
394 {
395 QgsOwsConnection::sTreeOwsConnections->deleteItem( mOriginalConnName, {mServiceName.toLower()} );
396 settings.sync();
397 }
398
399 QStringList detailsParameters = {mServiceName.toLower(), newConnectionName};
400
401 const QUrl url( urlTrimmed() );
402 QgsOwsConnection::settingsUrl->setValue( url.toString(), detailsParameters );
403
404 if ( mTypes & ConnectionWfs )
405 {
406 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWfsIgnoreAxisOrientation->isChecked(), detailsParameters );
407 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWfsInvertAxisOrientation->isChecked(), detailsParameters );
408 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->setValue( cbxWfsUseGml2EncodingForTransactions->isChecked(), detailsParameters );
409 }
410 if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
411 {
412 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWmsIgnoreAxisOrientation->isChecked(), detailsParameters );
413 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWmsInvertAxisOrientation->isChecked(), detailsParameters );
414
415 QgsOwsConnection::settingsReportedLayerExtents->setValue( cbxWmsIgnoreReportedLayerExtents->isChecked(), detailsParameters );
416 QgsOwsConnection::settingsIgnoreGetMapURI->setValue( cbxIgnoreGetMapURI->isChecked(), detailsParameters );
417 QgsOwsConnection::settingsSmoothPixmapTransform->setValue( cbxSmoothPixmapTransform->isChecked(), detailsParameters );
418
419 Qgis::DpiMode dpiMode = cmbDpiMode->currentData().value<Qgis::DpiMode>();
420 QgsOwsConnection::settingsDpiMode->setValue( dpiMode, detailsParameters );
421 Qgis::TilePixelRatio tilePixelRatio = cmbTilePixelRatio->currentData().value<Qgis::TilePixelRatio>();
422 QgsOwsConnection::settingsTilePixelRatio->setValue( tilePixelRatio, detailsParameters );
423
424 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), detailsParameters );
425 }
426 if ( mTypes & ConnectionWms )
427 {
428 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->setValue( cbxIgnoreGetFeatureInfoURI->isChecked(), detailsParameters );
429 }
430 if ( mTypes & ConnectionWfs )
431 {
432 QString version = QStringLiteral( "auto" );
433 switch ( cmbVersion->currentIndex() )
434 {
435 case WFS_VERSION_MAX:
436 version = QStringLiteral( "auto" );
437 break;
438 case WFS_VERSION_1_0:
439 version = QStringLiteral( "1.0.0" );
440 break;
441 case WFS_VERSION_1_1:
442 version = QStringLiteral( "1.1.0" );
443 break;
444 case WFS_VERSION_2_0:
445 version = QStringLiteral( "2.0.0" );
446 break;
448 version = QStringLiteral( "OGC_API_FEATURES" );
449 break;
450 }
451 QgsOwsConnection::settingsVersion->setValue( version, detailsParameters );
452 QgsOwsConnection::settingsMaxNumFeatures->setValue( txtMaxNumFeatures->text(), detailsParameters );
453 QgsOwsConnection::settingsPagesize->setValue( txtPageSize->text(), detailsParameters );
454
455 QString pagingEnabled = QStringLiteral( "default" );
456 switch ( cmbFeaturePaging->currentIndex() )
457 {
459 pagingEnabled = QStringLiteral( "default" );
460 break;
462 pagingEnabled = QStringLiteral( "enabled" );
463 break;
465 pagingEnabled = QStringLiteral( "disabled" );
466 break;
467 }
468 QgsOwsConnection::settingsPagingEnabled->setValue( pagingEnabled, detailsParameters );
469 }
470
471 QStringList credentialsParameters = {mServiceName.toLower(), newConnectionName};
472 QgsOwsConnection::settingsUsername->setValue( mAuthSettings->username(), credentialsParameters );
473 QgsOwsConnection::settingsPassword->setValue( mAuthSettings->password(), credentialsParameters );
474 QgsOwsConnection::settingsAuthCfg->setValue( mAuthSettings->configId(), credentialsParameters );
475
476 if ( mHttpHeaders->isVisible() )
477 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), credentialsParameters );
478
479 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( newConnectionName, {mServiceName.toLower()} );
480
481 QDialog::accept();
482}
483
484void QgsNewHttpConnection::showHelp()
485{
486 QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
487}
TilePixelRatio
DpiMode enum.
Definition: qgis.h:2730
@ Undefined
Undefined (not scale)
@ HighDpi
High (192 DPI)
@ StandardDpi
Standard (96 DPI)
DpiMode
DpiMode enum.
Definition: qgis.h:2716
@ GeoServer
GeoServer.
Widget for entering authentication credentials both in the form username/password and by using QGIS A...
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition: qgsgui.cpp:194
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Definition: qgshelp.cpp:39
This class implements simple http header management.
QPushButton * testConnectButton()
Returns the "test connection" button.
QgsAuthSettingsWidget * authSettingsWidget()
Returns the current authentication settings widget.
QComboBox * wfsPagingComboBox()
Returns the "WFS paging" combobox.
virtual bool validate()
Returns true if dialog settings are valid, or false if current settings are not valid and the dialog ...
QgsNewHttpConnection(QWidget *parent=nullptr, QgsNewHttpConnection::ConnectionTypes types=ConnectionWms, const QString &serviceName="WMS", const QString &connectionName=QString(), QgsNewHttpConnection::Flags flags=QgsNewHttpConnection::Flags(), Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsNewHttpConnection.
QString name() const
Returns the current connection name.
@ FlagShowHttpSettings
Display the 'http' group.
@ FlagHideAuthenticationGroup
Hide the Authentication group.
@ FlagShowTestConnection
Display the 'test connection' button.
QCheckBox * wfsUseGml2EncodingForTransactions()
Returns the "Use GML2 encoding for transactions" checkbox.
QComboBox * wfsVersionComboBox()
Returns the "WFS version" combobox.
virtual QString wmsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WMS related settings for the connection.
virtual QString wfsSettingsKey(const QString &base, const QString &connectionName) const
Returns the QSettings key for WFS related settings for the connection.
QString url() const
Returns the current connection url.
QPushButton * wfsVersionDetectButton()
Returns the "WFS version detect" button.
QUrl urlTrimmed() const
Returns the url.
QLineEdit * wfsPageSizeLineEdit()
Returns the "WFS page size" edit.
void updateServiceSpecificSettings()
Triggers a resync of the GUI widgets for the service specific settings (i.e.
@ ConnectionWms
WMS connection.
@ ConnectionWfs
WFS connection.
@ ConnectionWcs
WCS connection.
QFlags< ConnectionType > ConnectionTypes
static const QgsSettingsEntryBool * settingsPreferCoordinatesForWfsT11
static const QgsSettingsEntryString * settingsPagingEnabled
static const QgsSettingsEntryString * settingsMaxNumFeatures
static QgsSettingsTreeNamedListNode * sTreeOwsConnections
static const QgsSettingsEntryBool * settingsIgnoreGetFeatureInfoURI
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryBool * settingsReportedLayerExtents
static const QgsSettingsEntryEnumFlag< Qgis::DpiMode > * settingsDpiMode
static const QgsSettingsEntryBool * settingsIgnoreAxisOrientation
static const QgsSettingsEntryBool * settingsInvertAxisOrientation
static const QgsSettingsEntryString * settingsVersion
static const QgsSettingsEntryString * settingsPagesize
static const QgsSettingsEntryString * settingsAuthCfg
static const QgsSettingsEntryEnumFlag< Qgis::TilePixelRatio > * settingsTilePixelRatio
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryBool * settingsSmoothPixmapTransform
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryBool * settingsIgnoreGetMapURI
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
bool exists(const QString &dynamicKeyPart=QString()) const
Returns true if the settings is contained in the underlying QSettings.
void deleteItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Deletes a named item from the named list node.
void setSelectedItem(const QString &item, const QStringList &parentsNamedItems=QStringList())
Sets the selected named item from the named list node.
This class is a composition of two QSettings instances:
Definition: qgssettings.h:64
void sync()
Writes any unsaved changes to permanent storage, and reloads any settings that have been changed in t...
QString fromEncodedComponent_helper(const QByteArray &ba)