Skip to content

Glade Tooltable widget destroys tooltable in a particular case #2966

@hansu

Description

@hansu

When using locale settings for e.g. Germany, so having a "," as decimal point, the tool table shows the correct decimal point after starting.
But after loading an (empty) G-code file and reloading the tool table, the decimal point changes to a dot:

temp-2024-04-19_15.42.17.mp4

This can lead to loss of the complete tool table in the following (quite common) case:

  1. Load a G-code file
  2. Add the missing tool
  3. Apply the changes ... boom! all tools are gone!
temp-2024-04-19_15.44.31.mp4

Version: latest from 2.9 branch.

Traceback (most recent call last):
  File "/home/cnc/linuxcnc/linuxcnc-2.9/bin/gmoccapy", line 4947, in on_btn_apply_tool_changes_clicked
    self.widgets.tooledit1.save(None)
  File "/home/cnc/linuxcnc/linuxcnc-2.9/lib/python/gladevcp/tooledit_widget.py", line 348, in save
    line = line + "%s%s "%(KEYWORDS[num], locale.atof(test))
                                          ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/locale.py", line 338, in atof
    return func(delocalize(string))
           ^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: '0,0000'
 (gmoccapy:62)
Tool file was modified since it was last read
/usr/lib/python3/dist-packages/gi/overrides/GObject.py:493: Warning: ../../../gobject/gsignal.c:2772: instance '0x460ff90' has no handler with id '113342181'
  return func(*args, **kwargs)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions