]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove the option to disable libhb features as it's now vital to have this...
authorsr55 <sr55.hb@outlook.com>
Tue, 17 Sep 2013 21:06:20 +0000 (21:06 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 17 Sep 2013 21:06:20 +0000 (21:06 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5785 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs
win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs
win/CS/HandBrakeWPF/UserSettingConstants.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/defaultsettings.xml

index f316c85c6727641e32547b13fc100b1111d58258..0bf34b6a4c895b1e21ba32b60f25c6b899629d0f 100644 (file)
@@ -31,6 +31,11 @@ namespace HandBrake.ApplicationServices.Utilities
         /// </summary>\r
         private static readonly string LogDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
 \r
+        /// <summary>\r
+        /// The is lib hb present.\r
+        /// </summary>\r
+        private static bool? isLibHbPresent;\r
+\r
         #endregion\r
 \r
         #region Properties\r
@@ -46,6 +51,22 @@ namespace HandBrake.ApplicationServices.Utilities
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets a value indicating whether is lib hb present.\r
+        /// </summary>\r
+        public static bool IsLibHbPresent\r
+        {\r
+            get\r
+            {\r
+                if (isLibHbPresent == null)\r
+                {\r
+                    isLibHbPresent = File.Exists(Path.Combine(Application.StartupPath, "hb.dll"));\r
+                }\r
+\r
+                return isLibHbPresent.Value;\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Public Methods\r
index 6eb66911451aa6482050034ef1558aa28fc2229e..af4a57bcde5a8bbf5b4f7dc5f7e1e9ef8aed08b0 100644 (file)
@@ -74,6 +74,11 @@ namespace HandBrake.ApplicationServices.Utilities
             {\r
                 try\r
                 {\r
+                    if (!GeneralUtilities.IsLibHbPresent)\r
+                    {\r
+                        return false; // Feature is disabled.\r
+                    }\r
+\r
                     return HBFunctions.hb_qsv_available() == 1;\r
                 }\r
                 catch (Exception)\r
index b44ddd33a32c34710a1aedd6e71f788faad60311..be18e755f7f551fc3ca03eb7319d9925a3fa39ae 100644 (file)
@@ -195,11 +195,6 @@ namespace HandBrakeWPF
         /// The last preview duration\r
         /// </summary>\r
         public const string LastPreviewDuration = "LastPreviewDuration";\r
-\r
-        /// <summary>\r
-        /// Disable LibHb Features\r
-        /// </summary>\r
-        public const string DisableLibHbFeatures = "DisableLibHbFeatures";\r
     \r
         /// <summary>\r
         /// When Complete Action\r
index b84b6f922efaeee8a1951b5896144bddfa2fb177..79d5f5675e0b98148bfa07c0d251442ebb1e23cb 100644 (file)
@@ -143,11 +143,6 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private bool disableLibdvdNav;\r
 \r
-        /// <summary>\r
-        /// The disable libhb features\r
-        /// </summary>\r
-        private bool disableLibhbFeatures;\r
-\r
         /// <summary>\r
         /// The disable p reset update check notification.\r
         /// </summary>\r
@@ -1414,24 +1409,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether DisableLibdvdNav.\r
-        /// </summary>\r
-        public bool DisableLibHbFeatures\r
-        {\r
-            get\r
-            {\r
-                return this.disableLibhbFeatures;\r
-            }\r
-\r
-            set\r
-            {\r
-                this.disableLibhbFeatures = value;\r
-                this.NotifyOfPropertyChange("DisableLibHbFeatures");\r
-            }\r
-        }\r
-\r
-\r
         #endregion\r
 \r
         #endregion\r
@@ -1734,9 +1711,6 @@ namespace HandBrakeWPF.ViewModels
             this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);\r
             this.EnableDebugFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);\r
             this.EnableLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);\r
-\r
-            // LibHbFeatures\r
-            this.DisableLibHbFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures);\r
         }\r
 \r
         /// <summary>\r
@@ -1956,7 +1930,6 @@ namespace HandBrakeWPF.ViewModels
             userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation);\r
             userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString());\r
             userSettingService.SetUserSetting(UserSettingConstants.EnableDebugFeatures, this.EnableDebugFeatures);\r
-            userSettingService.SetUserSetting(UserSettingConstants.DisableLibHbFeatures, this.DisableLibHbFeatures);\r
             userSettingService.SetUserSetting(UserSettingConstants.EnableLibHb, this.EnableLibHb);\r
         }\r
 \r
index e8702e60fb4ef7525d34f70908d15f738bfad731..33403b5b38e2cf958e5a04c2a61e9819ac10ef9c 100644 (file)
@@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels
     using System.ComponentModel;\r
     using System.Globalization;\r
     using System.Linq;\r
+    using System.ServiceModel.Channels;\r
     using System.Windows;\r
 \r
     using Caliburn.Micro;\r
