Skip to content

Commit

Permalink
Allow adding features with empty geometry via attribute table
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 13, 2015
1 parent 5de9444 commit 6f860d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f860d0

Please sign in to comment.