DownloadPrinterProfile should return an instance of PrinterSettings

- Persistence of profile moves to caller
 - Rename to GetPrinterProfileAsync
 - Expose PrinterSettings.Save for use in external assemblies
 - Issue MatterHackers/MCCentral#227,  MatterHackers/MCCentral#242
This commit is contained in:
John Lewin 2016-07-28 09:38:03 -07:00
parent 48518f4314
commit 43e94f6ed4
4 changed files with 22 additions and 17 deletions

View file

@ -45,13 +45,16 @@ namespace MatterHackers.MatterControl.SetupWizard
var activeProfile = ProfileManager.Instance.ActiveProfile;
// Download the specified json profile
await ApplicationController.GetPrinterProfile(activeProfile, profileToken);
var jsonProfile = await ApplicationController.GetPrinterProfileAsync(activeProfile, profileToken);
if (jsonProfile != null)
{
// Persist downloaded profile
jsonProfile.Save();
// TODO: handle errors...
// Update the active instance to the newly downloaded item
var jsonProfile = ProfileManager.LoadProfile(activeProfile.ID, false);
ActiveSliceSettings.RefreshActiveInstance(jsonProfile);
// Update active instance without calling ReloadAll
ActiveSliceSettings.RefreshActiveInstance(jsonProfile);
}
UiThread.RunOnIdle(WizardWindow.Close);
}
};