diff options
author | sr55 <[email protected]> | 2012-05-31 00:50:26 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-05-31 00:50:26 +0000 |
commit | b89d9987440e08807238a5ec77ca59d1d4cce7c0 (patch) | |
tree | 5819b7decb2574d022484f0ea8788c4b77aeb023 /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | f5800c40e1c834fa5fc6de1432aea4cb86523950 (diff) |
WinGui: Fix an issue with the x264 CQ Granulairty on certain cultures. Change the way the Destination text box works and update the autonaming code to work with Start and End points.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4709 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 548523eee..df13c1482 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -590,6 +590,22 @@ namespace HandBrakeWPF.ViewModels #region Properties for Settings
/// <summary>
+ /// Gets or sets Destination.
+ /// </summary>
+ public string Destination
+ {
+ get
+ {
+ return this.CurrentTask.Destination;
+ }
+ set
+ {
+ this.CurrentTask.Destination = value;
+ this.NotifyOfPropertyChange(() => this.Destination);
+ }
+ }
+
+ /// <summary>
/// Gets or sets SelectedTitle.
/// </summary>
public Title SelectedTitle
@@ -624,7 +640,7 @@ namespace HandBrakeWPF.ViewModels if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
{
- this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
}
this.NotifyOfPropertyChange(() => this.CurrentTask);
@@ -666,6 +682,11 @@ namespace HandBrakeWPF.ViewModels this.CurrentTask.StartPoint = value;
this.NotifyOfPropertyChange(() => this.SelectedStartPoint);
this.Duration = this.DurationCalculation();
+
+ if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
}
@@ -683,6 +704,11 @@ namespace HandBrakeWPF.ViewModels this.CurrentTask.EndPoint = value;
this.NotifyOfPropertyChange(() => this.SelectedEndPoint);
this.Duration = this.DurationCalculation();
+
+ if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNaming))
+ {
+ this.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
+ }
}
}
@@ -988,7 +1014,7 @@ namespace HandBrakeWPF.ViewModels return;
}
- if (string.IsNullOrEmpty(this.CurrentTask.Destination))
+ if (string.IsNullOrEmpty(this.Destination))
{
this.errorService.ShowMessageBox("The Destination field was empty.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
@@ -1000,7 +1026,7 @@ namespace HandBrakeWPF.ViewModels return;
}
- if (File.Exists(this.CurrentTask.Destination))
+ if (File.Exists(this.Destination))
{
MessageBoxResult result = this.errorService.ShowMessageBox("The current file already exists, do you wish to overwrite it?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.No)
@@ -1110,7 +1136,7 @@ namespace HandBrakeWPF.ViewModels break;
}
- this.CurrentTask.Destination = dialog.FileName;
+ this.Destination = dialog.FileName;
this.NotifyOfPropertyChange(() => this.CurrentTask);
}
}
@@ -1312,7 +1338,7 @@ namespace HandBrakeWPF.ViewModels // Update The browse file extension display
if (Path.HasExtension(newExtension))
{
- this.CurrentTask.Destination = Path.ChangeExtension(this.CurrentTask.Destination, newExtension);
+ this.Destination = Path.ChangeExtension(this.Destination, newExtension);
}
// Update the UI Display
|