mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Disable dumping button when Redumper selected with unsupported media type (#576)
* Disable dumping button when HDDVD + Redumper selected * Exclude Bluray+Redumper as well * Move program-supports-mediatype logic to helper function * Fix for net48 * Fix for net48 * Undo fixes for net48
This commit is contained in:
@@ -1583,6 +1583,35 @@ namespace MPF.Core.UI.ViewModels
|
||||
this.DriveSpeed = speed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns False if a given InternalProgram does not support a given MediaType
|
||||
/// </summary>
|
||||
public bool ProgramSupportsMedia(InternalProgram program, MediaType? media)
|
||||
{
|
||||
switch (program)
|
||||
{
|
||||
case InternalProgram.Redumper:
|
||||
switch (media)
|
||||
{
|
||||
case MediaType.HDDVD:
|
||||
return false;
|
||||
case MediaType.BluRay:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
case InternalProgram.Aaru:
|
||||
case InternalProgram.DiscImageCreator:
|
||||
switch (media)
|
||||
{
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the dumping button should be enabled
|
||||
/// </summary>
|
||||
@@ -1591,7 +1620,8 @@ namespace MPF.Core.UI.ViewModels
|
||||
return Drives != null
|
||||
&& Drives.Count > 0
|
||||
&& this.CurrentSystem != null
|
||||
&& this.CurrentMediaType != null;
|
||||
&& this.CurrentMediaType != null
|
||||
&& ProgramSupportsMedia(this.CurrentProgram, this.CurrentMediaType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user