[commands] GroupedGraphModification: add 'disableUpdates' option

gives control over whether graph updates should be disabled during this grouped modification
This commit is contained in:
Yann Lanthony 2018-03-12 14:08:31 +01:00
parent bc8b39b172
commit 4f392a310b
2 changed files with 11 additions and 7 deletions

View file

@ -221,16 +221,17 @@ class UIGraph(QObject):
"""
return self._undoStack.tryAndPush(command)
def groupedGraphModification(self, title):
def groupedGraphModification(self, title, disableUpdates=True):
""" Get a GroupedGraphModification for this Graph.
Args:
title (str): the title of the macro command
disableUpdates (bool): whether to disable graph updates
Returns:
GroupedGraphModification: the instantiated context manager
"""
return commands.GroupedGraphModification(self._graph, self._undoStack, title)
return commands.GroupedGraphModification(self._graph, self._undoStack, title, disableUpdates)
def beginModification(self, name):
""" Begin a Graph modification. Calls to beginModification and endModification may be nested, but