Reloading settings doesn't work right

This commit is contained in:
Evan Dixon 2017-03-02 09:37:54 -06:00
parent 0946b00075
commit beed20cfdf

View file

@ -167,8 +167,22 @@ namespace PKHeX.WinForms
// Delete the settings if they exist // Delete the settings if they exist
var settingsFilename = (e.InnerException as ConfigurationErrorsException)?.Filename; var settingsFilename = (e.InnerException as ConfigurationErrorsException)?.Filename;
if (File.Exists(settingsFilename)) if (File.Exists(settingsFilename))
{
if (MessageBox.Show("PKHeX's settings are corrupt. Would you like to reset the settings? (Click Yes to delete the settings or No to close the program.", "PKHeX", MessageBoxButtons.YesNo) == DialogResult.Yes)
{ {
File.Delete(settingsFilename); File.Delete(settingsFilename);
// This should theoretically work, but has failed in evandixon's testing
// Properties.Settings.Default.Reload();
// Instead, restart the application
MessageBox.Show("The settings have been deleted. Please restart PKHeX.");
Process.GetCurrentProcess().Kill();
}
else
{
Process.GetCurrentProcess().Kill();
}
} }
else else
{ {