Commit d5bbc7dd authored by sumpfralle's avatar sumpfralle

display the current "speed limits" unit

explain the "unit" setting in the preferences window


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@241 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 089fa23d
...@@ -416,6 +416,7 @@ class ProjectGui: ...@@ -416,6 +416,7 @@ class ProjectGui:
# unit control (mm/inch) # unit control (mm/inch)
unit_field = self.gui.get_object("unit_control") unit_field = self.gui.get_object("unit_control")
unit_field.connect("changed", self.update_view) unit_field.connect("changed", self.update_view)
unit_field.connect("changed", self.update_unit_labels)
def set_unit(text): def set_unit(text):
unit_field.set_active((text == "mm") and 0 or 1) unit_field.set_active((text == "mm") and 0 or 1)
self.settings.add_item("unit", unit_field.get_active_text, set_unit) self.settings.add_item("unit", unit_field.get_active_text, set_unit)
...@@ -608,6 +609,7 @@ class ProjectGui: ...@@ -608,6 +609,7 @@ class ProjectGui:
self.disable_invalid_toolpath_settings() self.disable_invalid_toolpath_settings()
self.load_processing_settings() self.load_processing_settings()
self.update_save_actions() self.update_save_actions()
self.update_unit_labels()
if not self.no_dialog: if not self.no_dialog:
self.window.show() self.window.show()
...@@ -755,6 +757,14 @@ class ProjectGui: ...@@ -755,6 +757,14 @@ class ProjectGui:
GuiCommon.transform_model(self.model, value) GuiCommon.transform_model(self.model, value)
self.update_view() self.update_view()
def update_unit_labels(self, widget=None, data=None):
# we can't just use the "unit" setting, since we need the plural of "inch"
if self.settings.get("unit") == "mm":
base_unit = "mm"
else:
base_unit = "inches"
self.gui.get_object("SpeedLimitsUnitValue").set_text("%s/minute" % base_unit)
def get_filename_with_suffix(self, filename, type_filter): def get_filename_with_suffix(self, filename, type_filter):
# use the first extension provided by the filter as the default # use the first extension provided by the filter as the default
filter_ext = type_filter[1] filter_ext = type_filter[1]
......
This diff is collapsed.
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