Merge pull request #1115 from gregory-diaz/master

Added notification that lets users know that the profile they are try…
This commit is contained in:
Lars Brubaker 2016-07-18 14:42:16 -07:00 committed by GitHub
commit cc871edcb0

View file

@ -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;
}