From 4fa1273111d4e5dd5085994bac82582996ea0c7c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 18 Jul 2025 13:15:40 -0400 Subject: [PATCH] Remove media type from Check Dump UI --- CHANGELIST.md | 4 + MPF.Frontend/ViewModels/CheckDumpViewModel.cs | 89 +------------------ MPF.UI/Windows/CheckDumpWindow.xaml | 5 +- MPF.UI/Windows/CheckDumpWindow.xaml.cs | 11 --- 4 files changed, 7 insertions(+), 102 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 89ccdb6e..322a8d22 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -1,3 +1,7 @@ +### WIP (xxxx-xx-xx) + +- Remove media type from Check Dump UI + ### 3.3.3 (2025-07-18) - Handle layers for PS3CFW diff --git a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs index ee38965b..66273f6c 100644 --- a/MPF.Frontend/ViewModels/CheckDumpViewModel.cs +++ b/MPF.Frontend/ViewModels/CheckDumpViewModel.cs @@ -66,34 +66,6 @@ namespace MPF.Frontend.ViewModels } private bool _systemTypeComboBoxEnabled; - /// - /// Currently selected media type value - /// - public MediaType? CurrentMediaType - { - get => _currentMediaType; - set - { - _currentMediaType = value; - TriggerPropertyChanged(nameof(CurrentMediaType)); - } - } - private MediaType? _currentMediaType; - - /// - /// Indicates the status of the media type combo box - /// - public bool MediaTypeComboBoxEnabled - { - get => _mediaTypeComboBoxEnabled; - set - { - _mediaTypeComboBoxEnabled = value; - TriggerPropertyChanged(nameof(MediaTypeComboBoxEnabled)); - } - } - private bool _mediaTypeComboBoxEnabled; - /// /// Currently provided input path /// @@ -229,20 +201,6 @@ namespace MPF.Frontend.ViewModels #region List Properties - /// - /// Current list of supported media types - /// - public List>? MediaTypes - { - get => _mediaTypes; - set - { - _mediaTypes = value; - TriggerPropertyChanged(nameof(MediaTypes)); - } - } - private List>? _mediaTypes; - /// /// Current list of supported system profiles /// @@ -287,16 +245,13 @@ namespace MPF.Frontend.ViewModels SystemTypeComboBoxEnabled = true; InputPathTextBoxEnabled = true; InputPathBrowseButtonEnabled = true; - MediaTypeComboBoxEnabled = true; DumpingProgramComboBoxEnabled = true; CheckDumpButtonEnabled = false; CancelButtonEnabled = true; - MediaTypes = []; Systems = RedumpSystemComboBoxItem.GenerateElements(); InternalPrograms = []; - PopulateMediaType(); PopulateInternalPrograms(); EnableEventHandlers(); } @@ -327,15 +282,6 @@ namespace MPF.Frontend.ViewModels /// Change the currently selected system /// public void ChangeSystem() - { - PopulateMediaType(); - CheckDumpButtonEnabled = ShouldEnableCheckDumpButton(); - } - - /// - /// Change the currently selected media type - /// - public void ChangeMediaType() { CheckDumpButtonEnabled = ShouldEnableCheckDumpButton(); } @@ -369,7 +315,6 @@ namespace MPF.Frontend.ViewModels InputPathTextBoxEnabled = true; InputPathBrowseButtonEnabled = true; DumpingProgramComboBoxEnabled = true; - PopulateMediaType(); CheckDumpButtonEnabled = ShouldEnableCheckDumpButton(); CancelButtonEnabled = true; } @@ -382,7 +327,6 @@ namespace MPF.Frontend.ViewModels SystemTypeComboBoxEnabled = false; InputPathTextBoxEnabled = false; InputPathBrowseButtonEnabled = false; - MediaTypeComboBoxEnabled = false; DumpingProgramComboBoxEnabled = false; CheckDumpButtonEnabled = false; CancelButtonEnabled = false; @@ -392,35 +336,6 @@ namespace MPF.Frontend.ViewModels #region Population - /// - /// Populate media type according to system type - /// - private void PopulateMediaType() - { - // Disable other UI updates - bool cachedCanExecuteSelectionChanged = CanExecuteSelectionChanged; - DisableEventHandlers(); - - if (CurrentSystem != null) - { - var mediaTypeValues = CurrentSystem.MediaTypes(); - int index = mediaTypeValues.FindIndex(m => m == CurrentMediaType); - - MediaTypes = mediaTypeValues.ConvertAll(m => new Element(m ?? MediaType.NONE)); - MediaTypeComboBoxEnabled = MediaTypes.Count > 1; - CurrentMediaType = (index > -1 ? MediaTypes[index] : MediaTypes[0]); - } - else - { - MediaTypeComboBoxEnabled = false; - MediaTypes = null; - CurrentMediaType = null; - } - - // Reenable event handlers, if necessary - if (cachedCanExecuteSelectionChanged) EnableEventHandlers(); - } - /// /// Populate media type according to system type /// @@ -451,7 +366,7 @@ namespace MPF.Frontend.ViewModels private bool ShouldEnableCheckDumpButton() { - return CurrentSystem != null && CurrentMediaType != null && !string.IsNullOrEmpty(InputPath); + return CurrentSystem != null && !string.IsNullOrEmpty(InputPath); } /// @@ -507,7 +422,7 @@ namespace MPF.Frontend.ViewModels // Finally, attempt to do the output dance var result = await env.VerifyAndSaveDumpOutput( - mediaType: CurrentMediaType, + mediaType: null, resultProgress: resultProgress, protectionProgress: protectionProgress, processUserInfo: processUserInfo); diff --git a/MPF.UI/Windows/CheckDumpWindow.xaml b/MPF.UI/Windows/CheckDumpWindow.xaml index 5606d2af..c5a1250d 100644 --- a/MPF.UI/Windows/CheckDumpWindow.xaml +++ b/MPF.UI/Windows/CheckDumpWindow.xaml @@ -85,7 +85,7 @@