Add `IDialogParent` interface to a couple of config dialogs
This commit is contained in:
parent
8949b1aa6b
commit
df63853cd5
|
@ -1407,7 +1407,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private DialogResult OpenQuickNesGraphicsSettingsDialog(ISettingsAdapter settable)
|
||||
{
|
||||
using QuickNesConfig form = new(Config, settable);
|
||||
using QuickNesConfig form = new(Config, DialogController, settable);
|
||||
return this.ShowDialogWithTempMute(form);
|
||||
}
|
||||
|
||||
|
@ -2443,7 +2443,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void DisplayConfigMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var window = new DisplayConfig(Config, GL);
|
||||
using DisplayConfig window = new(Config, DialogController, GL);
|
||||
if (this.ShowDialogWithTempMute(window).IsOk())
|
||||
{
|
||||
DisplayManager.RefreshUserShader();
|
||||
|
|
|
@ -9,7 +9,7 @@ using BizHawk.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class DisplayConfig : Form
|
||||
public partial class DisplayConfig : Form, IDialogParent
|
||||
{
|
||||
private readonly Config _config;
|
||||
|
||||
|
@ -17,12 +17,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private string _pathSelection;
|
||||
|
||||
public IDialogController DialogController { get; }
|
||||
|
||||
public bool NeedReset { get; set; }
|
||||
|
||||
public DisplayConfig(Config config, IGL gl)
|
||||
public DisplayConfig(Config config, IDialogController dialogController, IGL gl)
|
||||
{
|
||||
_config = config;
|
||||
_gl = gl;
|
||||
DialogController = dialogController;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -265,7 +268,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Filter = new FilesystemFilter(".CGP Files", new[] { "cgp" }).ToString(),
|
||||
FileName = _pathSelection
|
||||
};
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
if (this.ShowDialogAsChild(ofd).IsOk())
|
||||
{
|
||||
rbUser.Checked = true;
|
||||
var choice = Path.GetFullPath(ofd.FileName);
|
||||
|
@ -288,7 +291,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (!ok)
|
||||
{
|
||||
using var errorForm = new ExceptionBox(errors);
|
||||
errorForm.ShowDialog();
|
||||
this.ShowDialogAsChild(errorForm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class QuickNesConfig : Form
|
||||
public partial class QuickNesConfig : Form, IDialogParent
|
||||
{
|
||||
private readonly Config _config;
|
||||
|
||||
|
@ -17,11 +17,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly QuickNES.QuickNESSettings _settings;
|
||||
|
||||
public QuickNesConfig(Config config, ISettingsAdapter settable)
|
||||
public IDialogController DialogController { get; }
|
||||
|
||||
public QuickNesConfig(Config config, IDialogController dialogController, ISettingsAdapter settable)
|
||||
{
|
||||
_config = config;
|
||||
_settable = settable;
|
||||
_settings = (QuickNES.QuickNESSettings) _settable.GetSettings();
|
||||
DialogController = dialogController;
|
||||
InitializeComponent();
|
||||
Icon = Properties.Resources.QuickNesIcon;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue