mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Return full result from dump checks
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -393,13 +393,13 @@ namespace MPF.Frontend.ViewModels
|
||||
/// Performs MPF.Check functionality
|
||||
/// </summary>
|
||||
/// <returns>An error message if failed, otherwise string.Empty/null</returns>
|
||||
public async Task<string?> CheckDump(ProcessUserInfoDelegate processUserInfo)
|
||||
public async Task<ResultEventArgs> 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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -158,8 +158,8 @@ namespace MPF.UI.Windows
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user