From e29316197cd546bc102a1eba2eba783e1301db66 Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Sat, 3 Apr 2021 08:13:37 -0700 Subject: [PATCH] show printer name when reporting an error --- .../ApplicationView/ApplicationController.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index caf54c252..19ce3e53e 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -987,16 +987,17 @@ namespace MatterHackers.MatterControl { if (line != null) { - string message = "Your printer is reporting a HARDWARE ERROR and has been paused. Check the error and cancel the print if required.".Localize() - + "\n" - + "\n" - + "Error Reported".Localize() + ":" - + $" \"{line}\"."; - if (sender is PrinterConnection printerConnection) { + string message = "Your printer is reporting a HARDWARE ERROR and has been paused. Check the error and cancel the print if required.".Localize() + + "\n" + + "\n" + + "Error Reported".Localize() + ":" + + $" \"{line}\"."; + UiThread.RunOnIdle(() => { + var prinerName = printerConnection.Printer.Settings.GetValue(SettingsKey.printer_name); var messageBox = new StyledMessageBox.MessageBoxPage((clickedOk) => { if (clickedOk && printerConnection.Paused) @@ -1005,7 +1006,7 @@ namespace MatterHackers.MatterControl } }, message, - "Printer Hardware Error".Localize(), + prinerName + " is reporting a Hardware Error".Localize(), StyledMessageBox.MessageType.YES_NO, null, 400,