Splash_screen: show full error message (#389)

* Splash_screen: show full error messge

* Fix splash not changing from connecting to error
This commit is contained in:
Alfredo Monclus 2022-01-03 03:29:49 -03:00 committed by GitHub
parent 9d3a6c7538
commit 9449f24b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 5 deletions

View File

@ -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":

View File

@ -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)

View File

@ -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):