summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <sr55.hb@outlook.com>2013-12-29 20:23:51 +0000
committersr55 <sr55.hb@outlook.com>2013-12-29 20:23:51 +0000
commita9cad63afe88581bf0ea5463e3199bd0d1b474c0 (patch)
treeb10970d33a0a2e0f393507b1643354477f810581
parent6be910a604b07801704fa4c48f40e0a949e7695c (diff)
WinGui: Fix a few bugs:
- Advanced query getting nulled out for QSV due to some dead code. - Updated the regex for the decomb value to accept unquoted value as well as quoted. - Remapped Ctrl-F to Ctrl-O to be more standard. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5944 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs2
-rw-r--r--win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs7
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml.cs1
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml.cs72
6 files changed, 25 insertions, 77 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index ec805ab9d..f20589f7d 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -33,6 +33,8 @@ namespace HandBrake.ApplicationServices.Model
/// </summary>
private bool showAdvancedTab;
+ private string advancedEncoderOptions;
+
#endregion
/// <summary>
@@ -405,7 +407,17 @@ namespace HandBrake.ApplicationServices.Model
/// <summary>
/// Gets or sets AdvancedEncoderOptions.
/// </summary>
- public string AdvancedEncoderOptions { get; set; }
+ public string AdvancedEncoderOptions
+ {
+ get
+ {
+ return this.advancedEncoderOptions;
+ }
+ set
+ {
+ this.advancedEncoderOptions = value;
+ }
+ }
/// <summary>
/// Gets or sets x264Preset.
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index db92b3504..4872d6e7d 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -75,7 +75,7 @@ namespace HandBrake.ApplicationServices.Utilities
// Picture Settings - Filters
Match decomb = Regex.Match(input, @" --decomb");
- Match decombValue = Regex.Match(input, @" --decomb=\""([a-zA-Z0-9.:]*)\""");
+ Match decombValue = Regex.Match(input, @" --decomb=([a-zA-Z0-9.:""\\]*)");
Match deinterlace = Regex.Match(input, @"--deinterlace=\""([a-zA-Z0-9.:]*)\""");
Match denoise = Regex.Match(input, @"--denoise=\""([a-zA-Z0-9.:]*)\""");
Match deblock = Regex.Match(input, @"--deblock=([0-9:]*)");
diff --git a/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs b/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs
index 636c424e6..912ea6f11 100644
--- a/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs
+++ b/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs
@@ -10,6 +10,7 @@
namespace HandBrakeWPF.Commands
{
using System;
+ using System.Windows;
using System.Windows.Input;
using Caliburn.Micro;
@@ -81,6 +82,12 @@ namespace HandBrakeWPF.Commands
if (gesture.Modifiers == ModifierKeys.Control && gesture.Key == Key.F)
{
mainViewModel.FileScan();
+ MessageBox.Show("Please use Ctrl-O in future. Ctrl-F is being deprecated in favour of something more standard. :)");
+ }
+
+ if (gesture.Modifiers == ModifierKeys.Control && gesture.Key == Key.O)
+ {
+ mainViewModel.FileScan();
}
// Scan a Folder (Ctrl+R)
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
index fbf700b4a..35e1e0333 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
@@ -77,6 +77,7 @@ namespace HandBrakeWPF.Views
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.Q, ModifierKeys.Control)), new KeyGesture(Key.Q, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.A, ModifierKeys.Control)), new KeyGesture(Key.A, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.F, ModifierKeys.Control)), new KeyGesture(Key.F, ModifierKeys.Control)));
+ this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.O, ModifierKeys.Control)), new KeyGesture(Key.O, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.R, ModifierKeys.Control)), new KeyGesture(Key.R, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.D, ModifierKeys.Control | ModifierKeys.Shift)), new KeyGesture(Key.D, ModifierKeys.Control | ModifierKeys.Shift)));
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index fffbfd0b2..1f0b31764 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -96,7 +96,7 @@
<TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
- <RadioButton Content="Constant Quality:" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0" Checked="qsv_preset_radiobutton"/>
+ <RadioButton Content="Constant Quality:" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0" />
<TextBlock Text="{Binding DisplayRF}" MinWidth="30" />
<TextBlock Text="{Binding Rfqp}" FontWeight="Bold" Margin="5,0,0,0" />
@@ -119,7 +119,7 @@
</Grid>
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
- <RadioButton Content="Avg Bitrate (kbps):" IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0" Checked="qsv_preset_radiobutton"/>
+ <RadioButton Content="Avg Bitrate (kbps):" IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>
<TextBox Width="75" Text="{Binding Task.VideoBitrate, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" />
</StackPanel>
@@ -192,7 +192,7 @@
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
Visibility="{Binding DisplayQSVOptions, Converter={StaticResource boolToVisConverter}}" >
<Slider Minimum="0" Maximum="{Binding QsvSliderMax}" Width="150" Value="{Binding QsvPresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
- IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ValueChanged="qsv_preset_ValueChanged"/>
+ IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" />
<TextBlock Text="{Binding QsvPreset, Converter={StaticResource enumComboConverter}}" Margin="5,0,0,0" />
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs b/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs
index 9f12972be..8a0842a96 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs
@@ -9,14 +9,8 @@
namespace HandBrakeWPF.Views
{
- using System.Collections.Generic;
- using System.Windows;
using System.Windows.Controls;
- using HandBrake.ApplicationServices.Model;
-
- using HandBrakeWPF.ViewModels;
-
/// <summary>
/// Interaction logic for VideoView.xaml
/// </summary>
@@ -29,71 +23,5 @@ namespace HandBrakeWPF.Views
{
InitializeComponent();
}
-
- /// <summary>
- /// The qsv_preset_radiobutton.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void qsv_preset_radiobutton(object sender, System.Windows.RoutedEventArgs e)
- {
- qsv_preset_ValueChanged(sender, null);
- }
-
- /// <summary>
- /// The qsv_preset_ value changed.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void qsv_preset_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
- {
- VideoViewModel mvm = ((VideoViewModel)this.DataContext);
- EncodeTask task = mvm.Task;
-
- string full_string = string.Empty;
-
- IDictionary<string, string> newOptions = new Dictionary<string, string>();
- string[] existingSegments = full_string.Split(':');
- foreach (string existingSegment in existingSegments)
- {
- string optionName = existingSegment;
- string optionValue = string.Empty;
- int equalsIndex = existingSegment.IndexOf('=');
- if (equalsIndex >= 0)
- {
- optionName = existingSegment.Substring(
- 0, existingSegment.IndexOf("=", System.StringComparison.Ordinal));
- optionValue = existingSegment.Substring(equalsIndex);
- }
-
- if (optionName != string.Empty)
- {
- if (newOptions.ContainsKey(optionName))
- newOptions.Remove(optionName);
- newOptions.Add(optionName, optionValue);
- }
- }
-
- full_string = string.Empty;
- foreach (KeyValuePair<string, string> entry in newOptions)
- {
- full_string += entry.Key;
- if (entry.Value != string.Empty)
- full_string += entry.Value;
- full_string += ":";
- }
- full_string = full_string.TrimEnd(':');
-
- task.AdvancedEncoderOptions = full_string;
- task.NotifyOfPropertyChange(() => task.AdvancedEncoderOptions);
- }
}
}