Make sure we still auto connect

issue: MatterHackers/MCCentral#4601
Make AutoConnect work with new multiple open printer tabs
This commit is contained in:
Lars Brubaker 2018-11-16 16:00:22 -08:00
parent 469a92fab9
commit cfdf796d92

View file

@ -1698,22 +1698,6 @@ namespace MatterHackers.MatterControl
}
}
if (this.ActivePrinter is PrinterConfig printer
&& printer.Settings.PrinterSelected
&& printer.Settings.GetValue<bool>(SettingsKey.auto_connect))
{
ApplicationController.StartupTasks.Add(new ApplicationController.StartupTask()
{
Title = "Auto Connect".Localize(),
Priority = 100,
Action = (progress, cancellationToken) =>
{
printer.Connection.Connect();
return Task.CompletedTask;
}
});
}
if (AssetObject3D.AssetManager == null)
{
AssetObject3D.AssetManager = new AssetManager();
@ -1806,6 +1790,12 @@ namespace MatterHackers.MatterControl
this.OnOpenPrintersChanged(new OpenPrintersChangedEventArgs(printer, OpenPrintersChangedEventArgs.OperationType.Add));
if (printer.Settings.PrinterSelected
&& printer.Settings.GetValue<bool>(SettingsKey.auto_connect))
{
printer.Connection.Connect();
}
return printer;
}