From ff5bc464ab9350e7b63331a18229a655fd011320 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 4 Feb 2020 13:25:50 -0800 Subject: [PATCH] Non-dumping commands shouldn't cause issues --- DICUI.Library/Utilities/ChefParameters.cs | 16 +++++++++++ DICUI.Library/Utilities/CreatorParameters.cs | 29 ++++++++++++++++++++ DICUI.Library/Utilities/DumpEnvironment.cs | 4 +-- DICUI/Windows/MainWindow.xaml.cs | 18 +++++++++++- 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/DICUI.Library/Utilities/ChefParameters.cs b/DICUI.Library/Utilities/ChefParameters.cs index 1ab8fd9c..7f23b3ec 100644 --- a/DICUI.Library/Utilities/ChefParameters.cs +++ b/DICUI.Library/Utilities/ChefParameters.cs @@ -783,6 +783,22 @@ namespace DICUI.Utilities return string.Join(" ", parameters); } + /// + /// Gets if the current command is considered a dumping command or not + /// + /// True if it's a dumping command, false otherwise + public bool IsDumpingCommand() + { + switch (Command) + { + case ChefCommand.MediaDump: + return true; + + default: + return false; + } + } + /// /// Returns if the current Parameter object is valid /// diff --git a/DICUI.Library/Utilities/CreatorParameters.cs b/DICUI.Library/Utilities/CreatorParameters.cs index 25cb6d0d..2be7cc4a 100644 --- a/DICUI.Library/Utilities/CreatorParameters.cs +++ b/DICUI.Library/Utilities/CreatorParameters.cs @@ -616,6 +616,35 @@ namespace DICUI.Utilities return string.Join(" ", parameters); } + /// + /// Gets if the current command is considered a dumping command or not + /// + /// True if it's a dumping command, false otherwise + public bool IsDumpingCommand() + { + switch (Command) + { + case CreatorCommand.Audio: + case CreatorCommand.BluRay: + case CreatorCommand.CompactDisc: + case CreatorCommand.Data: + case CreatorCommand.DigitalVideoDisc: + case CreatorCommand.Disk: + case CreatorCommand.Floppy: + case CreatorCommand.GDROM: + case CreatorCommand.SACD: + case CreatorCommand.Swap: + case CreatorCommand.XBOX: + case CreatorCommand.XBOXSwap: + case CreatorCommand.XGD2Swap: + case CreatorCommand.XGD3Swap: + return true; + + default: + return false; + } + } + /// /// Returns if the current Parameter object is valid /// diff --git a/DICUI.Library/Utilities/DumpEnvironment.cs b/DICUI.Library/Utilities/DumpEnvironment.cs index 933627ae..c28ba18b 100644 --- a/DICUI.Library/Utilities/DumpEnvironment.cs +++ b/DICUI.Library/Utilities/DumpEnvironment.cs @@ -419,9 +419,9 @@ namespace DICUI.Utilities } /// - /// Execute a complete dump workflow + /// Execute the initial invocation of the dumping programs /// - public async Task StartDumping(IProgress progress) + public async Task Run(IProgress progress) { Result result = IsValidForDump(); diff --git a/DICUI/Windows/MainWindow.xaml.cs b/DICUI/Windows/MainWindow.xaml.cs index 5725f84a..3b09ab06 100644 --- a/DICUI/Windows/MainWindow.xaml.cs +++ b/DICUI/Windows/MainWindow.xaml.cs @@ -550,7 +550,23 @@ namespace DICUI.Windows var progress = new Progress(); progress.ProgressChanged += ProgressUpdated; - Result result = await _env.StartDumping(progress); + Result result = await _env.Run(progress); + + // If we didn't execute a dumping command we cannot get submission output + bool isDumpingCommand = false; + if (_env.UseChef) + isDumpingCommand = _env.ChefParameters.IsDumpingCommand(); + else + isDumpingCommand = _env.CreatorParameters.IsDumpingCommand(); + + if (!isDumpingCommand) + { + ViewModels.LoggerViewModel.VerboseLogLn("No dumping command was run, submission information will not be gathered."); + StatusLabel.Content = "Execution complete!"; + StartStopButton.Content = Constants.StartDumping; + CopyProtectScanButton.IsEnabled = true; + return; + } if (result) {