Skip to content

Commit 89f1051

Browse files
committed
add select/unselect buttons in project properties->OWS server->WFS layers (fix #5865)
1 parent 5455d8a commit 89f1051

3 files changed

Lines changed: 41 additions & 3 deletions

File tree

‎src/app/qgsprojectproperties.cpp‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,24 @@ void QgsProjectProperties::on_pbnWMSSetUsedSRS_clicked()
744744
mWMSList->addItems( crsList.values() );
745745
}
746746

747+
void QgsProjectProperties::on_pbnWFSLayersSelectAll_clicked()
748+
{
749+
for ( int i = 0; i < twWFSLayers->rowCount(); i++ )
750+
{
751+
QCheckBox *cb = qobject_cast<QCheckBox *>( twWFSLayers->cellWidget( i, 1 ) );
752+
cb->setChecked( true );
753+
}
754+
}
755+
756+
void QgsProjectProperties::on_pbnWFSLayersUnselectAll_clicked()
757+
{
758+
for ( int i = 0; i < twWFSLayers->rowCount(); i++ )
759+
{
760+
QCheckBox *cb = qobject_cast<QCheckBox *>( twWFSLayers->cellWidget( i, 1 ) );
761+
cb->setChecked( false );
762+
}
763+
}
764+
747765
void QgsProjectProperties::on_pbnAddScale_clicked()
748766
{
749767
int myScale = QInputDialog::getInt(

‎src/app/qgsprojectproperties.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ class QgsProjectProperties : public QDialog, private Ui::QgsProjectPropertiesBas
113113
void on_pbnWMSRemoveSRS_clicked();
114114
void on_pbnWMSSetUsedSRS_clicked();
115115

116+
/*!
117+
* Slots to select/unselect all the WFS layers
118+
*/
119+
void on_pbnWFSLayersSelectAll_clicked();
120+
void on_pbnWFSLayersUnselectAll_clicked();
121+
116122
/*!
117123
* Slots for Styles
118124
*/

‎src/ui/qgsprojectpropertiesbase.ui‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,9 +801,9 @@
801801
<property name="geometry">
802802
<rect>
803803
<x>0</x>
804-
<y>0</y>
804+
<y>-390</y>
805805
<width>670</width>
806-
<height>926</height>
806+
<height>959</height>
807807
</rect>
808808
</property>
809809
<layout class="QGridLayout" name="gridLayout">
@@ -1105,7 +1105,7 @@
11051105
<string>WFS Capabilitities</string>
11061106
</property>
11071107
<layout class="QGridLayout" name="gridLayout_8">
1108-
<item row="0" column="0">
1108+
<item row="0" column="0" colspan="2">
11091109
<widget class="QTableWidget" name="twWFSLayers">
11101110
<property name="sizePolicy">
11111111
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
@@ -1125,6 +1125,20 @@
11251125
</column>
11261126
</widget>
11271127
</item>
1128+
<item row="1" column="1">
1129+
<widget class="QPushButton" name="pbnWFSLayersUnselectAll">
1130+
<property name="text">
1131+
<string>Unselect all</string>
1132+
</property>
1133+
</widget>
1134+
</item>
1135+
<item row="1" column="0">
1136+
<widget class="QPushButton" name="pbnWFSLayersSelectAll">
1137+
<property name="text">
1138+
<string>Select all</string>
1139+
</property>
1140+
</widget>
1141+
</item>
11281142
</layout>
11291143
</widget>
11301144
</item>

0 commit comments

Comments
 (0)