Assembly: Create joint: prevent errors on undo/ctrl-Z

This commit is contained in:
PaddleStroke
2024-07-02 15:06:51 +02:00
committed by wwmayer
parent 3f49779dae
commit a3436c2d5f
2 changed files with 7 additions and 1 deletions

View File

@@ -59,7 +59,10 @@ def activateJoint(index):
JointObject.activeTask.reject()
panel = TaskAssemblyCreateJoint(index)
Gui.Control.showDialog(panel)
dialog = Gui.Control.showDialog(panel)
if dialog is not None:
dialog.setAutoCloseOnTransactionChange(True)
dialog.setDocumentName(App.ActiveDocument.Name)
class CommandCreateJointFixed:

View File

@@ -1383,6 +1383,9 @@ class TaskAssemblyCreateJoint(QtCore.QObject):
self.joint.Visibility = self.visibilityBackup
return True
def autoClosedOnTransactionChange(self):
self.reject()
def deactivate(self):
global activeTask
activeTask = None