]> granicus.if.org Git - handbrake/commitdiff
WinGui: Advanced Tab Changes
authorsr55 <sr55.hb@outlook.com>
Tue, 13 Dec 2016 19:35:02 +0000 (19:35 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 13 Dec 2016 19:35:10 +0000 (19:35 +0000)
1. Strip out a lot of the old advanced tab infrastructure as it is no longer needed. Only the deprecated X264 Advacned Panel is left. All other encoders use the Video tab now.
2. Changed Option to "Allow use of 'Advanced Tab'" and only show the tab if the checkbox on the video tab is checked. It will no longer show based on the perference alone.
3. Fix the one-way communication from Video Tab to X264 Tab so preset options are reflected ont he X264 Tab.  The reverse is not supported but it will retain the previous options.

17 files changed:
win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs [deleted file]
win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs [deleted file]
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs [deleted file]
win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs [deleted file]
win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
win/CS/HandBrakeWPF/Views/AdvancedView.xaml [deleted file]
win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs [deleted file]
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/VideoView.xaml

diff --git a/win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs b/win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs
deleted file mode 100644 (file)
index bb78e1c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AdvancedEncoderOptionsCommand.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   A Command for resetting the video / advnaced tabs encoder options.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.Commands\r
-{\r
-    using Caliburn.Micro;\r
-\r
-    using HandBrakeWPF.Commands.Interfaces;\r
-    using HandBrakeWPF.ViewModels.Interfaces;\r
-\r
-    /// <summary>\r
-    /// A Command for resetting the video / advnaced tabs encoder options.\r
-    /// </summary>\r
-    public class AdvancedEncoderOptionsCommand : IAdvancedEncoderOptionsCommand\r
-    {\r
-        /// <summary>\r
-        /// Clear out the advanced options\r
-        /// </summary>\r
-        public void ExecuteClearAdvanced()\r
-        {\r
-            IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();\r
-            advancedViewModel.Clear();\r
-        }\r
-\r
-        /// <summary>\r
-        /// Clear the advanced encoder options out on the video tab.\r
-        /// </summary>\r
-        public void ExecuteClearVideo()\r
-        {\r
-            IVideoViewModel videoViewModel = IoC.Get<IVideoViewModel>();\r
-            videoViewModel.ClearAdvancedSettings();\r
-        }\r
-    }\r
-}\r
diff --git a/win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs b/win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs
deleted file mode 100644 (file)
index 5f0c96f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="IAdvancedEncoderOptionsCommand.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   The AdvancedEncoderOptionsCommand interface.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.Commands.Interfaces\r
-{\r
-    /// <summary>\r
-    /// The AdvancedEncoderOptionsCommand interface.\r
-    /// </summary>\r
-    public interface IAdvancedEncoderOptionsCommand\r
-    {\r
-        /// <summary>\r
-        /// Clear out the advanced options\r
-        /// </summary>\r
-        void ExecuteClearAdvanced();\r
-\r
-        /// <summary>\r
-        /// Clear the advanced encoder options out on the video tab.\r
-        /// </summary>\r
-        void ExecuteClearVideo();\r
-    }\r
-}
\ No newline at end of file
index 8425d731478347ef1a7cfe0feee6c4f8fe0df9bc..71584b1b07da533b0d304c1b0cec87c3aa89a57b 100644 (file)
     <Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
     <Compile Include="Collections\SerializableDictionary.cs" />\r
     <Compile Include="Commands\InputBindingTrigger.cs" />\r
-    <Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />\r
     <Compile Include="Commands\Menu\QueueCommandParams.cs" />\r
     <Compile Include="Commands\Menu\QueueCommands.cs" />\r
     <Compile Include="Commands\OpenOptionsScreenCommand.cs" />\r
     <Compile Include="Commands\PresetMenuSelectCommand.cs" />\r
     <Compile Include="Commands\ProcessShortcutCommand.cs" />\r
     <Compile Include="Commands\SourceMenuCommand.cs" />\r
-    <Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />\r
     <Compile Include="Constants.cs" />\r
     <Compile Include="Controls\SplitButton\SplitMenuButton.cs" />\r
     <Compile Include="Controls\AlertPanel.xaml.cs">\r
     <Compile Include="Services\Interfaces\IPrePostActionService.cs" />\r
     <Compile Include="Services\UpdateService.cs" />\r
     <Compile Include="Services\PrePostActionService.cs" />\r
-    <Compile Include="ViewModels\AdvancedViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IX264ViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IQueueSelectionViewModel.cs" />\r
     <Compile Include="ViewModels\QueueSelectionViewModel.cs" />\r
-    <Compile Include="Views\AdvancedView.xaml.cs">\r
-      <DependentUpon>AdvancedView.xaml</DependentUpon>\r
-    </Compile>\r
     <Compile Include="Views\QueueSelectionView.xaml.cs">\r
       <DependentUpon>QueueSelectionView.xaml</DependentUpon>\r
     </Compile>\r
     <Compile Include="ViewModels\ChaptersViewModel.cs" />\r
     <Compile Include="ViewModels\PictureSettingsViewModel.cs" />\r
     <Compile Include="ViewModels\ErrorViewModel.cs" />\r
-    <Compile Include="ViewModels\Interfaces\IAdvancedViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\ISubtitlesViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IChaptersViewModel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IPictureSettingsViewModel.cs" />\r
       <SubType>Designer</SubType>\r
       <Generator>MSBuild:Compile</Generator>\r
     </Page>\r
-    <Page Include="Views\AdvancedView.xaml">\r
-      <Generator>MSBuild:Compile</Generator>\r
-      <SubType>Designer</SubType>\r
-    </Page>\r
     <Page Include="Views\QueueSelectionView.xaml">\r
       <Generator>MSBuild:Compile</Generator>\r
       <SubType>Designer</SubType>\r
index 91ef97c494889fca71a855e7e45465bedacc10da..f5b473e784de921cc58958759ac243d5465422b7 100644 (file)
@@ -1015,7 +1015,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Show Advanced Encoder Options Tab (Deprecated).\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
index 36b8473ff0c289b4906f913ef86dbb03b976394d..6e0be7892c78804b87f18ee1e615d6c20e405384 100644 (file)
     <value>Advanced Options</value>\r
   </data>\r
   <data name="Options_AdvancedTab" xml:space="preserve">\r
-    <value>Show Advanced Encoder Options Tab (Deprecated)</value>\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
index 9eba5c684b57b6708ed175f54d738c28a0145ca5..9e1a8296649501c92fe0c71a1b97145cfc12e52d 100644 (file)
@@ -282,6 +282,14 @@ namespace HandBrakeWPF.Services.Encode.Factories
                 video.Options = job.ExtraAdvancedArguments;
                 video.Preset = job.VideoPreset != null ? job.VideoPreset.ShortName : null;
                 video.Profile = job.VideoProfile != null ? job.VideoProfile.ShortName : null;
+
+                if (job.VideoTunes != null && job.VideoTunes.Count > 0)
+                {
+                    foreach (var item in job.VideoTunes)
+                    {
+                        video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName;
+                    }
+                }
             }
 
             if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) video.Quality = job.Quality;
