Skip to content

Commit ce96eaa

Browse files
committedJun 21, 2014
attribute table: allow toggling editing if layer is capabable of any change, not only attributes (fixes #7504)
1 parent 71c15f0 commit ce96eaa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3641,7 +3641,7 @@ void QgisApp::newVectorLayer()
36413641
//todo: the last parameter will change accordingly to layer type
36423642
addVectorLayers( fileNames, enc, "file" );
36433643
}
3644-
else if( fileName.isNull() )
3644+
else if ( fileName.isNull() )
36453645
{
36463646
QLabel *msgLabel = new QLabel( tr( "Layer creation failed. Please check the <a href=\"#messageLog\">message log</a> for further information." ), messageBar() );
36473647
msgLabel->setWordWrap( true );

‎src/app/qgsattributetabledialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
168168
mToggleEditingButton->blockSignals( true );
169169
mToggleEditingButton->setCheckable( true );
170170
mToggleEditingButton->setChecked( mLayer->isEditable() );
171-
mToggleEditingButton->setEnabled( canChangeAttributes && !mLayer->isReadOnly() );
171+
mToggleEditingButton->setEnabled(( canChangeAttributes || canDeleteFeatures || canAddAttributes || canDeleteAttributes || canAddFeatures ) && !mLayer->isReadOnly() );
172172
mToggleEditingButton->blockSignals( false );
173173

174-
mSaveEditsButton->setEnabled( canChangeAttributes && mLayer->isEditable() );
174+
mSaveEditsButton->setEnabled( mToggleEditingButton->isEnabled() && mLayer->isEditable() );
175175
mOpenFieldCalculator->setEnabled(( canChangeAttributes || canAddAttributes ) && mLayer->isEditable() );
176176
mDeleteSelectedButton->setEnabled( canDeleteFeatures && mLayer->isEditable() );
177177
mAddAttribute->setEnabled( canAddAttributes && mLayer->isEditable() );

0 commit comments

Comments
 (0)
Please sign in to comment.