Don't load deleted printers

This commit is contained in:
Lars Brubaker 2016-09-28 16:29:11 -07:00
parent b522a47dbe
commit caa79ddff0
2 changed files with 8 additions and 3 deletions

View file

@ -322,7 +322,7 @@ namespace MatterHackers.MatterControl.ActionBar
if (!PrinterConnectionAndCommunication.Instance.PrinterIsConnected
&& PrinterConnectionAndCommunication.Instance.CommunicationState != PrinterConnectionAndCommunication.CommunicationStates.AttemptingToConnect)
{
if (ProfileManager.Instance.Profiles.Count() == 0)
if (!ProfileManager.Instance.ActiveProfiles.Any())
{
this.activePrintButtons.Add(addPrinterButton);
}
@ -338,6 +338,7 @@ namespace MatterHackers.MatterControl.ActionBar
this.activePrintButtons.Add(selectPrinterButton);
}
}
ShowActiveButtons();
EnableActiveButtons();
}

View file

@ -247,8 +247,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
public static PrinterSettings LoadWithoutRecovery(string profileID)
{
string profilePath = Instance[profileID]?.ProfilePath;
if (profilePath != null && File.Exists(profilePath))
var printerInfo = Instance[profileID];
string profilePath = printerInfo?.ProfilePath;
if (profilePath != null
&& File.Exists(profilePath)
&& !printerInfo.MarkedForDelete)
{
try
{