From c67800365242f2e449f59586a9e23dacf91569cd Mon Sep 17 00:00:00 2001 From: Patrick F Date: Sat, 26 Dec 2020 21:11:27 +0100 Subject: [PATCH] Panel Start at creation --- .../Path/PathScripts/PathDressupLeadInOut.py | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py index 261531835c..f74bc9e809 100644 --- a/src/Mod/Path/PathScripts/PathDressupLeadInOut.py +++ b/src/Mod/Path/PathScripts/PathDressupLeadInOut.py @@ -24,7 +24,9 @@ from __future__ import print_function import FreeCAD +import FreeCADGui import Path +#import PathScripts.PathDressupLeadInOut as PathDressupLeadInOut import PathScripts.PathDressup as PathDressup import PathScripts.PathGeom as PathGeom import PathScripts.PathLog as PathLog @@ -32,7 +34,7 @@ import PathScripts.PathUtils as PathUtils import math import copy -from PySide import QtCore +from PySide import QtCore, QtGui __doc__ = """LeadInOut Dressup MASHIN-CRC USE ROLL-ON ROLL-OFF to profile""" @@ -468,8 +470,29 @@ class TaskPanel: def __init__(self, obj): self.obj = obj self.form = FreeCADGui.PySideUic.loadUi(":/panels/DressUpLeadInOutEdit.ui") + self.setupUi() FreeCAD.ActiveDocument.openTransaction(translate("Path_DressupLeadInOut", "Edit LeadInOut Dress-up")) + + def getStandardButtons(self): + return int(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel) + + def modifyStandardButtons(self, buttonBox): + self.buttonBox = buttonBox + + def setDirty(self): + self.isDirty = True + self.buttonBox.button(QtGui.QDialogButtonBox.Apply).setEnabled(True) + + def setClean(self): + self.isDirty = False + self.buttonBox.button(QtGui.QDialogButtonBox.Apply).setEnabled(False) + + def clicked(self, button): + # callback for standard buttons + if button == QtGui.QDialogButtonBox.Apply: + self.updateModel() + FreeCAD.ActiveDocument.recompute() def reject(self): FreeCAD.ActiveDocument.abortTransaction() @@ -539,9 +562,9 @@ class TaskPanel: class ViewProviderDressup: - def __init__(self, vobj): self.obj = vobj.Object + self.setEdit(vobj) def attach(self, vobj): self.obj = vobj.Object @@ -625,9 +648,9 @@ class CommandPathDressupLeadInOut: FreeCADGui.doCommand('job = PathScripts.PathUtils.findParentJob(base)') FreeCADGui.doCommand('obj.Base = base') FreeCADGui.doCommand('job.Proxy.addOperation(obj, base)') + FreeCADGui.doCommand('dbo.setup(obj)') FreeCADGui.doCommand('obj.ViewObject.Proxy = PathScripts.PathDressupLeadInOut.ViewProviderDressup(obj.ViewObject)') FreeCADGui.doCommand('Gui.ActiveDocument.getObject(base.Name).Visibility = False') - FreeCADGui.doCommand('dbo.setup(obj)') FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.recompute()