Skip to content

Commit

Permalink
Possibility to add several wfs layers in one go
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 6, 2011
1 parent e8a67fe commit c12b9ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
24 changes: 13 additions & 11 deletions src/providers/wfs/qgswfssourceselect.cpp
Expand Up @@ -262,11 +262,7 @@ void QgsWFSSourceSelect::addLayer()
return;
}

QString typeName = tItem->text( 1 );
QString crs = labelCoordRefSys->text();
QString filter = mFilterLineEdit->text();
QgsRectangle bBox;

#if 0
// TODO: resolve [MD]
//get current extent
Expand All @@ -277,13 +273,19 @@ void QgsWFSSourceSelect::addLayer()
}
#endif

//add a wfs layer to the map
QgsWFSConnection conn( cmbConnections->currentText() );
QString uri = conn.uriGetFeature( typeName, crs, filter, bBox );

emit addWfsLayer( uri, typeName );

accept();
QList<QTreeWidgetItem*> selectedItems = treeWidget->selectedItems();
QList<QTreeWidgetItem*>::const_iterator sIt = selectedItems.constBegin();
for ( ; sIt != selectedItems.constEnd(); ++sIt )
{
QString typeName = ( *sIt )->text( 1 );
QString crs = labelCoordRefSys->text();
QString filter = mFilterLineEdit->text();

//add a wfs layer to the map
QgsWFSConnection conn( cmbConnections->currentText() );
QString uri = conn.uriGetFeature( typeName, crs, filter, bBox );
emit addWfsLayer( uri, typeName );
}
}

void QgsWFSSourceSelect::changeCRS()
Expand Down
5 changes: 4 additions & 1 deletion src/ui/qgswfssourceselectbase.ui
Expand Up @@ -105,6 +105,9 @@
</item>
<item row="1" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
Expand Down Expand Up @@ -203,7 +206,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit c12b9ba

Please sign in to comment.