diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
7 files changed, 60 insertions, 23 deletions
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<AudioEncoder>.GetDisplay(track.Encoder));
- }
- else
- {
- audioTracks.Append(", " + EnumHelper<AudioEncoder>.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<AudioEncoder>.GetDisplay(track.Encoder), Environment.NewLine));
}
}
- return audioTracks.ToString();
+ return audioTracks.ToString().Trim();
}
/// <summary>
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<SubtitleTrack> tracks = value as ObservableCollection<SubtitleTrack>;
- 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();
}
/// <summary>
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 @@ <Compile Include="Converters\Options\OptionsTabNameConverter.cs" />
<Compile Include="Converters\Subtitles\SubtitlesQueueDisplayConverter.cs" />
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />
+ <Compile Include="Converters\Video\EncoderOptionsTooltipConverter.cs" />
<Compile Include="Helpers\GrayscaleImage.cs" />
<Compile Include="Helpers\GrowlCommunicator.cs" />
<Compile Include="Helpers\AppStyleHelper.cs" />
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 /// </summary>
public const string UseSystemColours = "UseSystemColours";
+ /// <summary>
+ /// The reset when done action.
+ /// </summary>
+ 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 /// </summary>
private bool useSystemColoursForStyles;
+ /// <summary>
+ /// The reset when done action.
+ /// </summary>
+ private bool resetWhenDoneAction;
+
#endregion
#region Constructors and Destructors
@@ -441,6 +446,23 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Gets or sets a value indicating whether reset when done action.
+ /// </summary>
+ public bool ResetWhenDoneAction
+ {
+ get
+ {
+ return this.resetWhenDoneAction;
+ }
+
+ set
+ {
+ this.resetWhenDoneAction = value;
+ this.NotifyOfPropertyChange("ResetWhenDoneAction");
+ }
+ }
+
+ /// <summary>
/// Gets or sets CheckForUpdatesFrequencies.
/// </summary>
public BindingList<string> CheckForUpdatesFrequencies
@@ -1529,6 +1551,11 @@ namespace HandBrakeWPF.ViewModels this.whenDoneOptions.Add("Log off");
this.whenDoneOptions.Add("Quit HandBrake");
this.WhenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction))
+ {
+ this.WhenDone = "Do nothing";
+ this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, "Do nothing");
+ }
this.GrowlAfterEncode = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode);
this.GrowlAfterQueue = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue);
@@ -1537,6 +1564,7 @@ namespace HandBrakeWPF.ViewModels this.SendFileToPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo) ?? string.Empty;
this.Arguments = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs) ?? string.Empty;
this.UseSystemColoursForStylesForStyles = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseSystemColours);
+ this.ResetWhenDoneAction = this.userSettingService.GetUserSetting<bool>(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 @@ <TextBlock Text="When Done" Grid.Column="0" FontSize="14" Margin="0,0,0,10" />
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
- <ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120" HorizontalAlignment="Left"></ComboBox>
+ <StackPanel Orientation="Horizontal">
+ <ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120" HorizontalAlignment="Left" />
+ <CheckBox Content="Reset to 'Do nothing' when the app is launched." VerticalAlignment="Center" Margin="10,0,0,0" IsChecked="{Binding ResetWhenDoneAction}" />
+ </StackPanel>
+
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<CheckBox Content="Growl after Queue Completes" IsChecked="{Binding GrowlAfterEncode}" Margin="0,0,5,0"/>
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 @@ <Converters:QueueStatusToVisibilityConverter x:Key="queueStatusVisConverter" />
<Audio:AudioQueueDisplayConverter x:Key="audioTrackDisplayConverter" />
<Subtitles:SubtitlesQueueDisplayConverter x:Key="subtitleTrackDisplayConverter" />
+ <video:EncoderOptionsTooltipConverter x:Key="encoderOptionsTooltipConverter" />
<Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
@@ -210,7 +213,7 @@ <TextBlock FontWeight="Bold" VerticalAlignment="Top" Grid.Row="5" Grid.Column="0" Text="Advanced: " />
- <TextBlock Text="{Binding Task.AdvancedEncoderOptions}" Grid.Row="5" Grid.Column="1" />
+ <TextBlock Text="{Binding Task, Converter={StaticResource encoderOptionsTooltipConverter}}" Grid.Row="5" Grid.Column="1" TextWrapping="Wrap" />
</Grid>
</Setter.Value>
|