@@ -292,14 +300,6 @@ namespace HandBrakeWPF.Services.Encode.Factories
                 video.Turbo = job.TurboFirstPass;
             }
 
-            if (job.VideoTunes != null && job.VideoTunes.Count > 0)
-            {
-                foreach (var item in job.VideoTunes)
-                {
-                    video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName;
-                }
-            }
-
             video.OpenCL = configuration.ScalingMode == VideoScaler.BicubicCl;
             video.QSV.Decode = !configuration.DisableQuickSyncDecoding;
 
index 1e4a8a8ad93d171e1720d5ac9cf5f04ac277e7b9..7163b26cd77edc72aea54dcd4b9b1601b9060969 100644 (file)
@@ -14,8 +14,6 @@ namespace HandBrakeWPF.Startup
 \r
     using Caliburn.Micro;\r
 \r
-    using HandBrakeWPF.Commands;\r
-    using HandBrakeWPF.Commands.Interfaces;\r
     using HandBrakeWPF.Services;\r
     using HandBrakeWPF.Services.Interfaces;\r
     using HandBrakeWPF.Services.Presets;\r
@@ -65,7 +63,6 @@ namespace HandBrakeWPF.Startup
             this.container.Singleton<IQueueProcessor, QueueProcessor>();\r
 \r
             // Commands\r
