Merge pull request #1 from AdamSturge/feature/create-movie-path

Feature/create movie path
This commit is contained in:
AdamSturge 2016-01-15 19:32:48 -08:00
commit e484eee95b
1 changed files with 22 additions and 2 deletions

View File

@ -150,10 +150,30 @@ namespace BizHawk.Client.EmuHawk
}
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
)
{
//TO DO : Pass error to user?
}
var sfd = new SaveFileDialog
{
InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null),
InitialDirectory = movieFolderPath,
DefaultExt = "." + Global.MovieSession.Movie.PreferredExtension,
FileName = RecordBox.Text,
OverwritePrompt = false,