Draft: Update v0.22 references to v1.0 (#13934)

This commit is contained in:
Roy-043
2024-05-12 09:47:51 +02:00
committed by GitHub
parent 7b7dc52c8a
commit 30b3fcd045
5 changed files with 12 additions and 12 deletions

View File

@@ -1819,7 +1819,7 @@ if FreeCAD.GuiUp:
_view_observer_active = False
# Compatibility function (V0.22, 2023):
# Compatibility function (v1.0, 2023):
def getPlacementFromPoints(points):
"""Return a placement from a list of 3 or 4 points. The 4th point is no longer used.
@@ -1829,7 +1829,7 @@ def getPlacementFromPoints(points):
return DraftGeomUtils.placement_from_points(*points[:3])
# Compatibility function (V0.22, 2023):
# Compatibility function (v1.0, 2023):
def getPlacementFromFace(face, rotated=False):
"""Return a placement from a face.

View File

@@ -412,7 +412,7 @@ class PathArray(DraftLink):
def onDocumentRestored(self, obj):
super().onDocumentRestored(obj)
# Fuse property was added in v0.22, obj should be OK if it is present:
# Fuse property was added in v1.0, obj should be OK if it is present:
if hasattr(obj, "Fuse"):
return
self.set_properties(obj)
@@ -428,7 +428,7 @@ class PathArray(DraftLink):
_wrn("v0.19, " + obj.Label + ", " + translate("draft", "migrated 'Xlate' property to 'ExtraTranslation'"))
obj.ExtraTranslation = obj.Xlate
obj.removeProperty("Xlate")
_wrn("v0.22, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
_wrn("v1.0, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
# Alias for compatibility with v0.18 and earlier

View File

@@ -134,11 +134,11 @@ class PathTwistedArray(DraftLink):
def onDocumentRestored(self, obj):
super().onDocumentRestored(obj)
# Fuse property was added in v0.22, obj should be OK if it is present:
# Fuse property was added in v1.0, obj should be OK if it is present:
if hasattr(obj, "Fuse"):
return
self.set_properties(obj)
_wrn("v0.22, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
_wrn("v1.0, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
def execute(self, obj):
"""Execute when the object is created or recomputed."""

View File

@@ -132,7 +132,7 @@ class PointArray(DraftLink):
def onDocumentRestored(self, obj):
super().onDocumentRestored(obj)
# Fuse property was added in v0.22, obj should be OK if it is present:
# Fuse property was added in v1.0, obj should be OK if it is present:
if hasattr(obj, "Fuse"):
return
if not hasattr(obj, "ExtraPlacement"):
@@ -142,7 +142,7 @@ class PointArray(DraftLink):
_wrn("v0.19, " + obj.Label + ", " + translate("draft", "migrated 'PointList' property to 'PointObject'"))
obj.PointObject = obj.PointList
obj.removeProperty("PointList")
_wrn("v0.22, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
_wrn("v1.0, " + obj.Label + ", " + translate("draft", "added 'Fuse' property"))
def remove_equal_vecs (vec_list):

View File

@@ -105,9 +105,9 @@ class ShapeString(DraftObject):
super().onDocumentRestored(obj)
if hasattr(obj, "ObliqueAngle"): # several more properties were added
return
self.update_properties_0v22(obj)
self.update_properties_1v0(obj)
def update_properties_0v22(self, obj):
def update_properties_1v0(self, obj):
"""Update view properties."""
old_tracking = obj.Tracking # no need for obj.getTypeIdOfProperty("Tracking")
obj.removeProperty("Tracking")
@@ -115,9 +115,9 @@ class ShapeString(DraftObject):
obj.KeepLeftMargin = True
obj.ScaleToSize = False
obj.Tracking = old_tracking
_wrn("v0.22, " + obj.Label + ", "
_wrn("v1.0, " + obj.Label + ", "
+ translate("draft", "added 'Fuse', 'Justification', 'JustificationReference', 'KeepLeftMargin', 'ObliqueAngle' and 'ScaleToSize' properties"))
_wrn("v0.22, " + obj.Label + ", "
_wrn("v1.0, " + obj.Label + ", "
+ translate("draft", "changed 'Tracking' property type"))
def execute(self, obj):