Skip to content

Commit

Permalink
enable Toggle editing button depending on layer type (fix #4965)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Feb 8, 2012
1 parent bd51944 commit a080538
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -6164,9 +6164,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
//start editing/stop editing
if ( dprovider->capabilities() & QgsVectorDataProvider::EditingCapabilities )
{
mActionToggleEditing->setEnabled( !vlayer->isReadOnly() );
bool canChangeAttributes = dprovider->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
mActionToggleEditing->setEnabled( canChangeAttributes && !vlayer->isReadOnly() );
mActionToggleEditing->setChecked( vlayer->isEditable() );
mActionSaveEdits->setEnabled( vlayer->isEditable() );
mActionSaveEdits->setEnabled( canChangeAttributes && vlayer->isEditable() );
}
else
{
Expand Down

0 comments on commit a080538

Please sign in to comment.