From d280fc575bd0e75b9d32331884ded66c977cf72c Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 10 Jun 2019 09:02:43 +0800 Subject: [PATCH] Path: handle PathAreaOp object migration --- src/Mod/Path/PathScripts/PathAreaOp.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAreaOp.py b/src/Mod/Path/PathScripts/PathAreaOp.py index 66f495a2a7..a139b0eac3 100644 --- a/src/Mod/Path/PathScripts/PathAreaOp.py +++ b/src/Mod/Path/PathScripts/PathAreaOp.py @@ -96,12 +96,16 @@ class ObjectOp(PathOp.ObjectOp): obj.setEditorMode('PathParams', 2) # hide obj.addProperty("Part::PropertyPartShape", "removalshape", "Path") obj.setEditorMode('removalshape', 2) # hide + + self.setupAdditionalProperties(obj) + + self.initAreaOp(obj) + + def setupAdditionalProperties(self, obj): if not hasattr(obj, 'UseRotation'): obj.addProperty("App::PropertyEnumeration", "UseRotation", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Use rotation to gain access to pockets/areas.")) obj.UseRotation = ['Off', 'A(x)', 'B(y)', 'A & B'] - self.initAreaOp(obj) - def initAreaOp(self, obj): '''initAreaOp(obj) ... overwrite if the receiver class needs initialisation. Can safely be overwritten by subclasses.''' @@ -152,6 +156,9 @@ class ObjectOp(PathOp.ObjectOp): for prop in ['AreaParams', 'PathParams', 'removalshape']: if hasattr(obj, prop): obj.setEditorMode(prop, 2) + + self.setupAdditionalProperties(obj) + self.docRestored = True self.areaOpOnDocumentRestored(obj)