Merge pull request #1147 from gregory-diaz/master

Added code to handle scenario where user switches to a printer profil…
This commit is contained in:
johnlewin 2016-07-20 15:39:44 -07:00 committed by GitHub
commit cced82136b

View file

@ -39,6 +39,7 @@ using System.Collections.Generic;
using MatterHackers.Agg.PlatformAbstract;
using MatterHackers.SerialPortCommunication.FrostedSerial;
using MatterHackers.Agg.UI;
using System.Threading.Tasks;
namespace MatterHackers.MatterControl.SlicerConfiguration
{
@ -153,12 +154,21 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
internal static void SwitchToProfile(string printerID)
internal static async Task SwitchToProfile(string printerID)
{
var profile = ProfileManager.LoadProfile(printerID);
ProfileManager.Instance.SetLastProfile(printerID);
if (profile == null)
{
var printerInfo = ProfileManager.Instance[printerID];
await ApplicationController.GetPrinterProfile(printerInfo, null);
profile = ProfileManager.LoadProfile(printerID);
}
Instance = profile ?? ProfileManager.LoadEmptyProfile();
}