summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs21
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs5
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs27
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml16
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml8
7 files changed, 38 insertions, 49 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
index f316c85c6..0bf34b6a4 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
@@ -31,6 +31,11 @@ namespace HandBrake.ApplicationServices.Utilities
/// </summary>
private static readonly string LogDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ /// <summary>
+ /// The is lib hb present.
+ /// </summary>
+ private static bool? isLibHbPresent;
+
#endregion
#region Properties
@@ -46,6 +51,22 @@ namespace HandBrake.ApplicationServices.Utilities
}
}
+ /// <summary>
+ /// Gets a value indicating whether is lib hb present.
+ /// </summary>
+ public static bool IsLibHbPresent
+ {
+ get
+ {
+ if (isLibHbPresent == null)
+ {
+ isLibHbPresent = File.Exists(Path.Combine(Application.StartupPath, "hb.dll"));
+ }
+
+ return isLibHbPresent.Value;
+ }
+ }
+
#endregion
#region Public Methods
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
index 6eb669114..af4a57bcd 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
@@ -74,6 +74,11 @@ namespace HandBrake.ApplicationServices.Utilities
{
try
{
+ if (!GeneralUtilities.IsLibHbPresent)
+ {
+ return false; // Feature is disabled.
+ }
+
return HBFunctions.hb_qsv_available() == 1;
}
catch (Exception)
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs
index b44ddd33a..be18e755f 100644
--- a/win/CS/HandBrakeWPF/UserSettingConstants.cs
+++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs
@@ -195,11 +195,6 @@ namespace HandBrakeWPF
/// The last preview duration
/// </summary>
public const string LastPreviewDuration = "LastPreviewDuration";
-
- /// <summary>
- /// Disable LibHb Features
- /// </summary>
- public const string DisableLibHbFeatures = "DisableLibHbFeatures";
/// <summary>
/// When Complete Action
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index b84b6f922..79d5f5675 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -144,11 +144,6 @@ namespace HandBrakeWPF.ViewModels
private bool disableLibdvdNav;
/// <summary>
- /// The disable libhb features
- /// </summary>
- private bool disableLibhbFeatures;
-
- /// <summary>
/// The disable p reset update check notification.
/// </summary>
private bool disablePresetUpdateCheckNotification;
@@ -1414,24 +1409,6 @@ namespace HandBrakeWPF.ViewModels
}
}
- /// <summary>
- /// Gets or sets a value indicating whether DisableLibdvdNav.
- /// </summary>
- public bool DisableLibHbFeatures
- {
- get
- {
- return this.disableLibhbFeatures;
- }
-
- set
- {
- this.disableLibhbFeatures = value;
- this.NotifyOfPropertyChange("DisableLibHbFeatures");
- }
- }
-
-
#endregion
#endregion
@@ -1734,9 +1711,6 @@ namespace HandBrakeWPF.ViewModels
this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
this.EnableDebugFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);
this.EnableLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
-
- // LibHbFeatures
- this.DisableLibHbFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures);
}
/// <summary>
@@ -1956,7 +1930,6 @@ namespace HandBrakeWPF.ViewModels
userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation);
userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString());
userSettingService.SetUserSetting(UserSettingConstants.EnableDebugFeatures, this.EnableDebugFeatures);
- userSettingService.SetUserSetting(UserSettingConstants.DisableLibHbFeatures, this.DisableLibHbFeatures);
userSettingService.SetUserSetting(UserSettingConstants.EnableLibHb, this.EnableLibHb);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index e8702e60f..33403b5b3 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels
using System.ComponentModel;
using System.Globalization;
using System.Linq;
+ using System.ServiceModel.Channels;
using System.Windows;
using Caliburn.Micro;
@@ -199,7 +200,7 @@ namespace HandBrakeWPF.ViewModels
if (!object.Equals(value, this.useAdvancedTab))
{
// Set the Advanced Tab up with the current settings, if we can.
- if (value && !this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))
+ if (value)
{
this.Task.AdvancedEncoderOptions = this.GetActualx264Query();
}
@@ -1133,7 +1134,7 @@ namespace HandBrakeWPF.ViewModels
/// </returns>
private string GetActualx264Query()
{
- if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))
+ if (!GeneralUtilities.IsLibHbPresent)
{
return string.Empty; // Feature is disabled.
}
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 923876b8e..39282a062 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -99,9 +99,12 @@
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
<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="Reset to 'Do nothing' when the app is re-launched." VerticalAlignment="Center" 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"/>
@@ -182,10 +185,10 @@
</StackPanel>
<TextBlock Text="Available Options: {source} {title} {chapters} {date} {time} {quality} {bitrate}" />
- <StackPanel Orientation="Horizontal" Margin="0,15,0,0">
+ <StackPanel Orientation="Vertical" Margin="0,15,0,0">
<CheckBox Content="Replace underscores with a space" IsChecked="{Binding RemoveUnderscores}"/>
- <CheckBox Content="Remove common punctuation" ToolTip="Dash (-), Period (.) and Comma (,) " IsChecked="{Binding RemovePunctuation}" Margin="5,0,0,0"/>
- <CheckBox Content="Change case to Title Case" IsChecked="{Binding ChangeToTitleCase}" Margin="5,0,0,0" />
+ <CheckBox Content="Remove common punctuation" ToolTip="Dash (-), Period (.) and Comma (,) " IsChecked="{Binding RemovePunctuation}" />
+ <CheckBox Content="Change case to Title Case" IsChecked="{Binding ChangeToTitleCase}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,15,0,0">
@@ -311,7 +314,6 @@
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
<CheckBox Content="Prevent the system from sleeping while encoding" IsChecked="{Binding PreventSleep}" />
- <CheckBox Content="Disable LibHB Features" IsChecked="{Binding DisableLibHbFeatures}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Text="Number of picture previews to scan:" VerticalAlignment="Center" Width="250" />
<ComboBox Name="numberOfPreviews" ItemsSource="{Binding PreviewPicturesToScan}" SelectedItem="{Binding SelectedPreviewCount}" Width="120" />
@@ -369,7 +371,7 @@
<Button Content="Clear Log History" cal:Message.Attach="[Event Click] = [Action ClearLogHistory]" />
</StackPanel>
- <CheckBox Content="Clear Log files older than 30 days " Margin="0,5,0,0" IsChecked="{Binding ClearOldOlgs}" />
+ <CheckBox Content="Clear Log files older than 30 days " Margin="0,10,0,0" IsChecked="{Binding ClearOldOlgs}" />
</StackPanel>
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml
index 30eebc778..6ee45940f 100644
--- a/win/CS/HandBrakeWPF/defaultsettings.xml
+++ b/win/CS/HandBrakeWPF/defaultsettings.xml
@@ -442,14 +442,6 @@
</item>
<item>
<key>
- <string>DisableLibHbFeatures</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>
- <item>
- <key>
<string>RemovePunctuation</string>
</key>
<value>