Added Directory.Exists check for Movie director when clicking the browse button
This commit is contained in:
parent
d786292ccf
commit
7949e2e182
|
@ -151,9 +151,29 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void BrowseBtn_Click(object sender, EventArgs e)
|
private void BrowseBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
string movieFolderPath = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null);
|
||||||
|
|
||||||
|
// Create movie folder if it doesn't already exist
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(movieFolderPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(movieFolderPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception movieDirException)
|
||||||
|
when (
|
||||||
|
movieDirException is IOException ||
|
||||||
|
movieDirException is UnauthorizedAccessException ||
|
||||||
|
movieDirException is PathTooLongException
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var sfd = new SaveFileDialog
|
var sfd = new SaveFileDialog
|
||||||
{
|
{
|
||||||
InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null),
|
InitialDirectory = movieFolderPath,
|
||||||
DefaultExt = "." + Global.MovieSession.Movie.PreferredExtension,
|
DefaultExt = "." + Global.MovieSession.Movie.PreferredExtension,
|
||||||
FileName = RecordBox.Text,
|
FileName = RecordBox.Text,
|
||||||
OverwritePrompt = false,
|
OverwritePrompt = false,
|
||||||
|
|
Loading…
Reference in New Issue