From 9494c172b6bd9ae94eb75c1f928a7d81e7129129 Mon Sep 17 00:00:00 2001 From: zz912 Date: Sat, 7 Feb 2026 15:46:23 +0100 Subject: [PATCH] Gmoccapy - exit ToolTable - more verbose --- src/emc/usr_intf/gmoccapy/gmoccapy.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 02f5a1d0df4..a4041a87870 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -4744,11 +4744,20 @@ def on_btn_back_clicked(self, widget, data=None): new_offset = (tt.xoffset, tt.yoffset, tt.zoffset, tt.aoffset, tt.boffset, tt.coffset, tt.uoffset, tt.voffset, tt.woffset) + message = None + new_offset_is_nonzero = any(v != 0.0 for v in new_offset) + old_offset_is_zero = all(v == 0.0 for v in self.stat.tool_offset) if (new_offset != self.stat.tool_offset) and ("G43" in self.active_gcodes): message = _("Offset values for the tool in the spindle\n" \ "have been changed with tool compensation (G43) active.\n\n" \ "Do you want the new values to be applied as the currently\n" \ "active tool offset?") + elif new_offset_is_nonzero and old_offset_is_zero and ("G49" in self.active_gcodes): + message = _("Offset values for the tool in the spindle\n" \ + "have been changed from zero to non-zero.\n\n" \ + "Do you want to activate tool compensation (G43)\n" \ + "using the currently active tool offset?") + if message: result = self.dialogs.yesno_dialog(self, message, _("Attention!")) if result: # user says YES self.command.mode(linuxcnc.MODE_MDI)