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]
......
...@@ -924,15 +924,6 @@ ...@@ -924,15 +924,6 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">3</property> <property name="spacing">3</property>
<child>
<object class="GtkHSeparator" id="hseparator8">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="hbox9"> <object class="GtkHBox" id="hbox9">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -1011,7 +1002,7 @@ ...@@ -1011,7 +1002,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">1</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1020,7 +1011,7 @@ ...@@ -1020,7 +1011,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1031,7 +1022,7 @@ ...@@ -1031,7 +1022,7 @@
</object> </object>
<packing> <packing>
<property name="padding">7</property> <property name="padding">7</property>
<property name="position">3</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1177,6 +1168,7 @@ ...@@ -1177,6 +1168,7 @@
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1194,6 +1186,7 @@ ...@@ -1194,6 +1186,7 @@
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -1231,17 +1224,24 @@ ...@@ -1231,17 +1224,24 @@
<child> <child>
<object class="GtkAlignment" id="alignment19"> <object class="GtkAlignment" id="alignment19">
<property name="visible">True</property> <property name="visible">True</property>
<property name="top_padding">3</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkTable" id="table5"> <object class="GtkTable" id="table5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">3</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="column_spacing">4</property>
<property name="row_spacing">2</property>
<child> <child>
<object class="GtkLabel" id="FeedrateLabel"> <object class="GtkLabel" id="FeedrateLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Feedrate:</property> <property name="label" translatable="yes">Feedrate:</property>
</object> </object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
...@@ -1249,8 +1249,8 @@ ...@@ -1249,8 +1249,8 @@
<property name="label" translatable="yes">Speed:</property> <property name="label" translatable="yes">Speed:</property>
</object> </object>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">2</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">3</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1264,6 +1264,8 @@ ...@@ -1264,6 +1264,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1277,8 +1279,25 @@ ...@@ -1277,8 +1279,25 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property> <property name="top_attach">2</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="SpeedLimitsUnitLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Unit:</property>
</object>
</child>
<child>
<object class="GtkLabel" id="SpeedLimitsUnitValue">
<property name="visible">True</property>
<property name="tooltip_markup">Change the unit in the &lt;i&gt;Preferences&lt;/i&gt; window</property>
<property name="label" translatable="yes">inches/minute</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -1299,7 +1318,7 @@ ...@@ -1299,7 +1318,7 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="position">4</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1308,7 +1327,7 @@ ...@@ -1308,7 +1327,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">5</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1319,7 +1338,7 @@ ...@@ -1319,7 +1338,7 @@
</object> </object>
<packing> <packing>
<property name="padding">7</property> <property name="padding">7</property>
<property name="position">6</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1584,7 +1603,6 @@ ...@@ -1584,7 +1603,6 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
...@@ -1746,13 +1764,12 @@ ...@@ -1746,13 +1764,12 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property>
<property name="position">4</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="position">7</property> <property name="position">6</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1761,7 +1778,7 @@ ...@@ -1761,7 +1778,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">8</property> <property name="position">7</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -1773,7 +1790,7 @@ ...@@ -1773,7 +1790,7 @@
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">9</property> <property name="position">8</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -2522,7 +2539,7 @@ ...@@ -2522,7 +2539,7 @@
<object class="GtkLabel" id="UnitLabel"> <object class="GtkLabel" id="UnitLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Unit:</property> <property name="label" translatable="yes">Unit (for all dimensions):</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
......
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