From cc66e149da034cffaa48284532eec7e5b7ca72e8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 17 Aug 2013 18:46:34 +0000 Subject: WinGui: Improved the Queue Tooltip and Added a new "Reset to 'Do nothing' when the app starts" option (for the when done dropdown) to preferences. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5704 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Converters/Audio/AudioQueueDisplayConverter.cs | 17 ++++++------- .../Subtitles/SubtitlesQueueDisplayConverter.cs | 18 ++++++-------- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + win/CS/HandBrakeWPF/UserSettingConstants.cs | 5 ++++ win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 29 ++++++++++++++++++++++ win/CS/HandBrakeWPF/Views/OptionsView.xaml | 6 ++++- win/CS/HandBrakeWPF/Views/QueueView.xaml | 7 ++++-- 7 files changed, 60 insertions(+), 23 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs index d081be1a6..c729fac82 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs @@ -13,6 +13,7 @@ namespace HandBrakeWPF.Converters.Audio using System.Collections.ObjectModel; using System.Globalization; using System.Text; + using System.Threading.Tasks; using System.Windows.Data; using HandBrake.ApplicationServices.Model.Encoding; @@ -39,18 +40,16 @@ namespace HandBrakeWPF.Converters.Audio { foreach (AudioTrack track in tracks) { - if (string.IsNullOrEmpty(audioTracks.ToString())) - { - audioTracks.Append(EnumHelper.GetDisplay(track.Encoder)); - } - else - { - audioTracks.Append(", " + EnumHelper.GetDisplay(track.Encoder)); - } + string trackName = string.Format( + "{0} {1}", + track.ScannedTrack.TrackNumber, + track.ScannedTrack.Language); + + audioTracks.Append(string.Format("{0} - {1} To {2}{3}", trackName, track.TrackName, EnumHelper.GetDisplay(track.Encoder), Environment.NewLine)); } } - return audioTracks.ToString(); + return audioTracks.ToString().Trim(); } /// diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs index e30967ae3..3e5f5d113 100644 --- a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitlesQueueDisplayConverter.cs @@ -32,24 +32,20 @@ namespace HandBrakeWPF.Converters.Subtitles public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ObservableCollection tracks = value as ObservableCollection; - StringBuilder audioTracks = new StringBuilder(); + StringBuilder sutitleTracks = new StringBuilder(); if (tracks != null) { foreach (SubtitleTrack track in tracks) { - string text = track.SourceTrack != null ? track.SourceTrack.ToString() : (track.SrtFileName + ".srt"); - if (string.IsNullOrEmpty(audioTracks.ToString())) - { - audioTracks.Append(text); - } - else - { - audioTracks.Append(", " + text); - } + string text = track.SourceTrack != null + ? track.SourceTrack.ToString() + : (track.SrtFileName + ".srt"); + + sutitleTracks.AppendLine(text); } } - return string.IsNullOrEmpty(audioTracks.ToString()) ? "None" : audioTracks.ToString(); + return string.IsNullOrEmpty(sutitleTracks.ToString()) ? "None" : sutitleTracks.ToString().Trim(); } /// diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 1e1bddefa..b4e6d724f 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -156,6 +156,7 @@ + diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index b9ce40b0c..b44ddd33a 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -241,6 +241,11 @@ namespace HandBrakeWPF /// public const string UseSystemColours = "UseSystemColours"; + /// + /// The reset when done action. + /// + public const string ResetWhenDoneAction = "ResetWhenDoneAction"; + #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index e1376363a..b84b6f922 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -363,6 +363,11 @@ namespace HandBrakeWPF.ViewModels /// private bool useSystemColoursForStyles; + /// + /// The reset when done action. + /// + private bool resetWhenDoneAction; + #endregion #region Constructors and Destructors @@ -440,6 +445,23 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether reset when done action. + /// + public bool ResetWhenDoneAction + { + get + { + return this.resetWhenDoneAction; + } + + set + { + this.resetWhenDoneAction = value; + this.NotifyOfPropertyChange("ResetWhenDoneAction"); + } + } + /// /// Gets or sets CheckForUpdatesFrequencies. /// @@ -1529,6 +1551,11 @@ namespace HandBrakeWPF.ViewModels this.whenDoneOptions.Add("Log off"); this.whenDoneOptions.Add("Quit HandBrake"); this.WhenDone = userSettingService.GetUserSetting("WhenCompleteAction"); + if (this.userSettingService.GetUserSetting(UserSettingConstants.ResetWhenDoneAction)) + { + this.WhenDone = "Do nothing"; + this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, "Do nothing"); + } this.GrowlAfterEncode = userSettingService.GetUserSetting(UserSettingConstants.GrowlEncode); this.GrowlAfterQueue = userSettingService.GetUserSetting(UserSettingConstants.GrowlQueue); @@ -1537,6 +1564,7 @@ namespace HandBrakeWPF.ViewModels this.SendFileToPath = this.userSettingService.GetUserSetting(UserSettingConstants.SendFileTo) ?? string.Empty; this.Arguments = this.userSettingService.GetUserSetting(UserSettingConstants.SendFileToArgs) ?? string.Empty; this.UseSystemColoursForStylesForStyles = this.userSettingService.GetUserSetting(UserSettingConstants.UseSystemColours); + this.ResetWhenDoneAction = this.userSettingService.GetUserSetting(UserSettingConstants.ResetWhenDoneAction); // ############################# // Output Settings @@ -1874,6 +1902,7 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode); this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments); this.userSettingService.SetUserSetting(UserSettingConstants.UseSystemColours, this.UseSystemColoursForStylesForStyles); + this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction); /* Output Files */ this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles); diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index d1dc2f03a..8aadb7ce3 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -97,7 +97,11 @@ - + + + + + diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index 65efca4ce..dc6354ea5 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -9,7 +9,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:YourNamespace="clr-namespace:HandBrakeWPF.AttachedProperties" xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio" - xmlns:Subtitles="clr-namespace:HandBrakeWPF.Converters.Subtitles" Title="{Binding Title}" + xmlns:Subtitles="clr-namespace:HandBrakeWPF.Converters.Subtitles" + xmlns:video="clr-namespace:HandBrakeWPF.Converters.Video" + Title="{Binding Title}" Width="700" Height="500" MinWidth="200" @@ -26,6 +28,7 @@ +