QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
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 sbFeatureCount->setVisible( false );
145 mGroupBox->layout()->removeWidget( sbFeatureCount );
146 lblFeatureCount->setVisible( false );
147 mGroupBox->layout()->removeWidget( lblFeatureCount );
148
149 cmbDpiMode->setVisible( false );
150 mGroupBox->layout()->removeWidget( cmbDpiMode );
151 lblDpiMode->setVisible( false );
152 mGroupBox->layout()->removeWidget( lblDpiMode );
153 cmbTilePixelRatio->setVisible( false );
154 mGroupBox->layout()->removeWidget( cmbTilePixelRatio );
155 lblTilePixelRatio->setVisible( false );
156 mGroupBox->layout()->removeWidget( lblTilePixelRatio );
157 }
158 }
159
160 if ( !( flags & FlagShowTestConnection ) )
161 {
162 mTestConnectionButton->hide();
163 mGroupBox->layout()->removeWidget( mTestConnectionButton );
164 }
165
166 if ( flags & FlagHideAuthenticationGroup )
167 {
168 mAuthGroupBox->hide();
169 mGroupBox->layout()->removeWidget( mAuthGroupBox );
170 }
171 // Adjust height
172 const int w = width();
173 adjustSize();
174 resize( w, height() );
175
176 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
177 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
178
179 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
180 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
181 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
182
183 nameChanged( connectionName );
184}
185
186void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
187{
188 // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
189 cmbFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
190 const bool pagingNotDisabled = cmbFeaturePaging->currentIndex() != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
191 lblPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
192 txtPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
193 cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
194 cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
195 wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
196}
197
198void QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged( int index )
199{
200 const bool pagingNotDisabled = index != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
201 lblPageSize->setEnabled( pagingNotDisabled );
202 txtPageSize->setEnabled( pagingNotDisabled );
203}
204
206{
207 return txtName->text();
208}
209
211{
212 return txtUrl->text();
213}
214
215void QgsNewHttpConnection::nameChanged( const QString &text )
216{
217 Q_UNUSED( text )
218 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
219}
220
221void QgsNewHttpConnection::urlChanged( const QString &text )
222{
223 Q_UNUSED( text )
224 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
225 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
226}
227
228void QgsNewHttpConnection::updateOkButtonState()
229{
230 const bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
231 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
232}
233
235{
236 const QString newConnectionName = txtName->text();
237
238 bool urlExists = QgsOwsConnection::settingsUrl->exists( {mServiceName.toLower(), newConnectionName} );
239
240 // warn if entry was renamed to an existing connection
241 if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( newConnectionName, Qt::CaseInsensitive ) != 0 ) &&
242 urlExists &&
243 QMessageBox::question( this,
244 tr( "Save Connection" ),
245 tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
246 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
247 {
248 return false;
249 }
250
251 if ( ! mAuthSettings->password().isEmpty() &&
252 QMessageBox::question( this,
253 tr( "Saving Passwords" ),
254 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." ),
255 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
256 {
257 return false;
258 }
259
260 return true;
261}
262
264{
265 return mTestConnectionButton;
266}
267
272
274{
275 return mWfsVersionDetectButton;
276}
277
279{
280 return cmbVersion;
281}
282
284{
285 return cmbFeaturePaging;
286}
287
289{
290 return cbxWfsUseGml2EncodingForTransactions;
291}
292
294{
295 return txtPageSize;
296}
297
298QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
299{
300 return base + connectionName;
301}
302
303QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
304{
305 return base + connectionName;
306}
307
309{
310 QStringList detailsParameters = { mServiceName.toLower(), mOriginalConnName };
311
312 cbxIgnoreGetMapURI->setChecked( QgsOwsConnection::settingsIgnoreGetMapURI->value( detailsParameters ) );
313 cbxWmsIgnoreReportedLayerExtents->setChecked( QgsOwsConnection::settingsReportedLayerExtents->value( detailsParameters ) );
314 cbxWfsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
315 cbxWfsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
316 cbxWfsUseGml2EncodingForTransactions->setChecked( QgsOwsConnection::settingsPreferCoordinatesForWfsT11->value( detailsParameters ) );
317
318 cbxWmsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
319 cbxWmsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
320 cbxIgnoreGetFeatureInfoURI->setChecked( QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->value( detailsParameters ) );
321 cbxSmoothPixmapTransform->setChecked( QgsOwsConnection::settingsSmoothPixmapTransform->value( detailsParameters ) );
322
323 Qgis::DpiMode dpiMode = QgsOwsConnection::settingsDpiMode->value( detailsParameters );
324 cmbDpiMode->setCurrentIndex( cmbDpiMode->findData( static_cast<int>( dpiMode ) ) );
325 Qgis::TilePixelRatio tilePixelRatio = QgsOwsConnection::settingsTilePixelRatio->value( detailsParameters );
326 cmbTilePixelRatio->setCurrentIndex( cmbTilePixelRatio->findData( static_cast<int>( tilePixelRatio ) ) );
327
328 sbFeatureCount->setValue( QgsOwsConnection::settingsFeatureCount->value( detailsParameters ) );
329
330 const QString version = QgsOwsConnection::settingsVersion->value( detailsParameters );
331 int versionIdx = WFS_VERSION_MAX; // AUTO
332 if ( version == QLatin1String( "1.0.0" ) )
333 versionIdx = WFS_VERSION_1_0;
334 else if ( version == QLatin1String( "1.1.0" ) )
335 versionIdx = WFS_VERSION_1_1;
336 else if ( version == QLatin1String( "2.0.0" ) )
337 versionIdx = WFS_VERSION_2_0;
338 else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
339 versionIdx = WFS_VERSION_API_FEATURES_1_0;
340 cmbVersion->setCurrentIndex( versionIdx );
341
342 // Enable/disable these items per WFS versions
343 wfsVersionCurrentIndexChanged( versionIdx );
344
345 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( {mServiceName.toLower(), mOriginalConnName} ) ) );
346
347 txtMaxNumFeatures->setText( QgsOwsConnection::settingsMaxNumFeatures->value( detailsParameters ) );
348
349 // Only default to paging enabled if WFS 2.0.0 or higher
350 const QString pagingEnabled = QgsOwsConnection::settingsPagingEnabled->value( detailsParameters );
351 if ( pagingEnabled == QLatin1String( "enabled" ) )
352 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::ENABLED ) );
353 else if ( pagingEnabled == QLatin1String( "disabled" ) )
354 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED ) );
355 else
356 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DEFAULT ) );
357
358 txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
359}
360
362{
363 QUrl url( txtUrl->text().trimmed() );
364 QUrlQuery query( url );
365 const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
366 QHash< QString, QPair<QString, QString> > params;
367 for ( const QPair<QString, QString> &it : items )
368 {
369 params.insert( it.first.toUpper(), it );
370 }
371
372 if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
373 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
374 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
375 {
376 query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
377 query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
378 query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
379 }
380
381 url.setQuery( query );
382
383 if ( url.path( QUrl::FullyEncoded ).isEmpty() )
384 {
385 url.setPath( fromEncodedComponent_helper( "/" ) );
386 }
387 return url;
388}
389
391{
392 const QString newConnectionName = txtName->text();
393
394 if ( !validate() )
395 return;
396
397 QgsSettings settings;
398
399 // on rename delete original entry first
400 if ( !mOriginalConnName.isNull() && mOriginalConnName != newConnectionName )
401 {
402 QgsOwsConnection::sTreeOwsConnections->deleteItem( mOriginalConnName, {mServiceName.toLower()} );
403 settings.sync();
404 }
405
406 QStringList detailsParameters = {mServiceName.toLower(), newConnectionName};
407
408 const QUrl url( urlTrimmed() );
409 QgsOwsConnection::settingsUrl->setValue( url.toString(), detailsParameters );
410
411 if ( mTypes & ConnectionWfs )
412 {
413 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWfsIgnoreAxisOrientation->isChecked(), detailsParameters );
414 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWfsInvertAxisOrientation->isChecked(), detailsParameters );
415 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->setValue( cbxWfsUseGml2EncodingForTransactions->isChecked(), detailsParameters );
416 }
417 if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
418 {
419 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWmsIgnoreAxisOrientation->isChecked(), detailsParameters );
420 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWmsInvertAxisOrientation->isChecked(), detailsParameters );
421
422 QgsOwsConnection::settingsReportedLayerExtents->setValue( cbxWmsIgnoreReportedLayerExtents->isChecked(), detailsParameters );
423 QgsOwsConnection::settingsIgnoreGetMapURI->setValue( cbxIgnoreGetMapURI->isChecked(), detailsParameters );
424 QgsOwsConnection::settingsSmoothPixmapTransform->setValue( cbxSmoothPixmapTransform->isChecked(), detailsParameters );
425
426 Qgis::DpiMode dpiMode = cmbDpiMode->currentData().value<Qgis::DpiMode>();
427 QgsOwsConnection::settingsDpiMode->setValue( dpiMode, detailsParameters );
428 Qgis::TilePixelRatio tilePixelRatio = cmbTilePixelRatio->currentData().value<Qgis::TilePixelRatio>();
429 QgsOwsConnection::settingsTilePixelRatio->setValue( tilePixelRatio, detailsParameters );
430
431 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), detailsParameters );
432 }
433 if ( mTypes & ConnectionWms )
434 {
435 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->setValue( cbxIgnoreGetFeatureInfoURI->isChecked(), detailsParameters );
436 QgsOwsConnection::settingsFeatureCount->setValue( sbFeatureCount->value(), detailsParameters );
437 }
438 if ( mTypes & ConnectionWfs )
439 {
440 QString version = QStringLiteral( "auto" );
441 switch ( cmbVersion->currentIndex() )
442 {
443 case WFS_VERSION_MAX:
444 version = QStringLiteral( "auto" );
445 break;
446 case WFS_VERSION_1_0:
447 version = QStringLiteral( "1.0.0" );
448 break;
449 case WFS_VERSION_1_1:
450 version = QStringLiteral( "1.1.0" );
451 break;
452 case WFS_VERSION_2_0:
453 version = QStringLiteral( "2.0.0" );
454 break;
456 version = QStringLiteral( "OGC_API_FEATURES" );
457 break;
458 }
459 QgsOwsConnection::settingsVersion->setValue( version, detailsParameters );
460 QgsOwsConnection::settingsMaxNumFeatures->setValue( txtMaxNumFeatures->text(), detailsParameters );
461 QgsOwsConnection::settingsPagesize->setValue( txtPageSize->text(), detailsParameters );
462
463 QString pagingEnabled = QStringLiteral( "default" );
464 switch ( cmbFeaturePaging->currentIndex() )
465 {
467 pagingEnabled = QStringLiteral( "default" );
468 break;
470 pagingEnabled = QStringLiteral( "enabled" );
471 break;
473 pagingEnabled = QStringLiteral( "disabled" );
474 break;
475 }
476 QgsOwsConnection::settingsPagingEnabled->setValue( pagingEnabled, detailsParameters );
477 }
478
479 QStringList credentialsParameters = {mServiceName.toLower(), newConnectionName};
480 QgsOwsConnection::settingsUsername->setValue( mAuthSettings->username(), credentialsParameters );
481 QgsOwsConnection::settingsPassword->setValue( mAuthSettings->password(), credentialsParameters );
482 QgsOwsConnection::settingsAuthCfg->setValue( mAuthSettings->configId(), credentialsParameters );
483
484 if ( mHttpHeaders->isVisible() )
485 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), credentialsParameters );
486
487 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( newConnectionName, {mServiceName.toLower()} );
488
489 QDialog::accept();
490}
491
492void QgsNewHttpConnection::showHelp()
493{
494 QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
495}
TilePixelRatio
DpiMode enum.
Definition qgis.h:3115
@ Undefined
Undefined (not scale)
@ HighDpi
High (192 DPI)
@ StandardDpi
Standard (96 DPI)
DpiMode
DpiMode enum.
Definition qgis.h:3101
@ 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:208
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 QgsSettingsEntryInteger * settingsFeatureCount
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)