Skip to content

Commit a4e2586

Browse files
committed
gmoccapy: add setting to disable calculator in toolpage
1 parent 1bdb6dd commit a4e2586

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

src/emc/usr_intf/gmoccapy/gmoccapy.glade

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,55 @@ uncomment selection</property>
39823982
<property name="position">1</property>
39833983
</packing>
39843984
</child>
3985+
<child>
3986+
<object class="GtkFrame" id="frm_use_calc">
3987+
<property name="visible">True</property>
3988+
<property name="can-focus">False</property>
3989+
<property name="label-xalign">0.5</property>
3990+
<child>
3991+
<object class="GtkBox" id="vbox_use_calc">
3992+
<property name="visible">True</property>
3993+
<property name="can-focus">False</property>
3994+
<property name="margin-start">3</property>
3995+
<property name="margin-end">3</property>
3996+
<property name="margin-top">5</property>
3997+
<property name="margin-bottom">5</property>
3998+
<property name="orientation">vertical</property>
3999+
<child>
4000+
<object class="GtkCheckButton" id="chk_tooltable_use_calc">
4001+
<property name="label" translatable="yes">Use calculator for tool table</property>
4002+
<property name="use-action-appearance">True</property>
4003+
<property name="visible">True</property>
4004+
<property name="can-focus">True</property>
4005+
<property name="receives-default">False</property>
4006+
<property name="tooltip-text" translatable="yes">Open the calculator as pop-up when editing numerical values in the tool table</property>
4007+
<property name="active">True</property>
4008+
<property name="draw-indicator">True</property>
4009+
<signal name="toggled" handler="on_chk_toolpage_use_calc_toggled" swapped="no"/>
4010+
</object>
4011+
<packing>
4012+
<property name="expand">False</property>
4013+
<property name="fill">True</property>
4014+
<property name="position">0</property>
4015+
</packing>
4016+
</child>
4017+
</object>
4018+
</child>
4019+
<child type="label">
4020+
<object class="GtkLabel" id="lbl_frm_use_calc">
4021+
<property name="visible">True</property>
4022+
<property name="can-focus">False</property>
4023+
<property name="label" translatable="yes">&lt;b&gt;Calculator&lt;/b&gt;</property>
4024+
<property name="use-markup">True</property>
4025+
</object>
4026+
</child>
4027+
</object>
4028+
<packing>
4029+
<property name="expand">False</property>
4030+
<property name="fill">True</property>
4031+
<property name="position">2</property>
4032+
</packing>
4033+
</child>
39854034
<child>
39864035
<object class="GtkFrame" id="frm_ntb_preview">
39874036
<property name="visible">True</property>
@@ -4043,7 +4092,7 @@ uncomment selection</property>
40434092
<packing>
40444093
<property name="expand">False</property>
40454094
<property name="fill">False</property>
4046-
<property name="position">2</property>
4095+
<property name="position">3</property>
40474096
</packing>
40484097
</child>
40494098
</object>

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ def __init__(self, argv):
222222
self.incr_rbt_list = [] # we use this list to add hal pin to the button later
223223
self.jog_increments = [] # This holds the increment values
224224
self.unlock = False # this value will be set using the hal pin unlock settings
225-
self.toolpage_use_calc = True # enable/disable calculator widget to edit numeric values in the tool editor
226225

227226
# needed to display the labels
228227
self.system_list = ("0", "G54", "G55", "G56", "G57", "G58", "G59", "G59.1", "G59.2", "G59.3")
@@ -654,6 +653,10 @@ def _get_pref_data(self):
654653
jog_box_width = self.prefs.getpref("jog_box_width", 360, int)
655654
self.widgets.adj_jog_box_width.set_value(jog_box_width)
656655
self.widgets.vbx_jog.set_size_request(jog_box_width, -1)
656+
657+
# enable/disable calculator widget to edit numeric values in the tool editor
658+
self.toolpage_use_calc = self.prefs.getpref("toolpage_use_calc", True, bool)
659+
self.widgets.chk_tooltable_use_calc.set_active(self.toolpage_use_calc)
657660

658661
###############################################################################
659662
## create widgets dynamically ##
@@ -5002,6 +5005,10 @@ def on_chk_use_kb_on_mdi_toggled(self, widget, data=None):
50025005

50035006
def on_chk_use_kb_on_file_selection_toggled(self, widget, data=None):
50045007
self.prefs.putpref("show_keyboard_on_file_selection", widget.get_active())
5008+
5009+
def on_chk_toolpage_use_calc_toggled(self, widget, data=None):
5010+
self.toolpage_use_calc = widget.get_active()
5011+
self.prefs.putpref("toolpage_use_calc", self.toolpage_use_calc)
50055012

50065013
def on_chk_use_kb_shortcuts_toggled(self, widget, data=None):
50075014
self.prefs.putpref("use_keyboard_shortcuts", widget.get_active())

0 commit comments

Comments
 (0)