Use FolderBrowserDialog on Unix instead of FolderBrowserEx
This commit is contained in:
parent
d9c42f44a1
commit
17ba5fa815
|
@ -6,6 +6,7 @@ using System.Windows.Forms;
|
||||||
|
|
||||||
using BizHawk.Client.Common;
|
using BizHawk.Client.Common;
|
||||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||||
|
using BizHawk.Common;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -218,15 +219,32 @@ namespace BizHawk.Client.EmuHawk
|
||||||
system = null;
|
system = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DialogResult result;
|
||||||
|
string selectedPath;
|
||||||
|
if (OSTailoredCode.CurrentOS == OSTailoredCode.DistinctOS.Windows)
|
||||||
|
{
|
||||||
var f = new FolderBrowserEx
|
var f = new FolderBrowserEx
|
||||||
{
|
{
|
||||||
Description = $"Set the directory for {name}",
|
Description = $"Set the directory for {name}",
|
||||||
SelectedPath = PathManager.MakeAbsolutePath(box.Text, system)
|
SelectedPath = PathManager.MakeAbsolutePath(box.Text, system)
|
||||||
};
|
};
|
||||||
var result = f.ShowDialog();
|
result = f.ShowDialog();
|
||||||
|
selectedPath = f.SelectedPath;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// FolderBrowserEx doesn't work in Mono for obvious reasons
|
||||||
|
var f = new FolderBrowserDialog
|
||||||
|
{
|
||||||
|
Description = $"Set the directory for {name}",
|
||||||
|
SelectedPath = PathManager.MakeAbsolutePath(box.Text, system)
|
||||||
|
};
|
||||||
|
result = f.ShowDialog();
|
||||||
|
selectedPath = f.SelectedPath;
|
||||||
|
}
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
box.Text = PathManager.TryMakeRelative(f.SelectedPath, system);
|
box.Text = PathManager.TryMakeRelative(selectedPath, system);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue