Commit 59d3fc2c authored by GitLab CI's avatar GitLab CI

Merge remote-tracking branch 'upstream/master' into master-build

* upstream/master:
  WinGui:  Add Preference to perform the When Done Action immediately without the 60 second prompt. (off by default)
  WinGui: Fix Copyright header
parents 80c0173c c976c839
Pipeline #62924542 passed with stages
in 62 minutes and 44 seconds
......@@ -2850,6 +2850,15 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Perform action immediately. (This will disable the 60 second confirmation dialog).
/// </summary>
public static string Options_PromptBeforeAction {
get {
return ResourceManager.GetString("Options_PromptBeforeAction", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Prefer use of Intel QuickSync for decoding video when available. .
/// </summary>
......
......@@ -1996,4 +1996,7 @@ Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitra
Where supported, any user presets will have been imported.</value>
</data>
<data name="Options_PromptBeforeAction" xml:space="preserve">
<value>Perform action immediately. (This will disable the 60 second confirmation dialog)</value>
</data>
</root>
\ No newline at end of file
......@@ -141,15 +141,20 @@ namespace HandBrakeWPF.Services
}
// Give the user the ability to cancel the shutdown. Default 60 second timer.
ICountdownAlertViewModel titleSpecificView = IoC.Get<ICountdownAlertViewModel>();
Execute.OnUIThread(
() =>
bool isCancelled = false;
if (!this.userSettingService.GetUserSetting<bool>(UserSettingConstants.WhenDonePerformActionImmediately))
{
ICountdownAlertViewModel titleSpecificView = IoC.Get<ICountdownAlertViewModel>();
Execute.OnUIThread(
() =>
{
titleSpecificView.SetAction(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction));
this.windowManager.ShowDialog(titleSpecificView);
isCancelled = titleSpecificView.IsCancelled;
});
}
if (!titleSpecificView.IsCancelled)
if (!isCancelled)
{
// Do something when the encode ends.
switch (this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction))
......
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TitleFactory.cs" company="">
// <copyright file="TitleFactory.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>
......
......@@ -71,5 +71,6 @@ namespace HandBrakeWPF
public const string FileOverwriteBehaviour = "FileOverwriteBehaviour";
public const string AutonameFileCollisionBehaviour = "AutonameFileCollisionBehaviour";
public const string AutonameFilePrePostString = "AutonameFilePrePostString";
public const string WhenDonePerformActionImmediately = "WhenDonePerformActionImmediately";
}
}
\ No newline at end of file
......@@ -107,10 +107,9 @@ namespace HandBrakeWPF.ViewModels
private bool showAddAllToQueue;
private int selectedOverwriteBehaviour;
private int selectedCollisionBehaviour;
private string prePostFilenameText;
private bool showPrePostFilenameBox;
private bool whenDonePerformActionImmediately;
#endregion
......@@ -381,6 +380,17 @@ namespace HandBrakeWPF.ViewModels
}
}
public bool WhenDonePerformActionImmediately
{
get => this.whenDonePerformActionImmediately;
set
{
if (value == this.whenDonePerformActionImmediately) return;
this.whenDonePerformActionImmediately = value;
this.NotifyOfPropertyChange(() => this.WhenDonePerformActionImmediately);
}
}
/// <summary>
/// Gets or sets a value indicating whether show queue inline.
/// </summary>
......@@ -1428,6 +1438,16 @@ namespace HandBrakeWPF.ViewModels
this.CheckForUpdatesFrequency = 1;
}
this.ShowQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);
this.ShowStatusInTitleBar = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowStatusInTitleBar);
this.ShowPreviewOnSummaryTab = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPreviewOnSummaryTab);
this.ShowAddAllToQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAddAllToQueue);
this.ShowAddSelectionToQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAddSelectionToQueue);
// #############################
// When Done
// #############################
// On Encode Completion Action
this.whenDoneOptions.Clear();
this.whenDoneOptions.Add("Do nothing");
......@@ -1437,7 +1457,8 @@ namespace HandBrakeWPF.ViewModels
this.whenDoneOptions.Add("Lock System");
this.whenDoneOptions.Add("Log off");
this.whenDoneOptions.Add("Quit HandBrake");
this.WhenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");
this.WhenDone = userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction);
if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction))
{
this.WhenDone = "Do nothing";
......@@ -1448,17 +1469,12 @@ namespace HandBrakeWPF.ViewModels
this.SendFileToPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo) ?? string.Empty;
this.Arguments = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs) ?? string.Empty;
this.ResetWhenDoneAction = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction);
this.ShowQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);
this.ShowStatusInTitleBar = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowStatusInTitleBar);
this.ShowPreviewOnSummaryTab = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowPreviewOnSummaryTab);
this.WhenDonePerformActionImmediately = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.WhenDonePerformActionImmediately);
this.WhenDoneAudioFile = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenDoneAudioFile)) ?? string.Empty;
this.WhenDoneAudioFileFullPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenDoneAudioFile);
this.PlaySoundWhenDone = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PlaySoundWhenDone);
this.PlaySoundWhenQueueDone = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PlaySoundWhenQueueDone);
this.ShowAddAllToQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAddAllToQueue);
this.ShowAddSelectionToQueue = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAddSelectionToQueue);
// #############################
// Output Settings
// #############################
......@@ -1624,16 +1640,12 @@ namespace HandBrakeWPF.ViewModels
/* General */
this.userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, this.CheckForUpdates);
this.userSettingService.SetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck, this.CheckForUpdatesFrequency);
this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, this.WhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.SendFileTo, this.SendFileToPath);
this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode);
this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments);
this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowStatusInTitleBar, this.ShowStatusInTitleBar);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowPreviewOnSummaryTab, this.ShowPreviewOnSummaryTab);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenDone, this.PlaySoundWhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenQueueDone, this.PlaySoundWhenQueueDone);
this.userSettingService.SetUserSetting(UserSettingConstants.WhenDoneAudioFile, this.WhenDoneAudioFileFullPath);
this.userSettingService.SetUserSetting(UserSettingConstants.UiLanguage, this.SelectedLanguage?.Culture);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowAddAllToQueue, this.ShowAddAllToQueue);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowAddSelectionToQueue, this.ShowAddSelectionToQueue);
......@@ -1641,6 +1653,15 @@ namespace HandBrakeWPF.ViewModels
/* Experiments */
this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline);
/* When Done */
this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, this.WhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction);
this.userSettingService.SetUserSetting(UserSettingConstants.WhenDonePerformActionImmediately, this.WhenDonePerformActionImmediately);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenDone, this.PlaySoundWhenDone);
this.userSettingService.SetUserSetting(UserSettingConstants.PlaySoundWhenQueueDone, this.PlaySoundWhenQueueDone);
this.userSettingService.SetUserSetting(UserSettingConstants.WhenDoneAudioFile, this.WhenDoneAudioFileFullPath);
/* Output Files */
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNameFormat, this.AutonameFormat);
......
......@@ -226,16 +226,28 @@
<TextBlock Text="{x:Static Properties:Resources.Options_WhenDone}" FontSize="20" FontFamily="Segoe UI Light" />
<TextBlock Text="{x:Static Properties:Resources.Options_QueueCompleted}" FontSize="14" Margin="0,10,0,10" />
<StackPanel Orientation="Vertical" Margin="0,0,0,10">
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static Properties:Resources.Options_WhenDoneColon}" />
<ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120" HorizontalAlignment="Left" />
<CheckBox Content="{x:Static Properties:Resources.Options_ResetDoNothing}" VerticalAlignment="Center" Margin="5,0,0,0" IsChecked="{Binding ResetWhenDoneAction}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,0,0,10">
<Grid Margin="20,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{x:Static Properties:Resources.Options_WhenDoneColon}" Grid.Row="0" Grid.Column="0" />
<ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" />
<CheckBox Content="{x:Static Properties:Resources.Options_ResetDoNothing}" VerticalAlignment="Center" Margin="0,5,0,0" Grid.Row="1" Grid.Column="1"
IsChecked="{Binding ResetWhenDoneAction}" />
<CheckBox Content="{x:Static Properties:Resources.Options_PromptBeforeAction}" VerticalAlignment="Center" Margin="0,5,0,0" Grid.Row="2" Grid.Column="1"
IsChecked="{Binding WhenDonePerformActionImmediately}" />
</Grid>
<TextBlock Text="{x:Static Properties:Resources.Options_EncodeCompleted}" FontSize="14" Margin="0,10,0,10" />
<StackPanel Orientation="Vertical" Margin="20,0,0,0">
......
......@@ -545,5 +545,12 @@
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">output_</anyType>
</value>
</item>
<item>
<key>
<string>WhenDonePerformActionImmediately</string>
</key>
<value>
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
</value>
</item>
</dictionary>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment