Skip to content
Permalink
Browse files

Hide layer edit state buttons on relation editor when in transaction

... because that the buttons are there was mainly triggered by the fact
that it's sometimes hard to find the appropriate layer in the legend.

Fix #15102
  • Loading branch information
m-kuhn committed Jun 26, 2016
1 parent 4b0df5b commit 972fc9fa11646543548577c043a18e5bc99a19ec
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/gui/qgsrelationeditorwidget.cpp
@@ -24,6 +24,8 @@
#include "qgsgenericfeatureselectionmanager.h"
#include "qgsrelation.h"
#include "qgsvectorlayertools.h"
#include "qgsproject.h"
#include "qgstransactiongroup.h"

#include <QHBoxLayout>
#include <QLabel>
@@ -199,6 +201,17 @@ void QgsRelationEditorWidget::setRelations( const QgsRelation& relation, const Q
if ( !mRelation.isValid() )
return;

mToggleEditingButton->setVisible( true );

Q_FOREACH ( QgsTransactionGroup* tg, QgsProject::instance()->transactionGroups().values() )
{
if ( tg->layers().contains( mRelation.referencingLayer() ) )
{
mToggleEditingButton->setVisible( false );
mSaveEditsButton->setVisible( false );
}
}

connect( mRelation.referencingLayer(), SIGNAL( editingStarted() ), this, SLOT( updateButtons() ) );
connect( mRelation.referencingLayer(), SIGNAL( editingStopped() ), this, SLOT( updateButtons() ) );

0 comments on commit 972fc9f

Please sign in to comment.
You can’t perform that action at this time.