From 6b07388d5ea2ee6fdb8613d024913062dbcbd72a Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 14 Jun 2012 18:09:38 +0000 Subject: WinGui: Strip out more legacy code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4733 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../ASUserSettingConstants.cs | 12 ++++++--- .../Model/Encoding/SubtitleTrack.cs | 22 ---------------- .../HandBrake.ApplicationServices/Model/Preset.cs | 5 ---- .../ServiceManager.cs | 30 ++++++++-------------- .../Services/PresetService.cs | 4 --- .../ServicesWindsorInstaller.cs | 11 +++++++- 6 files changed, 29 insertions(+), 55 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices') diff --git a/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs b/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs index e05e37aa9..f9200958d 100644 --- a/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs +++ b/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs @@ -1,7 +1,11 @@ -/* UserSettingConstants.cs $ - This file is part of the HandBrake source code. - Homepage: . - It may be used under the terms of the GNU General Public License. */ +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The User Setting Constants +// +// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices { diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs index ab716e5fd..d944dea97 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs @@ -7,12 +7,9 @@ // // -------------------------------------------------------------------------------------------------------------------- -using System.IO; - namespace HandBrake.ApplicationServices.Model.Encoding { using System; - using System.Windows.Forms; using Caliburn.Micro; @@ -132,25 +129,6 @@ namespace HandBrake.ApplicationServices.Model.Encoding } } - /// - /// Gets A ListViewItem Containing information about this subitlte - /// - [Obsolete("Used only for the old forms gui. Will be removed.")] - public ListViewItem ListView - { - get - { - var listTrack = new ListViewItem(this.Track); - listTrack.SubItems.Add(this.Forced ? "Yes" : "No"); - listTrack.SubItems.Add(this.Burned ? "Yes" : "No"); - listTrack.SubItems.Add(this.Default ? "Yes" : "No"); - listTrack.SubItems.Add(this.SrtLang); - listTrack.SubItems.Add(this.SrtCharCode); - listTrack.SubItems.Add(this.SrtOffset.ToString()); - return listTrack; - } - } - /// /// Gets or sets SourceTrack. /// diff --git a/win/CS/HandBrake.ApplicationServices/Model/Preset.cs b/win/CS/HandBrake.ApplicationServices/Model/Preset.cs index 177b3c267..5d165ae94 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Preset.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Preset.cs @@ -29,11 +29,6 @@ namespace HandBrake.ApplicationServices.Model /// public string Query { get; set; } - /// - /// Gets or sets a value indicating whether to use picture Settings in presets. - /// - [Obsolete("Don't use this!")] - public bool CropSettings { get; set; } /// /// Gets or sets The version number which associates this preset with a HB build diff --git a/win/CS/HandBrake.ApplicationServices/ServiceManager.cs b/win/CS/HandBrake.ApplicationServices/ServiceManager.cs index fba0e99b9..41775a287 100644 --- a/win/CS/HandBrake.ApplicationServices/ServiceManager.cs +++ b/win/CS/HandBrake.ApplicationServices/ServiceManager.cs @@ -1,10 +1,16 @@ -namespace HandBrake.ApplicationServices -{ - using System; +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Tempory Class which manages services until Windosor is added back into the project to handle it for us. +// +// -------------------------------------------------------------------------------------------------------------------- +namespace HandBrake.ApplicationServices +{ using Caliburn.Micro; - using HandBrake.ApplicationServices.Services; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.Interop; @@ -13,11 +19,6 @@ /// public class ServiceManager { - /// - /// Backing Field for the User Setting Service. - /// - private static IUserSettingService userSettingService; - /// /// The Backing field for HandBrake Instance. /// @@ -30,16 +31,7 @@ { get { - try - { - return IoC.Get(); - } - catch (NullReferenceException) - { - // Hack until this legacy code for the forms gui is removed! - } - - return userSettingService ?? (userSettingService = new UserSettingService()); + return IoC.Get(); } } diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs index 68bf80481..11df7ccb2 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs @@ -151,7 +151,6 @@ namespace HandBrake.ApplicationServices.Services { preset.Query = update.Query; preset.Task = update.Task; - preset.CropSettings = update.CropSettings; preset.UsePictureFilters = update.UsePictureFilters; // Update the presets file @@ -297,15 +296,12 @@ namespace HandBrake.ApplicationServices.Services Regex r = new Regex("(: )"); // Split on hyphens. string[] presetName = r.Split(line); - bool pic = presetName[2].Contains("crop"); - Preset newPreset = new Preset { Category = category, Name = presetName[0].Replace("+", string.Empty).Trim(), Query = presetName[2], Version = this.userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - CropSettings = pic, Description = string.Empty, // Maybe one day we will populate this. IsBuildIn = true, UsePictureFilters = true, diff --git a/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs b/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs index a250aa2fa..6d5b40ef6 100644 --- a/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs +++ b/win/CS/HandBrake.ApplicationServices/ServicesWindsorInstaller.cs @@ -1,4 +1,13 @@ -namespace HandBrake.ApplicationServices +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The Windsor Installer Interface Implementation +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices { using Castle.MicroKernel.Registration; using Castle.MicroKernel.SubSystems.Configuration; -- cgit v1.2.3