@@ -199,7 +200,7 @@ namespace HandBrakeWPF.ViewModels
                 if (!object.Equals(value, this.useAdvancedTab))\r
                 {\r
                     // Set the Advanced Tab up with the current settings, if we can.\r
-                    if (value && !this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))\r
+                    if (value)\r
                     {\r
                         this.Task.AdvancedEncoderOptions = this.GetActualx264Query();\r
                     }\r
@@ -1133,7 +1134,7 @@ namespace HandBrakeWPF.ViewModels
         /// </returns>\r
         private string GetActualx264Query()\r
         {\r
-            if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))\r
+            if (!GeneralUtilities.IsLibHbPresent)\r
             {\r
                 return string.Empty; // Feature is disabled.\r
             }\r
index 923876b8ed569a0fd7e2d3959a445b1665d82c62..39282a062f8d0f091a7acfa87c8a9ec86097819c 100644 (file)
                         <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">\r
                             <StackPanel Orientation="Horizontal">\r
                                 <ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120"  HorizontalAlignment="Left" />\r
-                                <CheckBox Content="Reset to 'Do nothing' when the app is launched." VerticalAlignment="Center" Margin="10,0,0,0" IsChecked="{Binding ResetWhenDoneAction}" />\r
+                           \r
+                            </StackPanel>\r
+\r
+                            <StackPanel Orientation="Horizontal" Margin="0,5,0,0">\r
+                                <CheckBox Content="Reset to 'Do nothing' when the app is re-launched." VerticalAlignment="Center" IsChecked="{Binding ResetWhenDoneAction}" />\r
                             </StackPanel>\r
-                         \r
 \r
                             <StackPanel Orientation="Horizontal" Margin="0,5,0,0">\r
                                 <CheckBox Content="Growl after Queue Completes" IsChecked="{Binding GrowlAfterEncode}" Margin="0,0,5,0"/>\r
                             </StackPanel>\r
                             <TextBlock Text="Available Options: {source} {title} {chapters} {date} {time} {quality} {bitrate}" />\r
 \r
-                            <StackPanel Orientation="Horizontal" Margin="0,15,0,0">\r
+                            <StackPanel Orientation="Vertical" Margin="0,15,0,0">\r
                                 <CheckBox Content="Replace underscores with a space" IsChecked="{Binding RemoveUnderscores}"/>\r
-                                <CheckBox Content="Remove common punctuation" ToolTip="Dash (-), Period (.) and Comma (,) " IsChecked="{Binding RemovePunctuation}"  Margin="5,0,0,0"/>\r
-                                <CheckBox Content="Change case to Title Case" IsChecked="{Binding ChangeToTitleCase}" Margin="5,0,0,0" />\r
+                                <CheckBox Content="Remove common punctuation" ToolTip="Dash (-), Period (.) and Comma (,) " IsChecked="{Binding RemovePunctuation}"  />\r
+                                <CheckBox Content="Change case to Title Case" IsChecked="{Binding ChangeToTitleCase}" />\r
                             </StackPanel>\r
 \r
                             <StackPanel Orientation="Horizontal" Margin="0,15,0,0">\r
 \r
                         <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">\r
                             <CheckBox Content="Prevent the system from sleeping while encoding" IsChecked="{Binding PreventSleep}" />\r
-                            <CheckBox Content="Disable LibHB Features" IsChecked="{Binding DisableLibHbFeatures}" />\r
                             <StackPanel Orientation="Horizontal" Margin="0,10,0,0">\r
                                 <TextBlock Text="Number of picture previews to scan:" VerticalAlignment="Center" Width="250" />\r
                                 <ComboBox Name="numberOfPreviews" ItemsSource="{Binding PreviewPicturesToScan}" SelectedItem="{Binding SelectedPreviewCount}" Width="120" />\r
                                 <Button Content="Clear Log History" cal:Message.Attach="[Event Click] = [Action ClearLogHistory]" />\r
                             </StackPanel>\r
 \r
-                            <CheckBox Content="Clear Log files older than 30 days " Margin="0,5,0,0" IsChecked="{Binding ClearOldOlgs}" />\r
+                            <CheckBox Content="Clear Log files older than 30 days " Margin="0,10,0,0" IsChecked="{Binding ClearOldOlgs}" />\r
                         </StackPanel>\r
 \r
                     </StackPanel>\r
index 30eebc778fa9520b9d0e627ac8df16ffc13b4f2a..6ee45940f01ab75b2e341f4328ad124a07fa4eec 100644 (file)
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">30</anyType>\r
     </value>\r
   </item>\r
-  <item>\r
-    <key>\r
-      <string>DisableLibHbFeatures</string>\r
-    </key>\r
-    <value>\r
-      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
-    </value>\r
-  </item>\r
   <item>\r
     <key>\r
       <string>RemovePunctuation</string>\r