-            this.container.Singleton<IAdvancedEncoderOptionsCommand, AdvancedEncoderOptionsCommand>();\r
 \r
             // Services and Shell Components\r
             this.container.Singleton<IErrorService, ErrorService>();\r
@@ -86,7 +83,6 @@ namespace HandBrakeWPF.Startup
             // Tab Components\r
             this.container.Singleton<IAudioViewModel, AudioViewModel>();\r
             this.container.Singleton<IX264ViewModel, X264ViewModel>();\r
-            this.container.Singleton<IAdvancedViewModel, AdvancedViewModel>();\r
             this.container.Singleton<IPictureSettingsViewModel, PictureSettingsViewModel>();\r
             this.container.Singleton<IChaptersViewModel, ChaptersViewModel>();\r
             this.container.Singleton<ISubtitlesViewModel, SubtitlesViewModel>();\r
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
deleted file mode 100644 (file)
index 746d457..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AdvancedViewModel.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   The Advanced View Model\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.ViewModels\r
-{\r
-    using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
-\r
-    using HandBrakeWPF.Services.Presets.Model;\r
-    using HandBrakeWPF.Services.Scan.Model;\r
-    using HandBrakeWPF.ViewModels.Interfaces;\r
-\r
-    using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;\r
-\r
-    /// <summary>\r
-    /// The Advanced View Model\r
-    /// </summary>\r
-    public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel\r
-    {\r
-        #region Constants and Fields\r
-\r
-        /// <summary>\r
-        /// The show x 264 panel.\r
-        /// </summary>\r
-        private bool showX264Panel;\r
-\r
-        #endregion\r
-\r
-        /// <summary>\r
-        /// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.\r
-        /// </summary>\r
-        /// <param name="x264ViewModel">\r
-        /// The x 264 view model.\r
-        /// </param>\r
-        public AdvancedViewModel(IX264ViewModel x264ViewModel)\r
-        {\r
-            this.X264ViewModel = x264ViewModel;\r
-        }\r
-\r
-        #region Properties\r
-\r
-        /// <summary>\r
-        /// Gets or sets the x 264 view model.\r
-        /// </summary>\r
-        public IX264ViewModel X264ViewModel { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether show x 264 panel.\r
-        /// </summary>\r
-        public bool ShowX264Panel\r
-        {\r
-            get\r
-            {\r
-                return this.showX264Panel;\r
-            }\r
-            set\r
-            {\r
-                this.showX264Panel = value;\r
-                this.NotifyOfPropertyChange(() => this.ShowX264Panel);\r
-            }\r
-        }\r
-\r
-        #endregion\r
-\r
-        #region Implemented Interfaces\r
-\r
-        /// <summary>\r
-        /// The set encoder.\r
-        /// </summary>\r
-        /// <param name="encoder">\r
-        /// The encoder.\r
-        /// </param>\r
-        public void SetEncoder(VideoEncoder encoder)\r
-        {\r
-            this.X264ViewModel.SetEncoder(encoder);\r
-            this.ShowX264Panel = encoder == VideoEncoder.X264 || encoder == VideoEncoder.X264_10;\r
-        }\r
-\r
-        /// <summary>\r
-        /// The clear.\r
-        /// </summary>\r
-        public void Clear()\r
-        {\r
-            this.X264ViewModel.Clear();\r
-        }\r
-\r
-        /// <summary>\r
-        /// Setup this tab for the specified preset.\r
-        /// </summary>\r
-        /// <param name="preset">\r
-        /// The preset.\r
-        /// </param>\r
-        /// <param name="task">\r
-        /// The task.\r
-        /// </param>\r
-        public void SetPreset(Preset preset, EncodeTask task)\r
-        {\r
-            this.X264ViewModel.SetPreset(preset, task);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Update all the UI controls based on the encode task passed in.\r
-        /// </summary>\r
-        /// <param name="task">\r
-        /// The task.\r
-        /// </param>\r
-        public void UpdateTask(EncodeTask task)\r
-        {\r
-            this.X264ViewModel.UpdateTask(task);\r
-\r
-            this.SetEncoder(task.VideoEncoder);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Setup this window for a new source\r
-        /// </summary>\r
-        /// <param name="source">\r
-        /// The source.\r
-        /// </param>\r
-        /// <param name="title">\r
-        /// The title.\r
-        /// </param>\r
-        /// <param name="preset">\r
-        /// The preset.\r
-        /// </param>\r
-        /// <param name="task">\r
-        /// The task.\r
-        /// </param>\r
-        public void SetSource(Source source, Title title, Preset preset, EncodeTask task)\r
-        {\r
-            this.X264ViewModel.SetSource(source, title, preset, task);\r
-        }\r
-\r
-        #endregion\r
-    }\r
-}
\ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
deleted file mode 100644 (file)
index acbcb7d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="IAdvancedViewModel.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Defines the IAdvancedViewModel type.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.ViewModels.Interfaces\r
-{\r
-    using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
-\r
-    /// <summary>\r
-    /// The Advanced View Model Interface\r
-    /// </summary>\r
-    public interface IAdvancedViewModel : ITabInterface\r
-    {\r
-        /// <summary>\r
-        /// Set the currently selected encoder.\r
-        /// </summary>\r
-        /// <param name="encoder">\r
-        /// The Video Encoder.\r
-        /// </param>\r
-        void SetEncoder(VideoEncoder encoder);\r
-\r
-        /// <summary>\r
-        /// Clear out the settings.\r
-        /// </summary>\r
-        void Clear();\r
-    }\r
-}\r
index d3602e5e5b6ed81f3ac0a0d3c7fdd50a1f110bab..d3b1625015453823e4175a32ba8cf82329b9b9b4 100644 (file)
@@ -18,10 +18,5 @@ namespace HandBrakeWPF.ViewModels.Interfaces
         /// Trigger a Notify Property Changed on the Task to force various UI elements to update.\r
         /// </summary>\r
         void RefreshTask();\r
-\r
-        /// <summary>\r
-        /// Clear the advanced x264 options.\r
-        /// </summary>\r
-        void ClearAdvancedSettings();\r
     }\r
 }\r
index 957ce4d296f0cd3861f84a2d5f3b2db233845025..359301296691de39e35831d09717cc057a69270e 100644 (file)
@@ -161,8 +161,8 @@ namespace HandBrakeWPF.ViewModels
         public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, \r
             IErrorService errorService, IUpdateService updateService, \r
             IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, \r
-            IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel, \r
-            IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,\r
+            IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,\r
+            IX264ViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,\r
             IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel)\r
         {\r
             this.scanService = scanService;\r
@@ -260,7 +260,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets or sets AdvancedViewModel.\r
         /// </summary>\r
-        public IAdvancedViewModel AdvancedViewModel { get; set; }\r
+        public IX264ViewModel AdvancedViewModel { get; set; }\r
 \r
         /// <summary>\r
         /// Gets or sets VideoViewModel.\r
index 55a679ea75a7e4011d3cdd967a8ec7c8c644c927..7b3cf78130f7e8b9fae4f7ea6237e876c6782bda 100644 (file)
@@ -20,7 +20,6 @@ namespace HandBrakeWPF.ViewModels
     using HandBrake.ApplicationServices.Interop;\r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
 \r
-    using HandBrakeWPF.Commands.Interfaces;\r
     using HandBrakeWPF.Properties;\r
     using HandBrakeWPF.Services.Interfaces;\r
     using HandBrakeWPF.Services.Presets.Model;\r
@@ -51,14 +50,12 @@ namespace HandBrakeWPF.ViewModels
 \r
         private const string SameAsSource = "Same as source";\r
         private readonly IUserSettingService userSettingService;\r
-        private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;\r
 \r
         private bool displayOptimiseOptions;\r
         private int qualityMax;\r
         private int qualityMin;\r
         private bool showPeakFramerate;\r
         private int rf;\r
-        private bool canClear;\r
         private bool displayTurboFirstPass;\r
         private int videoPresetMaxValue;\r
         private int videoPresetValue;\r
@@ -82,11 +79,10 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="advancedEncoderOptionsCommand">\r
         /// The advanced Encoder Options Command.\r
         /// </param>\r
-        public VideoViewModel(IUserSettingService userSettingService, IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)\r
+        public VideoViewModel(IUserSettingService userSettingService)\r
         {\r
             this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 };\r
             this.userSettingService = userSettingService;\r
-            this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;\r
             this.QualityMin = 0;\r
             this.QualityMax = 51;\r
             this.IsConstantQuantity = true;\r
@@ -112,7 +108,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Gets a value indicating whether show advanced tab.\r
         /// </summary>\r
-        public bool ShowAdvancedTab\r
+        public bool IsAdvancedTabOptionEnabled\r
         {\r
             get\r
             {\r
@@ -124,6 +120,7 @@ namespace HandBrakeWPF.ViewModels
 \r
                 if (this.SelectedVideoEncoder != VideoEncoder.X264 && this.SelectedVideoEncoder != VideoEncoder.X264_10)\r
                 {\r
+                    this.UseAdvancedTab = false;\r
                     return false;\r
                 }\r
 \r
@@ -146,8 +143,8 @@ namespace HandBrakeWPF.ViewModels
                 {\r
                     // Set the Advanced Tab up with the current settings, if we can.\r
                     this.Task.AdvancedEncoderOptions = value ? this.GetActualx264Query() : string.Empty;\r
-\r
                     this.Task.ShowAdvancedTab = value;\r
+\r
                     this.NotifyOfPropertyChange(() => this.UseAdvancedTab);\r
                 }\r
             }\r
@@ -673,7 +670,6 @@ namespace HandBrakeWPF.ViewModels
 \r
                 this.NotifyOfPropertyChange(() => this.FastDecode);\r
                 this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
-                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -691,7 +687,6 @@ namespace HandBrakeWPF.ViewModels
                 this.Task.VideoPreset = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoPreset);\r
                 this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
-                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -772,7 +767,6 @@ namespace HandBrakeWPF.ViewModels
 \r
                 this.NotifyOfPropertyChange(() => this.VideoTune);\r
                 this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
-                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -790,7 +784,6 @@ namespace HandBrakeWPF.ViewModels
                 this.Task.VideoProfile = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoProfile);\r
                 this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
