Add mechanism to DialogPage to start and show SetupWizards
- Remove special behavior in each SetupWizard for showing Dialogs - Move initialization code in old Start method into constructors
This commit is contained in:
parent
843b353bbb
commit
bae0bf9020
10 changed files with 63 additions and 76 deletions
|
|
@ -48,19 +48,10 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
: base(printer)
|
||||
{
|
||||
this.WindowTitle = $"{ApplicationController.Instance.ProductName} - " + "Unload Filament Wizard".Localize();
|
||||
this.extruderIndex = extruderIndex;
|
||||
|
||||
pages = this.GetPages();
|
||||
pages.MoveNext();
|
||||
|
||||
this.extruderIndex = extruderIndex;
|
||||
}
|
||||
|
||||
public static void Start(PrinterConfig printer, ThemeConfig theme, int extruderIndex)
|
||||
{
|
||||
// turn off print leveling
|
||||
var unloadWizard = new UnloadFilamentWizard(printer, extruderIndex);
|
||||
|
||||
DialogWindow.Show(unloadWizard.CurrentPage);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
|
|
@ -239,7 +230,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
|
|||
loadFilamentButton.Click += (s, e) =>
|
||||
{
|
||||
loadFilamentButton.Parents<SystemWindow>().First().Close();
|
||||
LoadFilamentWizard.Start(printer, theme, extruderIndex, false);
|
||||
|
||||
DialogWindow.Show(
|
||||
new LoadFilamentWizard(printer, extruderIndex, showAlreadyLoadedButton: false));
|
||||
};
|
||||
theme.ApplyPrimaryActionStyle(loadFilamentButton);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue