From 5b446548672626c960b8c72db72d8e6f82b7e955 Mon Sep 17 00:00:00 2001 From: Scott <sr55@users.noreply.github.com> Date: Fri, 18 Sep 2015 21:51:45 +0100 Subject: [PATCH] WinGui: Strip out some old unused code. --- .../Interop/Factories/AnamorphicFactory.cs | 11 --- win/CS/HandBrakeWPF/AppArguments.cs | 18 ---- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 3 - .../Interfaces/INotificationService.cs | 18 ---- .../Services/NotificationService.cs | 82 ------------------- win/CS/HandBrakeWPF/Services/UpdateService.cs | 10 --- .../HandBrakeWPF/Startup/AppBootstrapper.cs | 1 - win/CS/HandBrakeWPF/UserSettingConstants.cs | 15 ---- win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs | 4 +- .../HandBrakeWPF/ViewModels/MainViewModel.cs | 7 +- .../ViewModels/OptionsViewModel.cs | 48 ----------- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 5 -- 12 files changed, 2 insertions(+), 220 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/AppArguments.cs delete mode 100644 win/CS/HandBrakeWPF/Services/Interfaces/INotificationService.cs delete mode 100644 win/CS/HandBrakeWPF/Services/NotificationService.cs diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs index 35ec20ba9..5d095cc2c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs @@ -27,19 +27,8 @@ namespace HandBrake.ApplicationServices.Interop.Factories /// </summary> public enum KeepSetting { - /// <summary> - /// The h b_ kee p_ width. - /// </summary> HB_KEEP_WIDTH = 0x01, - - /// <summary> - /// The h b_ kee p_ height. - /// </summary> HB_KEEP_HEIGHT = 0x02, - - /// <summary> - /// The h b_ kee p_ displa y_ aspect. - /// </summary> HB_KEEP_DISPLAY_ASPECT = 0x04 } diff --git a/win/CS/HandBrakeWPF/AppArguments.cs b/win/CS/HandBrakeWPF/AppArguments.cs deleted file mode 100644 index c673a8fa1..000000000 --- a/win/CS/HandBrakeWPF/AppArguments.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="AppArguments.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Defines the AppArguments type. -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF -{ - /// <summary> - /// The app arguments. - /// </summary> - public class AppArguments - { - } -} diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index b0a55aacf..bd638e860 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -126,7 +126,6 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </ApplicationDefinition> - <Compile Include="AppArguments.cs" /> <Compile Include="AttachedProperties\MenuItemExtensions.cs" /> <Compile Include="Collections\SerializableDictionary.cs" /> <Compile Include="Commands\InputBindingTrigger.cs" /> @@ -237,10 +236,8 @@ <Compile Include="Model\SourceMenuItem.cs" /> <Compile Include="Model\UpdateCheckInformation.cs" /> <Compile Include="Model\DownloadStatus.cs" /> - <Compile Include="Services\Interfaces\INotificationService.cs" /> <Compile Include="Services\Interfaces\IUpdateService.cs" /> <Compile Include="Services\Interfaces\IPrePostActionService.cs" /> - <Compile Include="Services\NotificationService.cs" /> <Compile Include="Services\UpdateService.cs" /> <Compile Include="Services\PrePostActionService.cs" /> <Compile Include="ViewModels\AdvancedViewModel.cs" /> diff --git a/win/CS/HandBrakeWPF/Services/Interfaces/INotificationService.cs b/win/CS/HandBrakeWPF/Services/Interfaces/INotificationService.cs deleted file mode 100644 index 8a20c274e..000000000 --- a/win/CS/HandBrakeWPF/Services/Interfaces/INotificationService.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="INotificationService.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Defines the INotificationService type. -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Services.Interfaces -{ - /// <summary> - /// The NotificationService interface. - /// </summary> - public interface INotificationService - { - } -} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/NotificationService.cs b/win/CS/HandBrakeWPF/Services/NotificationService.cs deleted file mode 100644 index 33870fe14..000000000 --- a/win/CS/HandBrakeWPF/Services/NotificationService.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="NotificationService.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// The Notification Service (Growl Connector) -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Services -{ - using HandBrake.ApplicationServices.Services.Encode.EventArgs; - using HandBrake.ApplicationServices.Services.Encode.Interfaces; - - using HandBrakeWPF.Services.Interfaces; - - using IQueueProcessor = HandBrakeWPF.Services.Queue.Interfaces.IQueueProcessor; - - /// <summary> - /// The Notification Service (Growl Connector) - /// </summary> - public class NotificationService : INotificationService - { - /// <summary> - /// The user setting service. - /// </summary> - private readonly IUserSettingService userSettingService; - - /// <summary> - /// Initializes a new instance of the <see cref="NotificationService"/> class. - /// </summary> - /// <param name="encodeService"> - /// The encode Service. - /// </param> - /// <param name="queueProcessor"> - /// The queue Processor. - /// </param> - /// <param name="userSettingService"> - /// The user Setting Service. - /// </param> - public NotificationService(IEncode encodeService, IQueueProcessor queueProcessor, IUserSettingService userSettingService) - { - this.userSettingService = userSettingService; - // encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted; - // queueProcessor.QueueCompleted += this.QueueProcessorQueueCompleted; - } - - /// <summary> - /// The queue processor_ queue completed. - /// </summary> - /// <param name="sender"> - /// The sender. - /// </param> - /// <param name="e"> - /// The EventArgs. - /// </param> - private void QueueProcessorQueueCompleted(object sender, System.EventArgs e) - { - if (userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue)) - { - // GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done."); - } - } - - /// <summary> - /// The encode service_ encode completed. - /// </summary> - /// <param name="sender"> - /// The sender. - /// </param> - /// <param name="e"> - /// The EncodeCompletedEventArgs. - /// </param> - private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e) - { - if (userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode)) - { - // GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done."); - } - } - } -} diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs index d31d3b60f..f49836b6a 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs @@ -103,7 +103,6 @@ namespace HandBrakeWPF.Services } var currentBuild = HandBrakeUtils.Build; - var skipBuild = this.userSettingService.GetUserSetting<int>(UserSettingConstants.Skipversion); // Initialize variables WebRequest request = WebRequest.Create(url); @@ -118,15 +117,6 @@ namespace HandBrakeWPF.Services int latest = int.Parse(build); int current = currentBuild; - int skip = skipBuild; - - // If the user wanted to skip this version, don't report the update - if (latest == skip) - { - var info = new UpdateCheckInformation { NewVersionAvailable = false }; - callback(info); - return; - } var info2 = new UpdateCheckInformation { diff --git a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs index 53225c235..c2ca7b3ad 100644 --- a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs @@ -60,7 +60,6 @@ namespace HandBrakeWPF.Startup this.container.Singleton<IUpdateService, UpdateService>(); this.container.Singleton<IScan, LibScan>(); this.container.Singleton<IEncode, LibEncode>(); - this.container.Singleton<INotificationService, NotificationService>(); this.container.Singleton<IPrePostActionService, PrePostActionService>(); this.container.Singleton<IUserSettingService, UserSettingService>(); this.container.Singleton<IPresetService, PresetService>(); diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 9154b678f..f41b0d9e7 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -71,11 +71,6 @@ namespace HandBrakeWPF /// </summary> public const string MinTitleLength = "MinTitleLength"; - /// <summary> - /// Skip Version - /// </summary> - public const string Skipversion = "skipversion"; - /// <summary> /// Update Status /// </summary> @@ -91,16 +86,6 @@ namespace HandBrakeWPF /// </summary> public const string VLCPath = "VLC_Path"; - /// <summary> - /// Growl Encodes - /// </summary> - public const string GrowlEncode = "GrowlEncode"; - - /// <summary> - /// Growl Queues - /// </summary> - public const string GrowlQueue = "GrowlQueue"; - /// <summary> /// The Instance Id /// </summary> diff --git a/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs b/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs index bcdbfb430..5dccba552 100644 --- a/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs +++ b/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs @@ -47,16 +47,14 @@ namespace HandBrakeWPF.Utilities { try { - Console.WriteLine("Trying to deleting File: {0}", file); if (File.Exists(file)) { File.Delete(file); - Console.WriteLine("File was deleted successfully"); } } catch (Exception exc) { - Console.WriteLine("Unable to Delete File: {0} {1} {2}", file, Environment.NewLine, exc); + throw; } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 919f82389..9e04cf396 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -228,10 +228,6 @@ namespace HandBrakeWPF.ViewModels /// <param name="updateService"> /// The update Service. /// </param> - /// <param name="notificationService"> - /// The notification Service. - /// *** Leave in Constructor. *** - /// </param> /// <param name="whenDoneService"> /// The when Done Service. /// *** Leave in Constructor. *** @@ -264,7 +260,7 @@ namespace HandBrakeWPF.ViewModels /// The static Preview View Model. /// </param> public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, - IErrorService errorService, IUpdateService updateService, INotificationService notificationService, + IErrorService errorService, IUpdateService updateService, IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel, IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel) @@ -273,7 +269,6 @@ namespace HandBrakeWPF.ViewModels this.encodeService = encodeService; this.presetService = presetService; this.errorService = errorService; - // this.shellViewModel = shellViewModel; IShellViewModel shellViewModel, this.updateService = updateService; this.windowManager = windowManager; this.userSettingService = userSettingService; diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 331c9bf5c..04c2df797 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -113,16 +113,6 @@ namespace HandBrakeWPF.ViewModels /// </summary> private bool disableLibdvdNav; - /// <summary> - /// The growl after encode. - /// </summary> - private bool growlAfterEncode; - - /// <summary> - /// The growl after queue. - /// </summary> - private bool growlAfterQueue; - /// <summary> /// The log directory. /// </summary> @@ -433,40 +423,6 @@ namespace HandBrakeWPF.ViewModels } } - /// <summary> - /// Gets or sets a value indicating whether GrowlAfterEncode. - /// </summary> - public bool GrowlAfterEncode - { - get - { - return this.growlAfterEncode; - } - - set - { - this.growlAfterEncode = value; - this.NotifyOfPropertyChange("GrowlAfterEncode"); - } - } - - /// <summary> - /// Gets or sets a value indicating whether GrowlAfterQueue. - /// </summary> - public bool GrowlAfterQueue - { - get - { - return this.growlAfterQueue; - } - - set - { - this.growlAfterQueue = value; - this.NotifyOfPropertyChange("GrowlAfterQueue"); - } - } - /// <summary> /// Gets or sets a value indicating whether SendFileAfterEncode. /// </summary> @@ -1349,8 +1305,6 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, "Do nothing"); } - this.GrowlAfterEncode = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode); - this.GrowlAfterQueue = userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue); this.SendFileAfterEncode = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.SendFile); this.SendFileTo = Path.GetFileNameWithoutExtension(this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo)) ?? string.Empty; this.SendFileToPath = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileTo) ?? string.Empty; @@ -1478,8 +1432,6 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, this.CheckForUpdates); this.userSettingService.SetUserSetting(UserSettingConstants.DaysBetweenUpdateCheck, this.CheckForUpdatesFrequency); this.userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, this.WhenDone); - this.userSettingService.SetUserSetting(UserSettingConstants.GrowlQueue, this.GrowlAfterQueue); - this.userSettingService.SetUserSetting(UserSettingConstants.GrowlEncode, this.GrowlAfterEncode); this.userSettingService.SetUserSetting(UserSettingConstants.SendFileTo, this.SendFileToPath); this.userSettingService.SetUserSetting(UserSettingConstants.SendFile, this.SendFileAfterEncode); this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments); diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 956c3d602..d8c6ee802 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -109,11 +109,6 @@ <CheckBox Content="{x:Static Properties:ResourcesUI.Options_ResetDoNothing}" VerticalAlignment="Center" IsChecked="{Binding ResetWhenDoneAction}" /> </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0,5,0,0" Visibility="Collapsed"> - <CheckBox Content="Growl after Queue Completes" IsChecked="{Binding GrowlAfterEncode}" Margin="0,0,5,0"/> - <CheckBox Content="Growl after Encode Completes" IsChecked="{Binding GrowlAfterQueue}" /> - </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0,5,0,0"> <CheckBox Content="{x:Static Properties:ResourcesUI.Options_SendFileTo}" VerticalAlignment="Center" IsChecked="{Binding SendFileAfterEncode}" /> <TextBlock Margin="5,0,5,5" VerticalAlignment="Center" Text="{Binding SendFileTo}" /> -- 2.40.0