Implement 'Reset to defaults' for printer settings

This commit is contained in:
John Lewin 2016-06-09 07:59:25 -07:00
parent 992e20f347
commit 433de0c20b

View file

@ -122,6 +122,22 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
private bool RestoreAllSettingsMenu_Click()
{
string warningMessage = "Resetting to default values will remove your current overrides and restore your original printer settings.\r\nAre you sure you want to continue?";
StyledMessageBox.ShowMessageBox(
revertSettings =>
{
if (revertSettings)
{
// TODO: We should offer to export the settings before the purge
ActiveSliceSettings.Instance.UserLayer.Clear();
ActiveSliceSettings.Instance.SaveChanges();
ApplicationController.Instance.ReloadAdvancedControlsPanel();
}
},
warningMessage.Localize(),
"Revert Settings".Localize(),
StyledMessageBox.MessageType.YES_NO);
return true;
}
@ -132,7 +148,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
{ "Import".Localize(), ImportSettingsMenu_Click },
{ "Export".Localize(), ExportSettingsMenu_Click },
{ "Restore All".Localize(), RestoreAllSettingsMenu_Click },
{ "Reset to defaults".Localize(), RestoreAllSettingsMenu_Click },
};
//Add the menu items to the menu itself