Skip to content

Commit

Permalink
Hide layer edit state buttons on relation editor when in transaction
Browse files Browse the repository at this point in the history
... 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 972fc9f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/qgsrelationeditorwidget.cpp
Expand Up @@ -24,6 +24,8 @@
#include "qgsgenericfeatureselectionmanager.h"
#include "qgsrelation.h"
#include "qgsvectorlayertools.h"
#include "qgsproject.h"
#include "qgstransactiongroup.h"

#include <QHBoxLayout>
#include <QLabel>
Expand Down Expand Up @@ -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() ) );

Expand Down

0 comments on commit 972fc9f

Please sign in to comment.