diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 41dc93291..331c9bf5c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -552,6 +552,7 @@ namespace HandBrakeWPF.ViewModels }
}
+
#endregion
#region Output Files
@@ -1217,10 +1218,13 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void BrowseSendFileTo()
{
- VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.*)|*.*" };
- dialog.ShowDialog();
- this.SendFileTo = Path.GetFileNameWithoutExtension(dialog.FileName);
- this.sendFileToPath = dialog.FileName;
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.*)|*.*", FileName = this.sendFileToPath };
+ bool? dialogResult = dialog.ShowDialog();
+ if (dialogResult.HasValue && dialogResult.Value)
+ {
+ this.SendFileTo = Path.GetFileNameWithoutExtension(dialog.FileName);
+ this.sendFileToPath = dialog.FileName;
+ }
}
/// <summary>
@@ -1228,9 +1232,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void BrowseAutoNamePath()
{
- VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
- dialog.ShowDialog();
- this.AutoNameDefaultPath = dialog.SelectedPath;
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true, SelectedPath = this.AutoNameDefaultPath };
+ bool? dialogResult = dialog.ShowDialog();
+ if (dialogResult.HasValue && dialogResult.Value)
+ {
+ this.AutoNameDefaultPath = dialog.SelectedPath;
+ }
}
/// <summary>
@@ -1238,9 +1245,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void BrowseVlcPath()
{
- VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.exe)|*.exe" };
- dialog.ShowDialog();
- this.VLCPath = dialog.FileName;
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.exe)|*.exe", FileName = this.VLCPath };
+ bool? dialogResult = dialog.ShowDialog();
+ if (dialogResult.HasValue && dialogResult.Value)
+ {
+ this.VLCPath = dialog.FileName;
+ }
}
/// <summary>
@@ -1248,9 +1258,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void BrowseLogPath()
{
- VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
- dialog.ShowDialog();
- this.LogDirectory = dialog.SelectedPath;
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true, SelectedPath = this.LogDirectory };
+ bool? dialogResult = dialog.ShowDialog();
+ if (dialogResult.HasValue && dialogResult.Value)
+ {
+ this.LogDirectory = dialog.SelectedPath;
+ }
}
/// <summary>
@@ -1453,7 +1466,7 @@ namespace HandBrakeWPF.ViewModels this.MinLength = this.userSettingService.GetUserSetting<int>(UserSettingConstants.MinScanDuration);
// Use dvdnav
- this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
+ this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
}
/// <summary>
@@ -1483,7 +1496,7 @@ namespace HandBrakeWPF.ViewModels /* Previews */
this.userSettingService.SetUserSetting(UserSettingConstants.VLCPath, this.VLCPath);
-
+
/* Video */
this.userSettingService.SetUserSetting(UserSettingConstants.DisableQuickSyncDecoding, this.DisableQuickSyncDecoding);
this.userSettingService.SetUserSetting(UserSettingConstants.EnableDxva, this.EnableDxvaDecoding);
|