screen: preload most used panels

This commit is contained in:
alfrix authored and Alfredo Monclus committed 2023-08-18 11:48:37 -03:00
1 parent 168e75059a
commit 7dbe11e0b5
1 file changed
+6
+6
View File
@@ -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):