-                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -808,7 +801,6 @@ namespace HandBrakeWPF.ViewModels
                 this.Task.VideoLevel = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoLevel);\r
                 this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
-                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -954,7 +946,7 @@ namespace HandBrakeWPF.ViewModels
                 }\r
 \r
                 this.ExtraArguments = preset.Task.ExtraAdvancedArguments;\r
-                this.UseAdvancedTab = (!string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab) || preset.Task.ShowAdvancedTab;\r
+                this.UseAdvancedTab = (!string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.IsAdvancedTabOptionEnabled) || preset.Task.ShowAdvancedTab;\r
             }\r
         }\r
 \r
@@ -1017,23 +1009,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Clear advanced settings.\r
-        /// </summary>\r
-        public void ClearAdvancedSettings()\r
-        {\r
-            this.canClear = false;\r
-            this.FastDecode = false;\r
-            this.VideoTune = null;\r
-            this.VideoProfile = new VideoProfile("auto", "auto");\r
-            this.VideoPreset = null;\r
-            this.VideoPresetValue = 1;\r
-            this.VideoLevel = new VideoLevel("auto", "auto");\r
-\r
-            this.ExtraArguments = string.Empty;\r
-            this.canClear = true;\r
-        }\r
-\r
         /// <summary>\r
         /// The copy query.\r
         /// </summary>\r
