This commit is contained in:
alfrix 2022-11-03 22:20:03 -03:00
parent 2fc01c07b6
commit 7ee162092c
2 changed files with 58 additions and 55 deletions

View File

@ -117,6 +117,7 @@ class BasePanel(ScreenPanel):
return return
def show_heaters(self, show=True): def show_heaters(self, show=True):
try:
for child in self.control['temp_box'].get_children(): for child in self.control['temp_box'].get_children():
self.control['temp_box'].remove(child) self.control['temp_box'].remove(child)
if not show or self._screen.printer.get_temp_store_devices() is None: if not show or self._screen.printer.get_temp_store_devices() is None:
@ -179,6 +180,8 @@ class BasePanel(ScreenPanel):
self.control['temp_box'].add(self.labels[f"{device}_box"]) self.control['temp_box'].add(self.labels[f"{device}_box"])
n += 1 n += 1
self.control['temp_box'].show_all() self.control['temp_box'].show_all()
except Exception as e:
logging.debug(f"Couldn't create heaters box: {e}")
def get_icon(self, device, img_size): def get_icon(self, device, img_size):
if device.startswith("extruder"): if device.startswith("extruder"):

View File

@ -440,7 +440,7 @@ class JobStatusPanel(ScreenPanel):
if self.filename != "none": if self.filename != "none":
self._screen._ws.klippy.print_start(self.filename) self._screen._ws.klippy.print_start(self.filename)
self.new_print() self.new_print()
GLib.timeout_add_seconds(5, self.enable_button("restart")) GLib.timeout_add_seconds(5, self.enable_button, "restart")
def resume(self, widget): def resume(self, widget):
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel") self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
@ -497,7 +497,7 @@ class JobStatusPanel(ScreenPanel):
if self.state not in ["printing", "paused", "cancelling"]: if self.state not in ["printing", "paused", "cancelling"]:
self._screen.printer_ready() self._screen.printer_ready()
self._printer.change_state("ready") self._printer.change_state("ready")
GLib.timeout_add_seconds(5, self.enable_button("menu")) GLib.timeout_add_seconds(5, self.enable_button, "menu")
return False return False