Check Global.Config.SupressAskSave in ToolManager instead of doing it in the tool dialogs themselves

This commit is contained in:
adelikat 2014-01-01 02:09:03 +00:00
parent 3784256e56
commit a3a8170c44
4 changed files with 13 additions and 18 deletions

View File

@ -118,11 +118,6 @@ namespace BizHawk.Client.EmuHawk
public bool AskSave() public bool AskSave()
{ {
if (Global.Config.SupressAskSave)
{
return true;
}
if (Global.CheatList.Changes) if (Global.CheatList.Changes)
{ {
GlobalWin.Sound.StopSound(); GlobalWin.Sound.StopSound();

View File

@ -476,11 +476,6 @@ namespace BizHawk.Client.EmuHawk
public bool AskSave() public bool AskSave()
{ {
if (Global.Config.SupressAskSave)
{
return true;
}
if (_luaList.Changes) if (_luaList.Changes)
{ {
GlobalWin.Sound.StopSound(); GlobalWin.Sound.StopSound();

View File

@ -8,9 +8,9 @@ namespace BizHawk.Client.EmuHawk
{ {
public class ToolManager public class ToolManager
{ {
//TODO: merge ToolHelper code where logical // TODO: merge ToolHelper code where logical
//For instance, add an IToolForm property called UsesCheats, so that a UpdateCheatRelatedTools() method can update all tools of this type // For instance, add an IToolForm property called UsesCheats, so that a UpdateCheatRelatedTools() method can update all tools of this type
//Also a UsesRam, and similar method // Also a UsesRam, and similar method
private List<IToolForm> _tools = new List<IToolForm>(); private List<IToolForm> _tools = new List<IToolForm>();
@ -147,6 +147,11 @@ namespace BizHawk.Client.EmuHawk
/// <returns></returns> /// <returns></returns>
public bool AskSave() public bool AskSave()
{ {
if (Global.Config.SupressAskSave) // User has elected to not be nagged
{
return true;
}
foreach (var tool in _tools) foreach (var tool in _tools)
{ {
var result = tool.AskSave(); var result = tool.AskSave();
@ -167,6 +172,11 @@ namespace BizHawk.Client.EmuHawk
/// <returns></returns> /// <returns></returns>
public bool AskSave<T>() where T : IToolForm public bool AskSave<T>() where T : IToolForm
{ {
if (Global.Config.SupressAskSave) // User has elected to not be nagged
{
return true;
}
var tool = _tools.FirstOrDefault(x => x is T); var tool = _tools.FirstOrDefault(x => x is T);
if (tool != null) if (tool != null)
{ {

View File

@ -99,11 +99,6 @@ namespace BizHawk.Client.EmuHawk
public bool AskSave() public bool AskSave()
{ {
if (Global.Config.SupressAskSave) // User has elected to not be nagged
{
return true;
}
if (_watches.Changes) if (_watches.Changes)
{ {
GlobalWin.Sound.StopSound(); GlobalWin.Sound.StopSound();