Suppress attribute form popup if layer has no fields

Prevents empty form popup for layers with no fields (eg memory layers).
If desired, this behaviour can be overriden by the layer's feature
form suppress option, eg if form has python logic which makes it useful
even with no fields.

(fix #10775)
This commit is contained in:
Nyall Dawson 2015-02-25 21:56:43 +11:00
parent c3c945b13b
commit ee68332ed7

View File

@ -163,8 +163,10 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
mFeature.setAttribute( idx, v );
}
// show the dialog to enter attribute values
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
//show the dialog to enter attribute values
//only show if enabled in settings and layer has fields
bool isDisabledAttributeValuesDlg = ( fields.count() == 0 ) || settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
// override application-wide setting with any layer setting
switch ( mLayer->featureFormSuppress() )
{