diff --git a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui index 1ad99515fb..f1897a0bcb 100644 --- a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui @@ -642,10 +642,13 @@ - + + + false + Edit diff --git a/src/Mod/Path/PathScripts/PathDressupDogbone.py b/src/Mod/Path/PathScripts/PathDressupDogbone.py index bc6e05f8fe..b740fb5e66 100644 --- a/src/Mod/Path/PathScripts/PathDressupDogbone.py +++ b/src/Mod/Path/PathScripts/PathDressupDogbone.py @@ -996,7 +996,7 @@ def Create(base, name = 'DogboneDressup'): obj = FreeCAD.ActiveDocument.addObject('Path::FeaturePython', 'DogboneDressup') dbo = ObjectDressup(obj, base) job = PathUtils.findParentJob(base) - job.addOperation(obj) + job.Proxy.addOperation(obj) if FreeCAD.GuiUp: ViewProviderDressup(obj.ViewObject) @@ -1004,7 +1004,6 @@ def Create(base, name = 'DogboneDressup'): obj.ToolController = base.ToolController dbo.setup(obj, True) - return obj class CommandDressupDogbone: diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index e50a81634b..2426cf9075 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -968,7 +968,7 @@ def Create(baseObject, name = 'DressupTag'): obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", "TagDressup") dbo = ObjectTagDressup(obj, baseObject) job = PathUtils.findParentJob(baseObject) - job.addOperation(obj) + job.Proxy.addOperation(obj) dbo.setup(obj, True) return obj diff --git a/src/Mod/Path/PathScripts/PathDressupRampEntry.py b/src/Mod/Path/PathScripts/PathDressupRampEntry.py index 7dcf302685..e73b4b774e 100644 --- a/src/Mod/Path/PathScripts/PathDressupRampEntry.py +++ b/src/Mod/Path/PathScripts/PathDressupRampEntry.py @@ -563,7 +563,7 @@ class ViewProviderDressup: '''this makes sure that the base operation is added back to the project and visible''' FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True job = PathUtils.findParentJob(self.obj) - job.addOperation(arg1.Object.Base) + job.Proxy.addOperation(arg1.Object.Base) arg1.Object.Base = None return True diff --git a/src/Mod/Path/PathScripts/PathDressupTagGui.py b/src/Mod/Path/PathScripts/PathDressupTagGui.py index 71efea0bb2..709787c4d2 100644 --- a/src/Mod/Path/PathScripts/PathDressupTagGui.py +++ b/src/Mod/Path/PathScripts/PathDressupTagGui.py @@ -522,7 +522,7 @@ class PathDressupTagViewProvider: if self.obj.Base.ViewObject: self.obj.Base.ViewObject.Visibility = True job = PathUtils.findParentJob(self.obj) - job.addOperation(arg1.Object.Base) + job.Proxy.addOperation(arg1.Object.Base) arg1.Object.Base = None #if self.debugDisplay(): # self.vobj.Debug.removeObjectsFromDocument() diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index 01484b24ca..eb7d11a805 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -152,6 +152,10 @@ class ObjectJob: return None def __setstate__(self, state): + for obj in FreeCAD.ActiveDocument.Objects: + if hasattr(obj, 'Proxy') and obj.Proxy == self: + self.obj = obj + break return None def execute(self, obj): diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index 5d79718b1a..56227d0206 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -195,16 +195,29 @@ class TaskPanel: self.form.infoModel.setCurrentIndex(baseindex) - def open(self): - pass - def setPostProcessorOutputFile(self): filename = QtGui.QFileDialog.getSaveFileName(self.form, translate("Path_Job", "Select Output File"), None, translate("Path_Job", "All Files (*.*)")) if filename and filename[0]: self.obj.PostProcessorOutputFile = str(filename[0]) self.setFields() + def operationSelect(self): + if self.form.operationsList.selectedItems(): + self.form.operationModify.setEnabled(True) + else: + self.form.operationModify.setEnabled(False) + + def operationDelete(self): + for item in self.form.operationsList.selectedItems(): + obj = item.data(self.DataObject) + if obj.ViewObject and hasattr(obj.ViewObject, 'Proxy') and hasattr(obj.ViewObject.Proxy, 'onDelete'): + obj.ViewObject.Proxy.onDelete(obj.ViewObject, None) + FreeCAD.ActiveDocument.removeObject(obj.Name) + self.setFields() + def setupUi(self): + self.setFields() + # Info self.form.infoLabel.editingFinished.connect(self.getFields) self.form.infoModel.currentIndexChanged.connect(self.getFields) @@ -215,9 +228,11 @@ class TaskPanel: self.form.postProcessorOutputFile.editingFinished.connect(self.getFields) self.form.postProcessorSetOutputFile.clicked.connect(self.setPostProcessorOutputFile) + self.form.operationsList.itemSelectionChanged.connect(self.operationSelect) self.form.operationsList.indexesMoved.connect(self.getFields) + self.form.operationDelete.clicked.connect(self.operationDelete) - self.setFields() + self.operationSelect() def Create(base, template=None): '''Create(base, template) ... creates a job instance for the given base object