Merge pull request #4128 from larsbrubaker/master

Adding Tyler's printer name confirmation code to delete printer
This commit is contained in:
johnlewin 2018-12-29 12:31:43 -08:00 committed by GitHub
commit 19a9520be9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View file

@ -143,22 +143,22 @@ namespace MatterHackers.MatterControl.PrintLibrary
var deleteMenuItem = menu.CreateMenuItem("Delete".Localize());
deleteMenuItem.Click += (s2, e2) =>
{
if (treeView.SelectedNode.Tag is PrinterInfo printerInfo)
{
// Delete printer
StyledMessageBox.ShowMessageBox(
(deletePrinter) =>
(deletePrinter) =>
{
if (deletePrinter)
{
if (deletePrinter)
{
if (treeView.SelectedNode.Tag is PrinterInfo printerInfo)
{
ProfileManager.Instance.DeletePrinter(printerInfo.ID);
}
}
},
"Are you sure you want to delete your currently selected printer?".Localize(),
"Delete Printer?".Localize(),
StyledMessageBox.MessageType.YES_NO,
"Delete Printer".Localize());
ProfileManager.Instance.DeletePrinter(printerInfo.ID);
}
},
"Are you sure you want to delete printer '{0}'?".Localize().FormatWith(printerInfo.Name),
"Delete Printer?".Localize(),
StyledMessageBox.MessageType.YES_NO,
"Delete Printer".Localize());
}
};

View file

@ -394,7 +394,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
ProfileManager.Instance.DeletePrinter(printer.Settings.ID);
}
},
"Are you sure you want to delete your currently selected printer?".Localize(),
"Are you sure you want to delete printer '{0}'?".Localize().FormatWith(printer.Settings.GetValue(SettingsKey.printer_name)),
"Delete Printer?".Localize(),
StyledMessageBox.MessageType.YES_NO,
"Delete Printer".Localize());

@ -1 +1 @@
Subproject commit 90d7436006c9b52bcdae38cb1d8714d976a90e5e
Subproject commit f41ca0ff7c45c6d8a397565ca62ba97927075c45