Skip to content

Commit 411d862

Browse files
committed
pncconf -fix recording of touchy preferences
refactoring code error
1 parent 6068ac0 commit 411d862

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/emc/usr_intf/pncconf/data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def save(self,basedir):
10211021
templist = {"touchyabscolor":"abs_textcolor","touchyrelcolor":"rel_textcolor",
10221022
"touchydtgcolor":"dtg_textcolor","touchyerrcolor":"err_textcolor"}
10231023
for key,value in templist.items():
1024-
prefs.putpref(value, self[key], str)
1024+
_APP.set_touchy_preference(value, self[key], str)
10251025
if self.touchyposition[0] or self.touchysize[0]:
10261026
pos = size = ""
10271027
if self.touchyposition[0]:
@@ -1030,9 +1030,9 @@ def save(self,basedir):
10301030
size = "%dx%d"% (self.touchysize[1],self.touchysize[2])
10311031
geo = "%s%s"%(size,pos)
10321032
else: geo = "default"
1033-
prefs.putpref('window_geometry',geo, str)
1034-
prefs.putpref('gtk_theme',self.touchytheme, str)
1035-
prefs.putpref('window_force_max', self.touchyforcemax, bool)
1033+
_APP.set_touchy_preference('window_geometry',geo, str)
1034+
_APP.set_touchy_preference('gtk_theme',self.touchytheme, str)
1035+
_APP.set_touchy_preference('window_force_max', self.touchyforcemax, bool)
10361036

10371037
# write AXIS rc file for geometry
10381038
if self.frontend == _PD._AXIS and (self.axisposition[0] or self.axissize[0] or self.axisforcemax):

src/emc/usr_intf/pncconf/pncconf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,9 @@ def read_touchy_preferences(self):
18091809
self.widgets[key+"button"].set_color(gdk.color_parse(data))
18101810
self.widgets.touchyforcemax.set_active(bool(prefs.getpref('window_force_max')))
18111811

1812+
def set_touchy_preference(self, value, default, type):
1813+
prefs.getpref(value, default, type)
1814+
18121815
def get_installed_themes(self):
18131816
data1 = self.d.gladevcptheme
18141817
data2 = prefs.getpref('gtk_theme', 'Follow System Theme', str)

0 commit comments

Comments
 (0)