diff --git a/CHANGELIST.md b/CHANGELIST.md index 735e6f37..23530043 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -36,6 +36,7 @@ - Remove another redundant GetFullFile - Clean up usings after moving methods - Remove Chime +- Move string contents for UI to view model ### 3.1.9a (2024-05-21) diff --git a/MPF.Core/Data/Constants.cs b/MPF.Core/Data/Constants.cs index 7a556bab..7d603ade 100644 --- a/MPF.Core/Data/Constants.cs +++ b/MPF.Core/Data/Constants.cs @@ -9,10 +9,6 @@ namespace MPF.Core.Data /// public static class Interface { - // Button values - public const string StartDumping = "Start Dumping"; - public const string StopDumping = "Stop Dumping"; - // Byte arrays for signatures public static readonly byte[] SaturnSectorZeroStart = [0x53, 0x45, 0x47, 0x41, 0x20, 0x53, 0x45, 0x47, 0x41, 0x53, 0x41, 0x54, 0x55, 0x52, 0x4E, 0x20]; diff --git a/MPF.Core/Data/Drive.cs b/MPF.Core/Data/Drive.cs index 54b848f9..473b2ebe 100644 --- a/MPF.Core/Data/Drive.cs +++ b/MPF.Core/Data/Drive.cs @@ -57,7 +57,7 @@ namespace MPF.Core.Data #region Constants - private const string DiscNotDetected = "Disc Not Detected"; + private const string DiscNotDetectedValue = "Disc Not Detected"; #endregion @@ -72,7 +72,7 @@ namespace MPF.Core.Data { get { - string? volumeLabel = DiscNotDetected; + string? volumeLabel = DiscNotDetectedValue; if (!this.MarkedActive) return volumeLabel; diff --git a/MPF.Core/UI/ViewModels/MainViewModel.cs b/MPF.Core/UI/ViewModels/MainViewModel.cs index 3c884001..fdc0ebc9 100644 --- a/MPF.Core/UI/ViewModels/MainViewModel.cs +++ b/MPF.Core/UI/ViewModels/MainViewModel.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using BinaryObjectScanner; using MPF.Core.Converters; using MPF.Core.Data; -using MPF.Core.ExecutionContexts; using MPF.Core.UI.ComboBoxItems; using MPF.Core.Utilities; using SabreTools.RedumpLib.Data; @@ -517,6 +516,13 @@ namespace MPF.Core.UI.ViewModels #endregion + #region Constants + + private const string StartDumpingValue = "Start Dumping"; + public const string StopDumpingValue = "Stop Dumping"; + + #endregion + /// /// Generic constructor /// @@ -544,7 +550,7 @@ namespace MPF.Core.UI.ViewModels DriveLetterComboBoxEnabled = true; DumpingProgramComboBoxEnabled = true; StartStopButtonEnabled = true; - StartStopButtonText = Interface.StartDumping; + StartStopButtonText = StartDumpingValue; MediaScanButtonEnabled = true; EnableParametersCheckBoxEnabled = true; LogPanelExpanded = _options.OpenLogWindowAtStartup; @@ -940,11 +946,11 @@ namespace MPF.Core.UI.ViewModels public async void ToggleStartStop() { // Dump or stop the dump - if (this.StartStopButtonText as string == Interface.StartDumping) + if (this.StartStopButtonText as string == StartDumpingValue) { StartDumping(); } - else if (this.StartStopButtonText as string == Interface.StopDumping) + else if (this.StartStopButtonText as string == StopDumpingValue) { VerboseLogLn("Canceling dumping process..."); _environment?.CancelDumping(); @@ -1286,7 +1292,7 @@ namespace MPF.Core.UI.ViewModels DriveSpeedComboBoxEnabled = false; DumpingProgramComboBoxEnabled = false; EnableParametersCheckBoxEnabled = false; - StartStopButtonText = Interface.StopDumping; + StartStopButtonText = StopDumpingValue; MediaScanButtonEnabled = false; UpdateVolumeLabelEnabled = false; CopyProtectScanButtonEnabled = false; @@ -1308,7 +1314,7 @@ namespace MPF.Core.UI.ViewModels DriveSpeedComboBoxEnabled = true; DumpingProgramComboBoxEnabled = true; EnableParametersCheckBoxEnabled = true; - StartStopButtonText = Interface.StartDumping; + StartStopButtonText = StartDumpingValue; MediaScanButtonEnabled = true; UpdateVolumeLabelEnabled = true; CopyProtectScanButtonEnabled = true;