Skip to content
Permalink
Browse files
fix enabling of field edit buttons in vector properties
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15615 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 27, 2011
1 parent e169c28 commit a3f2f257da5c9425501a41fa1fdbbe039cc4f388
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/app/qgsvectorlayerproperties.cpp
@@ -398,20 +398,22 @@ void QgsVectorLayerProperties::editingToggled()

void QgsVectorLayerProperties::updateButtons()
{
int cap = layer->dataProvider()->capabilities();

mToggleEditingButton->setEnabled(( cap & QgsVectorDataProvider::EditingCapabilities ) && !layer->isReadOnly() );
mToggleEditingButton->setChecked( layer->isEditable() );

if ( layer->isEditable() )
{
int cap = layer->dataProvider()->capabilities();
mAddAttributeButton->setEnabled( cap & QgsVectorDataProvider::AddAttributes );
mDeleteAttributeButton->setEnabled( cap & QgsVectorDataProvider::DeleteAttributes );
mCalculateFieldButton->setEnabled( cap & QgsVectorDataProvider::ChangeAttributeValues );
mToggleEditingButton->setChecked( true );
}
else
{
mAddAttributeButton->setEnabled( false );
mDeleteAttributeButton->setEnabled( false );
mToggleEditingButton->setChecked( false );
mCalculateFieldButton->setEnabled( false );
mAddAttributeButton->setDisabled( true );
mDeleteAttributeButton->setDisabled( true );
mCalculateFieldButton->setDisabled( true );
}
}

@@ -863,7 +865,7 @@ QString QgsVectorLayerProperties::metadata()

QGis::GeometryType type = layer->geometryType();

if ( type < 0 || type > QGis::Polygon )
if ( type < 0 || type > QGis::NoGeometry )
{
QgsDebugMsg( "Invalid vector type" );
}

0 comments on commit a3f2f25

Please sign in to comment.