35 , mFileName( fileName )
37 , mConnectionType( type )
42 QPushButton *pb =
nullptr;
43 pb =
new QPushButton( tr(
"Select All" ) );
44 buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
47 pb =
new QPushButton( tr(
"Clear Selection" ) );
48 buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
51 if ( mDialogMode ==
Import )
53 label->setText( tr(
"Select connections to import" ) );
54 buttonBox->button( QDialogButtonBox::Ok )->setText( tr(
"Import" ) );
55 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );
60 buttonBox->button( QDialogButtonBox::Ok )->setText( tr(
"Export" ) );
61 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );
64 if ( !populateConnections() )
66 QApplication::postEvent(
this,
new QCloseEvent() );
70 disconnect( buttonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
78 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !listConnections->selectedItems().isEmpty() );
83 const QList<QListWidgetItem *> selection = listConnections->selectedItems();
84 if ( selection.isEmpty() )
86 QMessageBox::warning(
this, tr(
"Export/Import Error" ),
87 tr(
"You should select at least one connection from list." ) );
92 items.reserve( selection.size() );
93 for (
int i = 0; i < selection.size(); ++i )
95 items.append( selection.at( i )->text() );
98 if ( mDialogMode ==
Export )
100 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Save Connections" ), QDir::homePath(),
101 tr(
"XML files (*.xml *.XML)" ) );
102 if ( fileName.isEmpty() )
108 if ( !fileName.endsWith( QLatin1String(
".xml" ), Qt::CaseInsensitive ) )
110 fileName += QLatin1String(
".xml" );
113 mFileName = fileName;
116 switch ( mConnectionType )
119 doc = saveOWSConnections( items, QStringLiteral(
"WMS" ) );
122 doc = saveWfsConnections( items );
125 doc = savePgConnections( items );
128 doc = saveMssqlConnections( items );
131 doc = saveOWSConnections( items, QStringLiteral(
"WCS" ) );
134 doc = saveOracleConnections( items );
137 doc = saveHanaConnections( items );
140 doc = saveXyzTilesConnections( items );
144 doc = saveArcgisConnections( items );
147 doc = saveVectorTileConnections( items );
151 QFile file( mFileName );
152 if ( !file.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) )
154 QMessageBox::warning(
this, tr(
"Saving Connections" ),
155 tr(
"Cannot write file %1:\n%2." )
157 file.errorString() ) );
161 QTextStream out( &file );
166 QFile file( mFileName );
167 if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
169 QMessageBox::warning(
this, tr(
"Loading Connections" ),
170 tr(
"Cannot read file %1:\n%2." )
172 file.errorString() ) );
181 if ( !doc.setContent( &file,
true, &errorStr, &errorLine, &errorColumn ) )
183 QMessageBox::warning(
this, tr(
"Loading Connections" ),
184 tr(
"Parse error at line %1, column %2:\n%3" )
191 switch ( mConnectionType )
194 loadOWSConnections( doc, items, QStringLiteral(
"WMS" ) );
197 loadWfsConnections( doc, items );
200 loadPgConnections( doc, items );
203 loadMssqlConnections( doc, items );
206 loadOWSConnections( doc, items, QStringLiteral(
"WCS" ) );
209 loadOracleConnections( doc, items );
212 loadHanaConnections( doc, items );
215 loadXyzTilesConnections( doc, items );
218 loadArcgisConnections( doc, items, QStringLiteral(
"ARCGISMAPSERVER" ) );
221 loadArcgisConnections( doc, items, QStringLiteral(
"ARCGISFEATURESERVER" ) );
224 loadVectorTileConnections( doc, items );
228 listConnections->clear();
235bool QgsManageConnectionsDialog::populateConnections()
238 if ( mDialogMode ==
Export )
240 QStringList connections;
242 switch ( mConnectionType )
254 settings.
beginGroup( QStringLiteral(
"/PostgreSQL/connections" ) );
257 settings.
beginGroup( QStringLiteral(
"/MSSQL/connections" ) );
260 settings.
beginGroup( QStringLiteral(
"/Oracle/connections" ) );
263 settings.
beginGroup( QStringLiteral(
"/HANA/connections" ) );
273 connections = QgsVectorTileProviderConnection::sTreeConnectionVectorTile->items();
276 if ( !settings.
group().isEmpty() )
279 QStringList::Iterator it = keys.begin();
280 while ( it != keys.end() )
282 QListWidgetItem *item =
new QListWidgetItem();
283 item->setText( *it );
284 listConnections->addItem( item );
293 QFile file( mFileName );
294 if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
296 QMessageBox::warning(
this, tr(
"Loading Connections" ),
297 tr(
"Cannot read file %1:\n%2." )
299 file.errorString() ) );
308 if ( !doc.setContent( &file,
true, &errorStr, &errorLine, &errorColumn ) )
310 QMessageBox::warning(
this, tr(
"Loading Connections" ),
311 tr(
"Parse error at line %1, column %2:\n%3" )
318 const QDomElement root = doc.documentElement();
319 switch ( mConnectionType )
322 if ( root.tagName() != QLatin1String(
"qgsWMSConnections" ) )
324 QMessageBox::information(
this, tr(
"Loading Connections" ),
325 tr(
"The file is not a WMS connections exchange file." ) );
331 if ( root.tagName() != QLatin1String(
"qgsWFSConnections" ) )
333 QMessageBox::information(
this, tr(
"Loading Connections" ),
334 tr(
"The file is not a WFS connections exchange file." ) );
340 if ( root.tagName() != QLatin1String(
"qgsWCSConnections" ) )
342 QMessageBox::information(
this, tr(
"Loading Connections" ),
343 tr(
"The file is not a WCS connections exchange file." ) );
349 if ( root.tagName() != QLatin1String(
"qgsPgConnections" ) )
351 QMessageBox::information(
this, tr(
"Loading Connections" ),
352 tr(
"The file is not a PostGIS connections exchange file." ) );
358 if ( root.tagName() != QLatin1String(
"qgsMssqlConnections" ) )
360 QMessageBox::information(
this, tr(
"Loading Connections" ),
361 tr(
"The file is not a MS SQL Server connections exchange file." ) );
366 if ( root.tagName() != QLatin1String(
"qgsOracleConnections" ) )
368 QMessageBox::information(
this, tr(
"Loading Connections" ),
369 tr(
"The file is not an Oracle connections exchange file." ) );
374 if ( root.tagName() != QLatin1String(
"qgsHanaConnections" ) )
376 QMessageBox::warning(
this, tr(
"Loading Connections" ),
377 tr(
"The file is not a HANA connections exchange file." ) );
382 if ( root.tagName() != QLatin1String(
"qgsXYZTilesConnections" ) )
384 QMessageBox::information(
this, tr(
"Loading Connections" ),
385 tr(
"The file is not a XYZ Tiles connections exchange file." ) );
390 if ( root.tagName() != QLatin1String(
"qgsARCGISMAPSERVERConnections" ) )
392 QMessageBox::information(
this, tr(
"Loading Connections" ),
393 tr(
"The file is not a ArcGIS Map Service connections exchange file." ) );
398 if ( root.tagName() != QLatin1String(
"qgsARCGISFEATURESERVERConnections" ) )
400 QMessageBox::information(
this, tr(
"Loading Connections" ),
401 tr(
"The file is not a ArcGIS Feature Service connections exchange file." ) );
406 if ( root.tagName() != QLatin1String(
"qgsVectorTileConnections" ) )
408 QMessageBox::information(
this, tr(
"Loading Connections" ),
409 tr(
"The file is not a Vector Tile connections exchange file." ) );
415 QDomElement child = root.firstChildElement();
416 while ( !child.isNull() )
418 QListWidgetItem *item =
new QListWidgetItem();
419 item->setText( child.attribute( QStringLiteral(
"name" ) ) );
420 listConnections->addItem( item );
421 child = child.nextSiblingElement();
427QDomDocument QgsManageConnectionsDialog::saveOWSConnections(
const QStringList &connections,
const QString &service )
429 QDomDocument doc( QStringLiteral(
"connections" ) );
430 QDomElement root = doc.createElement(
"qgs" + service.toUpper() +
"Connections" );
431 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
432 doc.appendChild( root );
434 for (
int i = 0; i < connections.count(); ++i )
436 QDomElement el = doc.createElement( service.toLower() );
437 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
440 if ( service == QLatin1String(
"WMS" ) )
450 httpHeader.updateDomElement( el );
455 root.appendChild( el );
461QDomDocument QgsManageConnectionsDialog::saveWfsConnections(
const QStringList &connections )
463 QDomDocument doc( QStringLiteral(
"connections" ) );
464 QDomElement root = doc.createElement( QStringLiteral(
"qgsWFSConnections" ) );
465 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.1" ) );
466 doc.appendChild( root );
468 for (
int i = 0; i < connections.count(); ++i )
470 QDomElement el = doc.createElement( QStringLiteral(
"wfs" ) );
471 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
482 root.appendChild( el );
488QDomDocument QgsManageConnectionsDialog::savePgConnections(
const QStringList &connections )
490 QDomDocument doc( QStringLiteral(
"connections" ) );
491 QDomElement root = doc.createElement( QStringLiteral(
"qgsPgConnections" ) );
492 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
493 doc.appendChild( root );
497 for (
int i = 0; i < connections.count(); ++i )
499 path =
"/PostgreSQL/connections/" + connections[ i ];
500 QDomElement el = doc.createElement( QStringLiteral(
"postgis" ) );
501 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
502 el.setAttribute( QStringLiteral(
"host" ), settings.
value( path +
"/host" ).toString() );
503 el.setAttribute( QStringLiteral(
"port" ), settings.
value( path +
"/port" ).toString() );
504 el.setAttribute( QStringLiteral(
"database" ), settings.
value( path +
"/database" ).toString() );
505 el.setAttribute( QStringLiteral(
"service" ), settings.
value( path +
"/service" ).toString() );
506 el.setAttribute( QStringLiteral(
"sslmode" ), settings.
value( path +
"/sslmode",
"1" ).toString() );
507 el.setAttribute( QStringLiteral(
"estimatedMetadata" ), settings.
value( path +
"/estimatedMetadata",
"0" ).toString() );
508 el.setAttribute( QStringLiteral(
"projectsInDatabase" ), settings.
value( path +
"/projectsInDatabase",
"0" ).toString() );
509 el.setAttribute( QStringLiteral(
"dontResolveType" ), settings.
value( path +
"/dontResolveType",
"0" ).toString() );
510 el.setAttribute( QStringLiteral(
"allowGeometrylessTables" ), settings.
value( path +
"/allowGeometrylessTables",
"0" ).toString() );
511 el.setAttribute( QStringLiteral(
"geometryColumnsOnly" ), settings.
value( path +
"/geometryColumnsOnly",
"0" ).toString() );
512 el.setAttribute( QStringLiteral(
"publicOnly" ), settings.
value( path +
"/publicOnly",
"0" ).toString() );
514 el.setAttribute( QStringLiteral(
"saveUsername" ), settings.
value( path +
"/saveUsername",
"false" ).toString() );
516 if ( settings.
value( path +
"/saveUsername",
"false" ).toString() == QLatin1String(
"true" ) )
518 el.setAttribute( QStringLiteral(
"username" ), settings.
value( path +
"/username" ).toString() );
521 el.setAttribute( QStringLiteral(
"savePassword" ), settings.
value( path +
"/savePassword",
"false" ).toString() );
523 if ( settings.
value( path +
"/savePassword",
"false" ).toString() == QLatin1String(
"true" ) )
525 el.setAttribute( QStringLiteral(
"password" ), settings.
value( path +
"/password" ).toString() );
528 root.appendChild( el );
534QDomDocument QgsManageConnectionsDialog::saveMssqlConnections(
const QStringList &connections )
536 QDomDocument doc( QStringLiteral(
"connections" ) );
537 QDomElement root = doc.createElement( QStringLiteral(
"qgsMssqlConnections" ) );
538 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
539 doc.appendChild( root );
543 for (
int i = 0; i < connections.count(); ++i )
545 path =
"/MSSQL/connections/" + connections[ i ];
546 QDomElement el = doc.createElement( QStringLiteral(
"mssql" ) );
547 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
548 el.setAttribute( QStringLiteral(
"host" ), settings.
value( path +
"/host" ).toString() );
549 el.setAttribute( QStringLiteral(
"port" ), settings.
value( path +
"/port" ).toString() );
550 el.setAttribute( QStringLiteral(
"database" ), settings.
value( path +
"/database" ).toString() );
551 el.setAttribute( QStringLiteral(
"service" ), settings.
value( path +
"/service" ).toString() );
552 el.setAttribute( QStringLiteral(
"sslmode" ), settings.
value( path +
"/sslmode",
"1" ).toString() );
553 el.setAttribute( QStringLiteral(
"estimatedMetadata" ), settings.
value( path +
"/estimatedMetadata",
"0" ).toString() );
555 el.setAttribute( QStringLiteral(
"saveUsername" ), settings.
value( path +
"/saveUsername",
"false" ).toString() );
557 if ( settings.
value( path +
"/saveUsername",
"false" ).toString() == QLatin1String(
"true" ) )
559 el.setAttribute( QStringLiteral(
"username" ), settings.
value( path +
"/username" ).toString() );
562 el.setAttribute( QStringLiteral(
"savePassword" ), settings.
value( path +
"/savePassword",
"false" ).toString() );
564 if ( settings.
value( path +
"/savePassword",
"false" ).toString() == QLatin1String(
"true" ) )
566 el.setAttribute( QStringLiteral(
"password" ), settings.
value( path +
"/password" ).toString() );
569 root.appendChild( el );
575QDomDocument QgsManageConnectionsDialog::saveOracleConnections(
const QStringList &connections )
577 QDomDocument doc( QStringLiteral(
"connections" ) );
578 QDomElement root = doc.createElement( QStringLiteral(
"qgsOracleConnections" ) );
579 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
580 doc.appendChild( root );
584 for (
int i = 0; i < connections.count(); ++i )
586 path =
"/Oracle/connections/" + connections[ i ];
587 QDomElement el = doc.createElement( QStringLiteral(
"oracle" ) );
588 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
589 el.setAttribute( QStringLiteral(
"host" ), settings.
value( path +
"/host" ).toString() );
590 el.setAttribute( QStringLiteral(
"port" ), settings.
value( path +
"/port" ).toString() );
591 el.setAttribute( QStringLiteral(
"database" ), settings.
value( path +
"/database" ).toString() );
592 el.setAttribute( QStringLiteral(
"dboptions" ), settings.
value( path +
"/dboptions" ).toString() );
593 el.setAttribute( QStringLiteral(
"dbworkspace" ), settings.
value( path +
"/dbworkspace" ).toString() );
594 el.setAttribute( QStringLiteral(
"schema" ), settings.
value( path +
"/schema" ).toString() );
595 el.setAttribute( QStringLiteral(
"estimatedMetadata" ), settings.
value( path +
"/estimatedMetadata",
"0" ).toString() );
596 el.setAttribute( QStringLiteral(
"userTablesOnly" ), settings.
value( path +
"/userTablesOnly",
"0" ).toString() );
597 el.setAttribute( QStringLiteral(
"geometryColumnsOnly" ), settings.
value( path +
"/geometryColumnsOnly",
"0" ).toString() );
598 el.setAttribute( QStringLiteral(
"allowGeometrylessTables" ), settings.
value( path +
"/allowGeometrylessTables",
"0" ).toString() );
600 el.setAttribute( QStringLiteral(
"saveUsername" ), settings.
value( path +
"/saveUsername",
"false" ).toString() );
602 if ( settings.
value( path +
"/saveUsername",
"false" ).toString() == QLatin1String(
"true" ) )
604 el.setAttribute( QStringLiteral(
"username" ), settings.
value( path +
"/username" ).toString() );
607 el.setAttribute( QStringLiteral(
"savePassword" ), settings.
value( path +
"/savePassword",
"false" ).toString() );
609 if ( settings.
value( path +
"/savePassword",
"false" ).toString() == QLatin1String(
"true" ) )
611 el.setAttribute( QStringLiteral(
"password" ), settings.
value( path +
"/password" ).toString() );
614 root.appendChild( el );
620QDomDocument QgsManageConnectionsDialog::saveHanaConnections(
const QStringList &connections )
622 QDomDocument doc( QStringLiteral(
"connections" ) );
623 QDomElement root = doc.createElement( QStringLiteral(
"qgsHanaConnections" ) );
624 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
625 doc.appendChild( root );
629 for (
int i = 0; i < connections.count(); ++i )
631 path =
"/HANA/connections/" + connections[i];
632 QDomElement el = doc.createElement( QStringLiteral(
"hana" ) );
633 el.setAttribute( QStringLiteral(
"name" ), connections[i] );
634 el.setAttribute( QStringLiteral(
"driver" ), settings.
value( path +
"/driver", QString() ).toString() );
635 el.setAttribute( QStringLiteral(
"host" ), settings.
value( path +
"/host", QString() ).toString() );
636 el.setAttribute( QStringLiteral(
"identifierType" ), settings.
value( path +
"/identifierType", QString() ).toString() );
637 el.setAttribute( QStringLiteral(
"identifier" ), settings.
value( path +
"/identifier", QString() ).toString() );
638 el.setAttribute( QStringLiteral(
"multitenant" ), settings.
value( path +
"/multitenant", QString() ).toString() );
639 el.setAttribute( QStringLiteral(
"database" ), settings.
value( path +
"/database", QString() ).toString() );
640 el.setAttribute( QStringLiteral(
"schema" ), settings.
value( path +
"/schema", QString() ).toString() );
641 el.setAttribute( QStringLiteral(
"userTablesOnly" ), settings.
value( path +
"/userTablesOnly", QStringLiteral(
"0" ) ).toString() );
642 el.setAttribute( QStringLiteral(
"allowGeometrylessTables" ), settings.
value( path +
"/allowGeometrylessTables", QStringLiteral(
"0" ) ).toString() );
644 el.setAttribute( QStringLiteral(
"saveUsername" ), settings.
value( path +
"/saveUsername", QStringLiteral(
"false" ) ).toString() );
645 if ( settings.
value( path +
"/saveUsername",
"false" ).toString() == QLatin1String(
"true" ) )
647 el.setAttribute( QStringLiteral(
"username" ), settings.
value( path +
"/username", QString() ).toString() );
650 el.setAttribute( QStringLiteral(
"savePassword" ), settings.
value( path +
"/savePassword", QStringLiteral(
"false" ) ).toString() );
651 if ( settings.
value( path +
"/savePassword",
"false" ).toString() == QLatin1String(
"true" ) )
653 el.setAttribute( QStringLiteral(
"password" ), settings.
value( path +
"/password", QString() ).toString() );
656 el.setAttribute( QStringLiteral(
"sslEnabled" ), settings.
value( path +
"/sslEnabled", QStringLiteral(
"false" ) ).toString() );
657 el.setAttribute( QStringLiteral(
"sslCryptoProvider" ), settings.
value( path +
"/sslCryptoProvider", QStringLiteral(
"openssl" ) ).toString() );
658 el.setAttribute( QStringLiteral(
"sslKeyStore" ), settings.
value( path +
"/sslKeyStore", QString() ).toString() );
659 el.setAttribute( QStringLiteral(
"sslTrustStore" ), settings.
value( path +
"/sslTrustStore", QString() ).toString() );
660 el.setAttribute( QStringLiteral(
"sslValidateCertificate" ), settings.
value( path +
"/sslValidateCertificate", QStringLiteral(
"false" ) ).toString() );
661 el.setAttribute( QStringLiteral(
"sslHostNameInCertificate" ), settings.
value( path +
"/sslHostNameInCertificate", QString() ).toString() );
663 root.appendChild( el );
669QDomDocument QgsManageConnectionsDialog::saveXyzTilesConnections(
const QStringList &connections )
671 QDomDocument doc( QStringLiteral(
"connections" ) );
672 QDomElement root = doc.createElement( QStringLiteral(
"qgsXYZTilesConnections" ) );
673 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
674 doc.appendChild( root );
676 for (
int i = 0; i < connections.count(); ++i )
679 QDomElement el = doc.createElement( QStringLiteral(
"xyztiles" ) );
681 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
691 httpHeader.updateDomElement( el );
693 root.appendChild( el );
699QDomDocument QgsManageConnectionsDialog::saveArcgisConnections(
const QStringList &connections )
701 QDomDocument doc( QStringLiteral(
"connections" ) );
702 QDomElement root = doc.createElement(
"qgsARCGISFEATURESERVERConnections" );
703 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
704 doc.appendChild( root );
706 for (
const QString &connection : connections )
708 QDomElement el = doc.createElement( QStringLiteral(
"arcgisfeatureserver" ) );
709 el.setAttribute( QStringLiteral(
"name" ), connection );
713 httpHeader.updateDomElement( el );
719 root.appendChild( el );
725QDomDocument QgsManageConnectionsDialog::saveVectorTileConnections(
const QStringList &connections )
727 QDomDocument doc( QStringLiteral(
"connections" ) );
728 QDomElement root = doc.createElement( QStringLiteral(
"qgsVectorTileConnections" ) );
729 root.setAttribute( QStringLiteral(
"version" ), QStringLiteral(
"1.0" ) );
730 doc.appendChild( root );
732 for (
int i = 0; i < connections.count(); ++i )
734 QDomElement el = doc.createElement( QStringLiteral(
"vectortile" ) );
736 el.setAttribute( QStringLiteral(
"name" ), connections[ i ] );
737 el.setAttribute( QStringLiteral(
"url" ), QgsVectorTileProviderConnection::settingsUrl->value( connections[ i ] ) );
738 el.setAttribute( QStringLiteral(
"zmin" ), QgsVectorTileProviderConnection::settingsZmin->value( connections[ i ] ) );
739 el.setAttribute( QStringLiteral(
"zmax" ), QgsVectorTileProviderConnection::settingsZmax->value( connections[ i ] ) );
740 el.setAttribute( QStringLiteral(
"serviceType" ), QgsVectorTileProviderConnection::settingsServiceType->value( connections[ i ] ) );
741 el.setAttribute( QStringLiteral(
"authcfg" ), QgsVectorTileProviderConnection::settingsAuthcfg->value( connections[ i ] ) );
742 el.setAttribute( QStringLiteral(
"username" ), QgsVectorTileProviderConnection::settingsUsername->value( connections[ i ] ) );
743 el.setAttribute( QStringLiteral(
"password" ), QgsVectorTileProviderConnection::settingsPassword->value( connections[ i ] ) );
744 el.setAttribute( QStringLiteral(
"styleUrl" ), QgsVectorTileProviderConnection::settingsStyleUrl->value( connections[ i ] ) );
746 QgsHttpHeaders httpHeader( QgsVectorTileProviderConnection::settingsHeaders->value( connections[ i ] ) );
747 httpHeader.updateDomElement( el );
749 root.appendChild( el );
755void QgsManageConnectionsDialog::loadOWSConnections(
const QDomDocument &doc,
const QStringList &items,
const QString &service )
757 const QDomElement root = doc.documentElement();
758 if ( root.tagName() !=
"qgs" + service.toUpper() +
"Connections" )
760 QMessageBox::information(
this, tr(
"Loading Connections" ),
761 tr(
"The file is not a %1 connections exchange file." ).arg( service ) );
765 QString connectionName;
767 QDomElement child = root.firstChildElement();
769 bool overwrite =
true;
771 while ( !child.isNull() )
773 connectionName = child.attribute( QStringLiteral(
"name" ) );
774 if ( !items.contains( connectionName ) )
776 child = child.nextSiblingElement();
783 const int res = QMessageBox::warning(
this,
784 tr(
"Loading Connections" ),
785 tr(
"Connection with name '%1' already exists. Overwrite?" )
786 .arg( connectionName ),
787 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
791 case QMessageBox::Cancel:
793 case QMessageBox::No:
794 child = child.nextSiblingElement();
796 case QMessageBox::Yes:
799 case QMessageBox::YesToAll:
803 case QMessageBox::NoToAll:
812 child = child.nextSiblingElement();
828 if ( !child.attribute( QStringLiteral(
"username" ) ).isEmpty() )
833 child = child.nextSiblingElement();
837void QgsManageConnectionsDialog::loadWfsConnections(
const QDomDocument &doc,
const QStringList &items )
839 const QDomElement root = doc.documentElement();
840 if ( root.tagName() != QLatin1String(
"qgsWFSConnections" ) )
842 QMessageBox::information(
this, tr(
"Loading Connections" ),
843 tr(
"The file is not a WFS connections exchange file." ) );
847 QString connectionName;
850 QDomElement child = root.firstChildElement();
852 bool overwrite =
true;
854 while ( !child.isNull() )
856 connectionName = child.attribute( QStringLiteral(
"name" ) );
857 if ( !items.contains( connectionName ) )
859 child = child.nextSiblingElement();
864 if ( keys.contains( connectionName ) && prompt )
866 const int res = QMessageBox::warning(
this,
867 tr(
"Loading Connections" ),
868 tr(
"Connection with name '%1' already exists. Overwrite?" )
869 .arg( connectionName ),
870 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
874 case QMessageBox::Cancel:
876 case QMessageBox::No:
877 child = child.nextSiblingElement();
879 case QMessageBox::Yes:
882 case QMessageBox::YesToAll:
886 case QMessageBox::NoToAll:
893 if ( keys.contains( connectionName ) )
897 child = child.nextSiblingElement();
903 keys << connectionName;
916 if ( !child.attribute( QStringLiteral(
"username" ) ).isEmpty() )
921 child = child.nextSiblingElement();
925void QgsManageConnectionsDialog::loadPgConnections(
const QDomDocument &doc,
const QStringList &items )
927 const QDomElement root = doc.documentElement();
928 if ( root.tagName() != QLatin1String(
"qgsPgConnections" ) )
930 QMessageBox::information(
this,
931 tr(
"Loading Connections" ),
932 tr(
"The file is not a PostGIS connections exchange file." ) );
936 QString connectionName;
938 settings.
beginGroup( QStringLiteral(
"/PostgreSQL/connections" ) );
941 QDomElement child = root.firstChildElement();
943 bool overwrite =
true;
945 while ( !child.isNull() )
947 connectionName = child.attribute( QStringLiteral(
"name" ) );
948 if ( !items.contains( connectionName ) )
950 child = child.nextSiblingElement();
955 if ( keys.contains( connectionName ) && prompt )
957 const int res = QMessageBox::warning(
this,
958 tr(
"Loading Connections" ),
959 tr(
"Connection with name '%1' already exists. Overwrite?" )
960 .arg( connectionName ),
961 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
964 case QMessageBox::Cancel:
966 case QMessageBox::No:
967 child = child.nextSiblingElement();
969 case QMessageBox::Yes:
972 case QMessageBox::YesToAll:
976 case QMessageBox::NoToAll:
983 if ( keys.contains( connectionName ) )
987 child = child.nextSiblingElement();
993 keys << connectionName;
997 settings.
beginGroup(
"/PostgreSQL/connections/" + connectionName );
999 settings.
setValue( QStringLiteral(
"/host" ), child.attribute( QStringLiteral(
"host" ) ) );
1000 settings.
setValue( QStringLiteral(
"/port" ), child.attribute( QStringLiteral(
"port" ) ) );
1001 settings.
setValue( QStringLiteral(
"/database" ), child.attribute( QStringLiteral(
"database" ) ) );
1002 if ( child.hasAttribute( QStringLiteral(
"service" ) ) )
1004 settings.
setValue( QStringLiteral(
"/service" ), child.attribute( QStringLiteral(
"service" ) ) );
1008 settings.
setValue( QStringLiteral(
"/service" ),
"" );
1010 settings.
setValue( QStringLiteral(
"/sslmode" ), child.attribute( QStringLiteral(
"sslmode" ) ) );
1011 settings.
setValue( QStringLiteral(
"/estimatedMetadata" ), child.attribute( QStringLiteral(
"estimatedMetadata" ) ) );
1012 settings.
setValue( QStringLiteral(
"/projectsInDatabase" ), child.attribute( QStringLiteral(
"projectsInDatabase" ), 0 ) );
1013 settings.
setValue( QStringLiteral(
"/dontResolveType" ), child.attribute( QStringLiteral(
"dontResolveType" ), 0 ) );
1014 settings.
setValue( QStringLiteral(
"/allowGeometrylessTables" ), child.attribute( QStringLiteral(
"allowGeometrylessTables" ), 0 ) );
1015 settings.
setValue( QStringLiteral(
"/geometryColumnsOnly" ), child.attribute( QStringLiteral(
"geometryColumnsOnly" ), 0 ) );
1016 settings.
setValue( QStringLiteral(
"/publicOnly" ), child.attribute( QStringLiteral(
"publicOnly" ), 0 ) );
1017 settings.
setValue( QStringLiteral(
"/saveUsername" ), child.attribute( QStringLiteral(
"saveUsername" ) ) );
1018 settings.
setValue( QStringLiteral(
"/username" ), child.attribute( QStringLiteral(
"username" ) ) );
1019 settings.
setValue( QStringLiteral(
"/savePassword" ), child.attribute( QStringLiteral(
"savePassword" ) ) );
1020 settings.
setValue( QStringLiteral(
"/password" ), child.attribute( QStringLiteral(
"password" ) ) );
1023 child = child.nextSiblingElement();
1027void QgsManageConnectionsDialog::loadMssqlConnections(
const QDomDocument &doc,
const QStringList &items )
1029 const QDomElement root = doc.documentElement();
1030 if ( root.tagName() != QLatin1String(
"qgsMssqlConnections" ) )
1032 QMessageBox::information(
this,
1033 tr(
"Loading Connections" ),
1034 tr(
"The file is not a MS SQL Server connections exchange file." ) );
1038 QString connectionName;
1040 settings.
beginGroup( QStringLiteral(
"/MSSQL/connections" ) );
1043 QDomElement child = root.firstChildElement();
1045 bool overwrite =
true;
1047 while ( !child.isNull() )
1049 connectionName = child.attribute( QStringLiteral(
"name" ) );
1050 if ( !items.contains( connectionName ) )
1052 child = child.nextSiblingElement();
1057 if ( keys.contains( connectionName ) && prompt )
1059 const int res = QMessageBox::warning(
this,
1060 tr(
"Loading Connections" ),
1061 tr(
"Connection with name '%1' already exists. Overwrite?" )
1062 .arg( connectionName ),
1063 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1066 case QMessageBox::Cancel:
1068 case QMessageBox::No:
1069 child = child.nextSiblingElement();
1071 case QMessageBox::Yes:
1074 case QMessageBox::YesToAll:
1078 case QMessageBox::NoToAll:
1085 if ( keys.contains( connectionName ) )
1089 child = child.nextSiblingElement();
1095 keys << connectionName;
1099 settings.
beginGroup(
"/MSSQL/connections/" + connectionName );
1101 settings.
setValue( QStringLiteral(
"/host" ), child.attribute( QStringLiteral(
"host" ) ) );
1102 settings.
setValue( QStringLiteral(
"/port" ), child.attribute( QStringLiteral(
"port" ) ) );
1103 settings.
setValue( QStringLiteral(
"/database" ), child.attribute( QStringLiteral(
"database" ) ) );
1104 if ( child.hasAttribute( QStringLiteral(
"service" ) ) )
1106 settings.
setValue( QStringLiteral(
"/service" ), child.attribute( QStringLiteral(
"service" ) ) );
1110 settings.
setValue( QStringLiteral(
"/service" ),
"" );
1112 settings.
setValue( QStringLiteral(
"/sslmode" ), child.attribute( QStringLiteral(
"sslmode" ) ) );
1113 settings.
setValue( QStringLiteral(
"/estimatedMetadata" ), child.attribute( QStringLiteral(
"estimatedMetadata" ) ) );
1114 settings.
setValue( QStringLiteral(
"/saveUsername" ), child.attribute( QStringLiteral(
"saveUsername" ) ) );
1115 settings.
setValue( QStringLiteral(
"/username" ), child.attribute( QStringLiteral(
"username" ) ) );
1116 settings.
setValue( QStringLiteral(
"/savePassword" ), child.attribute( QStringLiteral(
"savePassword" ) ) );
1117 settings.
setValue( QStringLiteral(
"/password" ), child.attribute( QStringLiteral(
"password" ) ) );
1120 child = child.nextSiblingElement();
1124void QgsManageConnectionsDialog::loadOracleConnections(
const QDomDocument &doc,
const QStringList &items )
1126 const QDomElement root = doc.documentElement();
1127 if ( root.tagName() != QLatin1String(
"qgsOracleConnections" ) )
1129 QMessageBox::information(
this,
1130 tr(
"Loading Connections" ),
1131 tr(
"The file is not an Oracle connections exchange file." ) );
1135 QString connectionName;
1137 settings.
beginGroup( QStringLiteral(
"/Oracle/connections" ) );
1140 QDomElement child = root.firstChildElement();
1142 bool overwrite =
true;
1144 while ( !child.isNull() )
1146 connectionName = child.attribute( QStringLiteral(
"name" ) );
1147 if ( !items.contains( connectionName ) )
1149 child = child.nextSiblingElement();
1154 if ( keys.contains( connectionName ) && prompt )
1156 const int res = QMessageBox::warning(
this,
1157 tr(
"Loading Connections" ),
1158 tr(
"Connection with name '%1' already exists. Overwrite?" )
1159 .arg( connectionName ),
1160 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1163 case QMessageBox::Cancel:
1165 case QMessageBox::No:
1166 child = child.nextSiblingElement();
1168 case QMessageBox::Yes:
1171 case QMessageBox::YesToAll:
1175 case QMessageBox::NoToAll:
1182 if ( keys.contains( connectionName ) )
1186 child = child.nextSiblingElement();
1192 keys << connectionName;
1196 settings.
beginGroup(
"/Oracle/connections/" + connectionName );
1198 settings.
setValue( QStringLiteral(
"/host" ), child.attribute( QStringLiteral(
"host" ) ) );
1199 settings.
setValue( QStringLiteral(
"/port" ), child.attribute( QStringLiteral(
"port" ) ) );
1200 settings.
setValue( QStringLiteral(
"/database" ), child.attribute( QStringLiteral(
"database" ) ) );
1201 settings.
setValue( QStringLiteral(
"/dboptions" ), child.attribute( QStringLiteral(
"dboptions" ) ) );
1202 settings.
setValue( QStringLiteral(
"/dbworkspace" ), child.attribute( QStringLiteral(
"dbworkspace" ) ) );
1203 settings.
setValue( QStringLiteral(
"/schema" ), child.attribute( QStringLiteral(
"schema" ) ) );
1204 settings.
setValue( QStringLiteral(
"/estimatedMetadata" ), child.attribute( QStringLiteral(
"estimatedMetadata" ) ) );
1205 settings.
setValue( QStringLiteral(
"/userTablesOnly" ), child.attribute( QStringLiteral(
"userTablesOnly" ) ) );
1206 settings.
setValue( QStringLiteral(
"/geometryColumnsOnly" ), child.attribute( QStringLiteral(
"geometryColumnsOnly" ) ) );
1207 settings.
setValue( QStringLiteral(
"/allowGeometrylessTables" ), child.attribute( QStringLiteral(
"allowGeometrylessTables" ) ) );
1208 settings.
setValue( QStringLiteral(
"/saveUsername" ), child.attribute( QStringLiteral(
"saveUsername" ) ) );
1209 settings.
setValue( QStringLiteral(
"/username" ), child.attribute( QStringLiteral(
"username" ) ) );
1210 settings.
setValue( QStringLiteral(
"/savePassword" ), child.attribute( QStringLiteral(
"savePassword" ) ) );
1211 settings.
setValue( QStringLiteral(
"/password" ), child.attribute( QStringLiteral(
"password" ) ) );
1214 child = child.nextSiblingElement();
1218void QgsManageConnectionsDialog::loadHanaConnections(
const QDomDocument &doc,
const QStringList &items )
1220 QDomElement root = doc.documentElement();
1221 if ( root.tagName() != QLatin1String(
"qgsHanaConnections" ) )
1223 QMessageBox::warning(
this,
1224 tr(
"Loading Connections" ),
1225 tr(
"The file is not a HANA connections exchange file." ) );
1229 const QDomAttr version = root.attributeNode(
"version" );
1230 if ( version.value() != QLatin1String(
"1.0" ) )
1232 QMessageBox::warning(
this,
1233 tr(
"Loading Connections" ),
1234 tr(
"The HANA connections exchange file version '%1' is not supported." ).arg( version.value() ) );
1239 settings.
beginGroup( QStringLiteral(
"/HANA/connections" ) );
1242 QDomElement child = root.firstChildElement();
1244 bool overwrite =
true;
1246 while ( !child.isNull() )
1248 const QString connectionName = child.attribute( QStringLiteral(
"name" ) );
1249 if ( !items.contains( connectionName ) )
1251 child = child.nextSiblingElement();
1256 if ( keys.contains( connectionName ) && prompt )
1258 const int res = QMessageBox::warning(
this,
1259 tr(
"Loading Connections" ),
1260 tr(
"Connection with name '%1' already exists. Overwrite?" )
1261 .arg( connectionName ),
1262 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1265 case QMessageBox::Cancel:
1267 case QMessageBox::No:
1268 child = child.nextSiblingElement();
1270 case QMessageBox::Yes:
1273 case QMessageBox::YesToAll:
1277 case QMessageBox::NoToAll:
1284 if ( keys.contains( connectionName ) )
1288 child = child.nextSiblingElement();
1294 keys << connectionName;
1298 settings.
beginGroup(
"/HANA/connections/" + connectionName );
1300 for (
const QString param :
1301 {
"driver",
"host",
"database",
"identifierType",
"identifier",
"multitenant",
"schema",
"userTablesOnly",
1302 "allowGeometrylessTables",
"saveUsername",
"username",
"savePassword",
"password",
"sslEnabled",
1303 "sslCryptoProvider",
"sslKeyStore",
"sslTrustStore",
"sslValidateCertificate",
"sslHostNameInCertificate"
1305 settings.
setValue( QStringLiteral(
"/" ) + param, child.attribute( param ) );
1309 child = child.nextSiblingElement();
1313void QgsManageConnectionsDialog::loadXyzTilesConnections(
const QDomDocument &doc,
const QStringList &items )
1315 const QDomElement root = doc.documentElement();
1316 if ( root.tagName() != QLatin1String(
"qgsXYZTilesConnections" ) )
1318 QMessageBox::information(
this, tr(
"Loading Connections" ),
1319 tr(
"The file is not a XYZ Tiles connections exchange file." ) );
1323 QString connectionName;
1325 QDomElement child = root.firstChildElement();
1327 bool overwrite =
true;
1329 while ( !child.isNull() )
1331 connectionName = child.attribute( QStringLiteral(
"name" ) );
1332 if ( !items.contains( connectionName ) )
1334 child = child.nextSiblingElement();
1339 if ( keys.contains( connectionName ) && prompt )
1341 const int res = QMessageBox::warning(
this,
1342 tr(
"Loading Connections" ),
1343 tr(
"Connection with name '%1' already exists. Overwrite?" )
1344 .arg( connectionName ),
1345 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1349 case QMessageBox::Cancel:
1351 case QMessageBox::No:
1352 child = child.nextSiblingElement();
1354 case QMessageBox::Yes:
1357 case QMessageBox::YesToAll:
1361 case QMessageBox::NoToAll:
1368 if ( keys.contains( connectionName ) )
1372 child = child.nextSiblingElement();
1378 keys << connectionName;
1393 child = child.nextSiblingElement();
1397void QgsManageConnectionsDialog::loadArcgisConnections(
const QDomDocument &doc,
const QStringList &items,
const QString &service )
1399 const QDomElement root = doc.documentElement();
1400 if ( root.tagName() !=
"qgs" + service.toUpper() +
"Connections" )
1402 QMessageBox::information(
this, tr(
"Loading Connections" ),
1403 tr(
"The file is not a %1 connections exchange file." ).arg( service ) );
1407 QString connectionName;
1409 QDomElement child = root.firstChildElement();
1411 bool overwrite =
true;
1413 while ( !child.isNull() )
1415 connectionName = child.attribute( QStringLiteral(
"name" ) );
1416 if ( !items.contains( connectionName ) )
1418 child = child.nextSiblingElement();
1423 if ( keys.contains( connectionName ) && prompt )
1425 const int res = QMessageBox::warning(
this,
1426 tr(
"Loading Connections" ),
1427 tr(
"Connection with name '%1' already exists. Overwrite?" )
1428 .arg( connectionName ),
1429 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1433 case QMessageBox::Cancel:
1435 case QMessageBox::No:
1436 child = child.nextSiblingElement();
1438 case QMessageBox::Yes:
1441 case QMessageBox::YesToAll:
1445 case QMessageBox::NoToAll:
1452 if ( keys.contains( connectionName ) )
1456 child = child.nextSiblingElement();
1462 keys << connectionName;
1475 child = child.nextSiblingElement();
1479void QgsManageConnectionsDialog::loadVectorTileConnections(
const QDomDocument &doc,
const QStringList &items )
1481 const QDomElement root = doc.documentElement();
1482 if ( root.tagName() != QLatin1String(
"qgsVectorTileConnections" ) )
1484 QMessageBox::information(
this, tr(
"Loading Connections" ),
1485 tr(
"The file is not a Vector Tile connections exchange file." ) );
1489 QString connectionName;
1491 settings.
beginGroup( QStringLiteral(
"/qgis/connections-vector-tile" ) );
1494 QDomElement child = root.firstChildElement();
1496 bool overwrite =
true;
1498 while ( !child.isNull() )
1500 connectionName = child.attribute( QStringLiteral(
"name" ) );
1501 if ( !items.contains( connectionName ) )
1503 child = child.nextSiblingElement();
1508 if ( keys.contains( connectionName ) && prompt )
1510 const int res = QMessageBox::warning(
this,
1511 tr(
"Loading Connections" ),
1512 tr(
"Connection with name '%1' already exists. Overwrite?" )
1513 .arg( connectionName ),
1514 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
1518 case QMessageBox::Cancel:
1520 case QMessageBox::No:
1521 child = child.nextSiblingElement();
1523 case QMessageBox::Yes:
1526 case QMessageBox::YesToAll:
1530 case QMessageBox::NoToAll:
1537 if ( keys.contains( connectionName ) )
1541 child = child.nextSiblingElement();
1547 keys << connectionName;
1550 QgsVectorTileProviderConnection::settingsUrl->setValue( child.attribute( QStringLiteral(
"url" ) ), connectionName );
1551 QgsVectorTileProviderConnection::settingsZmin->setValue( child.attribute( QStringLiteral(
"zmin" ) ).toInt(), connectionName );
1552 QgsVectorTileProviderConnection::settingsZmax->setValue( child.attribute( QStringLiteral(
"zmax" ) ).toInt(), connectionName );
1553 QgsVectorTileProviderConnection::settingsServiceType->setValue( child.attribute( QStringLiteral(
"serviceType" ) ), connectionName );
1554 QgsVectorTileProviderConnection::settingsAuthcfg->setValue( child.attribute( QStringLiteral(
"authcfg" ) ), connectionName );
1555 QgsVectorTileProviderConnection::settingsUsername->setValue( child.attribute( QStringLiteral(
"username" ) ), connectionName );
1556 QgsVectorTileProviderConnection::settingsPassword->setValue( child.attribute( QStringLiteral(
"password" ) ), connectionName );
1557 QgsVectorTileProviderConnection::settingsStyleUrl->setValue( child.attribute( QStringLiteral(
"styleUrl" ) ), connectionName );
1560 QgsVectorTileProviderConnection::settingsHeaders->setValue( httpHeader.headers(), connectionName );
1562 child = child.nextSiblingElement();
1568 listConnections->selectAll();
1569 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !listConnections->selectedItems().isEmpty() );
1574 listConnections->clearSelection();
1575 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryVariantMap * settingsHeaders
static QgsSettingsTreeNamedListNode * sTreeConnectionArcgis
static const QgsSettingsEntryString * settingsAuthcfg
QgsManageConnectionsDialog(QWidget *parent=nullptr, Mode mode=Export, Type type=WMS, const QString &fileName=QString())
Constructor for QgsManageConnectionsDialog.
static const QgsSettingsEntryBool * settingsPagingEnabled
static const QgsSettingsEntryString * settingsMaxNumFeatures
static QgsSettingsTreeNamedListNode * sTreeOwsConnections
static const QgsSettingsEntryBool * settingsIgnoreGetFeatureInfoURI
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryEnumFlag< Qgis::DpiMode > * settingsDpiMode
static const QgsSettingsEntryBool * settingsIgnoreAxisOrientation
static const QgsSettingsEntryBool * settingsInvertAxisOrientation
static const QgsSettingsEntryString * settingsVersion
static const QgsSettingsEntryString * settingsPagesize
static const QgsSettingsEntryVariantMap * settingsHeaders
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryBool * settingsSmoothPixmapTransform
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryBool * settingsIgnoreGetMapURI
bool setValue(const T &value, const QString &dynamicKeyPart=QString()) const
Set settings value.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
bool setValue(T value, const QString &dynamicKeyPart=QString()) const
Set settings value.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
QStringList items(const QStringList &parentsNamedItems=QStringList()) const SIP_THROW(QgsSettingsException)
Returns the list of items.
This class is a composition of two QSettings instances:
QStringList childGroups(Qgis::SettingsOrigin origin=Qgis::SettingsOrigin::Any) const
Returns a list of all key top-level groups that contain keys that can be read using the QSettings obj...
void endGroup()
Resets the group to what it was before the corresponding beginGroup() call.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
QString group() const
Returns the current group.
void beginGroup(const QString &prefix, QgsSettings::Section section=QgsSettings::NoSection)
Appends prefix to the current group.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
static QgsSettingsTreeNamedListNode * sTreeXyzConnections
static const QgsSettingsEntryString * settingsPassword
static const QgsSettingsEntryDouble * settingsTilePixelRatio
static const QgsSettingsEntryString * settingsUsername
static const QgsSettingsEntryString * settingsAuthcfg
static const QgsSettingsEntryInteger * settingsZmin
static const QgsSettingsEntryInteger * settingsZmax
static const QgsSettingsEntryString * settingsUrl
static const QgsSettingsEntryVariantMap * settingsHeaders