@@ -1080,16 +1055,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Reset advanced tab.\r
-        /// </summary>\r
-        private void ResetAdvancedTab()\r
-        {\r
-            if (canClear)\r
-            {\r
-                this.advancedEncoderOptionsCommand.ExecuteClearAdvanced();\r
-            }\r
-        }\r
 \r
         /// <summary>\r
         /// The get actualx 264 query.\r
@@ -1156,7 +1121,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             if (e.Key == UserSettingConstants.ShowAdvancedTab)\r
             {\r
-                this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);\r
+                this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled);\r
             }\r
         }\r
 \r
@@ -1310,7 +1275,7 @@ namespace HandBrakeWPF.ViewModels
             }\r
 \r
             // Tell the Advanced Panel off the change\r
-            IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();\r
+            IX264ViewModel advancedViewModel = IoC.Get<IX264ViewModel>();\r
             advancedViewModel.SetEncoder(this.Task.VideoEncoder);\r
 \r
             // Update the Quality Slider. Make sure the bounds are up to date with the users settings.\r
@@ -1337,7 +1302,7 @@ namespace HandBrakeWPF.ViewModels
      \r
             // Refresh Display\r
             this.NotifyOfPropertyChange(() => this.Rfqp);\r
-            this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);\r
+            this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled);\r
             this.NotifyOfPropertyChange(() => this.HighQualityLabel);\r
 \r
             // Handle some quicksync specific options.\r
