Skip to content

Commit

Permalink
Correctly synchronize layer editable state with UI in relation editor
Browse files Browse the repository at this point in the history
Fix #11524

Thank you very much Benjamin Trigona-Harany
  • Loading branch information
m-kuhn committed Jan 12, 2015
1 parent b7dcd67 commit ba495f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/qgsrelationeditorwidget.cpp
Expand Up @@ -143,7 +143,15 @@ void QgsRelationEditorWidget::setRelationFeature( const QgsRelation& relation, c
QgsVectorLayer* lyr = relation.referencingLayer();

bool canChangeAttributes = lyr->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
mToggleEditingButton->setEnabled( canChangeAttributes && !lyr->isReadOnly() );
if ( canChangeAttributes && !lyr->isReadOnly() )
{
mToggleEditingButton->setEnabled( true );
referencingLayerEditingToggled();
}
else
{
mToggleEditingButton->setEnabled( false );
}

// If not yet initialized, it is not (yet) visible, so we don't load it to be faster (lazy loading)
// If it is already initialized, it has been set visible before and the currently shown feature is changing
Expand Down

0 comments on commit ba495f3

Please sign in to comment.