Make gear creation "undoable"

Right now, the tool tip is used as transaction name, which matches the
wording "Create a new sketch". There doesn't seem to be consistency
though FreeCAD's other workbenches, though.
This commit is contained in:
Jonas Bähr
2021-10-21 22:39:41 +02:00
committed by lorenz
parent 69ff30d65e
commit 6ce203ea8f

View File

@@ -41,10 +41,13 @@ class BaseCommand(object):
return True
def Activated(self):
doc = FreeCAD.ActiveDocument
Gui.doCommandGui("import freecad.gears.commands")
doc.openTransaction(self.ToolTip)
Gui.doCommandGui("freecad.gears.commands.{}.create()".format(
self.__class__.__name__))
FreeCAD.ActiveDocument.recompute()
doc.commitTransaction()
doc.recompute()
Gui.SendMsgToActiveView("ViewFit")
@classmethod