Skip system detection on inactive drives (fixes #558)

This commit is contained in:
Matt Nadareski
2023-10-02 01:17:14 -04:00
parent c69afe69dd
commit 09afdf52fb
2 changed files with 9 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
- Fix XGD4 PIC reading
- Ensure popups are topmost
- Try out more UI functionality
- Skip system detection on inactive drives
### 2.6.5 (2023-09-27)

View File

@@ -940,7 +940,12 @@ namespace MPF.UI.Core.ViewModels
if (Drives == null || Drives.Count == 0 || this.Parent.DriveLetterComboBox.SelectedIndex == -1)
{
if (this.Options.VerboseLogging)
this.Logger.VerboseLog("Skipping system type detection because no valid drives found!");
this.Logger.VerboseLogLn("Skipping system type detection because no valid drives found!");
}
else if ((this.Parent.DriveLetterComboBox.SelectedItem as Drive)?.MarkedActive != true)
{
if (this.Options.VerboseLogging)
this.Logger.VerboseLogLn("Skipping system type detection because drive not marked as active!");
}
else if (!this.Options.SkipSystemDetection)
{
@@ -960,7 +965,7 @@ namespace MPF.UI.Core.ViewModels
{
var currentSystem = this.Options.DefaultSystem;
if (this.Options.VerboseLogging)
this.Logger.VerboseLog($"System detection disabled, setting to default of {currentSystem.LongName()}.");
this.Logger.VerboseLogLn($"System detection disabled, setting to default of {currentSystem.LongName()}.");
int sysIndex = Systems.FindIndex(s => s == currentSystem);
this.Parent.SystemTypeComboBox.SelectedIndex = sysIndex;
}
@@ -1120,7 +1125,7 @@ namespace MPF.UI.Core.ViewModels
// Pull the drive letter from the UI directly, just in case
var drive = this.Parent.DriveLetterComboBox.SelectedItem as Drive;
if (drive.Letter != default(char))
if (drive != null && drive.Letter != default(char))
{
if (this.Options.VerboseLogging)
this.Logger.VerboseLogLn($"Scanning for copy protection in {drive.Letter}");