summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Morley <chrisinnanaimo@hotmail.com>2014-01-04 23:06:17 -0800
committerChris Morley <chrisinnanaimo@hotmail.com>2014-01-04 23:06:17 -0800
commit1ad20eb7b98db93f1de53ce992fb147a70e728fc (patch)
treee0790460ab2bf90a80dcd2e1d1e570127df144b4
parent9edbd19ad1899de042b5a26d521b48a724d01605 (diff)
downloadlinuxcnc-1ad20eb7b98db93f1de53ce992fb147a70e728fc.tar.gz
linuxcnc-1ad20eb7b98db93f1de53ce992fb147a70e728fc.zip
gscreen -fix early setting of states from preference file
dro_units, dro_absolute and toolsetting style were set from the preference file outside of the usual preference file function call, so could not be overridden from a skin properly. eg with an missing preference file, dro_units would be set false so any checks later of the preference file, would see that it is false. Gmoccapy wants this True as default and could not do so. Now by adding code to initialize_preferences() in the skins handler file, the skin can have any default they want.
-rwxr-xr-xsrc/emc/usr_intf/gscreen/gscreen.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/emc/usr_intf/gscreen/gscreen.py b/src/emc/usr_intf/gscreen/gscreen.py
index 94abc9d8e..6570beeb5 100755
--- a/src/emc/usr_intf/gscreen/gscreen.py
+++ b/src/emc/usr_intf/gscreen/gscreen.py
@@ -676,23 +676,6 @@ class Gscreen:
# see if the user specified a tool editor
self.data.varfile = self.inifile.find("RS274NGC","PARAMETER_FILE")
- # toolsetting reference type
- if self.prefs.getpref('toolsetting_fixture', False):
- self.g10l11 = 1
- else:
- self.g10l11 = 0
-
- # set the display options from preference file
- if self.prefs.getpref('dro_is_metric', False):
- self.status.dro_mm(0)
- else:
- self.status.dro_inch(0)
-
- if self.prefs.getpref('dro_actual', False):
- self.status.dro_actual(0)
- else:
- self.status.dro_commanded(0)
-
if "initialize_keybindings" in dir(self.handler_instance):
self.handler_instance.initialize_keybindings()
else:
@@ -774,6 +757,10 @@ class Gscreen:
self.data.diameter_mode = self.prefs.getpref('diameter_mode', False, bool)
self.data.display_order = self.prefs.getpref('display_order', (0,1,2), repr)
self.data.dro_units = self.prefs.getpref('dro_is_metric', False, bool)
+ if self.data.dro_units: # set linuxcnc as well
+ self.status.dro_mm(0)
+ else:
+ self.status.dro_inch(0)
self.data.error_sound = self.prefs.getpref('audio_error', self.data.error_sound, str)
self.data.error_font_name = self.prefs.getpref('error_font', 'Sans Bold 10', str)
self.data.err_textcolor = self.prefs.getpref('err_textcolor', 'default', str)
@@ -784,6 +771,19 @@ class Gscreen:
self.data.spindle_start_rpm = self.prefs.getpref('spindle_start_rpm', 300 , float)
self.data.unlock_code = self.prefs.getpref('unlock_code', '123', str)
self.data.embedded_keyboard = self.prefs.getpref('embedded_keyboard', True, bool)
+ if self.prefs.getpref('dro_actual', False, bool):
+ self.status.dro_actual(0)
+ else:
+ self.status.dro_commanded(0)
+ # toolsetting reference type
+ if self.prefs.getpref('toolsetting_fixture', False, bool):
+ self.g10l11 = 1
+ else:
+ self.g10l11 = 0
+
+
+
+
# initialize default widgets
def initialize_widgets(self):