Implement 'Reset to defaults' for printer settings
This commit is contained in:
parent
992e20f347
commit
433de0c20b
1 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue