OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 29 Jan 2011 21:29:26 +0000 (21:29 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 29 Jan 2011 21:29:26 +0000 (21:29 +0000)
- Refactor the preset service and move to the Application Services.
   * Left the old service in place for now, will hook the new service in later.

git-svn-id: svn://localhost/HandBrake/trunk@3772 b64f7644-9d1e-0410-96f1-a4d463321fa5

15 files changed:
win/C#/Controls/AudioPanel.cs
win/C#/Controls/PictureSettings.cs
win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
win/C#/HandBrake.ApplicationServices/Init.cs
win/C#/HandBrake.ApplicationServices/Model/Preset.cs [moved from win/C#/Presets/Preset.cs with 70% similarity]
win/C#/HandBrake.ApplicationServices/Services/Interfaces/IPresetService.cs [new file with mode: 0644]
win/C#/HandBrake.ApplicationServices/Services/PresetService.cs [new file with mode: 0644]
win/C#/HandBrake.ApplicationServices/Services/QueueManager.cs
win/C#/HandBrake.ApplicationServices/Settings.StyleCop
win/C#/HandBrakeCS.csproj
win/C#/Presets/PlistPresetHandler.cs
win/C#/Presets/PresetsHandler.cs
win/C#/Program.cs
win/C#/frmOptions.cs
win/C#/frmOptions.resx

index 3f4808e..cb24335 100644 (file)
@@ -12,6 +12,7 @@ namespace Handbrake.Controls
     using System.Windows.Forms;\r
     using Functions;\r
 \r
+    using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
 \r
     using Presets;\r
index b6f51f5..2425407 100644 (file)
@@ -10,6 +10,7 @@ namespace Handbrake.Controls
     using System.Globalization;\r
     using System.Windows.Forms;\r
 \r
+    using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
 \r
     using Presets;\r
index d45228a..764eb0c 100644 (file)
@@ -65,6 +65,7 @@
       <HintPath>..\libraries\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>\r
     </Reference>\r
     <Reference Include="PresentationCore" />\r
+    <Reference Include="PresentationFramework" />\r
     <Reference Include="System" />\r
     <Reference Include="System.Core">\r
       <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
     <Compile Include="Model\Encoding\SubtitleTrack.cs" />\r
     <Compile Include="Model\Encoding\VideoEncoder.cs" />\r
     <Compile Include="Model\Encoding\VideoEncodeMode.cs" />\r
+    <Compile Include="Model\Preset.cs" />\r
     <Compile Include="Model\QueueTask.cs" />\r
     <Compile Include="Model\Encoding\SubtitleType.cs" />\r
     <Compile Include="Parsing\AudioTrack.cs" />\r
     <Compile Include="Services\Interfaces\IQueueManager.cs" />\r
     <Compile Include="Services\Interfaces\IQueueProcessor.cs" />\r
     <Compile Include="Services\Interfaces\IScan.cs" />\r
+    <Compile Include="Services\Interfaces\IPresetService.cs" />\r
     <Compile Include="Services\LibScan.cs" />\r
+    <Compile Include="Services\PresetService.cs" />\r
     <Compile Include="Services\QueueManager.cs" />\r
     <Compile Include="Services\QueueProcessor.cs" />\r
     <Compile Include="Services\ScanService.cs" />\r
index bacf132..999b455 100644 (file)
@@ -13,6 +13,11 @@ namespace HandBrake.ApplicationServices
     /// </summary>\r
     public class Init\r
     {\r
+        /**\r
+         *  I really dislike this, Need to replace this sooner rather than later.\r
+         **/ \r
+\r
+\r
         /// <summary>\r
         /// Setup the Settings used by the applicaiton with this library\r
         /// </summary>\r
@@ -52,12 +57,13 @@ namespace HandBrake.ApplicationServices
         /// <param name="preventSleep">\r
         /// Prevent the system from sleeping\r
         /// </param>\r
-        public static void SetupSettings(string versionString, int instanceId, string completionOption, bool disableDvdNav,\r
+        public static void SetupSettings(string versionString, string version, int instanceId, string completionOption, bool disableDvdNav,\r
                                   bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,\r
                                   bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)\r
         {\r
             InstanceId = instanceId;\r
             HandBrakeGuiVersionString = versionString;\r
+            Version = version;\r
             CompletionOption = completionOption;\r
             DisableDvdNav = disableDvdNav;\r
             GrowlEncode = growlEncode;\r
@@ -92,6 +98,11 @@ namespace HandBrake.ApplicationServices
         public static string HandBrakeGuiVersionString;\r
 \r
         /// <summary>\r
+        /// HandBrakes Version or Svn revision\r
+        /// </summary>\r
+        public static string Version;\r
+\r
+        /// <summary>\r
         /// What to do when the encode completes.\r
         /// </summary>\r
         public static string CompletionOption;\r
similarity index 70%
rename from win/C#/Presets/Preset.cs
rename to win/C#/HandBrake.ApplicationServices/Model/Preset.cs
index b6151a3..988e3da 100644 (file)
@@ -3,10 +3,10 @@
     Homepage: <http://handbrake.fr>.\r
     It may be used under the terms of the GNU General Public License. */\r
 \r
-namespace Handbrake.Presets\r
+namespace HandBrake.ApplicationServices.Model\r
 {\r
     /// <summary>\r
-    /// A Preset\r
+    /// A Preset for encoding with.\r
     /// </summary>\r
     public class Preset \r
     {\r
@@ -31,6 +31,11 @@ namespace Handbrake.Presets
         public bool CropSettings { get; set; }\r
 \r
         /// <summary>\r
+        /// Gets or sets the Settings for this encode/preset. Can be used in place of Query property.\r
+        /// </summary>\r
+        public EncodeTask EncodeSettings { get; set; }\r
+\r
+        /// <summary>\r
         /// Gets or sets The version number which associates this preset with a HB build\r
         /// </summary>\r
         public string Version { get; set; }\r
@@ -39,5 +44,10 @@ namespace Handbrake.Presets
         /// Gets or sets the Description for the preset\r
         /// </summary>\r
         public string Description { get; set; }\r
+\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether this is a built in preset\r
+        /// </summary>\r
+        public bool IsBuildIn { get; set; }\r
     }\r
 }
\ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IPresetService.cs b/win/C#/HandBrake.ApplicationServices/Services/Interfaces/IPresetService.cs
new file mode 100644 (file)
index 0000000..b947a95
--- /dev/null
@@ -0,0 +1,85 @@
+/*  IPresetService.cs $\r
+    This file is part of the HandBrake source code.\r
+    Homepage: <http://handbrake.fr>.\r
+    It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices.Services.Interfaces\r
+{\r
+    using System.ComponentModel;\r
+\r
+    using HandBrake.ApplicationServices.Model;\r
+\r
+    /// <summary>\r
+    /// The Preset Service Interface\r
+    /// </summary>\r
+    public interface IPresetService\r
+    {\r
+        /// <summary>\r
+        /// Gets or sets a Collection of presets.\r
+        /// </summary>\r
+        ICollectionView Presets { get; set; }\r
+\r
+        /// <summary>\r
+        /// Add a new preset to the system\r
+        /// </summary>\r
+        /// <param name="preset">\r
+        /// A Preset to add\r
+        /// </param>\r
+        /// <returns>\r
+        /// True if added,\r
+        /// False if name already exists\r
+        /// </returns>\r
+        bool Add(Preset preset);\r
+\r
+        /// <summary>\r
+        /// Remove a preset with a given name from either the built in or user preset list.\r
+        /// </summary>\r
+        /// <param name="preset">\r
+        /// The Preset to remove\r
+        /// </param>\r
+        void Remove(Preset preset);\r
+\r
+        /// <summary>\r
+        /// Get a Preset\r
+        /// </summary>\r
+        /// <param name="name">\r
+        /// The name of the preset to get\r
+        /// </param>\r
+        /// <returns>\r
+        /// A Preset or null object\r
+        /// </returns>\r
+        Preset GetPreset(string name);\r
+\r
+        /// <summary>\r
+        /// Clear Built-in Presets\r
+        /// </summary>\r
+        void ClearBuiltIn();\r
+\r
+        /// <summary>\r
+        /// Clear all presets\r
+        /// </summary>\r
+        void ClearAll();\r
+\r
+        /// <summary>\r
+        /// Reads the CLI's CLI output format and load's them into the preset List Preset\r
+        /// </summary>\r
+        /// <param name="cliPath">\r
+        /// The Path to the CLI, leave blank for current folder.\r
+        /// </param>\r
+        void UpdateBuiltInPresets(string cliPath);\r
+\r
+        /// <summary>\r
+        /// Check if the built in Presets stored are not out of date.\r
+        /// Update them if they are.\r
+        /// </summary>\r
+        /// <returns>true if out of date</returns>\r
+        bool CheckIfPresetsAreOutOfDate();\r
+\r
+        /// <summary>\r
+        /// Check if the preset "name" exists in either Presets or UserPresets lists.\r
+        /// </summary>\r
+        /// <param name="name">Name of the preset</param>\r
+        /// <returns>True if found</returns>\r
+        bool CheckIfPresetExists(string name);\r
+    }\r
+}
\ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Services/PresetService.cs b/win/C#/HandBrake.ApplicationServices/Services/PresetService.cs
new file mode 100644 (file)
index 0000000..dbfb878
--- /dev/null
@@ -0,0 +1,350 @@
+/*  PresetService.cs $\r
+    This file is part of the HandBrake source code.\r
+    Homepage: <http://handbrake.fr>.\r
+    It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices.Services\r
+{\r
+    using System;\r
+    using System.Collections.Generic;\r
+    using System.Collections.ObjectModel;\r
+    using System.ComponentModel;\r
+    using System.Diagnostics;\r
+    using System.IO;\r
+    using System.Linq;\r
+    using System.Text.RegularExpressions;\r
+    using System.Windows.Data;\r
+    using System.Xml.Serialization;\r
+\r
+    using HandBrake.ApplicationServices.Model;\r
+    using HandBrake.ApplicationServices.Services.Interfaces;\r
+\r
+    /// <summary>\r
+    /// The preset service manages HandBrake's presets\r
+    /// </summary>\r
+    public class PresetService : IPresetService\r
+    {\r
+        /**\r
+         * TODO:\r
+         * - Wire this into the Forms and WPF UI's\r
+         * - Note: This is untested so far. It'll likely need fixes before it can be used.\r
+         **/ \r
+\r
+        #region Private Variables\r
+\r
+        /// <summary>\r
+        /// XML Serializer\r
+        /// </summary>\r
+        private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<Preset>));\r
+\r
+        /// <summary>\r
+        /// The User Preset file\r
+        /// </summary>\r
+        private readonly string userPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\user_presets.xml";\r
+\r
+        /// <summary>\r
+        /// The Built In Presets File\r
+        /// </summary>\r
+        private readonly string builtInPresetFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml";\r
+\r
+        /// <summary>\r
+        /// A Collection of presets\r
+        /// </summary>\r
+        private ObservableCollection<Preset> presets = new ObservableCollection<Preset>();\r
+\r
+        #endregion\r
+\r
+        /// <summary>\r
+        /// Initializes a new instance of the <see cref="PresetService"/> class.\r
+        /// </summary>\r
+        public PresetService()\r
+        {\r
+            this.Presets = CollectionViewSource.GetDefaultView(this.presets);\r
+            this.LoadPresets();\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets a Collection of presets.\r
+        /// </summary>\r
+        public ICollectionView Presets { get; set; }\r
+\r
+        #region Public Methods\r
+\r
+        /// <summary>\r
+        /// Add a new preset to the system\r
+        /// </summary>\r
+        /// <param name="preset">\r
+        /// A Preset to add\r
+        /// </param>\r
+        /// <returns>\r
+        /// True if added,\r
+        /// False if name already exists\r
+        /// </returns>\r
+        public bool Add(Preset preset)\r
+        {\r
+            if (this.CheckIfPresetExists(preset.Name) == false)\r
+            {\r
+                this.presets.Add(preset);\r
+\r
+                // Update the presets file\r
+                this.UpdatePresetFiles();\r
+                return true;\r
+            }\r
+\r
+            return false;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Remove a preset with a given name from either the built in or user preset list.\r
+        /// </summary>\r
+        /// <param name="preset">\r
+        /// The Preset to remove\r
+        /// </param>\r
+        public void Remove(Preset preset)\r
+        {\r
+            this.presets.Remove(preset);\r
+\r
+            // Update the presets file\r
+            this.UpdatePresetFiles();\r
+        }\r
+\r
+        /// <summary>\r
+        /// Get a Preset\r
+        /// </summary>\r
+        /// <param name="name">\r
+        /// The name of the preset to get\r
+        /// </param>\r
+        /// <returns>\r
+        /// A Preset or null object\r
+        /// </returns>\r
+        public Preset GetPreset(string name)\r
+        {\r
+            return this.presets.FirstOrDefault(item => item.Name == name);\r
+        }\r
+\r
+        /// <summary>\r
+        /// Clear Built-in Presets\r
+        /// </summary>\r
+        public void ClearBuiltIn()\r
+        {\r
+            List<Preset> remove = this.presets.Where(p => p.IsBuildIn).ToList();\r
+            foreach (Preset preset in remove)\r
+            {\r
+                this.presets.Remove(preset);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Clear all presets\r
+        /// </summary>\r
+        public void ClearAll()\r
+        {\r
+            this.presets.Clear();\r
+        }\r
+\r
+        /// <summary>\r
+        /// Reads the CLI's CLI output format and load's them into the preset List Preset\r
+        /// </summary>\r
+        /// <param name="cliPath">\r
+        /// The Path to the CLI, leave blank for current folder.\r
+        /// </param>\r
+        public void UpdateBuiltInPresets(string cliPath)\r
+        {\r
+            // Create a new tempory file and execute the CLI to get the built in Presets.\r
+            string handbrakeCLIPath = Path.Combine(cliPath, "HandBrakeCLI.exe");\r
+            string presetsPath = Path.Combine(Path.GetTempPath(), "temp_presets.dat");\r
+            string strCmdLine = String.Format(@"cmd /c """"{0}"" --preset-list >""{1}"" 2>&1""", handbrakeCLIPath, presetsPath);\r
+            \r
+            ProcessStartInfo getPresets = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden };\r
+\r
+            Process hbproc = Process.Start(getPresets);\r
+            hbproc.WaitForExit();\r
+            hbproc.Dispose();\r
+            hbproc.Close();\r
+\r
+            // Clear the current built in Presets and now parse the tempory Presets file.\r
+            this.presets.Clear();\r
+\r
+            if (File.Exists(presetsPath))\r
+            {\r
+                StreamReader presetInput = new StreamReader(presetsPath);\r
+\r
+                string category = String.Empty;\r
+\r
+                while (!presetInput.EndOfStream)\r
+                {\r
+                    string line = presetInput.ReadLine();\r
+\r
+                    // Found the beginning of a preset block \r
+                    if (line != null && line.Contains("<") && !line.Contains("<<")) \r
+                    {\r
+                        category = line.Replace("<", string.Empty).Trim();\r
+                    }\r
+\r
+                    // Found a preset\r
+                    if (line != null && line.Contains("+")) \r
+                    {\r
+                        Regex r = new Regex("(:  )"); // Split on hyphens. \r
+                        string[] presetName = r.Split(line);\r
+\r
+                        bool pic = false;\r
+                        if (presetName[2].Contains("crop"))\r
+                        {\r
+                            pic = true;\r
+                        }\r
+\r
+                        Preset newPreset = new Preset\r
+                        {\r
+                            Category = category,\r
+                            Name = presetName[0].Replace("+", string.Empty).Trim(),\r
+                            Query = presetName[2],\r
+                            Version = Init.Version,\r
+                            CropSettings = pic,\r
+                            Description = string.Empty // Maybe one day we will populate this.\r
+                        };\r
+                        this.presets.Add(newPreset);\r
+                    }\r
+                }\r
+                presetInput.Close();\r
+                presetInput.Dispose();\r
+            }\r
+\r
+            // Finally, Create a new or update the current Presets.xml file\r
+            this.UpdatePresetFiles();\r
+        }\r
+\r
+        /// <summary>\r
+        /// Check if the built in Presets stored are not out of date.\r
+        /// Update them if they are.\r
+        /// </summary>\r
+        /// <returns>true if out of date</returns>\r
+        public bool CheckIfPresetsAreOutOfDate()\r
+        {\r
+            // Update built-in Presets if the built-in Presets belong to an older version.\r
+            if (this.presets.Count != 0)\r
+            {\r
+                if (this.presets[0].Version != Init.Version)\r
+                {\r
+                    this.UpdateBuiltInPresets(string.Empty);\r
+                    return true;\r
+                }\r
+            }\r
+\r
+            return false;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Check if the preset "name" exists in either Presets or UserPresets lists.\r
+        /// </summary>\r
+        /// <param name="name">Name of the preset</param>\r
+        /// <returns>True if found</returns>\r
+        public bool CheckIfPresetExists(string name)\r
+        {\r
+            return name == string.Empty || this.presets.Any(item => item.Name == name);\r
+        }\r
+\r
+        #endregion\r
+\r
+        #region Private Helpers\r
+\r
+        /// <summary>\r
+        /// Recover from a courrpted preset file\r
+        /// Add .old to the current filename, and delete the current file.\r
+        /// </summary>\r
+        /// <param name="file">\r
+        /// The broken presets file.\r
+        /// </param>\r
+        private static void RecoverFromCorruptedPresetFile(string file)\r
+        {\r
+            // Recover from Error.\r
+            if (File.Exists(file))\r
+            {\r
+                string disabledFile = file + ".old";\r
+                File.Move(file, disabledFile);\r
+                if (File.Exists(file))\r
+                {\r
+                    File.Delete(file);\r
+                }\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Load in the Built-in and User presets into the collection\r
+        /// </summary>\r
+        private void LoadPresets()\r
+        {\r
+            // First clear the Presets arraylists\r
+            this.presets.Clear();\r
+\r
+            // Load in the users Presets from UserPresets.xml\r
+            try\r
+            {\r
+                if (File.Exists(this.builtInPresetFile))\r
+                {\r
+                    StreamReader reader = new StreamReader(this.builtInPresetFile);\r
+                    List<Preset> list = (List<Preset>)Ser.Deserialize(reader);\r
+                    foreach (Preset preset in list)\r
+                    {\r
+                        this.presets.Add(preset);\r
+                    }\r
+\r
+                    reader.Close();\r
+                }\r
+            }\r
+            catch (Exception)\r
+            {\r
+                RecoverFromCorruptedPresetFile(this.builtInPresetFile);\r
+                this.UpdateBuiltInPresets(string.Empty);\r
+            }\r
+\r
+            // Load in the users Presets from UserPresets.xml\r
+            try\r
+            {\r
+                if (File.Exists(this.userPresetFile))\r
+                {\r
+                    StreamReader reader = new StreamReader(this.userPresetFile);\r
+                    List<Preset> list = (List<Preset>)Ser.Deserialize(reader);\r
+                    foreach (Preset preset in list)\r
+                    {\r
+                        this.presets.Add(preset);\r
+                    }\r
+\r
+                    reader.Close();\r
+                }\r
+            }\r
+            catch (Exception)\r
+            {\r
+                RecoverFromCorruptedPresetFile(this.userPresetFile);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Update the preset files\r
+        /// </summary>\r
+        private void UpdatePresetFiles()\r
+        {\r
+            try\r
+            {\r
+                using (FileStream strm = new FileStream(this.builtInPresetFile, FileMode.Create, FileAccess.Write))\r
+                {\r
+                    Ser.Serialize(strm, this.presets.Where(p => p.IsBuildIn));\r
+                    strm.Close();\r
+                    strm.Dispose();\r
+                }\r
+\r
+                using (FileStream strm = new FileStream(this.userPresetFile, FileMode.Create, FileAccess.Write))\r
+                {\r
+                    Ser.Serialize(strm, this.presets.Where(p => p.IsBuildIn == false));\r
+                    strm.Close();\r
+                    strm.Dispose();\r
+                }\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                throw new Exception("Unable to write to the file. Please make sure the location has the correct permissions for file writing.\n Error Information: \n\n", exc);\r
+            }\r
+        }\r
+\r
+        #endregion\r
+    }\r
+}\r
index f244e01..7f723b8 100644 (file)
@@ -1,4 +1,9 @@
-namespace HandBrake.ApplicationServices.Services\r
+/*  QueueManager.cs $\r
+    This file is part of the HandBrake source code.\r
+    Homepage: <http://handbrake.fr>.\r
+    It may be used under the terms of the GNU General Public License. */\r
+\r
+namespace HandBrake.ApplicationServices.Services\r
 {\r
     using System;\r
     using System.Collections.Generic;\r
index e61afbf..a691f20 100644 (file)
@@ -1,4 +1,7 @@
 <StyleCopSettings Version="4.3">\r
+  <GlobalSettings>\r
+    <BooleanProperty Name="WriteCache">False</BooleanProperty>\r
+  </GlobalSettings>\r
   <Analyzers>\r
     <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">\r
       <Rules>\r
index 0eb720f..2f0ebe0 100644 (file)
     </Compile>\r
     <Compile Include="Model\SourceType.cs" />\r
     <Compile Include="Presets\PlistPresetHandler.cs" />\r
-    <Compile Include="Presets\Preset.cs" />\r
     <Compile Include="Presets\PresetsHandler.cs" />\r
     <Compile Include="Functions\QueryParser.cs" />\r
     <Compile Include="Program.cs" />\r
index 12731f2..8be1563 100644 (file)
@@ -13,10 +13,9 @@ namespace Handbrake.Presets
     using System.Xml;\r
     using Functions;\r
 \r
+    using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Model.Encoding;\r
 \r
-    using Model;\r
-\r
     /// <summary>\r
     /// Plist Preset Converter\r
     /// </summary>\r
index 456cdfd..40ddeb2 100644 (file)
@@ -15,6 +15,8 @@ namespace Handbrake.Presets
     using System.Windows.Forms;\r
     using System.Xml.Serialization;\r
 \r
+    using HandBrake.ApplicationServices.Model;\r
+\r
     /// <summary>\r
     /// The Preset Handler Class\r
     /// </summary>\r
index d801293..34bf509 100644 (file)
@@ -108,7 +108,7 @@ namespace Handbrake
         private static void InitializeApplicationServices()\r
         {\r
             string versionId = String.Format("Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);\r
-            Init.SetupSettings(versionId, InstanceId, Settings.Default.CompletionOption, Settings.Default.noDvdNav,\r
+            Init.SetupSettings(versionId, Settings.Default.hb_version, InstanceId, Settings.Default.CompletionOption, Settings.Default.noDvdNav,\r
                                Settings.Default.growlEncode, Settings.Default.growlQueue,\r
                                Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,\r
                                Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus, Settings.Default.preventSleep);\r
index 89c5aae..4ad7b87 100644 (file)
@@ -503,6 +503,7 @@ namespace Handbrake
                 "Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);\r
             Init.SetupSettings(\r
                 versionId,\r
+                Settings.Default.hb_version,\r
                 Program.InstanceId,\r
                 Settings.Default.CompletionOption,\r
                 Settings.Default.noDvdNav,\r
index 42c24c3..2bfb5c9 100644 (file)
     <value>2.0</value>\r
   </resheader>\r
   <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
   <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
-  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>132, 18</value>\r
   </metadata>\r
   <data name="check_m4v.ToolTip" xml:space="preserve">\r
@@ -138,13 +138,13 @@ meaing you'll have playable files if you choose to end the encode early.
 \r
 When disabled, Presseting "Stop" on the main winow will render the encode unplayable.</value>\r
   </data>\r
-  <metadata name="pathFinder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+  <metadata name="pathFinder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>17, 17</value>\r
   </metadata>\r
-  <metadata name="openFile_vlc.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+  <metadata name="openFile_vlc.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>224, 18</value>\r
   </metadata>\r
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r