diff --git a/ControlElements/AttentionGetter.cs b/ControlElements/AttentionGetter.cs index 8760565b8..00c4e2e62 100644 --- a/ControlElements/AttentionGetter.cs +++ b/ControlElements/AttentionGetter.cs @@ -32,6 +32,7 @@ using MatterHackers.Agg.UI; using MatterHackers.GuiAutomation; using MatterHackers.Localizations; using MatterHackers.MatterControl.PrinterCommunication; +using MatterHackers.MatterControl.SlicerConfiguration; using System; using System.Collections.Generic; using System.Diagnostics; @@ -62,38 +63,30 @@ namespace MatterHackers.MatterControl { if (PrinterConnectionAndCommunication.Instance?.ActivePrinter?.ID != null) { - if (!runingNavigation) + Task.Run(() => { - runingNavigation = true; - Task.Run(() => + UiThread.RunOnIdle(() => { - AutomationRunner testRunner = new AutomationRunner(inputType: AutomationRunner.InputType.Simulated, drawSimulatedMouse: false); - testRunner.TimeToMoveMouse = 0; - testRunner.UpDelaySeconds = 0; + WizardWindow.Show("EditSettings", "Edit Printer Settings"); - UiThread.RunOnIdle(() => + EventHandler unregisterEvents = null; + ActiveSliceSettings.ActivePrinterChanged.RegisterEvent((s,e) => { - WizardWindow.Show("EditSettings", "Edit Printer Settings"); - }); - - testRunner.Wait(.5); - - if (widgetNameToHighlight.Contains(",")) - { - foreach (string item in widgetNameToHighlight.Split(',')) + WizardWindow openWindowInternal = WizardWindow.GetSystemWindow("EditSettings"); + if(openWindowInternal != null) { - HighlightWidget(testRunner, item); + UiThread.RunOnIdle(() => openWindowInternal.Close()); } - } - else - { - HighlightWidget(testRunner, widgetNameToHighlight); - } + }, ref unregisterEvents); + + WizardWindow openWindow = WizardWindow.GetSystemWindow("EditSettings"); + openWindow.Closed += (s2, e2) => + { + UiThread.RunOnIdle(() => unregisterEvents?.Invoke(s2, null)); + }; - testRunner.Dispose(); - runingNavigation = false; }); - } + }); } } diff --git a/SetupWizard/WizardWindow.cs b/SetupWizard/WizardWindow.cs index c21b4baf1..2defddabc 100644 --- a/SetupWizard/WizardWindow.cs +++ b/SetupWizard/WizardWindow.cs @@ -51,6 +51,28 @@ namespace MatterHackers.MatterControl this.MinimumSize = new Vector2(350 * GuiWidget.DeviceScale, 400 * GuiWidget.DeviceScale); } + public static void Close(string uri) + { + WizardWindow existingWindow; + + if (allWindows.TryGetValue(uri, out existingWindow)) + { + existingWindow.Close(); + } + } + + public static WizardWindow GetSystemWindow(string uri) + { + WizardWindow existingWindow; + + if (allWindows.TryGetValue(uri, out existingWindow)) + { + return existingWindow; + } + + return null; + } + public static void Show(string uri, string title) where PanelType : WizardPage, new() { WizardWindow existingWindow; diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index a748385f1..1dbecb120 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -4957,3 +4957,6 @@ Translated:Enable Fan If Layer Print Time Is Below English:Hz Translated:Hz +English:Current Settings +Translated:Current Settings +