Skip to content

Commit b60ba61

Browse files
committed
gmoccapy: fixed sensitizing of user tab button (#2111)
The user tabs button was disabled after toggling the "edit offsets" button. Also moved the functionalty from the lines 455-456 (which deactivate the user tab button If no EMBED_TABS are given) to _init_dynamic_tabs()
1 parent 2d562d3 commit b60ba61

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,6 @@ def __init__(self, argv):
452452
self.widgets.gcode_view.set_sensitive(False)
453453
self.widgets.ntb_user_tabs.remove_page(0)
454454

455-
if not self.get_ini_info.get_embedded_tabs()[2]:
456-
self.widgets.tbtn_user_tabs.set_sensitive(False)
457-
458455
# call the function to change the button status
459456
# so every thing is ready to start
460457
widgetlist = ["rbt_manual", "rbt_mdi", "rbt_auto", "btn_homing", "btn_touch", "btn_tool",
@@ -1698,6 +1695,8 @@ def _init_dynamic_tabs(self):
16981695

16991696
tab_names, tab_locations, tab_cmd = self.get_ini_info.get_embedded_tabs()
17001697
if not tab_names:
1698+
self.widgets.tbtn_user_tabs.set_sensitive( False )
1699+
self.user_tabs_enabled = False
17011700
print (_("**** GMOCCAPY INFO ****"))
17021701
print (_("**** Invalid embedded tab configuration ****"))
17031702
print (_("**** No tabs will be added! ****"))
@@ -1745,8 +1744,10 @@ def set_up_user_tab_widgets(self, tab_locations):
17451744
# if no ntb_user_tabs in location is given
17461745
if "ntb_user_tabs" in tab_locations:
17471746
self.widgets.tbtn_user_tabs.set_sensitive( True )
1747+
self.user_tabs_enabled = True
17481748
else:
17491749
self.widgets.tbtn_user_tabs.set_sensitive( False )
1750+
self.user_tabs_enabled = False
17501751

17511752
if "ntb_preview" in tab_locations:
17521753
self.widgets.ntb_preview.set_property( "show-tabs", True )
@@ -4018,7 +4019,7 @@ def on_tbtn_edit_offsets_toggled(self, widget, data=None):
40184019

40194020
widgetlist = ["ntb_jog", "rbt_mdi","rbt_auto","tbtn_setup"]
40204021

4021-
if self.widgets.tbtn_user_tabs.get_sensitive():
4022+
if self.user_tabs_enabled:
40224023
widgetlist.append("tbtn_user_tabs")
40234024
self._sensitize_widgets( widgetlist, not state )
40244025

0 commit comments

Comments
 (0)