summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-06-16 12:40:05 +0000
committersr55 <[email protected]>2012-06-16 12:40:05 +0000
commitff27427d20803a01800a288fbd3d8426cab7eb56 (patch)
treef6b4ed03656149433cbe9d436df9c8b88c6ac76b /win
parent0238140a12f273586ff1ad0b2416690fa44a4ecb (diff)
WinGui: Various fixes
- Add tooltip to each queue item to indicate some primary settings. - Removed some legacy preset code. - Fixed Queue Recovery git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4740 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Preset.cs5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/PresetService.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs2
-rw-r--r--win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs68
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/Views/QueueView.xaml26
8 files changed, 98 insertions, 10 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Preset.cs b/win/CS/HandBrake.ApplicationServices/Model/Preset.cs
index 2a9a1693e..448d1a33e 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Preset.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Preset.cs
@@ -25,11 +25,6 @@ namespace HandBrake.ApplicationServices.Model
public string Name { get; set; }
/// <summary>
- /// Gets or sets the preset query
- /// </summary>
- public string Query { get; set; }
-
- /// <summary>
/// Gets or sets The version number which associates this preset with a HB build
/// </summary>
public string Version { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
index a4946278a..804a963b6 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
@@ -153,7 +153,6 @@ namespace HandBrake.ApplicationServices.Services
{
if (preset.Name == update.Name)
{
- preset.Query = update.Query;
preset.Task = update.Task;
preset.UsePictureFilters = update.UsePictureFilters;
@@ -304,7 +303,6 @@ namespace HandBrake.ApplicationServices.Services
{
Category = category,
Name = presetName[0].Replace("+", string.Empty).Trim(),
- Query = presetName[2],
Version = this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
Description = string.Empty, // Maybe one day we will populate this.
IsBuildIn = true,
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
index 9f2c70bcf..6cf009285 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
@@ -496,7 +496,7 @@ namespace HandBrake.ApplicationServices.Utilities
return;
}
- EncodeTask parsed = QueryParserUtility.Parse(preset.Query);
+ EncodeTask parsed = new EncodeTask(preset.Task);
using (XmlTextWriter xmlWriter = new XmlTextWriter(path, Encoding.UTF8) { Formatting = Formatting.Indented })
{
// Header
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs
new file mode 100644
index 000000000..d3440e265
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs
@@ -0,0 +1,68 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioQueueDisplayConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Audio Queue Display Converter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Audio
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.Globalization;
+ using System.Text;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Functions;
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
+
+ /// <summary>
+ /// Audio Queue Display Converter
+ /// </summary>
+ public class AudioQueueDisplayConverter : IValueConverter
+ {
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ ObservableCollection<AudioTrack> tracks = value as ObservableCollection<AudioTrack>;
+ StringBuilder audioTracks = new StringBuilder();
+ if (tracks != null)
+ {
+ foreach (AudioTrack track in tracks)
+ {
+ if (string.IsNullOrEmpty(audioTracks.ToString()))
+ {
+ audioTracks.Append(EnumHelper<AudioEncoder>.GetDisplay(track.Encoder));
+ }
+ else
+ {
+ audioTracks.Append( "," + EnumHelper<AudioEncoder>.GetDisplay(track.Encoder));
+ }
+ }
+ }
+
+ return audioTracks.ToString();
+ }
+
+ /// <summary>
+ /// Converts a value.
+ /// </summary>
+ /// <returns>
+ /// A converted value. If the method returns null, the valid null value is used.
+ /// </returns>
+ /// <param name="value">The value that is produced by the binding target.</param><param name="targetType">The type to convert to.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 6d5d162b2..7d0270859 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -119,6 +119,7 @@
</Compile>
<Compile Include="Converters\Audio\AudioBitrateConverter.cs" />
<Compile Include="Converters\Audio\AudioEncoderConverter.cs" />
+ <Compile Include="Converters\Audio\AudioQueueDisplayConverter.cs" />
<Compile Include="Converters\BooleanToHiddenVisibilityConverter.cs" />
<Compile Include="Converters\Options\OptionsTabConverter.cs" />
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 156fc1dfa..60272c057 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -785,6 +785,9 @@ namespace HandBrakeWPF.ViewModels
this.errorService.ShowMessageBox("HandBrake has determined your built-in presets are out of date... These presets will now be updated.",
"Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);
+ // Queue Recovery
+ QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+
this.SelectedPreset = this.presetService.DefaultPreset;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index b72e093ea..e1c8fccb7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -280,6 +280,7 @@ namespace HandBrakeWPF.ViewModels
public void RetryJob(QueueTask task)
{
task.Status = QueueItemStatus.Waiting;
+ this.queueProcessor.QueueManager.BackupQueue(null);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml
index 2fcc8e8c2..e505800fc 100644
--- a/win/CS/HandBrakeWPF/Views/QueueView.xaml
+++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml
@@ -8,7 +8,7 @@
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:YourNamespace="clr-namespace:HandBrakeWPF.AttachedProperties"
- Title="{Binding Title}"
+ xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio" Title="{Binding Title}"
Width="600"
Height="400"
MinWidth="600"
@@ -23,6 +23,7 @@
<Converters:FullPathToFileNameConverter x:Key="filePathToFilenameConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
<Converters:QueueStatusToVisibilityConverter x:Key="queueStatusVisConverter" />
+ <Audio:AudioQueueDisplayConverter x:Key="audioTrackDisplayConverter" />
</Window.Resources>
<Grid>
@@ -154,10 +155,31 @@
</ListBox.ContextMenu>
<ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
+ <Style TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Background" Value="WhiteSmoke" />
<Setter Property="Margin" Value="0,0,0,1" />
+ <Setter Property="ToolTip">
+ <Setter.Value>
+ <StackPanel Grid.Column="1"
+ Margin="0,5,0,5"
+ HorizontalAlignment="Stretch">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontWeight="Bold" Text="Video" />
+ <TextBlock Text=": " />
+ <TextBlock Text="{Binding Task.VideoEncoder, Converter={StaticResource enumComboConverter}}" />
+ <TextBlock Margin="10,0,0,0" FontWeight="Bold" Text="Audio: " />
+ <TextBlock Text="{Binding Task.AudioTracks, Converter={StaticResource audioTrackDisplayConverter}}" />
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock FontWeight="Bold" Text="Advanced: " />
+ <TextBlock Text="{Binding Task.AdvancedEncoderOptions}" />
+ </StackPanel>
+
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
</Style>
</ListBox.ItemContainerStyle>