QGIS API Documentation 3.41.0-Master (3440c17df1d)
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 ***************************************************************************/
18#include "moc_qgsnewhttpconnection.cpp"
20#include "qgssettings.h"
21#include "qgshelp.h"
22#include "qgsgui.h"
24#include "qgsowsconnection.h"
27
28#include <QMessageBox>
29#include <QUrl>
30#include <QPushButton>
31#include <QRegularExpression>
32#include <QRegularExpressionValidator>
33#include <QUrlQuery>
34
35QgsNewHttpConnection::QgsNewHttpConnection( QWidget *parent, ConnectionTypes types, const QString &serviceName, const QString &connectionName, QgsNewHttpConnection::Flags flags, Qt::WindowFlags fl )
36 : QDialog( parent, fl )
37 , mTypes( types )
38 , mServiceName( serviceName )
39 , mOriginalConnName( connectionName )
40{
41 setupUi( this );
42
43 // compatibility fix with former API (pre 3.26) when serviceName was a setting key instead
44 if ( mServiceName.startsWith( QLatin1String( "qgis/" ) ) )
45 {
46 // It would be obviously much better to use mBaseKey also for credentials,
47 // but for some strange reason a different hardcoded key was used instead.
48 // WFS and WMS credentials were mixed with the same key WMS.
49 // Only WMS and WFS providers are using QgsNewHttpConnection at this moment
50 // using connection-wms and connection-wfs -> parse credential key from it.
51 mServiceName = mServiceName.split( '-' ).last().toUpper();
52 }
53
54 if ( !( flags & FlagShowHttpSettings ) )
55 mHttpHeaders->hide();
56
58
59 connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewHttpConnection::showHelp );
60
61 QString connectionType = mServiceName;
62 if ( mServiceName == QLatin1String( "WMS" ) )
63 {
64 connectionType = QStringLiteral( "WMS/WMTS" );
65 }
66 setWindowTitle( tr( "Create a New %1 Connection" ).arg( connectionType ) );
67
68 txtName->setValidator( new QRegularExpressionValidator( QRegularExpression( "[^\\/]+" ), txtName ) );
69
70 cmbDpiMode->clear();
71 cmbDpiMode->addItem( tr( "all" ), static_cast<int>( Qgis::DpiMode::All ) );
72 cmbDpiMode->addItem( tr( "off" ), static_cast<int>( Qgis::DpiMode::Off ) );
73 cmbDpiMode->addItem( tr( "QGIS" ), static_cast<int>( Qgis::DpiMode::QGIS ) );
74 cmbDpiMode->addItem( tr( "UMN" ), static_cast<int>( Qgis::DpiMode::UMN ) );
75 cmbDpiMode->addItem( tr( "GeoServer" ), static_cast<int>( Qgis::DpiMode::GeoServer ) );
76
77 cmbTilePixelRatio->clear();
78 cmbTilePixelRatio->addItem( tr( "Undefined (not scaled)" ), static_cast<int>( Qgis::TilePixelRatio::Undefined ) );
79 cmbTilePixelRatio->addItem( tr( "Standard (96 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::StandardDpi ) );
80 cmbTilePixelRatio->addItem( tr( "High (192 DPI)" ), static_cast<int>( Qgis::TilePixelRatio::HighDpi ) );
81
82 cmbVersion->clear();
83 cmbVersion->addItem( tr( "Maximum" ) );
84 cmbVersion->addItem( tr( "1.0" ) );
85 cmbVersion->addItem( tr( "1.1" ) );
86 cmbVersion->addItem( tr( "2.0" ) );
87 cmbVersion->addItem( tr( "OGC API - Features" ) );
88 connect( cmbVersion,
89 static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
90 this, &QgsNewHttpConnection::wfsVersionCurrentIndexChanged );
91
92 cmbFeaturePaging->clear();
93 cmbFeaturePaging->addItem( tr( "Default (trust server capabilities)" ) );
94 cmbFeaturePaging->addItem( tr( "Enabled" ) );
95 cmbFeaturePaging->addItem( tr( "Disabled" ) );
96 connect( cmbFeaturePaging,
97 static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ),
98 this, &QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged );
99
100 if ( !connectionName.isEmpty() )
101 {
102 // populate the dialog with the information stored for the connection
103 // populate the fields with the stored setting parameters
104
105 txtName->setText( connectionName );
106 const QStringList detailParameters { mServiceName.toLower(), connectionName };
107 txtUrl->setText( QgsOwsConnection::settingsUrl->value( detailParameters ) );
108 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( detailParameters ) ) );
109
111
112 // Authentication
113 mAuthSettings->setUsername( QgsOwsConnection::settingsUsername->value( detailParameters ) );
114 mAuthSettings->setPassword( QgsOwsConnection::settingsPassword->value( detailParameters ) );
115 mAuthSettings->setConfigId( QgsOwsConnection::settingsAuthCfg->value( detailParameters ) );
116 }
117 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
118
119 if ( !( mTypes & ConnectionWms ) && !( mTypes & ConnectionWcs ) )
120 {
121 mWmsOptionsGroupBox->setVisible( false );
122 mGroupBox->layout()->removeWidget( mWmsOptionsGroupBox );
123 }
124 if ( !( mTypes & ConnectionWfs ) )
125 {
126 mWfsOptionsGroupBox->setVisible( false );
127 mGroupBox->layout()->removeWidget( mWfsOptionsGroupBox );
128 }
129 else
130 {
131 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)" ) );
132 }
133
134 if ( mTypes & ConnectionWcs )
135 {
136 cbxIgnoreGetMapURI->setText( tr( "Ignore GetCoverage URI reported in capabilities" ) );
137 cbxWmsIgnoreAxisOrientation->setText( tr( "Ignore axis orientation" ) );
138 if ( !( mTypes & ConnectionWms ) )
139 {
140 mWmsOptionsGroupBox->setTitle( tr( "WCS Options" ) );
141
142 cbxIgnoreGetFeatureInfoURI->setVisible( false );
143 mGroupBox->layout()->removeWidget( cbxIgnoreGetFeatureInfoURI );
144
145 sbFeatureCount->setVisible( false );
146 mGroupBox->layout()->removeWidget( sbFeatureCount );
147 lblFeatureCount->setVisible( false );
148 mGroupBox->layout()->removeWidget( lblFeatureCount );
149
150 cmbDpiMode->setVisible( false );
151 mGroupBox->layout()->removeWidget( cmbDpiMode );
152 lblDpiMode->setVisible( false );
153 mGroupBox->layout()->removeWidget( lblDpiMode );
154 cmbTilePixelRatio->setVisible( false );
155 mGroupBox->layout()->removeWidget( cmbTilePixelRatio );
156 lblTilePixelRatio->setVisible( false );
157 mGroupBox->layout()->removeWidget( lblTilePixelRatio );
158 }
159 }
160
161 if ( !( flags & FlagShowTestConnection ) )
162 {
163 mTestConnectionButton->hide();
164 mGroupBox->layout()->removeWidget( mTestConnectionButton );
165 }
166
167 if ( flags & FlagHideAuthenticationGroup )
168 {
169 mAuthGroupBox->hide();
170 mGroupBox->layout()->removeWidget( mAuthGroupBox );
171 }
172 // Adjust height
173 const int w = width();
174 adjustSize();
175 resize( w, height() );
176
177 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::nameChanged );
178 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::urlChanged );
179
180 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
181 connect( txtName, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
182 connect( txtUrl, &QLineEdit::textChanged, this, &QgsNewHttpConnection::updateOkButtonState );
183
184 nameChanged( connectionName );
185}
186
187void QgsNewHttpConnection::wfsVersionCurrentIndexChanged( int index )
188{
189 // For now 2019-06-06, leave paging checkable for some WFS version 1.1 servers with support
190 cmbFeaturePaging->setEnabled( index == WFS_VERSION_MAX || index >= WFS_VERSION_2_0 );
191 const bool pagingNotDisabled = cmbFeaturePaging->currentIndex() != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
192 lblPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
193 txtPageSize->setEnabled( pagingNotDisabled && ( index == WFS_VERSION_MAX || index >= WFS_VERSION_1_1 ) );
194 cbxWfsIgnoreAxisOrientation->setEnabled( index != WFS_VERSION_1_0 && index != WFS_VERSION_API_FEATURES_1_0 );
195 cbxWfsInvertAxisOrientation->setEnabled( index != WFS_VERSION_API_FEATURES_1_0 );
196 wfsUseGml2EncodingForTransactions()->setEnabled( index == WFS_VERSION_1_1 );
197}
198
199void QgsNewHttpConnection::wfsFeaturePagingCurrentIndexChanged( int index )
200{
201 const bool pagingNotDisabled = index != static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED );
202 lblPageSize->setEnabled( pagingNotDisabled );
203 txtPageSize->setEnabled( pagingNotDisabled );
204}
205
207{
208 return txtName->text();
209}
210
212{
213 return txtUrl->text();
214}
215
216void QgsNewHttpConnection::nameChanged( const QString &text )
217{
218 Q_UNUSED( text )
219 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
220}
221
222void QgsNewHttpConnection::urlChanged( const QString &text )
223{
224 Q_UNUSED( text )
225 buttonBox->button( QDialogButtonBox::Ok )->setDisabled( txtName->text().isEmpty() || txtUrl->text().isEmpty() );
226 mWfsVersionDetectButton->setDisabled( txtUrl->text().isEmpty() );
227}
228
229void QgsNewHttpConnection::updateOkButtonState()
230{
231 const bool enabled = !txtName->text().isEmpty() && !txtUrl->text().isEmpty();
232 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( enabled );
233}
234
236{
237 const QString newConnectionName = txtName->text();
238
239 bool urlExists = QgsOwsConnection::settingsUrl->exists( {mServiceName.toLower(), newConnectionName} );
240
241 // warn if entry was renamed to an existing connection
242 if ( ( mOriginalConnName.isNull() || mOriginalConnName.compare( newConnectionName, Qt::CaseInsensitive ) != 0 ) &&
243 urlExists &&
244 QMessageBox::question( this,
245 tr( "Save Connection" ),
246 tr( "Should the existing connection %1 be overwritten?" ).arg( txtName->text() ),
247 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
248 {
249 return false;
250 }
251
252 if ( ! mAuthSettings->password().isEmpty() &&
253 QMessageBox::question( this,
254 tr( "Saving Passwords" ),
255 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." ),
256 QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
257 {
258 return false;
259 }
260
261 return true;
262}
263
265{
266 return mTestConnectionButton;
267}
268
273
275{
276 return mWfsVersionDetectButton;
277}
278
280{
281 return cmbVersion;
282}
283
285{
286 return cmbFeaturePaging;
287}
288
290{
291 return cbxWfsUseGml2EncodingForTransactions;
292}
293
295{
296 return txtPageSize;
297}
298
299QString QgsNewHttpConnection::wfsSettingsKey( const QString &base, const QString &connectionName ) const
300{
301 return base + connectionName;
302}
303
304QString QgsNewHttpConnection::wmsSettingsKey( const QString &base, const QString &connectionName ) const
305{
306 return base + connectionName;
307}
308
310{
311 QStringList detailsParameters = { mServiceName.toLower(), mOriginalConnName };
312
313 cbxIgnoreGetMapURI->setChecked( QgsOwsConnection::settingsIgnoreGetMapURI->value( detailsParameters ) );
314 cbxWmsIgnoreReportedLayerExtents->setChecked( QgsOwsConnection::settingsReportedLayerExtents->value( detailsParameters ) );
315 cbxWfsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
316 cbxWfsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
317 cbxWfsUseGml2EncodingForTransactions->setChecked( QgsOwsConnection::settingsPreferCoordinatesForWfsT11->value( detailsParameters ) );
318
319 cbxWmsIgnoreAxisOrientation->setChecked( QgsOwsConnection::settingsIgnoreAxisOrientation->value( detailsParameters ) );
320 cbxWmsInvertAxisOrientation->setChecked( QgsOwsConnection::settingsInvertAxisOrientation->value( detailsParameters ) );
321 cbxIgnoreGetFeatureInfoURI->setChecked( QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->value( detailsParameters ) );
322 cbxSmoothPixmapTransform->setChecked( QgsOwsConnection::settingsSmoothPixmapTransform->value( detailsParameters ) );
323
324 Qgis::DpiMode dpiMode = QgsOwsConnection::settingsDpiMode->value( detailsParameters );
325 cmbDpiMode->setCurrentIndex( cmbDpiMode->findData( static_cast<int>( dpiMode ) ) );
326 Qgis::TilePixelRatio tilePixelRatio = QgsOwsConnection::settingsTilePixelRatio->value( detailsParameters );
327 cmbTilePixelRatio->setCurrentIndex( cmbTilePixelRatio->findData( static_cast<int>( tilePixelRatio ) ) );
328
329 sbFeatureCount->setValue( QgsOwsConnection::settingsFeatureCount->value( detailsParameters ) );
330
331 const QString version = QgsOwsConnection::settingsVersion->value( detailsParameters );
332 int versionIdx = WFS_VERSION_MAX; // AUTO
333 if ( version == QLatin1String( "1.0.0" ) )
334 versionIdx = WFS_VERSION_1_0;
335 else if ( version == QLatin1String( "1.1.0" ) )
336 versionIdx = WFS_VERSION_1_1;
337 else if ( version == QLatin1String( "2.0.0" ) )
338 versionIdx = WFS_VERSION_2_0;
339 else if ( version == QLatin1String( "OGC_API_FEATURES" ) )
340 versionIdx = WFS_VERSION_API_FEATURES_1_0;
341 cmbVersion->setCurrentIndex( versionIdx );
342
343 // Enable/disable these items per WFS versions
344 wfsVersionCurrentIndexChanged( versionIdx );
345
346 mHttpHeaders->setHeaders( QgsHttpHeaders( QgsOwsConnection::settingsHeaders->value( {mServiceName.toLower(), mOriginalConnName} ) ) );
347
348 txtMaxNumFeatures->setText( QgsOwsConnection::settingsMaxNumFeatures->value( detailsParameters ) );
349
350 // Only default to paging enabled if WFS 2.0.0 or higher
351 const QString pagingEnabled = QgsOwsConnection::settingsPagingEnabled->value( detailsParameters );
352 if ( pagingEnabled == QLatin1String( "enabled" ) )
353 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::ENABLED ) );
354 else if ( pagingEnabled == QLatin1String( "disabled" ) )
355 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DISABLED ) );
356 else
357 cmbFeaturePaging->setCurrentIndex( static_cast<int>( QgsNewHttpConnection::WfsFeaturePagingIndex::DEFAULT ) );
358
359 txtPageSize->setText( QgsOwsConnection::settingsPagesize->value( detailsParameters ) );
360}
361
363{
364 QUrl url( txtUrl->text().trimmed() );
365 QUrlQuery query( url );
366 const QList<QPair<QString, QString> > items = query.queryItems( QUrl::FullyEncoded );
367 QHash< QString, QPair<QString, QString> > params;
368 for ( const QPair<QString, QString> &it : items )
369 {
370 params.insert( it.first.toUpper(), it );
371 }
372
373 if ( params[QStringLiteral( "SERVICE" )].second.toUpper() == "WMS" ||
374 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WFS" ||
375 params[QStringLiteral( "SERVICE" )].second.toUpper() == "WCS" )
376 {
377 query.removeQueryItem( params.value( QStringLiteral( "SERVICE" ) ).first );
378 query.removeQueryItem( params.value( QStringLiteral( "REQUEST" ) ).first );
379 query.removeQueryItem( params.value( QStringLiteral( "FORMAT" ) ).first );
380 }
381
382 url.setQuery( query );
383
384 if ( url.path( QUrl::FullyEncoded ).isEmpty() )
385 {
386 url.setPath( fromEncodedComponent_helper( "/" ) );
387 }
388 return url;
389}
390
392{
393 const QString newConnectionName = txtName->text();
394
395 if ( !validate() )
396 return;
397
398 QgsSettings settings;
399
400 // on rename delete original entry first
401 if ( !mOriginalConnName.isNull() && mOriginalConnName != newConnectionName )
402 {
403 QgsOwsConnection::sTreeOwsConnections->deleteItem( mOriginalConnName, {mServiceName.toLower()} );
404 settings.sync();
405 }
406
407 QStringList detailsParameters = {mServiceName.toLower(), newConnectionName};
408
409 const QUrl url( urlTrimmed() );
410 QgsOwsConnection::settingsUrl->setValue( url.toString(), detailsParameters );
411
412 if ( mTypes & ConnectionWfs )
413 {
414 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWfsIgnoreAxisOrientation->isChecked(), detailsParameters );
415 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWfsInvertAxisOrientation->isChecked(), detailsParameters );
416 QgsOwsConnection::settingsPreferCoordinatesForWfsT11->setValue( cbxWfsUseGml2EncodingForTransactions->isChecked(), detailsParameters );
417 }
418 if ( mTypes & ConnectionWms || mTypes & ConnectionWcs )
419 {
420 QgsOwsConnection::settingsIgnoreAxisOrientation->setValue( cbxWmsIgnoreAxisOrientation->isChecked(), detailsParameters );
421 QgsOwsConnection::settingsInvertAxisOrientation->setValue( cbxWmsInvertAxisOrientation->isChecked(), detailsParameters );
422
423 QgsOwsConnection::settingsReportedLayerExtents->setValue( cbxWmsIgnoreReportedLayerExtents->isChecked(), detailsParameters );
424 QgsOwsConnection::settingsIgnoreGetMapURI->setValue( cbxIgnoreGetMapURI->isChecked(), detailsParameters );
425 QgsOwsConnection::settingsSmoothPixmapTransform->setValue( cbxSmoothPixmapTransform->isChecked(), detailsParameters );
426
427 Qgis::DpiMode dpiMode = cmbDpiMode->currentData().value<Qgis::DpiMode>();
428 QgsOwsConnection::settingsDpiMode->setValue( dpiMode, detailsParameters );
429 Qgis::TilePixelRatio tilePixelRatio = cmbTilePixelRatio->currentData().value<Qgis::TilePixelRatio>();
430 QgsOwsConnection::settingsTilePixelRatio->setValue( tilePixelRatio, detailsParameters );
431
432 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), detailsParameters );
433 }
434 if ( mTypes & ConnectionWms )
435 {
436 QgsOwsConnection::settingsIgnoreGetFeatureInfoURI->setValue( cbxIgnoreGetFeatureInfoURI->isChecked(), detailsParameters );
437 QgsOwsConnection::settingsFeatureCount->setValue( sbFeatureCount->value(), detailsParameters );
438 }
439 if ( mTypes & ConnectionWfs )
440 {
441 QString version = QStringLiteral( "auto" );
442 switch ( cmbVersion->currentIndex() )
443 {
444 case WFS_VERSION_MAX:
445 version = QStringLiteral( "auto" );
446 break;
447 case WFS_VERSION_1_0:
448 version = QStringLiteral( "1.0.0" );
449 break;
450 case WFS_VERSION_1_1:
451 version = QStringLiteral( "1.1.0" );
452 break;
453 case WFS_VERSION_2_0:
454 version = QStringLiteral( "2.0.0" );
455 break;
457 version = QStringLiteral( "OGC_API_FEATURES" );
458 break;
459 }
460 QgsOwsConnection::settingsVersion->setValue( version, detailsParameters );
461 QgsOwsConnection::settingsMaxNumFeatures->setValue( txtMaxNumFeatures->text(), detailsParameters );
462 QgsOwsConnection::settingsPagesize->setValue( txtPageSize->text(), detailsParameters );
463
464 QString pagingEnabled = QStringLiteral( "default" );
465 switch ( cmbFeaturePaging->currentIndex() )
466 {
468 pagingEnabled = QStringLiteral( "default" );
469 break;
471 pagingEnabled = QStringLiteral( "enabled" );
472 break;
474 pagingEnabled = QStringLiteral( "disabled" );
475 break;
476 }
477 QgsOwsConnection::settingsPagingEnabled->setValue( pagingEnabled, detailsParameters );
478 }
479
480 QStringList credentialsParameters = {mServiceName.toLower(), newConnectionName};
481 QgsOwsConnection::settingsUsername->setValue( mAuthSettings->username(), credentialsParameters );
482 QgsOwsConnection::settingsPassword->setValue( mAuthSettings->password(), credentialsParameters );
483 QgsOwsConnection::settingsAuthCfg->setValue( mAuthSettings->configId(), credentialsParameters );
484
485 if ( mHttpHeaders->isVisible() )
486 QgsOwsConnection::settingsHeaders->setValue( mHttpHeaders->httpHeaders().headers(), credentialsParameters );
487
488 QgsOwsConnection::sTreeOwsConnections->setSelectedItem( newConnectionName, {mServiceName.toLower()} );
489
490 QDialog::accept();
491}
492
493void QgsNewHttpConnection::showHelp()
494{
495 QgsHelp::openHelp( QStringLiteral( "working_with_ogc/index.html" ) );
496}
TilePixelRatio
DpiMode enum.
Definition qgis.h:3123
@ Undefined
Undefined (not scale)
@ HighDpi
High (192 DPI)
@ StandardDpi
Standard (96 DPI)
DpiMode
DpiMode enum.
Definition qgis.h:3109
@ 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:209
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)