fix deleting recent roms when missing
This commit is contained in:
parent
9d594e013b
commit
94383ab143
|
@ -140,7 +140,9 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
|
||||||
|
|
||||||
//in any case, make a menuitem to let you remove the item
|
//in any case, make a menuitem to let you remove the item
|
||||||
var tsmiRemovePath = new ToolStripMenuItem { Text = "&Remove" };
|
var tsmiRemovePath = new ToolStripMenuItem { Text = "&Remove" };
|
||||||
tsmiRemovePath.Click += (o, ev) => { recent.Remove(path); };
|
tsmiRemovePath.Click += (o, ev) => {
|
||||||
|
recent.Remove(path);
|
||||||
|
};
|
||||||
tsdd.Items.Add(tsmiRemovePath);
|
tsdd.Items.Add(tsmiRemovePath);
|
||||||
|
|
||||||
////experiment of popping open a submenu. doesnt work well.
|
////experiment of popping open a submenu. doesnt work well.
|
||||||
|
@ -210,7 +212,7 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
|
||||||
return items.ToArray();
|
return items.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HandleLoadError(this RecentFiles recent, string path)
|
public static void HandleLoadError(this RecentFiles recent, string path, string encodedPath = null)
|
||||||
{
|
{
|
||||||
GlobalWin.Sound.StopSound();
|
GlobalWin.Sound.StopSound();
|
||||||
if (recent.Frozen)
|
if (recent.Frozen)
|
||||||
|
@ -222,7 +224,10 @@ namespace BizHawk.Client.EmuHawk.ToolExtensions
|
||||||
var result = MessageBox.Show("Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
var result = MessageBox.Show("Could not open " + path + "\nRemove from list?", "File not found", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
||||||
if (result == DialogResult.Yes)
|
if (result == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
recent.Remove(path);
|
if (encodedPath != null)
|
||||||
|
recent.Remove(encodedPath);
|
||||||
|
else
|
||||||
|
recent.Remove(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1770,11 +1770,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
};
|
};
|
||||||
|
|
||||||
//if(ioa is this or that) - for more complex behaviour
|
//if(ioa is this or that) - for more complex behaviour
|
||||||
rom = ioa.SimplePath;
|
string romPath = ioa.SimplePath;
|
||||||
|
|
||||||
if (!LoadRom(rom, args))
|
if (!LoadRom(romPath, args))
|
||||||
{
|
{
|
||||||
Global.Config.RecentRoms.HandleLoadError(rom);
|
Global.Config.RecentRoms.HandleLoadError(romPath, rom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue