From 2fef5660cb78bdcd1ce83b6ab44d1e538c25b4c5 Mon Sep 17 00:00:00 2001 From: alfrix Date: Fri, 4 Nov 2022 10:17:51 -0300 Subject: [PATCH] base_panel: change how it shows controls and heaters to avoid issues --- panels/base_panel.py | 2 +- panels/job_status.py | 1 + panels/main_menu.py | 1 + screen.py | 16 +++++++--------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/panels/base_panel.py b/panels/base_panel.py index 5efe8245..09ac0ee4 100644 --- a/panels/base_panel.py +++ b/panels/base_panel.py @@ -24,7 +24,7 @@ class BasePanel(ScreenPanel): 'back': not back, 'macros_shortcut': False, 'printer_select': False, - 'estop': True, + 'estop': False, } self.current_extruder = None # Action bar buttons diff --git a/panels/job_status.py b/panels/job_status.py index 8ed3be12..aac5a87d 100644 --- a/panels/job_status.py +++ b/panels/job_status.py @@ -365,6 +365,7 @@ class JobStatusPanel(ScreenPanel): self.create_status_grid() if self.vel_timeout is None: self.vel_timeout = GLib.timeout_add_seconds(1, self.update_velocity) + self._screen.base_panel_show_all() def deactivate(self): if self.vel_timeout is not None: diff --git a/panels/main_menu.py b/panels/main_menu.py index 420fcccf..6f08a3e2 100644 --- a/panels/main_menu.py +++ b/panels/main_menu.py @@ -74,6 +74,7 @@ class MainPanel(MenuPanel): # This has a high impact on load self.graph_update = GLib.timeout_add_seconds(5, self.update_graph) self.update_graph_visibility() + self._screen.base_panel_show_all() def deactivate(self): if self.graph_update: diff --git a/screen.py b/screen.py index eaa6909f..1da32f17 100644 --- a/screen.py +++ b/screen.py @@ -162,8 +162,6 @@ class KlipperScreen(Gtk.Window): while len(self.printer_select_callbacks) > 0: i = self.printer_select_callbacks.pop(0) i() - if self.printer.get_state() not in ["disconnected", "error", "startup", "shutdown"]: - self.base_panel.show_heaters(True) self.base_panel.show_printer_select(True) return @@ -784,10 +782,6 @@ class KlipperScreen(Gtk.Window): self.printer_select_callbacks = [self.state_ready] return - self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True)) - self.base_panel.show_heaters(True) - self.base_panel.show_estop(True) - # Do not return to main menu if completing a job, timeouts/user input will return if "job_status" in self._cur_panels or "main_menu" in self._cur_panels: return @@ -1037,10 +1031,16 @@ class KlipperScreen(Gtk.Window): self.panels['splash_screen'].update_text(msg) return False + def base_panel_show_all(self): + self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True)) + self.base_panel.show_heaters(True) + self.base_panel.show_estop(True) + def printer_ready(self): self.close_popup_message() self.show_panel('main_panel', "main_menu", None, 2, items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count()) + self.base_panel_show_all() self.ws_subscribe() if "job_status" in self.panels: self.remove_subscription("job_status") @@ -1049,9 +1049,7 @@ class KlipperScreen(Gtk.Window): def printer_printing(self): self.close_popup_message() self.show_panel('job_status', "job_status", _("Printing"), 2) - self.base_panel.show_heaters(True) - self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True)) - self.base_panel.show_estop(True) + self.base_panel_show_all() for dialog in self.dialogs: dialog.destroy()