From f1c2a74aed81171c41456bbf49b9c76bc15a20b7 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 25 Jan 2017 20:11:53 -0800 Subject: [PATCH] Add write protection alert on save load #750 --- PKHeX.WinForms/MainWindow/Main.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index cc0d8dd62..7d157e5ff 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -868,8 +868,7 @@ namespace PKHeX.WinForms WinFormsUtil.Error("Your platform does not support the required cryptography components.", "In order to be able to save your changes, you must either upgrade to a newer version of Windows or disable FIPS compliance mode."); // 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(); }