18 #include <QCloseEvent>
19 #include <QFileDialog>
20 #include <QMessageBox>
21 #include <QPushButton>
23 #include <QTextStream>
29 , mFileName( fileName )
31 , mConnectionType( type )
37 pb =
new QPushButton(
tr(
"Select all" ) );
38 buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
39 connect( pb, SIGNAL( clicked() ),
this, SLOT(
selectAll() ) );
41 pb =
new QPushButton(
tr(
"Clear selection" ) );
42 buttonBox->addButton( pb, QDialogButtonBox::ActionRole );
43 connect( pb, SIGNAL( clicked() ),
this, SLOT(
clearSelection() ) );
47 label->setText(
tr(
"Select connections to import" ) );
48 buttonBox->button( QDialogButtonBox::Ok )->setText(
tr(
"Import" ) );
49 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );
54 buttonBox->button( QDialogButtonBox::Ok )->setText(
tr(
"Export" ) );
55 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );
60 QApplication::postEvent(
this,
new QCloseEvent() );
64 disconnect( buttonBox, SIGNAL( accepted() ),
this, SLOT( accept() ) );
65 connect( buttonBox, SIGNAL( accepted() ),
this, SLOT(
doExportImport() ) );
67 connect( listConnections, SIGNAL( itemSelectionChanged() ),
this, SLOT(
selectionChanged() ) );
72 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !listConnections->selectedItems().isEmpty() );
77 QList<QListWidgetItem *> selection = listConnections->selectedItems();
78 if ( selection.isEmpty() )
80 QMessageBox::warning(
this,
tr(
"Export/import error" ),
81 tr(
"You should select at least one connection from list." ) );
86 for (
int i = 0; i < selection.size(); ++i )
88 items.append( selection.at( i )->text() );
93 QString fileName = QFileDialog::getSaveFileName(
this,
tr(
"Save connections" ),
".",
94 tr(
"XML files (*.xml *.XML)" ) );
95 if ( fileName.isEmpty() )
101 if ( !fileName.toLower().endsWith(
".xml" ) )
132 if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
134 QMessageBox::warning(
this,
tr(
"Saving connections" ),
135 tr(
"Cannot write file %1:\n%2." )
137 .arg( file.errorString() ) );
141 QTextStream out( &file );
147 if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
149 QMessageBox::warning(
this,
tr(
"Loading connections" ),
150 tr(
"Cannot read file %1:\n%2." )
152 .arg( file.errorString() ) );
161 if ( !doc.setContent( &file,
true, &errorStr, &errorLine, &errorColumn ) )
163 QMessageBox::warning(
this,
tr(
"Loading connections" ),
164 tr(
"Parse error at line %1, column %2:\n%3" )
193 listConnections->clear();
209 settings.beginGroup(
"/Qgis/connections-wms" );
212 settings.beginGroup(
"/Qgis/connections-wfs" );
215 settings.beginGroup(
"/Qgis/connections-wcs" );
218 settings.beginGroup(
"/PostgreSQL/connections" );
221 settings.beginGroup(
"/MSSQL/connections" );
224 settings.beginGroup(
"/Oracle/connections" );
227 QStringList keys = settings.childGroups();
228 QStringList::Iterator it = keys.begin();
229 while ( it != keys.end() )
231 QListWidgetItem *item =
new QListWidgetItem();
232 item->setText( *it );
233 listConnections->addItem( item );
242 if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
244 QMessageBox::warning(
this,
tr(
"Loading connections" ),
245 tr(
"Cannot read file %1:\n%2." )
247 .arg( file.errorString() ) );
256 if ( !doc.setContent( &file,
true, &errorStr, &errorLine, &errorColumn ) )
258 QMessageBox::warning(
this,
tr(
"Loading connections" ),
259 tr(
"Parse error at line %1, column %2:\n%3" )
266 QDomElement root = doc.documentElement();
270 if ( root.tagName() !=
"qgsWMSConnections" )
272 QMessageBox::information(
this,
tr(
"Loading connections" ),
273 tr(
"The file is not an WMS connections exchange file." ) );
279 if ( root.tagName() !=
"qgsWFSConnections" )
281 QMessageBox::information(
this,
tr(
"Loading connections" ),
282 tr(
"The file is not an WFS connections exchange file." ) );
288 if ( root.tagName() !=
"qgsWCSConnections" )
290 QMessageBox::information(
this,
tr(
"Loading connections" ),
291 tr(
"The file is not an WCS connections exchange file." ) );
297 if ( root.tagName() !=
"qgsPgConnections" )
299 QMessageBox::information(
this,
tr(
"Loading connections" ),
300 tr(
"The file is not an PostGIS connections exchange file." ) );
306 if ( root.tagName() !=
"qgsMssqlConnections" )
308 QMessageBox::information(
this,
tr(
"Loading connections" ),
309 tr(
"The file is not an MSSQL connections exchange file." ) );
314 if ( root.tagName() !=
"qgsOracleConnections" )
316 QMessageBox::information(
this,
tr(
"Loading connections" ),
317 tr(
"The file is not an Oracle connections exchange file." ) );
323 QDomElement child = root.firstChildElement();
324 while ( !child.isNull() )
326 QListWidgetItem *item =
new QListWidgetItem();
327 item->setText( child.attribute(
"name" ) );
328 listConnections->addItem( item );
329 child = child.nextSiblingElement();
337 QDomDocument doc(
"connections" );
338 QDomElement root = doc.createElement(
"qgs" + service.toUpper() +
"Connections" );
339 root.setAttribute(
"version",
"1.0" );
340 doc.appendChild( root );
344 for (
int i = 0; i < connections.count(); ++i )
346 path =
"/Qgis/connections-" + service.toLower() +
"/";
347 QDomElement el = doc.createElement( service.toLower() );
348 el.setAttribute(
"name", connections[ i ] );
349 el.setAttribute(
"url", settings.value( path + connections[ i ] +
"/url",
"" ).toString() );
351 if ( service ==
"WMS" )
353 el.setAttribute(
"ignoreGetMapURI", settings.value( path + connections[i] +
"/ignoreGetMapURI",
false ).toBool() ?
"true" :
"false" );
354 el.setAttribute(
"ignoreGetFeatureInfoURI", settings.value( path + connections[i] +
"/ignoreGetFeatureInfoURI",
false ).toBool() ?
"true" :
"false" );
355 el.setAttribute(
"ignoreAxisOrientation", settings.value( path + connections[i] +
"/ignoreAxisOrientation",
false ).toBool() ?
"true" :
"false" );
356 el.setAttribute(
"invertAxisOrientation", settings.value( path + connections[i] +
"/invertAxisOrientation",
false ).toBool() ?
"true" :
"false" );
357 el.setAttribute(
"referer", settings.value( path + connections[ i ] +
"/referer",
"" ).toString() );
358 el.setAttribute(
"smoothPixmapTransform", settings.value( path + connections[i] +
"/smoothPixmapTransform",
false ).toBool() ?
"true" :
"false" );
359 el.setAttribute(
"dpiMode", settings.value( path + connections[i] +
"/dpiMode",
"7" ).toInt() );
362 path =
"/Qgis/" + service.toUpper() +
"/";
363 el.setAttribute(
"username", settings.value( path + connections[ i ] +
"/username",
"" ).toString() );
364 el.setAttribute(
"password", settings.value( path + connections[ i ] +
"/password",
"" ).toString() );
365 root.appendChild( el );
373 QDomDocument doc(
"connections" );
374 QDomElement root = doc.createElement(
"qgsWFSConnections" );
375 root.setAttribute(
"version",
"1.0" );
376 doc.appendChild( root );
380 for (
int i = 0; i < connections.count(); ++i )
382 path =
"/Qgis/connections-wfs/";
383 QDomElement el = doc.createElement(
"wfs" );
384 el.setAttribute(
"name", connections[ i ] );
385 el.setAttribute(
"url", settings.value( path + connections[ i ] +
"/url",
"" ).toString() );
387 el.setAttribute(
"referer", settings.value( path + connections[ i ] +
"/referer",
"" ).toString() );
390 el.setAttribute(
"username", settings.value( path + connections[ i ] +
"/username",
"" ).toString() );
391 el.setAttribute(
"password", settings.value( path + connections[ i ] +
"/password",
"" ).toString() );
392 root.appendChild( el );
400 QDomDocument doc(
"connections" );
401 QDomElement root = doc.createElement(
"qgsPgConnections" );
402 root.setAttribute(
"version",
"1.0" );
403 doc.appendChild( root );
407 for (
int i = 0; i < connections.count(); ++i )
409 path =
"/PostgreSQL/connections/" + connections[ i ];
410 QDomElement el = doc.createElement(
"postgis" );
411 el.setAttribute(
"name", connections[ i ] );
412 el.setAttribute(
"host", settings.value( path +
"/host",
"" ).toString() );
413 el.setAttribute(
"port", settings.value( path +
"/port",
"" ).toString() );
414 el.setAttribute(
"database", settings.value( path +
"/database",
"" ).toString() );
415 el.setAttribute(
"service", settings.value( path +
"/service",
"" ).toString() );
416 el.setAttribute(
"sslmode", settings.value( path +
"/sslmode",
"1" ).toString() );
417 el.setAttribute(
"estimatedMetadata", settings.value( path +
"/estimatedMetadata",
"0" ).toString() );
419 el.setAttribute(
"saveUsername", settings.value( path +
"/saveUsername",
"false" ).toString() );
421 if ( settings.value( path +
"/saveUsername",
"false" ).toString() ==
"true" )
423 el.setAttribute(
"username", settings.value( path +
"/username",
"" ).toString() );
426 el.setAttribute(
"savePassword", settings.value( path +
"/savePassword",
"false" ).toString() );
428 if ( settings.value( path +
"/savePassword",
"false" ).toString() ==
"true" )
430 el.setAttribute(
"password", settings.value( path +
"/password",
"" ).toString() );
433 root.appendChild( el );
441 QDomDocument doc(
"connections" );
442 QDomElement root = doc.createElement(
"qgsMssqlConnections" );
443 root.setAttribute(
"version",
"1.0" );
444 doc.appendChild( root );
448 for (
int i = 0; i < connections.count(); ++i )
450 path =
"/MSSQL/connections/" + connections[ i ];
451 QDomElement el = doc.createElement(
"mssql" );
452 el.setAttribute(
"name", connections[ i ] );
453 el.setAttribute(
"host", settings.value( path +
"/host",
"" ).toString() );
454 el.setAttribute(
"port", settings.value( path +
"/port",
"" ).toString() );
455 el.setAttribute(
"database", settings.value( path +
"/database",
"" ).toString() );
456 el.setAttribute(
"service", settings.value( path +
"/service",
"" ).toString() );
457 el.setAttribute(
"sslmode", settings.value( path +
"/sslmode",
"1" ).toString() );
458 el.setAttribute(
"estimatedMetadata", settings.value( path +
"/estimatedMetadata",
"0" ).toString() );
460 el.setAttribute(
"saveUsername", settings.value( path +
"/saveUsername",
"false" ).toString() );
462 if ( settings.value( path +
"/saveUsername",
"false" ).toString() ==
"true" )
464 el.setAttribute(
"username", settings.value( path +
"/username",
"" ).toString() );
467 el.setAttribute(
"savePassword", settings.value( path +
"/savePassword",
"false" ).toString() );
469 if ( settings.value( path +
"/savePassword",
"false" ).toString() ==
"true" )
471 el.setAttribute(
"password", settings.value( path +
"/password",
"" ).toString() );
474 root.appendChild( el );
482 QDomDocument doc(
"connections" );
483 QDomElement root = doc.createElement(
"qgsOracleConnections" );
484 root.setAttribute(
"version",
"1.0" );
485 doc.appendChild( root );
489 for (
int i = 0; i < connections.count(); ++i )
491 path =
"/Oracle/connections/" + connections[ i ];
492 QDomElement el = doc.createElement(
"oracle" );
493 el.setAttribute(
"name", connections[ i ] );
494 el.setAttribute(
"host", settings.value( path +
"/host",
"" ).toString() );
495 el.setAttribute(
"port", settings.value( path +
"/port",
"" ).toString() );
496 el.setAttribute(
"database", settings.value( path +
"/database",
"" ).toString() );
497 el.setAttribute(
"estimatedMetadata", settings.value( path +
"/estimatedMetadata",
"0" ).toString() );
498 el.setAttribute(
"userTablesOnly", settings.value( path +
"/userTablesOnly",
"0" ).toString() );
499 el.setAttribute(
"geometryColumnsOnly", settings.value( path +
"/geometryColumnsOnly",
"0" ).toString() );
500 el.setAttribute(
"allowGeometrylessTables", settings.value( path +
"/allowGeometrylessTables",
"0" ).toString() );
502 el.setAttribute(
"saveUsername", settings.value( path +
"/saveUsername",
"false" ).toString() );
504 if ( settings.value( path +
"/saveUsername",
"false" ).toString() ==
"true" )
506 el.setAttribute(
"username", settings.value( path +
"/username",
"" ).toString() );
509 el.setAttribute(
"savePassword", settings.value( path +
"/savePassword",
"false" ).toString() );
511 if ( settings.value( path +
"/savePassword",
"false" ).toString() ==
"true" )
513 el.setAttribute(
"password", settings.value( path +
"/password",
"" ).toString() );
516 root.appendChild( el );
524 QDomElement root = doc.documentElement();
525 if ( root.tagName() !=
"qgs" + service.toUpper() +
"Connections" )
527 QMessageBox::information(
this,
tr(
"Loading connections" ),
528 tr(
"The file is not an %1 connections exchange file." ).arg( service ) );
532 QString connectionName;
534 settings.beginGroup(
"/Qgis/connections-" + service.toLower() );
535 QStringList keys = settings.childGroups();
537 QDomElement child = root.firstChildElement();
539 bool overwrite =
true;
541 while ( !child.isNull() )
543 connectionName = child.attribute(
"name" );
544 if ( !items.contains( connectionName ) )
546 child = child.nextSiblingElement();
551 if ( keys.contains( connectionName ) && prompt )
553 int res = QMessageBox::warning(
this,
554 tr(
"Loading connections" ),
555 tr(
"Connection with name '%1' already exists. Overwrite?" )
556 .arg( connectionName ),
557 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
561 case QMessageBox::Cancel:
563 case QMessageBox::No:
564 child = child.nextSiblingElement();
566 case QMessageBox::Yes:
569 case QMessageBox::YesToAll:
573 case QMessageBox::NoToAll:
580 if ( keys.contains( connectionName ) && !overwrite )
582 child = child.nextSiblingElement();
587 settings.beginGroup(
"/Qgis/connections-" + service.toLower() );
588 settings.setValue( QString(
"/" + connectionName +
"/url" ) , child.attribute(
"url" ) );
589 settings.setValue( QString(
"/" + connectionName +
"/ignoreGetMapURI" ), child.attribute(
"ignoreGetMapURI" ) ==
"true" );
590 settings.setValue( QString(
"/" + connectionName +
"/ignoreGetFeatureInfoURI" ), child.attribute(
"ignoreGetFeatureInfoURI" ) ==
"true" );
591 settings.setValue( QString(
"/" + connectionName +
"/ignoreAxisOrientation" ), child.attribute(
"ignoreAxisOrientation" ) ==
"true" );
592 settings.setValue( QString(
"/" + connectionName +
"/invertAxisOrientation" ), child.attribute(
"invertAxisOrientation" ) ==
"true" );
593 settings.setValue( QString(
"/" + connectionName +
"/referer" ), child.attribute(
"referer" ) );
594 settings.setValue( QString(
"/" + connectionName +
"/smoothPixmapTransform" ), child.attribute(
"smoothPixmapTransform" ) ==
"true" );
595 settings.setValue( QString(
"/" + connectionName +
"/dpiMode" ), child.attribute(
"dpiMode",
"7" ).toInt() );
598 if ( !child.attribute(
"username" ).isEmpty() )
600 settings.beginGroup(
"/Qgis/" + service.toUpper() +
"/" + connectionName );
601 settings.setValue(
"/username", child.attribute(
"username" ) );
602 settings.setValue(
"/password", child.attribute(
"password" ) );
605 child = child.nextSiblingElement();
611 QDomElement root = doc.documentElement();
612 if ( root.tagName() !=
"qgsWFSConnections" )
614 QMessageBox::information(
this,
tr(
"Loading connections" ),
615 tr(
"The file is not an WFS connections exchange file." ) );
619 QString connectionName;
621 settings.beginGroup(
"/Qgis/connections-wfs" );
622 QStringList keys = settings.childGroups();
624 QDomElement child = root.firstChildElement();
626 bool overwrite =
true;
628 while ( !child.isNull() )
630 connectionName = child.attribute(
"name" );
631 if ( !items.contains( connectionName ) )
633 child = child.nextSiblingElement();
638 if ( keys.contains( connectionName ) && prompt )
640 int res = QMessageBox::warning(
this,
641 tr(
"Loading connections" ),
642 tr(
"Connection with name '%1' already exists. Overwrite?" )
643 .arg( connectionName ),
644 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
648 case QMessageBox::Cancel:
650 case QMessageBox::No:
651 child = child.nextSiblingElement();
653 case QMessageBox::Yes:
656 case QMessageBox::YesToAll:
660 case QMessageBox::NoToAll:
667 if ( keys.contains( connectionName ) && !overwrite )
669 child = child.nextSiblingElement();
674 settings.beginGroup(
"/Qgis/connections-wfs" );
675 settings.setValue( QString(
"/" + connectionName +
"/url" ) , child.attribute(
"url" ) );
678 if ( !child.attribute(
"username" ).isEmpty() )
680 settings.beginGroup(
"/Qgis/WFS/" + connectionName );
681 settings.setValue(
"/username", child.attribute(
"username" ) );
682 settings.setValue(
"/password", child.attribute(
"password" ) );
685 child = child.nextSiblingElement();
692 QDomElement root = doc.documentElement();
693 if ( root.tagName() !=
"qgsPgConnections" )
695 QMessageBox::information(
this,
696 tr(
"Loading connections" ),
697 tr(
"The file is not an PostGIS connections exchange file." ) );
701 QString connectionName;
703 settings.beginGroup(
"/PostgreSQL/connections" );
704 QStringList keys = settings.childGroups();
706 QDomElement child = root.firstChildElement();
708 bool overwrite =
true;
710 while ( !child.isNull() )
712 connectionName = child.attribute(
"name" );
713 if ( !items.contains( connectionName ) )
715 child = child.nextSiblingElement();
720 if ( keys.contains( connectionName ) && prompt )
722 int res = QMessageBox::warning(
this,
723 tr(
"Loading connections" ),
724 tr(
"Connection with name '%1' already exists. Overwrite?" )
725 .arg( connectionName ),
726 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
729 case QMessageBox::Cancel:
731 case QMessageBox::No:
732 child = child.nextSiblingElement();
734 case QMessageBox::Yes:
737 case QMessageBox::YesToAll:
741 case QMessageBox::NoToAll:
748 if ( keys.contains( connectionName ) && !overwrite )
750 child = child.nextSiblingElement();
755 settings.beginGroup(
"/PostgreSQL/connections/" + connectionName );
757 settings.setValue(
"/host", child.attribute(
"host" ) );
758 settings.setValue(
"/port", child.attribute(
"port" ) );
759 settings.setValue(
"/database", child.attribute(
"database" ) );
760 if ( child.hasAttribute(
"service" ) )
762 settings.setValue(
"/service", child.attribute(
"service" ) );
766 settings.setValue(
"/service",
"" );
768 settings.setValue(
"/sslmode", child.attribute(
"sslmode" ) );
769 settings.setValue(
"/estimatedMetadata", child.attribute(
"estimatedMetadata" ) );
770 settings.setValue(
"/saveUsername", child.attribute(
"saveUsername" ) );
771 settings.setValue(
"/username", child.attribute(
"username" ) );
772 settings.setValue(
"/savePassword", child.attribute(
"savePassword" ) );
773 settings.setValue(
"/password", child.attribute(
"password" ) );
776 child = child.nextSiblingElement();
782 QDomElement root = doc.documentElement();
783 if ( root.tagName() !=
"qgsMssqlConnections" )
785 QMessageBox::information(
this,
786 tr(
"Loading connections" ),
787 tr(
"The file is not an MSSQL connections exchange file." ) );
791 QString connectionName;
793 settings.beginGroup(
"/MSSQL/connections" );
794 QStringList keys = settings.childGroups();
796 QDomElement child = root.firstChildElement();
798 bool overwrite =
true;
800 while ( !child.isNull() )
802 connectionName = child.attribute(
"name" );
803 if ( !items.contains( connectionName ) )
805 child = child.nextSiblingElement();
810 if ( keys.contains( connectionName ) && prompt )
812 int res = QMessageBox::warning(
this,
813 tr(
"Loading connections" ),
814 tr(
"Connection with name '%1' already exists. Overwrite?" )
815 .arg( connectionName ),
816 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
819 case QMessageBox::Cancel:
821 case QMessageBox::No:
822 child = child.nextSiblingElement();
824 case QMessageBox::Yes:
827 case QMessageBox::YesToAll:
831 case QMessageBox::NoToAll:
838 if ( keys.contains( connectionName ) && !overwrite )
840 child = child.nextSiblingElement();
845 settings.beginGroup(
"/MSSQL/connections/" + connectionName );
847 settings.setValue(
"/host", child.attribute(
"host" ) );
848 settings.setValue(
"/port", child.attribute(
"port" ) );
849 settings.setValue(
"/database", child.attribute(
"database" ) );
850 if ( child.hasAttribute(
"service" ) )
852 settings.setValue(
"/service", child.attribute(
"service" ) );
856 settings.setValue(
"/service",
"" );
858 settings.setValue(
"/sslmode", child.attribute(
"sslmode" ) );
859 settings.setValue(
"/estimatedMetadata", child.attribute(
"estimatedMetadata" ) );
860 settings.setValue(
"/saveUsername", child.attribute(
"saveUsername" ) );
861 settings.setValue(
"/username", child.attribute(
"username" ) );
862 settings.setValue(
"/savePassword", child.attribute(
"savePassword" ) );
863 settings.setValue(
"/password", child.attribute(
"password" ) );
866 child = child.nextSiblingElement();
872 QDomElement root = doc.documentElement();
873 if ( root.tagName() !=
"qgsOracleConnections" )
875 QMessageBox::information(
this,
876 tr(
"Loading connections" ),
877 tr(
"The file is not an Oracle connections exchange file." ) );
881 QString connectionName;
883 settings.beginGroup(
"/Oracle/connections" );
884 QStringList keys = settings.childGroups();
886 QDomElement child = root.firstChildElement();
888 bool overwrite =
true;
890 while ( !child.isNull() )
892 connectionName = child.attribute(
"name" );
893 if ( !items.contains( connectionName ) )
895 child = child.nextSiblingElement();
900 if ( keys.contains( connectionName ) && prompt )
902 int res = QMessageBox::warning(
this,
903 tr(
"Loading connections" ),
904 tr(
"Connection with name '%1' already exists. Overwrite?" )
905 .arg( connectionName ),
906 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
909 case QMessageBox::Cancel:
911 case QMessageBox::No:
912 child = child.nextSiblingElement();
914 case QMessageBox::Yes:
917 case QMessageBox::YesToAll:
921 case QMessageBox::NoToAll:
928 if ( keys.contains( connectionName ) && !overwrite )
930 child = child.nextSiblingElement();
935 settings.beginGroup(
"/Oracle/connections/" + connectionName );
937 settings.setValue(
"/host", child.attribute(
"host" ) );
938 settings.setValue(
"/port", child.attribute(
"port" ) );
939 settings.setValue(
"/database", child.attribute(
"database" ) );
940 settings.setValue(
"/estimatedMetadata", child.attribute(
"estimatedMetadata" ) );
941 settings.setValue(
"/userTablesOnly", child.attribute(
"userTablesOnly" ) );
942 settings.setValue(
"/geometryColumnsOnly", child.attribute(
"geometryColumnsOnly" ) );
943 settings.setValue(
"/allowGeometrylessTables", child.attribute(
"allowGeometrylessTables" ) );
944 settings.setValue(
"/saveUsername", child.attribute(
"saveUsername" ) );
945 settings.setValue(
"/username", child.attribute(
"username" ) );
946 settings.setValue(
"/savePassword", child.attribute(
"savePassword" ) );
947 settings.setValue(
"/password", child.attribute(
"password" ) );
950 child = child.nextSiblingElement();
956 listConnections->selectAll();
957 buttonBox->button( QDialogButtonBox::Ok )->setEnabled( !listConnections->selectedItems().isEmpty() );
962 listConnections->clearSelection();
963 buttonBox->button( QDialogButtonBox::Ok )->setEnabled(
false );