From c89a6ae8d5cc52c9499e5d7d960c65dfbb29afcd Mon Sep 17 00:00:00 2001 From: Greg Date: Mon, 18 Jul 2016 13:48:08 -0700 Subject: [PATCH] Added notification that lets users know that the profile they are trying to load is corrupt and that we have loaded a usable public profile instead. --- SlicerConfiguration/Settings/LayeredProfile.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SlicerConfiguration/Settings/LayeredProfile.cs b/SlicerConfiguration/Settings/LayeredProfile.cs index bf4a3528a..fb4bd40b9 100644 --- a/SlicerConfiguration/Settings/LayeredProfile.cs +++ b/SlicerConfiguration/Settings/LayeredProfile.cs @@ -38,6 +38,8 @@ using System.Text; using System.Collections.ObjectModel; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.SettingsManagement; +using MatterHackers.Agg.UI; +using MatterHackers.Localizations; namespace MatterHackers.MatterControl.SlicerConfiguration { @@ -235,7 +237,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - public static PrinterSettings RecoverProfile(string printerProfilePath) + + public static PrinterSettings RecoverProfile(string printerProfilePath) { string profileKey = Path.GetFileNameWithoutExtension(printerProfilePath); var profile = ProfileManager.Instance[profileKey]; @@ -251,6 +254,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration profileHelper.SetComPort(profile.ComPort); profileHelper.SaveChanges(); + UiThread.RunOnIdle(() => + { + StyledMessageBox.ShowMessageBox(null, "The profile you are attempting to load has been corrupted. We loaded a usable public profile for you instead.".Localize(), "Corrupted printer profile".Localize(), messageType: StyledMessageBox.MessageType.OK); + },1); + return oemProfile; }