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 19, 2012
1 parent 8d8543f commit 6e1e55e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -5734,9 +5734,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 6e1e55e

Please sign in to comment.