index 5b2694cd97a5453933beb7b69482e2b7dd686b46..ac92b760f7c6cf64ec60185676f1ad475e1943f8 100644 (file)
@@ -16,7 +16,6 @@ namespace HandBrakeWPF.ViewModels
 \r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
 \r
-    using HandBrakeWPF.Commands.Interfaces;\r
     using HandBrakeWPF.Helpers;\r
     using HandBrakeWPF.Model;\r
     using HandBrakeWPF.Services.Presets.Model;\r
@@ -30,11 +29,6 @@ namespace HandBrakeWPF.ViewModels
     /// </summary>\r
     public class X264ViewModel : ViewModelBase, IX264ViewModel\r
     {\r
-        /// <summary>\r
-        /// The advanced encoder options command.\r
-        /// </summary>\r
-        private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;\r
-\r
         #region Constants and Fields\r
 \r
         /// <summary>\r
@@ -164,12 +158,8 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// Initializes a new instance of the <see cref="X264ViewModel"/> class.\r
         /// </summary>\r
-        /// <param name="advancedEncoderOptionsCommand">\r
-        /// The advanced Encoder Options Command.\r
-        /// </param>\r
-        public X264ViewModel(IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)\r
+        public X264ViewModel()\r
         {\r
-            this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;\r
             this.Task = new EncodeTask();\r
             this.UpdateUIFromAdvancedOptions();\r
         }\r
@@ -190,6 +180,11 @@ namespace HandBrakeWPF.ViewModels
                 ShowX264AdvancedOptions = this.Task.ShowAdvancedTab;\r
                 this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions);\r
                 this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
+\r
+                if (ShowX264AdvancedOptions)\r
+                {\r
+                    this.UpdateUIFromAdvancedOptions();\r
+                }\r
             }\r
         }\r
 \r
@@ -253,12 +248,6 @@ namespace HandBrakeWPF.ViewModels
                 this.Task.AdvancedEncoderOptions = value;\r
                 this.UpdateUIFromAdvancedOptions();\r
                 this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
-\r
-                // Reset the video tab if the user is using this tab.\r
-                if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))\r
-                {\r
-                    this.advancedEncoderOptionsCommand.ExecuteClearVideo();\r
-                }\r
             }\r
         }\r
 \r
