diff --git a/src/Mod/Path/Path/Op/Custom.py b/src/Mod/Path/Path/Op/Custom.py index 3382e64268..beb4a5c9ac 100644 --- a/src/Mod/Path/Path/Op/Custom.py +++ b/src/Mod/Path/Path/Op/Custom.py @@ -70,10 +70,25 @@ class ObjectCustom(PathOp.ObjectOp): QT_TRANSLATE_NOOP("App::Property", "The G-code to be inserted"), ) - obj.Source = [ "Text", "File" ] obj.Proxy = self self.setEditorModes(obj) + def opPropertyEnumerations(self, dateType="data"): + enum = super().opPropertyEnumerations(dateType) + + props = [ + (translate("PathCustom", "Text"), "Text"), + (translate("PathCustom", "File"), "File") + ] + + if dateType == "raw": + enum["Source"] = props + return enum + + enum.append(("Source", [ p[1][1] for p in enumerate(props) ])) + + return enum + def onChanged(self, obj, prop): if prop == "Source": self.setEditorModes(obj)