Skip to content
Permalink
Browse files
enable Toggle editing button depending on layer type (fix #4965)
  • Loading branch information
alexbruy committed Feb 19, 2012
1 parent 8d8543f commit 6e1e55e4161567dfa28e99480e666978bbf5a53e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/app/qgisapp.cpp
@@ -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
{

0 comments on commit 6e1e55e

Please sign in to comment.