Skip to content
Permalink
Browse files

Allow adding features with empty geometry via attribute table

  • Loading branch information
nyalldawson committed Oct 13, 2015
1 parent 5de9444 commit 6f860d0bf33c29615e032afc384cc8abf3ad922b
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/app/qgsattributetabledialog.cpp
@@ -214,8 +214,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
mSaveEditsButton->setEnabled( mToggleEditingButton->isEnabled() && mLayer->isEditable() );
mAddAttribute->setEnabled(( canChangeAttributes || canAddAttributes ) && mLayer->isEditable() );
mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() );
mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() && mLayer->geometryType() == QGis::NoGeometry );
mAddFeature->setHidden( !canAddFeatures || mLayer->geometryType() != QGis::NoGeometry );
mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() );
mAddFeature->setHidden( !canAddFeatures );

mMainViewButtonGroup->setId( mTableViewButton, QgsDualView::AttributeTable );
mMainViewButtonGroup->setId( mAttributeViewButton, QgsDualView::AttributeEditor );
@@ -666,7 +666,7 @@ void QgsAttributeTableDialog::editingToggled()
bool canAddFeatures = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures;
mAddAttribute->setEnabled(( canChangeAttributes || canAddAttributes ) && mLayer->isEditable() );
mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() );
mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() && mLayer->geometryType() == QGis::NoGeometry );
mAddFeature->setEnabled( canAddFeatures && mLayer->isEditable() );

mUpdateExpressionBox->setVisible( mLayer->isEditable() );
// not necessary to set table read only if layer is not editable

0 comments on commit 6f860d0

Please sign in to comment.
You can’t perform that action at this time.