From c017a0f8169d4c6d159443c088acce3c362d7a8d Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Sat, 16 Nov 2024 00:04:58 +0100 Subject: [PATCH 1/3] offsetpage-widget: don't translate column 0 Backgrund: This value is used to compose the setting name in the gmoccapy pref file - so translating this will give a new setting for every language. --- lib/python/gladevcp/offsetpage.glade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/gladevcp/offsetpage.glade b/lib/python/gladevcp/offsetpage.glade index 03d4204e118..339ad5f636d 100644 --- a/lib/python/gladevcp/offsetpage.glade +++ b/lib/python/gladevcp/offsetpage.glade @@ -37,7 +37,7 @@ - Tool + Tool 0 0 0 @@ -71,7 +71,7 @@ G5x - Rot + Rot 0 0 0 From 5793a0bfe91261dd4bde709b986d485b5841bc1a Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Sat, 16 Nov 2024 00:08:27 +0100 Subject: [PATCH 2/3] gmoccapy: get offset names directly from offsetpage-widget This allows to use the proper default values defined in the offsetpage.glade file if no gmoccapy preference file is given. --- src/emc/usr_intf/gmoccapy/gmoccapy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 6f8e07b16e6..7fe28102ff4 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -2203,12 +2203,11 @@ def _init_offsetpage(self): self.widgets.offsetpage1.set_font("sans 12") self.widgets.offsetpage1.set_foreground_color(self._get_RGBA_color("#28D0D9")) self.widgets.offsetpage1.selection_mask = ("Tool", "G5x", "Rot") - systemlist = ["Tool", "G5x", "Rot", "G92", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", - "G59.2", "G59.3"] names = [] - for system in systemlist: + default_names = self.widgets.offsetpage1.get_names() + for system, name in default_names: system_name = "system_name_{0}".format(system) - name = self.prefs.getpref(system_name, system, str) + name = self.prefs.getpref(system_name, name, str) names.append([system, name]) self.widgets.offsetpage1.set_names(names) From 4accaa44c8a52321e5ac108505ed2ee224ef5178 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Sat, 16 Nov 2024 00:14:01 +0100 Subject: [PATCH 3/3] gmoccapy: ensure usage of lowercase for settings in pref file --- src/emc/usr_intf/gmoccapy/gmoccapy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 7fe28102ff4..467115794d5 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -1960,7 +1960,7 @@ def _init_themes(self): except: pass temp = 0 - theme_name = self.prefs.getpref("Gtk_theme", "Follow System Theme", str) + theme_name = self.prefs.getpref("gtk_theme", "Follow System Theme", str) for index, theme in enumerate(themes): model.append((theme,)) if theme == theme_name: @@ -2206,7 +2206,7 @@ def _init_offsetpage(self): names = [] default_names = self.widgets.offsetpage1.get_names() for system, name in default_names: - system_name = "system_name_{0}".format(system) + system_name = "system_name_{0}".format(system).lower() name = self.prefs.getpref(system_name, name, str) names.append([system, name]) self.widgets.offsetpage1.set_names(names) @@ -2327,7 +2327,7 @@ def _show_offset_tab(self, state): else: names = self.widgets.offsetpage1.get_names() for system, name in names: - system_name = "system_name_{0}".format(system) + system_name = "system_name_{0}".format(system).lower() self.prefs.putpref(system_name, name) page.hide() @@ -4408,7 +4408,7 @@ def on_theme_choice_changed(self, widget): if active is None: return theme = widget.get_model()[active][0] - self.prefs.putpref('Gtk_theme', theme) + self.prefs.putpref("gtk_theme", theme) if theme == "Follow System Theme": theme = self.default_theme settings = Gtk.Settings.get_default()