gb and dgb config UI: when movie is not active, be smart and don't commit syncsettings if they weren't touched

This commit is contained in:
goyuken 2014-08-06 01:06:52 +00:00
parent 09ca43328d
commit 0a7803c547
4 changed files with 19 additions and 3 deletions

View File

@ -37,6 +37,14 @@ namespace BizHawk.Client.EmuHawk.config.GB
ss = new GambatteLink.GambatteLinkSyncSettings(ssl, ssr);
}
private bool SyncSettingsChanged
{
get
{
return gbPrefControl1.SyncSettingsChanged || gbPrefControl2.SyncSettingsChanged;
}
}
public static void DoDGBPrefsDialog(IWin32Window owner)
{
var s = (GambatteLink.GambatteLinkSettings)Global.Emulator.GetSettings();
@ -54,7 +62,8 @@ namespace BizHawk.Client.EmuHawk.config.GB
{
dlg.GetSettings(out s, out ss);
Global.Emulator.PutSettings(s);
GlobalWin.MainForm.PutCoreSyncSettings(ss);
if (dlg.SyncSettingsChanged)
GlobalWin.MainForm.PutCoreSyncSettings(ss);
}
}
}

View File

@ -44,6 +44,7 @@
this.propertyGrid1.Size = new System.Drawing.Size(318, 276);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// buttonDefaults
//

View File

@ -21,6 +21,8 @@ namespace BizHawk.Client.EmuHawk.config.GB
[Browsable(false)]
public bool ColorGameBoy { get; set; }
[Browsable(false)]
public bool SyncSettingsChanged { get; private set; }
Gameboy.GambatteSettings s;
Gameboy.GambatteSyncSettings ss;
@ -52,6 +54,9 @@ namespace BizHawk.Client.EmuHawk.config.GB
ColorChooserForm.DoColorChooserFormDialog(this.ParentForm, s);
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
SyncSettingsChanged = true;
}
}
}

View File

@ -31,7 +31,8 @@ namespace BizHawk.Client.EmuHawk.config.GB
{
dlg.gbPrefControl1.GetSettings(out s, out ss);
Global.Emulator.PutSettings(s);
GlobalWin.MainForm.PutCoreSyncSettings(ss);
if (dlg.gbPrefControl1.SyncSettingsChanged)
GlobalWin.MainForm.PutCoreSyncSettings(ss);
}
}
}