From ff27427d20803a01800a288fbd3d8426cab7eb56 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 16 Jun 2012 12:40:05 +0000 Subject: 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 --- .../Converters/Audio/AudioQueueDisplayConverter.cs | 68 ++++++++++++++++++++++ win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 3 + win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs | 1 + win/CS/HandBrakeWPF/Views/QueueView.xaml | 26 ++++++++- 5 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs (limited to 'win/CS/HandBrakeWPF') 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 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Audio Queue Display Converter +// +// -------------------------------------------------------------------------------------------------------------------- + +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; + + /// + /// Audio Queue Display Converter + /// + public class AudioQueueDisplayConverter : IValueConverter + { + /// + /// Converts a value. + /// + /// + /// A converted value. If the method returns null, the valid null value is used. + /// + /// The value produced by the binding source.The type of the binding target property.The converter parameter to use.The culture to use in the converter. + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + ObservableCollection tracks = value as ObservableCollection; + StringBuilder audioTracks = new StringBuilder(); + if (tracks != null) + { + foreach (AudioTrack track in tracks) + { + if (string.IsNullOrEmpty(audioTracks.ToString())) + { + audioTracks.Append(EnumHelper.GetDisplay(track.Encoder)); + } + else + { + audioTracks.Append( "," + EnumHelper.GetDisplay(track.Encoder)); + } + } + } + + return audioTracks.ToString(); + } + + /// + /// Converts a value. + /// + /// + /// A converted value. If the method returns null, the valid null value is used. + /// + /// The value that is produced by the binding target.The type to convert to.The converter parameter to use.The culture to use in the converter. + 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 @@ + 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); } /// 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 @@ + @@ -154,10 +155,31 @@ - -- cgit v1.2.3