Wait for async printer load before copying part bed plate

- Issue MatterHackers/MCCentral#4478
When we open a printer from the select menu after clicking print
on a design tab, we don't get the part on the bed
This commit is contained in:
John Lewin 2018-11-03 00:20:03 -07:00
parent 7c25f6aa0b
commit 05966c7e56
3 changed files with 59 additions and 24 deletions

View file

@ -700,15 +700,17 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// If no active printer but profiles exist, show select printer
UiThread.RunOnIdle(() =>
{
var window = DialogWindow.Show(new SelectPrinterPage("Next".Localize()));
window.Closed += (s2, e2) =>
{
if (ApplicationController.Instance.ActivePrinter is PrinterConfig activePrinter
&& activePrinter.Settings.PrinterSelected)
{
CopyPlateToPrinter(sceneContext, activePrinter);
}
};
DialogWindow.Show(
new SelectPrinterPage(
"Next".Localize(),
(loadedPrinter) =>
{
if (loadedPrinter is PrinterConfig activePrinter
&& activePrinter.Settings.PrinterSelected)
{
CopyPlateToPrinter(sceneContext, activePrinter);
}
}));
});
}
}