Skip to content

Commit 972fc9f

Browse files
committed
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
1 parent 4b0df5b commit 972fc9f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/gui/qgsrelationeditorwidget.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "qgsgenericfeatureselectionmanager.h"
2525
#include "qgsrelation.h"
2626
#include "qgsvectorlayertools.h"
27+
#include "qgsproject.h"
28+
#include "qgstransactiongroup.h"
2729

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

204+
mToggleEditingButton->setVisible( true );
205+
206+
Q_FOREACH ( QgsTransactionGroup* tg, QgsProject::instance()->transactionGroups().values() )
207+
{
208+
if ( tg->layers().contains( mRelation.referencingLayer() ) )
209+
{
210+
mToggleEditingButton->setVisible( false );
211+
mSaveEditsButton->setVisible( false );
212+
}
213+
}
214+
202215
connect( mRelation.referencingLayer(), SIGNAL( editingStarted() ), this, SLOT( updateButtons() ) );
203216
connect( mRelation.referencingLayer(), SIGNAL( editingStopped() ), this, SLOT( updateButtons() ) );
204217

0 commit comments

Comments
 (0)