Added code to handle scenario where user switches to a printer profile that has been deleted from disk. Instead of loading an our default settings we download the missing profile instead.
This commit is contained in:
parent
543a5a0c4f
commit
e5644b0e88
1 changed files with 11 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue