Skip to content

Commit

Permalink
Fix update buttons when toggle editing from the main window
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Aug 10, 2021
1 parent 29c9c1d commit 5da3bc4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,15 @@ def afterSetRelations(self):
self._setCardinality()

self._checkTransactionGroup()


if self.relation().isValid():
self.relation().referencingLayer().editingStopped.connect(self.updateButtons)
self.relation().referencingLayer().editingStarted.connect(self.updateButtons)

if self.nmRelation().isValid():
self.nmRelation().referencedLayer().editingStarted.connect(self.updateButtons)
self.nmRelation().referencedLayer().editingStopped.connect(self.updateButtons)

self.updateButtons()

def parentFormValueChanged(self, attribute, newValue):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ def afterSetRelations(self):

self._checkTransactionGroup()

if self.relation().isValid():
self.relation().referencingLayer().editingStopped.connect(self.updateButtons)
self.relation().referencingLayer().editingStarted.connect(self.updateButtons)

if self.nmRelation().isValid():
self.nmRelation().referencedLayer().editingStarted.connect(self.updateButtons)
self.nmRelation().referencedLayer().editingStopped.connect(self.updateButtons)

self.updateButtons()

def _checkTransactionGroup(self):
Expand Down

0 comments on commit 5da3bc4

Please sign in to comment.