base_panel: Updates to macro shortcut

This commit is contained in:
Jordan
2021-09-11 09:15:47 -04:00
parent 517a6afab8
commit 407d8ad000
2 changed files with 3 additions and 7 deletions

View File

@@ -71,11 +71,6 @@ class BasePanel(ScreenPanel):
if len(self._config.get_printers()) > 1:
self.control_grid.remove(self.control_grid.get_child_at(0,2))
self.control_grid.attach(self.control['printer_select'], 0, 2, 1, 1)
# If there's only one printer, show the macros shortcut if enabled. Otherwise, wait until the printer has
# been selected to show
elif self._config.get_main_config_option('side_macro_shortcut') == "True":
self.control_grid.remove(self.control_grid.get_child_at(0,self.locations['macro_shortcut']))
self.control_grid.attach(self.control['macro_shortcut'], 0, self.locations['macro_shortcut'], 1, 1)
self.control_grid.attach(self.control['estop'], 0, 4, 1, 1)
try:
@@ -225,7 +220,6 @@ class BasePanel(ScreenPanel):
self.control_grid.remove(self.control['space%s' % self.locations['macro_shortcut']])
self.control_grid.attach(self.control['macro_shortcut'], 0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = True
self._screen.show_all()
elif show != True and self.buttons_showing['macros_shortcut'] == True:
if ('space%s' % self.locations['macro_shortcut']) not in self.control:
self.control['space%s' % self.locations['macro_shortcut']] = Gtk.Label("")
@@ -240,7 +234,7 @@ class BasePanel(ScreenPanel):
self.control_grid.attach(self.control['space%s' % self.locations['macro_shortcut']],
0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = False
self._screen.show_all()
self._screen.show_all()
def set_title(self, title):
try:

View File

@@ -589,6 +589,7 @@ class KlipperScreen(Gtk.Window):
_ = self.lang.gettext
logging.debug("### Going to disconnected")
self.base_panel.show_macro_shortcut(False)
self.printer_initializing(_("Klipper has disconnected"))
for panel in list(self.panels):
@@ -602,6 +603,7 @@ class KlipperScreen(Gtk.Window):
return
_ = self.lang.gettext
self.base_panel.show_macro_shortcut(False)
msg = self.printer.get_stat("webhooks","state_message")
if "FIRMWARE_RESTART" in msg:
self.printer_initializing(