CAM: Made Fanuc post processor compatible with FreeCAD 1.1.

Use setPlainText() if available, otherwise use setText().
Workaround for a regression from #23862.
This commit is contained in:
Petter Reinholdtsen
2025-12-09 00:02:34 +01:00
parent 8386f1394e
commit 9c78ced00c

View File

@@ -352,7 +352,13 @@ def export(objectslist, filename, argstring):
if FreeCAD.GuiUp and SHOW_EDITOR:
dia = PostUtils.GCodeEditorDialog()
dia.editor.setPlainText(gcode)
# Workaround for 1.1 while we wait for
# https://github.com/FreeCAD/FreeCAD/pull/26008 to be merged.
if hasattr(dia.editor, "setPlainText"):
dia.editor.setPlainText(gcode)
else:
dia.editor.setText(gcode)
result = dia.exec_()
if result:
final = dia.editor.toPlainText()