diff --git a/CHANGELIST.md b/CHANGELIST.md index 0ed0ac9c..5c4b3547 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -6,6 +6,7 @@ - Set media type visibility when options changed - Change label with media type visibility - Update media type visibility on system change +- Return full result from dump checks ### 3.4.0 (2025-09-25) diff --git a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs index b1f04d9e..1b461cc6 100644 --- a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs +++ b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs @@ -393,13 +393,13 @@ namespace MPF.Frontend.ViewModels /// Performs MPF.Check functionality /// /// An error message if failed, otherwise string.Empty/null - public async Task CheckDump(ProcessUserInfoDelegate processUserInfo) + public async Task CheckDump(ProcessUserInfoDelegate processUserInfo) { if (string.IsNullOrEmpty(InputPath)) - return "Invalid Input path"; + return ResultEventArgs.Failure("Invalid Input path"); if (!File.Exists(InputPath!.Trim('"'))) - return "Input Path is not a valid file"; + return ResultEventArgs.Failure("Input Path is not a valid file"); // Disable UI while Check is running DisableUIElements(); @@ -431,7 +431,7 @@ namespace MPF.Frontend.ViewModels if (cachedCanExecuteSelectionChanged) EnableEventHandlers(); - return result.Message; + return result; } /// diff --git a/MPF.UI/Windows/CheckDumpWindow.xaml.cs b/MPF.UI/Windows/CheckDumpWindow.xaml.cs index 915aafa0..c396ce32 100644 --- a/MPF.UI/Windows/CheckDumpWindow.xaml.cs +++ b/MPF.UI/Windows/CheckDumpWindow.xaml.cs @@ -158,8 +158,8 @@ namespace MPF.UI.Windows /// private async void OnCheckDumpClick(object sender, EventArgs e) { - string? errorMessage = await CheckDumpViewModel.CheckDump(ShowMediaInformationWindow); - if (string.IsNullOrEmpty(errorMessage)) + var result = await CheckDumpViewModel.CheckDump(ShowMediaInformationWindow); + if (result) { bool? checkAgain = DisplayUserMessage("Check Complete", "The dump has been processed successfully! Would you like to check another dump?", 2, false); if (checkAgain == false) @@ -169,7 +169,8 @@ namespace MPF.UI.Windows } else { - DisplayUserMessage("Check Failed", errorMessage!, 1, false); + string? message = result.Message ?? "Please check all files exist and try again!"; + DisplayUserMessage("Check Failed", message, 1, false); } }