From: sr55 Date: Sat, 20 Oct 2018 14:03:42 +0000 (+0100) Subject: WinGui: Remove the preference to show the advanced tab. This can still be toggled... X-Git-Tag: 1.2.0~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd2de7fb4095a4774b780d560444c34704e36603;p=handbrake WinGui: Remove the preference to show the advanced tab. This can still be toggled for 1 time uses via the extra args content menu on the video tab. Added a notification to remind users that it's going to be removed shortly. --- diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 5c7732428..0badf3c9e 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -364,19 +364,6 @@ namespace HandBrakeWPF.Properties { } } - /// - /// Looks up a localized string similar to The x264 Preset / Tune / Profile and Level options are currently in use on the Video Tab. - /// - ///To enable this tab, check the "Use Advanced Tab instead" option on the Video Tab. - /// - ///If you do not use this tab, it can be hidden from: Tools Menu > Options > Advanced.. - /// - public static string Advanced_NotInUse { - get { - return ResourceManager.GetString("Advanced_NotInUse", resourceCulture); - } - } - /// /// Looks up a localized string similar to Psychovisual Rate Distortion means x264 tries to retain detail, for better quality to the human eye, ///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.. @@ -2492,15 +2479,6 @@ namespace HandBrakeWPF.Properties { } } - /// - /// Looks up a localized string similar to Allow use of 'Advanced' Tab for x264 options. (Deprecated). - /// - public static string Options_AdvancedTab { - get { - return ResourceManager.GetString("Options_AdvancedTab", resourceCulture); - } - } - /// /// Looks up a localized string similar to Arguments:. /// @@ -5072,15 +5050,6 @@ namespace HandBrakeWPF.Properties { } } - /// - /// Looks up a localized string similar to Use Advanced Tab instead. - /// - public static string VideoView_UseAdvancedTab { - get { - return ResourceManager.GetString("VideoView_UseAdvancedTab", resourceCulture); - } - } - /// /// Looks up a localized string similar to Variable Framerate. /// diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 69aa2a76b..2ce55d5f1 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -283,13 +283,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - The x264 Preset / Tune / Profile and Level options are currently in use on the Video Tab. - -To enable this tab, check the "Use Advanced Tab instead" option on the Video Tab. - -If you do not use this tab, it can be hidden from: Tools Menu > Options > Advanced. WARNING: You do not have automatic file naming turned on. Please enable this in options. @@ -1329,9 +1322,6 @@ Would you like to overwrite it? Advanced Options - - Allow use of 'Advanced' Tab for x264 options. (Deprecated) - Arguments: @@ -1898,9 +1888,6 @@ This will not affect your current settings in the Subtitle tab. Turbo first pass - - Use Advanced Tab instead - Variable Framerate diff --git a/win/CS/HandBrakeWPF/Services/UserSettingService.cs b/win/CS/HandBrakeWPF/Services/UserSettingService.cs index 8bd70f509..bcadcadb4 100644 --- a/win/CS/HandBrakeWPF/Services/UserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/UserSettingService.cs @@ -211,6 +211,9 @@ namespace HandBrakeWPF.Services this.userSettings.Add(item.Key, item.Value); this.Save(); } + + // Legacy Settings forced Reset. + this.userSettings[UserSettingConstants.ShowAdvancedTab] = false; } catch (Exception exc) { diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index e915663c8..36034f0d2 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -85,7 +85,6 @@ namespace HandBrakeWPF.ViewModels private bool updateAvailable; private int downloadProgressPercentage; private UpdateCheckInformation updateInfo; - private bool showAdvancedTab; private bool removePunctuation; private bool resetWhenDoneAction; private bool enableQuickSyncDecoding; @@ -979,22 +978,6 @@ namespace HandBrakeWPF.ViewModels } } - /// - /// Gets or sets a value indicating whether enable lib hb. - /// - public bool ShowAdvancedTab - { - get - { - return this.showAdvancedTab; - } - set - { - this.showAdvancedTab = value; - this.NotifyOfPropertyChange(() => this.ShowAdvancedTab); - } - } - #endregion #region Video @@ -1454,7 +1437,6 @@ namespace HandBrakeWPF.ViewModels // Minimise to Tray this.MinimiseToTray = this.userSettingService.GetUserSetting(UserSettingConstants.MainWindowMinimize); this.ClearQueueOnEncodeCompleted = userSettingService.GetUserSetting(UserSettingConstants.ClearCompletedFromQueue); - this.ShowAdvancedTab = userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedTab); // Set the preview count this.PreviewPicturesToScan.Clear(); @@ -1574,7 +1556,6 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(UserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted); userSettingService.SetUserSetting(UserSettingConstants.PreviewScanCount, this.SelectedPreviewCount); userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture)); - userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab); int value; if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value)) diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 53f410356..92bf9677f 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.Windows; using Caliburn.Micro; @@ -51,6 +52,7 @@ namespace HandBrakeWPF.ViewModels private const string SameAsSource = "Same as source"; private readonly IUserSettingService userSettingService; + private readonly IErrorService errorService; private bool displayOptimiseOptions; private int qualityMax; @@ -78,10 +80,11 @@ namespace HandBrakeWPF.ViewModels /// /// The user Setting Service. /// - public VideoViewModel(IUserSettingService userSettingService) + public VideoViewModel(IUserSettingService userSettingService, IErrorService errorService) { this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 }; this.userSettingService = userSettingService; + this.errorService = errorService; this.QualityMin = 0; this.QualityMax = 51; this.IsConstantQuantity = true; @@ -1153,6 +1156,25 @@ namespace HandBrakeWPF.ViewModels Clipboard.SetDataObject(this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X264_10 ? this.GetActualx264Query() : this.ExtraArguments); } + public void ToggleAdvancedTab() + { + if (!this.userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedTab)) + { + this.errorService.ShowMessageBox( + "The 'Advanced' tab is no longer supported and will be removed in an upcoming release. We strongly recommend using the video tab instead.", + "Advanced Tab Deprecated", + MessageBoxButton.OK, + MessageBoxImage.Information); + this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, true); + this.UseAdvancedTab = true; + } + else + { + this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, false); + this.UseAdvancedTab = false; + } + } + #endregion protected virtual void OnTabStatusChanged(TabStatusEventArgs e) diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs index f0600981f..41cfb1ef1 100644 --- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs @@ -178,11 +178,9 @@ namespace HandBrakeWPF.ViewModels { if (e.PropertyName == UserSettingConstants.ShowAdvancedTab) { - ShowX264AdvancedOptions = this.Task.ShowAdvancedTab; - this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions); this.NotifyOfPropertyChange(() => this.AdvancedOptionsString); - if (ShowX264AdvancedOptions) + if (this.Task.ShowAdvancedTab) { this.UpdateUIFromAdvancedOptions(); } @@ -195,10 +193,6 @@ namespace HandBrakeWPF.ViewModels #region Properties - /// - /// Gets or sets a value indicating whether show x 264 advanced options. - /// - public bool ShowX264AdvancedOptions { get; set; } /// /// Gets or sets AdaptiveBFrames. @@ -936,12 +930,6 @@ namespace HandBrakeWPF.ViewModels this.Task = task; this.Task.PropertyChanged += this.Task_PropertyChanged; this.AdvancedOptionsString = preset.Task.AdvancedEncoderOptions; - - if (task.ShowAdvancedTab && (task.VideoEncoder == VideoEncoder.X264 || task.VideoEncoder == VideoEncoder.X264_10)) - { - this.ShowX264AdvancedOptions = true; - this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions); - } } /// diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index be4f98cff..ae403147b 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -172,7 +172,6 @@ - diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 92ab11d65..cfe3b9990 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -131,7 +131,7 @@ - @@ -193,6 +193,7 @@ + diff --git a/win/CS/HandBrakeWPF/Views/X264View.xaml b/win/CS/HandBrakeWPF/Views/X264View.xaml index 504bca3db..9fecd494b 100644 --- a/win/CS/HandBrakeWPF/Views/X264View.xaml +++ b/win/CS/HandBrakeWPF/Views/X264View.xaml @@ -38,11 +38,7 @@ - - - + @@ -521,8 +517,7 @@ + Text="x264 Encoder Options:" /> \ No newline at end of file