From 7dbe11e0b5a8b7619d014b8691ca4138056b67cb Mon Sep 17 00:00:00 2001 From: alfrix Date: Mon, 31 Jul 2023 23:54:04 -0300 Subject: [PATCH] screen: preload most used panels --- screen.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/screen.py b/screen.py index 0f6ae63f..2cca9b3d 100755 --- a/screen.py +++ b/screen.py @@ -256,6 +256,11 @@ class KlipperScreen(Gtk.Window): self._ws.klippy.object_subscription(requested_updates) + def preload(self): + logging.debug("Preloading panels") + for panel in ['move', 'temperature', 'extrude', 'job_status']: + self.panels[panel] = self._load_panel(panel).Panel(self, title='') + @staticmethod def _load_panel(panel): logging.debug(f"Loading panel: {panel}") @@ -881,6 +886,7 @@ class KlipperScreen(Gtk.Window): self.reinit_count = 0 self.initializing = False self.printer.process_update(data['result']['status']) + self.preload() return False def init_tempstore(self):