From b051b2bf54ff2d87eca2cb668e720e5b59bb901e Mon Sep 17 00:00:00 2001 From: Matt Moening Date: Fri, 16 Sep 2016 13:11:48 -0700 Subject: [PATCH] Remove Run on Idle due too regression - Added Additional guard to saving profile --- ApplicationView/MainApplicationWidget.cs | 2 +- SlicerConfiguration/Settings/SettingsHelpers.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationView/MainApplicationWidget.cs b/ApplicationView/MainApplicationWidget.cs index dd8fe3a78..fb28b6cfc 100644 --- a/ApplicationView/MainApplicationWidget.cs +++ b/ApplicationView/MainApplicationWidget.cs @@ -549,7 +549,7 @@ namespace MatterHackers.MatterControl Load?.Invoke(this, null); // Pushing this after load fixes that empty printer list - UiThread.RunOnIdle(ApplicationController.Instance.UserChanged); + ApplicationController.Instance.UserChanged(); if (!System.IO.File.Exists(@"/storage/sdcard0/Download/LaunchTestPrint.stl")) { diff --git a/SlicerConfiguration/Settings/SettingsHelpers.cs b/SlicerConfiguration/Settings/SettingsHelpers.cs index 21296c54c..6ca06573d 100644 --- a/SlicerConfiguration/Settings/SettingsHelpers.cs +++ b/SlicerConfiguration/Settings/SettingsHelpers.cs @@ -472,7 +472,8 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.id = value; } - if (File.Exists(ProfilePath)) + // If the local file exists and the PrinterInfo has been added to ProfileManager, then it's safe to call profile.Save, otherwise... + if (File.Exists(ProfilePath) && ProfileManager.Instance[this.id] != null) { var profile = PrinterSettings.LoadFile(ProfilePath); profile.ID = value;