From 9449f24b5f36656ffefb2f4b83fb0acd2c395da1 Mon Sep 17 00:00:00 2001 From: Alfredo Monclus Date: Mon, 3 Jan 2022 03:29:49 -0300 Subject: [PATCH] Splash_screen: show full error message (#389) * Splash_screen: show full error messge * Fix splash not changing from connecting to error --- ks_includes/printer.py | 4 ++-- panels/splash_screen.py | 14 ++++++++++++-- screen.py | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ks_includes/printer.py b/ks_includes/printer.py index fa22d919..5d424b0b 100644 --- a/ks_includes/printer.py +++ b/ks_includes/printer.py @@ -115,11 +115,11 @@ class Printer: def evaluate_state(self): wh_state = self.data['webhooks']['state'].lower() # possible values: startup, ready, shutdown, error - idle_state = self.data['idle_timeout']['state'].lower() # possible values: Idle, printing, ready - print_state = self.data['print_stats']['state'].lower() # possible values: complete, paused, printing, standby if wh_state == "ready": new_state = "ready" + print_state = self.data['print_stats']['state'].lower() # complete, paused, printing, standby + idle_state = self.data['idle_timeout']['state'].lower() # idle, printing, ready if print_state == "paused": new_state = "paused" elif idle_state == "printing": diff --git a/panels/splash_screen.py b/panels/splash_screen.py index b26a096e..61d3cc94 100644 --- a/panels/splash_screen.py +++ b/panels/splash_screen.py @@ -37,10 +37,20 @@ class SplashScreenPanel(ScreenPanel): self.labels['actions'].set_halign(Gtk.Align.CENTER) self.labels['actions'].set_homogeneous(True) + scroll = Gtk.ScrolledWindow() + scroll.set_property("overlay-scrolling", False) + scroll.set_hexpand(True) + scroll.set_vexpand(True) + scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) + scroll.add(self.labels['text']) + + info = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) + info.pack_start(image, False, True, 8) + info.pack_end(scroll, True, True, 8) + main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) - main.pack_start(image, True, True, 0) + main.pack_start(info, True, True, 8) main.pack_end(self.labels['actions'], False, False, 0) - main.pack_end(self.labels['text'], True, True, 0) self.content.add(main) diff --git a/screen.py b/screen.py index c5647819..1e525b84 100644 --- a/screen.py +++ b/screen.py @@ -689,14 +689,16 @@ class KlipperScreen(Gtk.Window): if "FIRMWARE_RESTART" in msg: self.printer_initializing( _("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.") + + "\n\n" + msg ) elif "micro-controller" in msg: self.printer_initializing( _("Klipper has encountered an error with the micro-controller.\nPlease recompile and flash.") + + "\n\n" + msg ) else: self.printer_initializing( - _("Klipper has encountered an error.") + _("Klipper has encountered an error.") + "\n\n" + msg ) for panel in list(self.panels):