mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-14 16:10:36 -05:00
Merge pull request #834 from kwsch/b/settings-save
Fixed settings not saving when form closes
This commit is contained in:
commit
d20006805f
|
|
@ -3118,13 +3118,14 @@ private void dragoutDrop(object sender, DragEventArgs e)
|
|||
|
||||
private void Main_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (!SAV.Edited)
|
||||
if (SAV.Edited && DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Any unsaved changes will be lost.", "Are you sure you want to close PKHeX?"))
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
if (DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Any unsaved changes will be lost.", "Are you sure you want to close PKHeX?"))
|
||||
{ e.Cancel = true; return; }
|
||||
}
|
||||
|
||||
try { Properties.Settings.Default.Save(); }
|
||||
catch (Exception x) { File.WriteAllLines("config error.txt", new[] {x.ToString()}); }
|
||||
catch (Exception x) { File.WriteAllLines("config error.txt", new[] { x.ToString() }); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user