Move string contents for UI to view model

This commit is contained in:
Matt Nadareski
2024-05-21 20:57:57 -04:00
parent 51b14874c7
commit 26daa46486
4 changed files with 15 additions and 12 deletions

View File

@@ -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)

View File

@@ -9,10 +9,6 @@ namespace MPF.Core.Data
/// </summary>
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];

View File

@@ -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;

View File

@@ -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
/// <summary>
/// Generic constructor
/// </summary>
@@ -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;