Don't load deleted printers
This commit is contained in:
parent
b522a47dbe
commit
caa79ddff0
2 changed files with 8 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue