Skip to content
Permalink
Browse files
attribute table: allow toggling editing if layer is capabable of any …
…change, not only attributes (fixes #7504)
  • Loading branch information
jef-n committed Jun 21, 2014
1 parent 71c15f0 commit ce96eaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
@@ -3641,7 +3641,7 @@ void QgisApp::newVectorLayer()
//todo: the last parameter will change accordingly to layer type
addVectorLayers( fileNames, enc, "file" );
}
else if( fileName.isNull() )
else if ( fileName.isNull() )
{
QLabel *msgLabel = new QLabel( tr( "Layer creation failed. Please check the <a href=\"#messageLog\">message log</a> for further information." ), messageBar() );
msgLabel->setWordWrap( true );
@@ -168,10 +168,10 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
mToggleEditingButton->blockSignals( true );
mToggleEditingButton->setCheckable( true );
mToggleEditingButton->setChecked( mLayer->isEditable() );
mToggleEditingButton->setEnabled( canChangeAttributes && !mLayer->isReadOnly() );
mToggleEditingButton->setEnabled(( canChangeAttributes || canDeleteFeatures || canAddAttributes || canDeleteAttributes || canAddFeatures ) && !mLayer->isReadOnly() );
mToggleEditingButton->blockSignals( false );

mSaveEditsButton->setEnabled( canChangeAttributes && mLayer->isEditable() );
mSaveEditsButton->setEnabled( mToggleEditingButton->isEnabled() && mLayer->isEditable() );
mOpenFieldCalculator->setEnabled(( canChangeAttributes || canAddAttributes ) && mLayer->isEditable() );
mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() );
mAddAttribute->setEnabled( canAddAttributes && mLayer->isEditable() );

0 comments on commit ce96eaa

Please sign in to comment.