Commit 18733865 authored by sumpfralle's avatar sumpfralle

prevent the "enable_ode" setting from being overridden when it is not available


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@286 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 4dd43c97
...@@ -507,13 +507,11 @@ class ProjectGui: ...@@ -507,13 +507,11 @@ class ProjectGui:
("show_dimensions", "ShowDimensionsCheckBox"), ("show_dimensions", "ShowDimensionsCheckBox"),
("show_bounding_box", "ShowBoundingCheckBox"), ("show_bounding_box", "ShowBoundingCheckBox"),
("show_toolpath", "ShowToolPathCheckBox"), ("show_toolpath", "ShowToolPathCheckBox"),
("show_drill_progress", "ShowDrillProgressCheckBox"), ("show_drill_progress", "ShowDrillProgressCheckBox")):
("enable_ode", "SettingEnableODE")):
obj = self.gui.get_object(objname) obj = self.gui.get_object(objname)
self.settings.add_item(name, obj.get_active, obj.set_active) self.settings.add_item(name, obj.get_active, obj.set_active)
# all of the objects above should trigger redraw # all of the objects above should trigger redraw
if name != "enable_ode": obj.connect("toggled", self.update_view)
obj.connect("toggled", self.update_view)
for name, objname in ( for name, objname in (
("view_light", "OpenGLLight"), ("view_light", "OpenGLLight"),
("view_shadow", "OpenGLShadow"), ("view_shadow", "OpenGLShadow"),
...@@ -544,14 +542,14 @@ class ProjectGui: ...@@ -544,14 +542,14 @@ class ProjectGui:
obj.connect("color-set", self.update_view) obj.connect("color-set", self.update_view)
# set the availability of ODE # set the availability of ODE
if ode_objects.is_ode_available(): if ode_objects.is_ode_available():
self.settings.set("enable_ode", True) obj = self.gui.get_object("SettingEnableODE")
self.gui.get_object("SettingEnableODE").set_sensitive(True) self.settings.add_item("enable_ode", obj.get_active, obj.set_active)
self.gui.get_object("MaterialAllowanceControl").set_sensitive(True)
else: else:
self.settings.set("enable_ode", False)
self.gui.get_object("SettingEnableODE").set_sensitive(False) self.gui.get_object("SettingEnableODE").set_sensitive(False)
# TODO: remove this as soon as non-ODE toolpath generation respects material allowance # TODO: remove this as soon as non-ODE toolpath generation respects material allowance
self.gui.get_object("MaterialAllowanceControl").set_sensitive(False) self.gui.get_object("MaterialAllowanceControl").set_sensitive(False)
# bind dummy get/set functions to "enable_ode" (always return False)
self.settings.add_item("enable_ode", lambda: False, lambda state: None)
skip_obj = self.gui.get_object("DrillProgressFrameSkipControl") skip_obj = self.gui.get_object("DrillProgressFrameSkipControl")
self.settings.add_item("drill_progress_max_fps", skip_obj.get_value, skip_obj.set_value) self.settings.add_item("drill_progress_max_fps", skip_obj.get_value, skip_obj.set_value)
# drill settings # drill settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment