]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove the preference to show the advanced tab. This can still be toggled...
authorsr55 <sr55.hb@outlook.com>
Sat, 20 Oct 2018 14:03:42 +0000 (15:03 +0100)
committersr55 <sr55.hb@outlook.com>
Sat, 20 Oct 2018 14:06:11 +0000 (15:06 +0100)
win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
win/CS/HandBrakeWPF/Properties/Resources.resx
win/CS/HandBrakeWPF/Services/UserSettingService.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/Views/VideoView.xaml
win/CS/HandBrakeWPF/Views/X264View.xaml

index 5c7732428f28f4a9cbb8357da0a0fb05bd632ac5..0badf3c9e03e67dc66654c1877e735ce0e8af930 100644 (file)
@@ -364,19 +364,6 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
-        /// <summary>\r
-        ///   Looks up a localized string similar to The x264 Preset / Tune / Profile and Level options are currently in use on the Video Tab. \r
-        ///\r
-        ///To enable this tab, check the &quot;Use Advanced Tab instead&quot; option on the Video Tab.\r
-        ///\r
-        ///If you do not use this tab, it can be hidden from: Tools Menu &gt; Options &gt; Advanced..\r
-        /// </summary>\r
-        public static string Advanced_NotInUse {\r
-            get {\r
-                return ResourceManager.GetString("Advanced_NotInUse", resourceCulture);\r
-            }\r
-        }\r
-        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Psychovisual Rate Distortion means x264 tries to retain detail, for better quality to the human eye, \r
         ///as opposed to trying to maximize quality the way a computer understands it, through signal-to-noise ratios that have trouble telling apart fine detail and noise..\r
@@ -2492,15 +2479,6 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
-        /// <summary>\r
-        ///   Looks up a localized string similar to Allow use of &apos;Advanced&apos; Tab for x264 options. (Deprecated).\r
-        /// </summary>\r
-        public static string Options_AdvancedTab {\r
-            get {\r
-                return ResourceManager.GetString("Options_AdvancedTab", resourceCulture);\r
-            }\r
-        }\r
-        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Arguments:.\r
         /// </summary>\r
@@ -5072,15 +5050,6 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
-        /// <summary>\r
-        ///   Looks up a localized string similar to Use Advanced Tab instead.\r
-        /// </summary>\r
-        public static string VideoView_UseAdvancedTab {\r
-            get {\r
-                return ResourceManager.GetString("VideoView_UseAdvancedTab", resourceCulture);\r
-            }\r
-        }\r
-        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Variable Framerate.\r
         /// </summary>\r
index 69aa2a76baeb31bb4fbb842e1fc818f332ee9d2a..2ce55d5f1d6ada11b18efa1c4162697c84528d68 100644 (file)
@@ -283,13 +283,6 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License\r
 along with this program; if not, write to the Free Software\r
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.</value>\r
-  </data>\r
-  <data name="Advanced_NotInUse" xml:space="preserve">\r
-    <value>The x264 Preset / Tune / Profile and Level options are currently in use on the Video Tab. \r
-\r
-To enable this tab, check the "Use Advanced Tab instead" option on the Video Tab.\r
-\r
-If you do not use this tab, it can be hidden from: Tools Menu &gt; Options &gt; Advanced.</value>\r
   </data>\r
   <data name="QueueSelection_AutoNameWarning" xml:space="preserve">\r
     <value>WARNING: You do not have automatic file naming turned on. Please enable this in options.</value>\r
@@ -1329,9 +1322,6 @@ Would you like to overwrite it?</value>
   <data name="Options_AdvancedOptions" xml:space="preserve">\r
     <value>Advanced Options</value>\r
   </data>\r
-  <data name="Options_AdvancedTab" xml:space="preserve">\r
-    <value>Allow use of 'Advanced' Tab for x264 options. (Deprecated)</value>\r
-  </data>\r
   <data name="Options_Arguments" xml:space="preserve">\r
     <value>Arguments:</value>\r
   </data>\r
@@ -1898,9 +1888,6 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="VideoView_TurboFirstPass" xml:space="preserve">\r
     <value>Turbo first pass</value>\r
   </data>\r
-  <data name="VideoView_UseAdvancedTab" xml:space="preserve">\r
-    <value>Use Advanced Tab instead</value>\r
-  </data>\r
   <data name="VideoView_VariableFramerate" xml:space="preserve">\r
     <value>Variable Framerate</value>\r
   </data>\r
index 8bd70f509ae68389f0e0cc993c8d69cfa69206cf..bcadcadb49dfc806322fd3b1fffc0ea27b249cbf 100644 (file)
@@ -211,6 +211,9 @@ namespace HandBrakeWPF.Services
                     this.userSettings.Add(item.Key, item.Value);\r
                     this.Save();\r
                 }\r
+\r
+                // Legacy Settings forced Reset.\r
+                this.userSettings[UserSettingConstants.ShowAdvancedTab] = false;\r
             }\r
             catch (Exception exc)\r
             {\r
index e915663c8bef94111be41691998f1cf43d7440ad..36034f0d27d1763d0b5e4de0095c1c5c27b40a37 100644 (file)
@@ -85,7 +85,6 @@ namespace HandBrakeWPF.ViewModels
         private bool updateAvailable;\r
         private int downloadProgressPercentage;\r
         private UpdateCheckInformation updateInfo;\r
-        private bool showAdvancedTab;\r
         private bool removePunctuation;\r
         private bool resetWhenDoneAction;\r
         private bool enableQuickSyncDecoding;\r
@@ -979,22 +978,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether enable lib hb.\r
-        /// </summary>\r
-        public bool ShowAdvancedTab\r
-        {\r
-            get\r
-            {\r
-                return this.showAdvancedTab;\r
-            }\r
-            set\r
-            {\r
-                this.showAdvancedTab = value;\r
-                this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);\r
-            }\r
-        }\r
-\r
         #endregion\r
 \r
         #region Video\r
@@ -1454,7 +1437,6 @@ namespace HandBrakeWPF.ViewModels
             // Minimise to Tray\r
             this.MinimiseToTray = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);\r
             this.ClearQueueOnEncodeCompleted = userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearCompletedFromQueue);\r
-            this.ShowAdvancedTab = userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedTab);\r
 \r
             // Set the preview count\r
             this.PreviewPicturesToScan.Clear();\r
@@ -1574,7 +1556,6 @@ namespace HandBrakeWPF.ViewModels
             userSettingService.SetUserSetting(UserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted);\r
             userSettingService.SetUserSetting(UserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);\r
             userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));\r
-            userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);\r
 \r
             int value;\r
             if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value))\r
index 53f4103569a81234647dd23e93df4ecb94e1f8cd..92bf9677f7252aec8528bdb5a645b0bc26c58e5e 100644 (file)
@@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels
     using System.ComponentModel;\r
     using System.Globalization;\r
     using System.Linq;\r
+    using System.Windows;\r
 \r
     using Caliburn.Micro;\r
 \r
@@ -51,6 +52,7 @@ namespace HandBrakeWPF.ViewModels
 \r
         private const string SameAsSource = "Same as source";\r
         private readonly IUserSettingService userSettingService;\r
+        private readonly IErrorService errorService;\r
 \r
         private bool displayOptimiseOptions;\r
         private int qualityMax;\r
@@ -78,10 +80,11 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="userSettingService">\r
         /// The user Setting Service.\r
         /// </param>\r
-        public VideoViewModel(IUserSettingService userSettingService)\r
+        public VideoViewModel(IUserSettingService userSettingService, IErrorService errorService)\r
         {\r
             this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 };\r
             this.userSettingService = userSettingService;\r
+            this.errorService = errorService;\r
             this.QualityMin = 0;\r
             this.QualityMax = 51;\r
             this.IsConstantQuantity = true;\r
@@ -1153,6 +1156,25 @@ namespace HandBrakeWPF.ViewModels
             Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ? this.GetActualx264Query() : this.ExtraArguments);\r
         }\r
 \r
+        public void ToggleAdvancedTab()\r
+        {\r
+            if (!this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedTab))\r
+            {\r
+                this.errorService.ShowMessageBox(\r
+                    "The 'Advanced' tab is no longer supported and will be removed in an upcoming release. We strongly recommend using the video tab instead.",\r
+                    "Advanced Tab Deprecated",\r
+                    MessageBoxButton.OK,\r
+                    MessageBoxImage.Information);\r
+                this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, true);\r
+                this.UseAdvancedTab = true;\r
+            }\r
+            else\r
+            {\r
+                this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, false);\r
+                this.UseAdvancedTab = false;\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         protected virtual void OnTabStatusChanged(TabStatusEventArgs e)\r
index f0600981fe241b87a387b85a98fb5d1ac86f83a6..41cfb1ef1937583d5fa97ea704519197c76bdbb3 100644 (file)
@@ -178,11 +178,9 @@ namespace HandBrakeWPF.ViewModels
         {\r
             if (e.PropertyName == UserSettingConstants.ShowAdvancedTab)\r
             {\r
-                ShowX264AdvancedOptions = this.Task.ShowAdvancedTab;\r
-                this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions);\r
                 this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
 \r
-                if (ShowX264AdvancedOptions)\r
+                if (this.Task.ShowAdvancedTab)\r
                 {\r
                     this.UpdateUIFromAdvancedOptions();\r
                 }\r
@@ -195,10 +193,6 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Properties\r
 \r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether show x 264 advanced options.\r
-        /// </summary>\r
-        public bool ShowX264AdvancedOptions { get; set; }\r
 \r
         /// <summary>\r
         /// Gets or sets AdaptiveBFrames.\r
@@ -936,12 +930,6 @@ namespace HandBrakeWPF.ViewModels
             this.Task = task;\r
             this.Task.PropertyChanged += this.Task_PropertyChanged;\r
             this.AdvancedOptionsString = preset.Task.AdvancedEncoderOptions;\r
-\r
-            if (task.ShowAdvancedTab && (task.VideoEncoder == VideoEncoder.X264 || task.VideoEncoder == VideoEncoder.X264_10))\r
-            {\r
-                this.ShowX264AdvancedOptions = true;\r
-                this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions);\r
-            }\r
         }\r
 \r
         /// <summary>\r
index be4f98cff27cf1b95a3c093d3725e79e41cf56ce..ae403147be51d1cd7c2c7808ae49651f3ad1f716 100644 (file)
                         <StackPanel Orientation="Vertical" Margin="20,0,0,0">\r
                             <CheckBox Content="{x:Static Properties:Resources.Options_MinimiseTray}" IsChecked="{Binding MinimiseToTray}" />\r
                             <CheckBox Content="{x:Static Properties:Resources.Options_ClearCompleted}" IsChecked="{Binding ClearQueueOnEncodeCompleted}" />\r
-                            <CheckBox Content="{x:Static Properties:Resources.Options_AdvancedTab}" IsChecked="{Binding ShowAdvancedTab}" />\r
                             <CheckBox Content="{x:Static Properties:Resources.OptionsView_ShowStatusInTitleBar}" IsChecked="{Binding ShowStatusInTitleBar}" />\r
                             <CheckBox Content="{x:Static Properties:Resources.OptionsView_ShowPreviewOnSummaryTab}" IsChecked="{Binding ShowPreviewOnSummaryTab}" />\r
                         </StackPanel>\r
index 92ab11d653c4d0e92ce4f4ac553e6094c1ae43e2..cfe3b99904e9213641b17e6f81ca22635805766f 100644 (file)
 \r
                 <TextBlock Text="{x:Static Properties:Resources.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0"  Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />\r
 \r
-                <CheckBox Content="{x:Static Properties:Resources.VideoView_UseAdvancedTab}" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}" Margin="0,5,0,0"\r
+                <CheckBox Content="Use Legacy Advanced Tab" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}" Margin="0,5,0,0"\r
                           Visibility="{Binding IsAdvancedTabOptionEnabled, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"\r
                           ToolTip="{x:Static Properties:ResourcesTooltips.Video_AdvancedOptions}" />\r
 \r
                         <TextBox.ContextMenu>\r
                             <ContextMenu>\r
                                 <MenuItem Header="Copy Full Query" cal:Message.Attach="[Event Click] = [Action CopyQuery]"  />\r
+                                <MenuItem Header="Toggle Advanced Tab (Deprecated)" cal:Message.Attach="[Event Click] = [Action ToggleAdvancedTab]" />\r
                             </ContextMenu>\r
                         </TextBox.ContextMenu>\r
                     </TextBox>\r
index 504bca3db4281a65a0961a6d20866a2dd36b4d60..9fecd494bbeb5d52df7cda1c3589aab9361af982 100644 (file)
 \r
         <!-- X264 Query  -->\r
 \r
-        <TextBlock Text="{x:Static Properties:Resources.Advanced_NotInUse}" Grid.Row="0"\r
-                       TextWrapping="Wrap" Width="480" Margin="0, 100, 0, 0" FontSize="12"\r
-                       Visibility="{Binding ShowX264AdvancedOptions, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=true}" />\r
-\r
-        <Grid Grid.Row="1" Visibility="{Binding ShowX264AdvancedOptions, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=false}">\r
+        <Grid Grid.Row="1">\r
             <Grid.RowDefinitions>\r
                 <RowDefinition Height="Auto" />\r
                 <RowDefinition Height="*" />\r
         <TextBlock Grid.Row="2" Margin="10,5,10,0"\r
                    VerticalAlignment="Center"\r
                    FontWeight="Bold"\r
-                   Text="x264 Encoder Options:"\r
-                   Visibility="{Binding ShowX264AdvancedOptions, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=false}" />\r
+                   Text="x264 Encoder Options:" />\r
         \r
         <TextBox Grid.Row="3"\r
                  Margin="10,2,10, 2"\r
                  ToolTip="{x:Static Properties:Resources.Advanced_EncoderOptions}"\r
                  Text="{Binding AdvancedOptionsString, UpdateSourceTrigger=PropertyChanged}"\r
                  TextWrapping="Wrap"\r
-                 Visibility="{Binding ShowX264AdvancedOptions, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=false}"\r
                  />\r
     </Grid>\r
 </UserControl>
\ No newline at end of file