Skip to content

Commit c12b9ba

Browse files
committedDec 6, 2011
Possibility to add several wfs layers in one go
1 parent e8a67fe commit c12b9ba

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed
 

‎src/providers/wfs/qgswfssourceselect.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,7 @@ void QgsWFSSourceSelect::addLayer()
262262
return;
263263
}
264264

265-
QString typeName = tItem->text( 1 );
266-
QString crs = labelCoordRefSys->text();
267-
QString filter = mFilterLineEdit->text();
268265
QgsRectangle bBox;
269-
270266
#if 0
271267
// TODO: resolve [MD]
272268
//get current extent
@@ -277,13 +273,19 @@ void QgsWFSSourceSelect::addLayer()
277273
}
278274
#endif
279275

280-
//add a wfs layer to the map
281-
QgsWFSConnection conn( cmbConnections->currentText() );
282-
QString uri = conn.uriGetFeature( typeName, crs, filter, bBox );
283-
284-
emit addWfsLayer( uri, typeName );
285-
286-
accept();
276+
QList<QTreeWidgetItem*> selectedItems = treeWidget->selectedItems();
277+
QList<QTreeWidgetItem*>::const_iterator sIt = selectedItems.constBegin();
278+
for ( ; sIt != selectedItems.constEnd(); ++sIt )
279+
{
280+
QString typeName = ( *sIt )->text( 1 );
281+
QString crs = labelCoordRefSys->text();
282+
QString filter = mFilterLineEdit->text();
283+
284+
//add a wfs layer to the map
285+
QgsWFSConnection conn( cmbConnections->currentText() );
286+
QString uri = conn.uriGetFeature( typeName, crs, filter, bBox );
287+
emit addWfsLayer( uri, typeName );
288+
}
287289
}
288290

289291
void QgsWFSSourceSelect::changeCRS()

‎src/ui/qgswfssourceselectbase.ui

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105
</item>
106106
<item row="1" column="0">
107107
<widget class="QTreeWidget" name="treeWidget">
108+
<property name="selectionMode">
109+
<enum>QAbstractItemView::MultiSelection</enum>
110+
</property>
108111
<property name="sortingEnabled">
109112
<bool>true</bool>
110113
</property>
@@ -203,7 +206,7 @@
203206
<enum>Qt::Horizontal</enum>
204207
</property>
205208
<property name="standardButtons">
206-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
209+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
207210
</property>
208211
</widget>
209212
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.