Skip to content

Commit

Permalink
Delete ToolBit if ToolController is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Nov 29, 2019
1 parent aa5e7fe commit 308c1f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Mod/Path/PathScripts/PathToolController.py
Expand Up @@ -84,6 +84,11 @@ def __init__(self, obj, cTool=False):
def onDocumentRestored(self, obj):
obj.setEditorMode('Placement', 2)

def onDelete(self, obj, arg2=None):
if not self.usesLegacyTool(obj):
if len(obj.Tool.InList) == 1:
obj.Document.removeObject(obj.Tool.Name)

def setFromTemplate(self, obj, template):
'''setFromTemplate(obj, xmlItem) ... extract properties from xmlItem and assign to receiver.'''
PathLog.track(obj.Name, template)
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Path/PathScripts/PathToolControllerGui.py
Expand Up @@ -80,6 +80,7 @@ def onChanged(self, vobj, prop):
def onDelete(self, vobj, args=None):
# pylint: disable=unused-argument
PathUtil.clearExpressionEngine(vobj.Object)
self.vobj.Object.Proxy.onDelete(vobj.Object, args)
return True

def updateData(self, vobj, prop):
Expand Down

0 comments on commit 308c1f9

Please sign in to comment.