[Python Graph] Expose modification group methods

This commit is contained in:
Landrodie 2021-07-22 16:02:41 +02:00 committed by Fabien Castan
parent 262e42a18c
commit 9b753cc358

View file

@ -476,13 +476,15 @@ class UIGraph(QObject):
GroupedGraphModification: the instantiated context manager
"""
return commands.GroupedGraphModification(self._graph, self._undoStack, title, disableUpdates)
@Slot(str)
def beginModification(self, name):
""" Begin a Graph modification. Calls to beginModification and endModification may be nested, but
every call to beginModification must have a matching call to endModification. """
self._modificationCount += 1
self._undoStack.beginMacro(name)
@Slot()
def endModification(self):
""" Ends a Graph modification. Must match a call to beginModification. """
assert self._modificationCount > 0