Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmoccapy duplicated settings #3181

Open
wants to merge 3 commits into
base: 2.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/python/gladevcp/offsetpage.glade
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</columns>
<data>
<row>
<col id="0" translatable="yes">Tool</col>
<col id="0">Tool</col>
<col id="1">0</col>
<col id="2">0</col>
<col id="3">0</col>
Expand Down Expand Up @@ -71,7 +71,7 @@
<col id="14">G5x</col>
</row>
<row>
<col id="0" translatable="yes">Rot</col>
<col id="0">Rot</col>
<col id="1">0</col>
<col id="2">0</col>
<col id="3">0</col>
Expand Down
15 changes: 7 additions & 8 deletions src/emc/usr_intf/gmoccapy/gmoccapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
system_name = "system_name_{0}".format(system)
name = self.prefs.getpref(system_name, system, str)
default_names = self.widgets.offsetpage1.get_names()
for system, name in default_names:
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)

Expand Down Expand Up @@ -2328,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()

Expand Down Expand Up @@ -4409,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()
Expand Down
Loading