Convert EditLevelingSettingsWindow to DialogPage

- Issue MatterHackers/MCCentral#2759
Edit Leveling Settings window should use DialogPage for consistency
This commit is contained in:
John Lewin 2018-02-01 23:09:53 -08:00
parent ca646b91d0
commit c6d5605893
3 changed files with 21 additions and 102 deletions

View file

@ -13,7 +13,6 @@ namespace MatterHackers.MatterControl.PrinterControls
public class CalibrationControls : FlowLayoutWidget
{
private EventHandler unregisterEvents;
private EditLevelingSettingsWindow editLevelingSettingsWindow;
private GuiWidget runPrintLevelingButton;
private TextImageButtonFactory buttonFactory;
@ -94,7 +93,10 @@ namespace MatterHackers.MatterControl.PrinterControls
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, IconColor.Theme), theme);
editButton.Click += (s, e) =>
{
widget.EditOptions();
UiThread.RunOnIdle(() =>
{
DialogWindow.Show(new EditLevelingSettingsPage(printer));
});
};
return new SectionWidget(
@ -110,25 +112,6 @@ namespace MatterHackers.MatterControl.PrinterControls
base.OnClosed(e);
}
private void EditOptions()
{
UiThread.RunOnIdle(() =>
{
if (editLevelingSettingsWindow == null)
{
editLevelingSettingsWindow = new EditLevelingSettingsWindow(printer.Settings);
editLevelingSettingsWindow.Closed += (s, e) =>
{
editLevelingSettingsWindow = null;
};
}
else
{
editLevelingSettingsWindow.BringToFront();
}
});
}
private void PrinterStatusChanged(object sender, EventArgs e)
{
SetVisibleControls();