dialogs shouldnt be opened without an owner. so give all them an owner. fixes #2420
This commit is contained in:
parent
fb5a5ed78c
commit
c64fb11d0d
|
@ -164,11 +164,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles EmuHawk specific issues before showing a modal dialog
|
/// Handles EmuHawk specific issues before showing a modal dialog
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static DialogResult ShowHawkDialog(this CommonDialog form)
|
public static DialogResult ShowHawkDialog(this CommonDialog form, IWin32Window owner)
|
||||||
{
|
{
|
||||||
GlobalWin.Sound.StopSound();
|
GlobalWin.Sound.StopSound();
|
||||||
using var tempForm = new Form();
|
DialogResult result;
|
||||||
var result = form.ShowDialog(tempForm);
|
if(owner != null)
|
||||||
|
result = form.ShowDialog(owner);
|
||||||
|
else
|
||||||
|
result = form.ShowDialog();
|
||||||
GlobalWin.Sound.StartSound();
|
GlobalWin.Sound.StartSound();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +275,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Clipboard.SetImage(img);
|
Clipboard.SetImage(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveAsFile(this Bitmap bitmap, IGameInfo game, string suffix, string systemId, PathEntryCollection paths)
|
public static void SaveAsFile(this Bitmap bitmap, IGameInfo game, string suffix, string systemId, PathEntryCollection paths, IWin32Window owner)
|
||||||
{
|
{
|
||||||
using var sfd = new SaveFileDialog
|
using var sfd = new SaveFileDialog
|
||||||
{
|
{
|
||||||
|
@ -282,7 +285,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(owner);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -244,7 +244,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void OpenAdvancedMenuItem_Click(object sender, EventArgs e)
|
private void OpenAdvancedMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var oac = new OpenAdvancedChooser(Config, CreateCoreComm, Game, RunLibretroCoreChooser);
|
using var oac = new OpenAdvancedChooser(Config, CreateCoreComm, Game, RunLibretroCoreChooser);
|
||||||
if (oac.ShowHawkDialog() == DialogResult.Cancel)
|
if (oac.ShowHawkDialog(this) == DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Title = "Open Advanced"
|
Title = "Open Advanced"
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (!result.IsOk())
|
if (!result.IsOk())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -442,7 +442,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = false
|
RestoreDirectory = false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ofd.ShowHawkDialog().IsOk())
|
if (ofd.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
foreach (var fn in ofd.FileNames)
|
foreach (var fn in ofd.FileNames)
|
||||||
{
|
{
|
||||||
|
@ -468,7 +468,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
filename,
|
filename,
|
||||||
Config.PathEntries.MovieAbsolutePath(),
|
Config.PathEntries.MovieAbsolutePath(),
|
||||||
"Movie Files",
|
"Movie Files",
|
||||||
MovieSession.Movie.PreferredExtension);
|
MovieSession.Movie.PreferredExtension,
|
||||||
|
this
|
||||||
|
);
|
||||||
|
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
{
|
||||||
|
@ -560,7 +562,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = FilesystemFilter.PNGs.ToString()
|
Filter = FilesystemFilter.PNGs.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sfd.ShowHawkDialog().IsOk())
|
if (sfd.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
TakeScreenshot(sfd.FileName);
|
TakeScreenshot(sfd.FileName);
|
||||||
}
|
}
|
||||||
|
@ -1110,7 +1112,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = ConfigFileFSFilterString
|
Filter = ConfigFileFSFilterString
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sfd.ShowHawkDialog().IsOk())
|
if (sfd.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
SaveConfig(sfd.FileName);
|
SaveConfig(sfd.FileName);
|
||||||
AddOnScreenMessage("Copied settings");
|
AddOnScreenMessage("Copied settings");
|
||||||
|
@ -1132,7 +1134,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = ConfigFileFSFilterString
|
Filter = ConfigFileFSFilterString
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ofd.ShowHawkDialog().IsOk())
|
if (ofd.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
LoadConfigFile(ofd.FileName);
|
LoadConfigFile(ofd.FileName);
|
||||||
}
|
}
|
||||||
|
@ -1367,12 +1369,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (Emulator is NES nes && nes.IsVS)
|
if (Emulator is NES nes && nes.IsVS)
|
||||||
{
|
{
|
||||||
using var form = new NesVsSettings(this, nes.GetSyncSettings().Clone());
|
using var form = new NesVsSettings(this, nes.GetSyncSettings().Clone());
|
||||||
form.ShowHawkDialog();
|
form.ShowHawkDialog(this);
|
||||||
}
|
}
|
||||||
else if (Emulator is SubNESHawk sub && sub.IsVs)
|
else if (Emulator is SubNESHawk sub && sub.IsVs)
|
||||||
{
|
{
|
||||||
using var form = new NesVsSettings(this, sub.GetSyncSettings().Clone());
|
using var form = new NesVsSettings(this, sub.GetSyncSettings().Clone());
|
||||||
form.ShowHawkDialog();
|
form.ShowHawkDialog(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2248,7 +2248,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
FilterIndex = _lastOpenRomFilter
|
FilterIndex = _lastOpenRomFilter
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -3256,7 +3256,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
sfd.Filter = new FilesystemFilterSet(new FilesystemFilter(ext, new[] { ext })).ToString();
|
sfd.Filter = new FilesystemFilterSet(new FilesystemFilter(ext, new[] { ext })).ToString();
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.Cancel)
|
if (result == DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
aw.Dispose();
|
aw.Dispose();
|
||||||
|
@ -4236,7 +4236,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
FileName = $"{SaveStatePrefix()}.QuickSave0.State"
|
FileName = $"{SaveStatePrefix()}.QuickSave0.State"
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
SaveState(sfd.FileName, sfd.FileName);
|
SaveState(sfd.FileName, sfd.FileName);
|
||||||
|
@ -4268,7 +4268,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void SaveFile()
|
public void SaveFile()
|
||||||
{
|
{
|
||||||
Bmp.SaveAsFile(GlobalWin.Game, "Palettes", GlobalWin.Emulator.SystemId, GlobalWin.Config.PathEntries);
|
Bmp.SaveAsFile(GlobalWin.Game, "Palettes", GlobalWin.Emulator.SystemId, GlobalWin.Config.PathEntries, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -513,7 +513,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitialDirectory = _config.PathEntries.MovieAbsolutePath()
|
InitialDirectory = _config.PathEntries.MovieAbsolutePath()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
var file = new FileInfo(ofd.FileName);
|
var file = new FileInfo(ofd.FileName);
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = new FilesystemFilterSet(new FilesystemFilter("Movie Files", new[] { preferredExt })).ToString()
|
Filter = new FilesystemFilterSet(new FilesystemFilter("Movie Files", new[] { preferredExt })).ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK
|
if (result == DialogResult.OK
|
||||||
&& !string.IsNullOrWhiteSpace(sfd.FileName))
|
&& !string.IsNullOrWhiteSpace(sfd.FileName))
|
||||||
{
|
{
|
||||||
|
|
|
@ -363,7 +363,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CurrentFileName,
|
CurrentFileName,
|
||||||
Config.PathEntries.ToolsAbsolutePath(),
|
Config.PathEntries.ToolsAbsolutePath(),
|
||||||
"Bot files",
|
"Bot files",
|
||||||
"bot");
|
"bot",
|
||||||
|
this);
|
||||||
|
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -388,7 +388,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_currentFilename,
|
_currentFilename,
|
||||||
Config.PathEntries.LogAbsolutePath(),
|
Config.PathEntries.LogAbsolutePath(),
|
||||||
"Code Data Logger Files",
|
"Code Data Logger Files",
|
||||||
"cdl");
|
"cdl",
|
||||||
|
this);
|
||||||
|
|
||||||
if (file == null)
|
if (file == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -143,7 +143,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
MainForm.CheatList.CurrentFileName,
|
MainForm.CheatList.CurrentFileName,
|
||||||
Config.PathEntries.CheatsAbsolutePath(Game.System),
|
Config.PathEntries.CheatsAbsolutePath(Game.System),
|
||||||
"Cheat Files",
|
"Cheat Files",
|
||||||
"cht");
|
"cht",
|
||||||
|
Owner);
|
||||||
|
|
||||||
return file != null && MainForm.CheatList.SaveFile(file.FullName);
|
return file != null && MainForm.CheatList.SaveFile(file.FullName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
var b = CreateAddBreakpointDialog(BreakpointOperation.Add);
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Add);
|
||||||
|
|
||||||
if (b.ShowHawkDialog().IsOk())
|
if (b.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
_breakpoints.Add(Core, MemoryDomains.SystemBus.Name, b.Address, b.AddressMask, b.BreakType);
|
_breakpoints.Add(Core, MemoryDomains.SystemBus.Name, b.Address, b.AddressMask, b.BreakType);
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
var b = CreateAddBreakpointDialog(BreakpointOperation.Duplicate, breakpoint.Type, breakpoint.Address, breakpoint.AddressMask);
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Duplicate, breakpoint.Type, breakpoint.Address, breakpoint.AddressMask);
|
||||||
|
|
||||||
if (b.ShowHawkDialog() == DialogResult.OK)
|
if (b.ShowHawkDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
_breakpoints.Add(new Breakpoint(Core, MemoryDomains.SystemBus.Name, breakpoint.Callback, b.Address, b.AddressMask, b.BreakType, breakpoint.Active));
|
_breakpoints.Add(new Breakpoint(Core, MemoryDomains.SystemBus.Name, breakpoint.Callback, b.Address, b.AddressMask, b.BreakType, breakpoint.Active));
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
var b = CreateAddBreakpointDialog(BreakpointOperation.Edit, breakpoint.Type, breakpoint.Address, breakpoint.AddressMask);
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Edit, breakpoint.Type, breakpoint.Address, breakpoint.AddressMask);
|
||||||
|
|
||||||
if (b.ShowHawkDialog() == DialogResult.OK)
|
if (b.ShowHawkDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
breakpoint.Type = b.BreakType;
|
breakpoint.Type = b.BreakType;
|
||||||
breakpoint.Address = b.Address;
|
breakpoint.Address = b.Address;
|
||||||
|
|
|
@ -942,7 +942,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Color = Spriteback
|
Color = Spriteback
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = dlg.ShowHawkDialog();
|
var result = dlg.ShowHawkDialog(this);
|
||||||
if (result.IsOk())
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
Spriteback = dlg.Color;
|
Spriteback = dlg.Color;
|
||||||
|
|
|
@ -179,7 +179,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void SaveAsFile(Bitmap bitmap, string suffix)
|
private void SaveAsFile(Bitmap bitmap, string suffix)
|
||||||
{
|
{
|
||||||
bitmap.SaveAsFile(Game, suffix, Emu.SystemId, Config.PathEntries);
|
bitmap.SaveAsFile(Game, suffix, Emu.SystemId, Config.PathEntries, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveBGAScreenshotToolStripMenuItem_Click(object sender, EventArgs e)
|
private void SaveBGAScreenshotToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -946,7 +946,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
: Game.FilesystemSafeName()
|
: Game.FilesystemSafeName()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
return result == DialogResult.OK ? sfd.FileName : "";
|
return result == DialogResult.OK ? sfd.FileName : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
return result == DialogResult.OK ? sfd.FileName : "";
|
return result == DialogResult.OK ? sfd.FileName : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,7 +1284,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -1338,7 +1338,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = false
|
RestoreDirectory = false
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
|
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
@ -1605,7 +1605,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Message = "Enter a hexadecimal value"
|
Message = "Enter a hexadecimal value"
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = inputPrompt.ShowHawkDialog();
|
var result = inputPrompt.ShowHawkDialog(this);
|
||||||
|
|
||||||
if (result == DialogResult.OK && inputPrompt.PromptText.IsHex())
|
if (result == DialogResult.OK && inputPrompt.PromptText.IsHex())
|
||||||
{
|
{
|
||||||
|
@ -1694,7 +1694,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
ParentTool = this
|
ParentTool = this
|
||||||
};
|
};
|
||||||
|
|
||||||
poke.ShowHawkDialog();
|
poke.ShowHawkDialog(this);
|
||||||
GeneralUpdate();
|
GeneralUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1702,7 +1702,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void SetColorsMenuItem_Click(object sender, EventArgs e)
|
private void SetColorsMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var form = new HexColorsForm(this);
|
using var form = new HexColorsForm(this);
|
||||||
form.ShowHawkDialog();
|
form.ShowHawkDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetColorsToDefaultMenuItem_Click(object sender, EventArgs e)
|
private void ResetColorsToDefaultMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -694,7 +694,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
sfd.Filter = SessionsFSFilterSet.ToString();
|
sfd.Filter = SessionsFSFilterSet.ToString();
|
||||||
sfd.RestoreDirectory = true;
|
sfd.RestoreDirectory = true;
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
return result.IsOk() ? new FileInfo(sfd.FileName) : null;
|
return result.IsOk() ? new FileInfo(sfd.FileName) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,7 +826,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Directory.CreateDirectory(ofd.InitialDirectory);
|
Directory.CreateDirectory(ofd.InitialDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result.IsOk() && !string.IsNullOrWhiteSpace(ofd.FileName))
|
if (result.IsOk() && !string.IsNullOrWhiteSpace(ofd.FileName))
|
||||||
{
|
{
|
||||||
LoadLuaSession(ofd.FileName);
|
LoadLuaSession(ofd.FileName);
|
||||||
|
@ -880,7 +880,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = new FilesystemFilterSet(FilesystemFilter.LuaScripts).ToString()
|
Filter = new FilesystemFilterSet(FilesystemFilter.LuaScripts).ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result.IsOk() && !string.IsNullOrWhiteSpace(sfd.FileName))
|
if (result.IsOk() && !string.IsNullOrWhiteSpace(sfd.FileName))
|
||||||
{
|
{
|
||||||
string defaultTemplate = "while true do\n\temu.frameadvance();\nend";
|
string defaultTemplate = "while true do\n\temu.frameadvance();\nend";
|
||||||
|
@ -912,7 +912,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Directory.CreateDirectory(ofd.InitialDirectory);
|
Directory.CreateDirectory(ofd.InitialDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result.IsOk() && ofd.FileNames != null)
|
if (result.IsOk() && ofd.FileNames != null)
|
||||||
{
|
{
|
||||||
foreach (var file in ofd.FileNames)
|
foreach (var file in ofd.FileNames)
|
||||||
|
|
|
@ -279,7 +279,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
create = true;
|
create = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogResult result = dialog.ShowHawkDialog();
|
DialogResult result = dialog.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
if (create)
|
if (create)
|
||||||
|
@ -304,7 +304,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = MacrosFSFilterSet.ToString()
|
Filter = MacrosFSFilterSet.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
DialogResult result = dialog.ShowHawkDialog();
|
DialogResult result = dialog.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Filter = new FilesystemFilterSet(new FilesystemFilter("XML Files", new[] { "xml" })).ToString()
|
Filter = new FilesystemFilterSet(new FilesystemFilter("XML Files", new[] { "xml" })).ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.Cancel)
|
if (result != DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
NameBox.Text = sfd.FileName;
|
NameBox.Text = sfd.FileName;
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
};
|
};
|
||||||
string hawkPath = "";
|
string hawkPath = "";
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
hawkPath = ofd.FileName;
|
hawkPath = ofd.FileName;
|
||||||
|
|
|
@ -188,7 +188,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
NameTableView
|
NameTableView
|
||||||
.ToBitMap()
|
.ToBitMap()
|
||||||
.SaveAsFile(Game, "Nametables", "NES", Config.PathEntries);
|
.SaveAsFile(Game, "Nametables", "NES", Config.PathEntries, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ScreenshotToClipboardMenuItem_Click(object sender, EventArgs e)
|
private void ScreenshotToClipboardMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -314,7 +314,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void Screenshot(Bitmap b, string suffix)
|
private void Screenshot(Bitmap b, string suffix)
|
||||||
{
|
{
|
||||||
b.SaveAsFile(Game, suffix, "NES", Config.PathEntries);
|
b.SaveAsFile(Game, suffix, "NES", Config.PathEntries, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e)
|
private void SavePaletteScreenshotMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -581,7 +581,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var point = Cursor.Position;
|
var point = Cursor.Position;
|
||||||
point.Offset(i.Width / -2, i.Height / -2);
|
point.Offset(i.Width / -2, i.Height / -2);
|
||||||
|
|
||||||
var result = i.ShowHawkDialog(position: point);
|
var result = i.ShowHawkDialog(this, position: point);
|
||||||
if (result.IsOk())
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
branch.UserText = i.PromptText;
|
branch.UserText = i.PromptText;
|
||||||
|
|
|
@ -197,7 +197,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
var point = Cursor.Position;
|
var point = Cursor.Position;
|
||||||
point.Offset(i.Width / -2, i.Height / -2);
|
point.Offset(i.Width / -2, i.Height / -2);
|
||||||
|
|
||||||
var result = i.ShowHawkDialog(position: point);
|
var result = i.ShowHawkDialog(this, position: point);
|
||||||
if (result.IsOk())
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
Markers.Add(new TasMovieMarker(frame, i.PromptText));
|
Markers.Add(new TasMovieMarker(frame, i.PromptText));
|
||||||
|
@ -249,7 +249,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
point.Offset(i.Width / -2, i.Height / -2);
|
point.Offset(i.Width / -2, i.Height / -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = i.ShowHawkDialog(position: point);
|
var result = i.ShowHawkDialog(this, position: point);
|
||||||
|
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
).ToString()
|
).ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result.IsOk())
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
LoadMovieFile(ofd.FileName, false);
|
LoadMovieFile(ofd.FileName, false);
|
||||||
|
|
|
@ -801,7 +801,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
filename,
|
filename,
|
||||||
Config.PathEntries.MovieAbsolutePath(),
|
Config.PathEntries.MovieAbsolutePath(),
|
||||||
"Tas Project Files",
|
"Tas Project Files",
|
||||||
"tasproj");
|
"tasproj",
|
||||||
|
this
|
||||||
|
);
|
||||||
|
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = ofd.ShowHawkDialog();
|
var result = ofd.ShowHawkDialog(this);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return new FileInfo(ofd.FileName);
|
return new FileInfo(ofd.FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FileInfo SaveFileDialog(string currentFile, string path, string fileType, string fileExt)
|
public static FileInfo SaveFileDialog(string currentFile, string path, string fileType, string fileExt, IWin32Window owner)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(path))
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RestoreDirectory = true
|
RestoreDirectory = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(owner);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public FileInfo GetWatchSaveFileFromUser(string currentFile)
|
public FileInfo GetWatchSaveFileFromUser(string currentFile)
|
||||||
{
|
{
|
||||||
return SaveFileDialog(currentFile, Config.PathEntries.WatchAbsolutePath(), "Watch Files", "wch");
|
return SaveFileDialog(currentFile, Config.PathEntries.WatchAbsolutePath(), "Watch Files", "wch", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ViewInHexEditor(MemoryDomain domain, IEnumerable<long> addresses, WatchSize size)
|
public void ViewInHexEditor(MemoryDomain domain, IEnumerable<long> addresses, WatchSize size)
|
||||||
|
|
|
@ -302,7 +302,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
FilesystemFilter.TextFiles
|
FilesystemFilter.TextFiles
|
||||||
).ToString();
|
).ToString();
|
||||||
sfd.RestoreDirectory = true;
|
sfd.RestoreDirectory = true;
|
||||||
var result = sfd.ShowHawkDialog();
|
var result = sfd.ShowHawkDialog(this);
|
||||||
return result.IsOk() ? new FileInfo(sfd.FileName) : null;
|
return result.IsOk() ? new FileInfo(sfd.FileName) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitialValue = MaxLines.ToString()
|
InitialValue = MaxLines.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = prompt.ShowHawkDialog();
|
var result = prompt.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
var max = int.Parse(prompt.PromptText);
|
var max = int.Parse(prompt.PromptText);
|
||||||
|
@ -372,7 +372,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitialValue = FileSizeCap.ToString()
|
InitialValue = FileSizeCap.ToString()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = prompt.ShowHawkDialog();
|
var result = prompt.ShowHawkDialog(this);
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
FileSizeCap = int.Parse(prompt.PromptText);
|
FileSizeCap = int.Parse(prompt.PromptText);
|
||||||
|
|
|
@ -868,7 +868,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
InitialLocation = this.ChildPointToScreen(WatchListView)
|
InitialLocation = this.ChildPointToScreen(WatchListView)
|
||||||
};
|
};
|
||||||
|
|
||||||
poke.ShowHawkDialog();
|
poke.ShowHawkDialog(this);
|
||||||
UpdateList();
|
UpdateList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -898,7 +898,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Message = "Enter a hexadecimal value"
|
Message = "Enter a hexadecimal value"
|
||||||
};
|
};
|
||||||
|
|
||||||
while (prompt.ShowHawkDialog().IsOk())
|
while (prompt.ShowHawkDialog(this).IsOk())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue