summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-05-31 00:50:26 +0000
committersr55 <[email protected]>2012-05-31 00:50:26 +0000
commitb89d9987440e08807238a5ec77ca59d1d4cce7c0 (patch)
tree5819b7decb2574d022484f0ea8788c4b77aeb023 /win/CS
parentf5800c40e1c834fa5fc6de1432aea4cb86523950 (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')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs36
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml2
3 files changed, 33 insertions, 7 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
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 6f9500e0d..47189db9b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -1678,7 +1678,7 @@ namespace HandBrakeWPF.ViewModels
userSettingService.SetUserSetting(ASUserSettingConstants.ShowCLI, this.ShowCliWindow);
userSettingService.SetUserSetting(ASUserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted);
userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);
- userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty));
+ userSettingService.SetUserSetting(ASUserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));
int value;
if (int.TryParse(this.MinLength.ToString(), out value))
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 4b68d6b3e..0b8347c0b 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -267,7 +267,7 @@
<Label Content="Destination" FontWeight="Bold" />
<StackPanel Orientation="Horizontal">
<Label Content="File" Margin="8,0,0,0" />
- <TextBox Name="Destination" Margin="8,0,0,0" Width="600" Text="{Binding CurrentTask.Destination, UpdateSourceTrigger=PropertyChanged}" />
+ <TextBox Name="Destination" Margin="8,0,0,0" Width="600" Text="{Binding Destination, UpdateSourceTrigger=PropertyChanged}" />
<Button Name="DestinationBrowser" Margin="8,0,0,0" Content="Browse" Micro:Message.Attach="[Event Click] = [Action BrowseDestination]" />
</StackPanel>
</StackPanel>