Draft: Fix multiple crashes when using modification functions - fixes #0004243

This commit is contained in:
marioalexis
2021-01-02 02:15:01 -03:00
parent 01072f3709
commit 4d9e29418a
13 changed files with 27 additions and 58 deletions

View File

@@ -79,16 +79,14 @@ class Array(gui_base_original.Modifier):
if self.ui:
self.ui.selectUi()
_msg(translate("draft", "Select an object to array"))
self.call = \
self.view.addEventCallback("SoEvent",
gui_tool_utils.selectObject)
self.call = self.view.addEventCallback(
"SoEvent",
gui_tool_utils.selectObject)
else:
self.proceed()
def proceed(self):
"""Proceed with the command if one object was selected."""
if self.call:
self.view.removeEventCallback("SoEvent", self.call)
if Gui.Selection.getSelection():
obj = Gui.Selection.getSelection()[0]
Gui.addModule("Draft")