@@ -1154,12 +1143,6 @@ namespace HandBrakeWPF.ViewModels
 \r
             this.Task.AdvancedEncoderOptions = string.Join(":", newOptions);\r
             this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
-\r
-            // Reset the video tab if the user is using this tab.\r
-            if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))\r
-            {\r
-                this.advancedEncoderOptionsCommand.ExecuteClearVideo();\r
-            }\r
         }\r
 \r
         #endregion\r
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
deleted file mode 100644 (file)
index a4fa3ca..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<UserControl x:Class="HandBrakeWPF.Views.AdvancedView"\r
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
-             xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"\r
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"\r
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"\r
-             xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"\r
-             x:Name="advancedView"\r
-             mc:Ignorable="d"\r
-             >\r
-    <UserControl.Resources>\r
-        <Converters:BooleanToVisibilityConverter x:Key="BooleanVisibilityConverter" />\r
-\r
-      </UserControl.Resources>\r
-    <Grid>\r
-        <Grid.RowDefinitions>\r
-            <RowDefinition Height="Auto" />\r
-            <RowDefinition Height="Auto" />\r
-            <RowDefinition Height="Auto" />\r
-        </Grid.RowDefinitions>\r
-\r
-        <ContentControl x:Name="X264ViewModel"\r
-                        Visibility="{Binding ShowX264Panel, Converter={StaticResource BooleanVisibilityConverter}}" />\r
-\r
-        <TextBlock Text="{x:Static Properties:Resources.Advanced_NoOptionsPaneAvailable}" Grid.Row="0"\r
-                       TextWrapping="Wrap" Width="480" Margin="0, 100, 0, 0" FontSize="12"\r
-                       Visibility="{Binding ShowX264Panel, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=true}" />\r
-\r
-\r
-    </Grid>\r
-</UserControl>
\ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs
deleted file mode 100644 (file)
index a47bf3e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="AdvancedView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">\r
-//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-//   Interaction logic for AdvancedView.xaml\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.Views\r
-{\r
-    using System.Windows.Controls;\r
-\r
-    /// <summary>\r
-    /// Interaction logic for AdvancedView.xaml\r
-    /// </summary>\r
-    public partial class AdvancedView : UserControl\r
-    {\r
-        /// <summary>\r
-        /// Initializes a new instance of the <see cref="AdvancedView"/> class.\r
-        /// </summary>\r
-        public AdvancedView()\r
-        {\r
-            InitializeComponent();\r
-        }\r
-    }\r
-}\r
index 1959c9bfe8622b7ebfbdae6be0c9ba938c2eab25..c08ece4d6c89c61cf886fcad5b517d0f6f1f6e67 100644 (file)
                 <TabItem Name="chaptersTab" Header="{x:Static Properties:ResourcesUI.MainView_ChaptersTab}">\r
                     <ContentControl x:Name="ChaptersViewModel" />\r
                 </TabItem>\r
-                <TabItem Name="advancedTab" Header="{x:Static Properties:ResourcesUI.MainView_AdvancedTab}" Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">\r
+                <TabItem Name="advancedTab" Header="{x:Static Properties:ResourcesUI.MainView_AdvancedTab}" Visibility="{Binding CurrentTask.ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">\r
                     <ContentControl x:Name="AdvancedViewModel" />\r
                 </TabItem>\r
             </TabControl>\r
index e8319b785a9080ee43f574f9fbb9ece9bf3a4414..bc6e1881ec8c0c1b45188e627320f313c27eadab 100644 (file)
                 <TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0"  Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />\r
 \r
                 <CheckBox Content="{x:Static Properties:ResourcesUI.VideoView_UseAdvancedTab}" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}" Margin="0,5,0,0"\r
-                          Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"\r
+                          Visibility="{Binding IsAdvancedTabOptionEnabled, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"\r
                           ToolTip="{x:Static Properties:ResourcesTooltips.Video_AdvancedOptions}" />\r
 \r
                 <Grid Grid.Row="2" Margin="0,8,0,0" IsEnabled="{Binding UseAdvancedTab, Converter={StaticResource inverseConverter}}">\r