Prevent user from adding a printer from file menu while print is active.
Previous pull request prevents user from adding a printer via printers... dropdown while print is active or paused . This commit achieves the same goal when users take the same action in the file menu.
This commit is contained in:
parent
13f8660214
commit
eb93687bd5
1 changed files with 16 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
return new List<MenuItemAction>
|
||||
{
|
||||
new MenuItemAction("Add Printer".Localize(), () => WizardWindow.ShowPrinterSetup(true)),
|
||||
new MenuItemAction("Add Printer".Localize(), AddPrinter_Click),
|
||||
new MenuItemAction("Import Printer".Localize(), ImportPrinter),
|
||||
new MenuItemAction("Add File To Queue".Localize(), importFile_Click),
|
||||
new MenuItemAction("Redeem Design Code".Localize(), () => RedeemDesignCode?.Invoke(this, null)),
|
||||
|
|
@ -71,6 +71,21 @@ namespace MatterHackers.MatterControl
|
|||
}
|
||||
}
|
||||
|
||||
private void AddPrinter_Click()
|
||||
{
|
||||
if (PrinterConnectionAndCommunication.Instance.PrinterIsPrinting
|
||||
|| PrinterConnectionAndCommunication.Instance.PrinterIsPaused)
|
||||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
StyledMessageBox.ShowMessageBox(null, "Please wait until the print has finished and try again.".Localize(), "Can't add printers while printing".Localize())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
WizardWindow.ShowPrinterSetup(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void importFile_Click()
|
||||
{
|
||||
FileDialog.OpenFileDialog(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue