Skip to content

Commit

Permalink
Merge pull request #2251 from realthunder/PathFix
Browse files Browse the repository at this point in the history
Path: handle PathAreaOp object migration
  • Loading branch information
sliptonic committed Jun 10, 2019
2 parents 6717499 + 93cbc52 commit eb9d778
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Mod/Path/PathScripts/PathAreaOp.py
Expand Up @@ -96,12 +96,16 @@ def initOperation(self, obj):
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.'''
Expand Down Expand Up @@ -152,6 +156,9 @@ def opOnDocumentRestored(self, obj):
for prop in ['AreaParams', 'PathParams', 'removalshape']:
if hasattr(obj, prop):
obj.setEditorMode(prop, 2)

self.setupAdditionalProperties(obj)

self.docRestored = True

self.areaOpOnDocumentRestored(obj)
Expand Down

0 comments on commit eb9d778

Please sign in to comment.