@@ -195,19 +195,6 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
195
195
mDiagramFrame ->setLayout ( new QVBoxLayout ( mDiagramFrame ) );
196
196
mDiagramFrame ->layout ()->addWidget ( diagramPropertiesDialog );
197
197
198
- // for each overlay plugin create a new tab
199
- int position;
200
- QList<QgsVectorOverlayPlugin*> overlayPluginList = overlayPlugins ();
201
- QList<QgsVectorOverlayPlugin*>::const_iterator it = overlayPluginList.constBegin ();
202
-
203
- for ( ; it != overlayPluginList.constEnd (); ++it )
204
- {
205
- QgsApplyDialog* d = ( *it )->dialog ( lyr );
206
- position = tabWidget->insertTab ( tabWidget->count (), qobject_cast<QDialog*>( d ), QgsApplication::getThemeIcon ( " propertyicons/diagram.png" ), tr ( " Overlay" ) );
207
- tabWidget->setCurrentIndex ( position ); // ugly, but otherwise the properties dialog is a mess
208
- mOverlayDialogs .push_back ( d );
209
- }
210
-
211
198
// layer title and abstract
212
199
if ( layer )
213
200
{
@@ -266,6 +253,8 @@ void QgsVectorLayerProperties::loadRows()
266
253
tblAttributes->setHorizontalHeaderItem ( attrPrecCol, new QTableWidgetItem ( tr ( " Precision" ) ) );
267
254
tblAttributes->setHorizontalHeaderItem ( attrCommentCol, new QTableWidgetItem ( tr ( " Comment" ) ) );
268
255
tblAttributes->setHorizontalHeaderItem ( attrEditTypeCol, new QTableWidgetItem ( tr ( " Edit widget" ) ) );
256
+ tblAttributes->setHorizontalHeaderItem ( attrWMSCol, new QTableWidgetItem ( " WMS" ) );
257
+ tblAttributes->setHorizontalHeaderItem ( attrWFSCol, new QTableWidgetItem ( " WFS" ) );
269
258
tblAttributes->setHorizontalHeaderItem ( attrAliasCol, new QTableWidgetItem ( tr ( " Alias" ) ) );
270
259
271
260
tblAttributes->horizontalHeader ()->setResizeMode ( 1 , QHeaderView::Stretch );
@@ -301,6 +290,16 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )
301
290
302
291
// set the alias for the attribute
303
292
tblAttributes->setItem ( row, attrAliasCol, new QTableWidgetItem ( layer->attributeAlias ( idx ) ) );
293
+
294
+ // published WMS/WFS attributes
295
+ QTableWidgetItem* wmsAttrItem = new QTableWidgetItem ();
296
+ wmsAttrItem->setCheckState ( layer->excludeAttributesWMS ().contains ( field.name () ) ? Qt::Unchecked : Qt::Checked );
297
+ wmsAttrItem->setFlags ( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
298
+ tblAttributes->setItem ( row, attrWMSCol, wmsAttrItem );
299
+ QTableWidgetItem* wfsAttrItem = new QTableWidgetItem ();
300
+ wfsAttrItem->setCheckState ( layer->excludeAttributesWFS ().contains ( field.name () ) ? Qt::Unchecked : Qt::Checked );
301
+ wfsAttrItem->setFlags ( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
302
+ tblAttributes->setItem ( row, attrWFSCol, wfsAttrItem );
304
303
}
305
304
306
305
void QgsVectorLayerProperties::attributeTypeDialog ( )
@@ -757,6 +756,8 @@ void QgsVectorLayerProperties::apply()
757
756
layer->enableLabels ( labelCheckBox->isChecked () );
758
757
layer->setLayerName ( displayName () );
759
758
759
+ QSet<QString> excludeAttributesWMS, excludeAttributesWFS;
760
+
760
761
for ( int i = 0 ; i < tblAttributes->rowCount (); i++ )
761
762
{
762
763
int idx = tblAttributes->item ( i, attrIdCol )->text ().toInt ();
@@ -815,8 +816,20 @@ void QgsVectorLayerProperties::apply()
815
816
case QgsVectorLayer::UuidGenerator:
816
817
break ;
817
818
}
819
+
820
+ if ( tblAttributes->item ( i, attrWMSCol )->checkState () == Qt::Unchecked )
821
+ {
822
+ excludeAttributesWMS.insert ( tblAttributes->item ( i, attrNameCol )->text () );
823
+ }
824
+ if ( tblAttributes->item ( i, attrWFSCol )->checkState () == Qt::Unchecked )
825
+ {
826
+ excludeAttributesWFS.insert ( tblAttributes->item ( i, attrNameCol )->text () );
827
+ }
818
828
}
819
829
830
+ layer->setExcludeAttributesWMS ( excludeAttributesWMS );
831
+ layer->setExcludeAttributesWFS ( excludeAttributesWFS );
832
+
820
833
if ( layer->isUsingRendererV2 () )
821
834
{
822
835
QgsRendererV2PropertiesDialog* dlg =
0 commit comments