Add write protection alert on save load

#750
This commit is contained in:
Kurt 2017-01-25 20:11:53 -08:00
parent 0d5694dc8e
commit f1c2a74aed

View file

@ -869,7 +869,6 @@ namespace PKHeX.WinForms
// Don't abort loading; user can still view save and fix checksum on another platform.
}
}
// Finish setting up the save file.
if (sav.IndeterminateGame && sav.Generation == 3)
{
@ -1203,6 +1202,14 @@ namespace PKHeX.WinForms
UndoStack.Clear(); Menu_Undo.Enabled = false;
RedoStack.Clear(); Menu_Redo.Enabled = false;
if (!string.IsNullOrWhiteSpace(path)) // Actual Save
{
// Check location write protection
if ((new DirectoryInfo(path).Attributes & FileAttributes.ReadOnly) != 0)
WinFormsUtil.Alert("Save file's location is write protected:\n" + path,
"If the path is a removable disk (SD card), please ensure the write protection switch is not set.");
}
// Indicate audibly the save is loaded
SystemSounds.Beep.Play();
}