diff --git a/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs b/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs index e88d66d7d..eb3e6f09b 100644 --- a/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs +++ b/MatterControlLib/ControlElements/StyledMessageBoxWindow.cs @@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project. */ using System; +using Markdig.Agg; using MatterHackers.Agg.Font; using MatterHackers.Agg.UI; using MatterHackers.Localizations; @@ -58,7 +59,7 @@ namespace MatterHackers.MatterControl private class MessageBoxPage : DialogPage { private string unwrappedMessage; - private TextWidget messageContainer; + private MarkdownWidget messageContainer; private Action responseCallback; bool haveResponded = false; @@ -78,10 +79,9 @@ namespace MatterHackers.MatterControl responseCallback = callback; unwrappedMessage = message; - contentRow.AddChild(messageContainer = new TextWidget(message, textColor: theme.TextColor, pointSize: 12 * DeviceScale) + contentRow.AddChild(messageContainer = new MarkdownWidget(theme) { - AutoExpandBoundsToText = true, - HAnchor = HAnchor.Left + Markdown = message, }); if (extraWidgetsToAdd != null) diff --git a/MatterControlLib/PrinterCommunication/PrinterConnection.cs b/MatterControlLib/PrinterCommunication/PrinterConnection.cs index b2d3d426a..d88701381 100644 --- a/MatterControlLib/PrinterCommunication/PrinterConnection.cs +++ b/MatterControlLib/PrinterCommunication/PrinterConnection.cs @@ -39,7 +39,9 @@ using System.Threading; using System.Threading.Tasks; using MatterControl.Printing; using MatterHackers.Agg; +using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; +using MatterHackers.Localizations; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrinterCommunication.Io; using MatterHackers.MatterControl.PrintQueue; @@ -971,6 +973,36 @@ namespace MatterHackers.MatterControl.PrinterCommunication OnConnectionFailed(ConnectionFailure.UnsupportedBaudRate); } + catch (IOException e) + { + TerminalLog.WriteLine("Exception:" + e.Message); + OnConnectionFailed(ConnectionFailure.IOException); + if (AggContext.OperatingSystem == OSType.X11 && e.Message == "Permission denied") + { + UiThread.RunOnIdle(() => + { + string message = @"In order for MatterControl to access the serial ports on Linux, you will need to give your user account the appropriate permissions. Run these commands in a terminal to add yourself to the correct group. + +Ubuntu/Debian +-------------- + +``` +# sudo gpasswd -a $USER dialout +``` + +Arch +---- + +``` +# sudo gpasswd -a $USER uucp +# sudo gpasswd -a $USER lock +``` + +You will then need to logout and log back in to the computer for the changes to take effect. "; + StyledMessageBox.ShowMessageBox(message, "Permission Denied".Localize()); + }); + } + } catch (Exception ex) { TerminalLog.WriteLine("Exception:" + ex.Message);