OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 19 Sep 2010 12:17:07 +0000 (12:17 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 19 Sep 2010 12:17:07 +0000 (12:17 +0000)
- Moved some non-specific HandBrake code (Exception Window, Update Information Window, Update Download Window) out into a separate framework library. Hoping to make this more reusable at a later point.

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

36 files changed:
win/C#/Controls/Subtitles.cs
win/C#/Functions/Main.cs
win/C#/HandBrake.ApplicationServices/Functions/Main.cs
win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
win/C#/HandBrake.ApplicationServices/Properties/Resources.Designer.cs
win/C#/HandBrake.ApplicationServices/Properties/Resources.resx
win/C#/HandBrake.ApplicationServices/Services/Encode.cs
win/C#/HandBrake.ApplicationServices/Services/Queue.cs
win/C#/HandBrake.ApplicationServices/Services/Scan.cs
win/C#/HandBrake.Framework/HandBrake.Framework.csproj [new file with mode: 0644]
win/C#/HandBrake.Framework/Helpers/AppcastReader.cs [moved from win/C#/Functions/AppcastReader.cs with 95% similarity]
win/C#/HandBrake.Framework/Model/UpdateCheckInformation.cs [new file with mode: 0644]
win/C#/HandBrake.Framework/Model/UpdateCheckResult.cs [moved from win/C#/Functions/UpdateCheckInformation.cs with 62% similarity]
win/C#/HandBrake.Framework/Properties/AssemblyInfo.cs [new file with mode: 0644]
win/C#/HandBrake.Framework/Properties/Resources.Designer.cs [new file with mode: 0644]
win/C#/HandBrake.Framework/Properties/Resources.resx [new file with mode: 0644]
win/C#/HandBrake.Framework/Resources/copy.png [moved from win/C#/HandBrake.ApplicationServices/Resources/copy.png with 100% similarity]
win/C#/HandBrake.Framework/Resources/errorx.png [moved from win/C#/HandBrake.ApplicationServices/Resources/ErrorX.png with 100% similarity]
win/C#/HandBrake.Framework/Resources/logo64.png [new file with mode: 0644]
win/C#/HandBrake.Framework/Services/ErrorService.cs [moved from win/C#/HandBrake.ApplicationServices/Services/ErrorService.cs with 92% similarity]
win/C#/HandBrake.Framework/Services/Interfaces/IErrorService.cs [moved from win/C#/HandBrake.ApplicationServices/Services/Interfaces/IErrorService.cs with 91% similarity]
win/C#/HandBrake.Framework/Services/UpdateService.cs [new file with mode: 0644]
win/C#/HandBrake.Framework/Views/DownloadUpdate.Designer.cs [moved from win/C#/frmDownload.Designer.cs with 95% similarity]
win/C#/HandBrake.Framework/Views/DownloadUpdate.cs [moved from win/C#/frmDownload.cs with 93% similarity]
win/C#/HandBrake.Framework/Views/DownloadUpdate.resx [moved from win/C#/frmDownload.resx with 100% similarity]
win/C#/HandBrake.Framework/Views/ExceptionWindow.cs [moved from win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.cs with 93% similarity]
win/C#/HandBrake.Framework/Views/ExceptionWindow.designer.cs [moved from win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.designer.cs with 95% similarity]
win/C#/HandBrake.Framework/Views/ExceptionWindow.resx [moved from win/C#/HandBrake.ApplicationServices/Views/ExceptionWindow.resx with 100% similarity]
win/C#/HandBrake.Framework/Views/UpdateInfo.Designer.cs [moved from win/C#/frmUpdater.Designer.cs with 96% similarity]
win/C#/HandBrake.Framework/Views/UpdateInfo.cs [moved from win/C#/frmUpdater.cs with 60% similarity]
win/C#/HandBrake.Framework/Views/UpdateInfo.resx [moved from win/C#/frmUpdater.resx with 100% similarity]
win/C#/HandBrake10.sln
win/C#/HandBrakeCS.csproj
win/C#/frmActivityWindow.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index 0583aa8..dec3ec1 100644 (file)
@@ -690,6 +690,14 @@ namespace Handbrake.Controls
             drp_subtitleTracks.SelectedIndex = 0;\r
             Clear();\r
 \r
+            this.AutomaticSubtitleSelection();\r
+        }\r
+\r
+        /// <summary>\r
+        /// Automatic Subtitle Selection based on user preferences.\r
+        /// </summary>\r
+        public void AutomaticSubtitleSelection()\r
+        {\r
             // Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options\r
             if (Properties.Settings.Default.NativeLanguage != "Any")\r
             {\r
@@ -714,7 +722,7 @@ namespace Handbrake.Controls
                                 BtnAddSubTrackClick(this, new EventArgs());\r
                             }\r
                         }\r
-                    }                    \r
+                    }\r
                 }\r
             }\r
         }\r
index 78da9ca..3856713 100644 (file)
@@ -16,6 +16,9 @@ namespace Handbrake.Functions
     using System.Threading;\r
     using System.Windows.Forms;\r
     using System.Xml.Serialization;\r
+\r
+    using HandBrake.Framework.Services;\r
+    using HandBrake.Framework.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
@@ -486,90 +489,6 @@ namespace Handbrake.Functions
         }\r
 \r
         /// <summary>\r
-        /// Begins checking for an update to HandBrake.\r
-        /// </summary>\r
-        /// <param name="callback">The method that will be called when the check is finished.</param>\r
-        /// <param name="debug">Whether or not to execute this in debug mode.</param>\r
-        public static void BeginCheckForUpdates(AsyncCallback callback, bool debug)\r
-        {\r
-            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate\r
-                                                              {\r
-                                                                  try\r
-                                                                  {\r
-                                                                      // Is this a stable or unstable build?\r
-                                                                      string url =\r
-                                                                          Properties.Settings.Default.hb_build.ToString()\r
-                                                                              .EndsWith("1")\r
-                                                                              ? Properties.Settings.Default.\r
-                                                                                    appcast_unstable\r
-                                                                              : Properties.Settings.Default.appcast;\r
-\r
-                                                                      // Initialize variables\r
-                                                                      WebRequest request = WebRequest.Create(url);\r
-                                                                      WebResponse response = request.GetResponse();\r
-                                                                      AppcastReader reader = new AppcastReader();\r
-\r
-                                                                      // Get the data, convert it to a string, and parse it into the AppcastReader\r
-                                                                      reader.GetInfo(\r
-                                                                          new StreamReader(response.GetResponseStream())\r
-                                                                              .ReadToEnd());\r
-\r
-                                                                      // Further parse the information\r
-                                                                      string build = reader.Build;\r
-\r
-                                                                      int latest = int.Parse(build);\r
-                                                                      int current = Properties.Settings.Default.hb_build;\r
-                                                                      int skip = Properties.Settings.Default.skipversion;\r
-\r
-                                                                      // If the user wanted to skip this version, don't report the update\r
-                                                                      if (latest == skip)\r
-                                                                      {\r
-                                                                          UpdateCheckInformation info =\r
-                                                                              new UpdateCheckInformation\r
-                                                                                  {\r
-                                                                                      NewVersionAvailable = false,\r
-                                                                                      BuildInformation = null\r
-                                                                                  };\r
-                                                                          callback(new UpdateCheckResult(debug, info));\r
-                                                                          return;\r
-                                                                      }\r
-\r
-                                                                      // Set when the last update was\r
-                                                                      Properties.Settings.Default.lastUpdateCheckDate =\r
-                                                                          DateTime.Now;\r
-                                                                      Properties.Settings.Default.Save();\r
-\r
-                                                                      UpdateCheckInformation info2 =\r
-                                                                          new UpdateCheckInformation\r
-                                                                              {\r
-                                                                                  NewVersionAvailable = latest > current,\r
-                                                                                  BuildInformation = reader\r
-                                                                              };\r
-                                                                      callback(new UpdateCheckResult(debug, info2));\r
-                                                                  }\r
-                                                                  catch (Exception exc)\r
-                                                                  {\r
-                                                                      callback(new UpdateCheckResult(debug, new UpdateCheckInformation { Error = exc }));\r
-                                                                  }\r
-                                                              }));\r
-        }\r
-\r
-        /// <summary>\r
-        /// End Check for Updates\r
-        /// </summary>\r
-        /// <param name="result">\r
-        /// The result.\r
-        /// </param>\r
-        /// <returns>\r
-        /// Update Check information\r
-        /// </returns>\r
-        public static UpdateCheckInformation EndCheckForUpdates(IAsyncResult result)\r
-        {\r
-            UpdateCheckResult checkResult = (UpdateCheckResult)result;\r
-            return checkResult.Result;\r
-        }\r
-\r
-        /// <summary>\r
         /// Map languages and their iso639_2 value into a IDictionary\r
         /// </summary>\r
         /// <returns>A Dictionary containing the language and iso code</returns>\r
index a8ebee3..368065d 100644 (file)
@@ -7,8 +7,6 @@ namespace HandBrake.ApplicationServices.Functions
 {\r
     using System.Diagnostics;\r
 \r
-    using HandBrake.ApplicationServices.Views;\r
-\r
     /// <summary>\r
     /// Useful functions which various screens can use.\r
     /// </summary>\r
index 50fe295..5e06e87 100644 (file)
       <DependentUpon>Resources.resx</DependentUpon>\r
     </Compile>\r
     <Compile Include="Services\Encode.cs" />\r
-    <Compile Include="Services\ErrorService.cs" />\r
     <Compile Include="Services\Interfaces\IEncode.cs" />\r
-    <Compile Include="Services\Interfaces\IErrorService.cs" />\r
     <Compile Include="Services\Interfaces\IQueue.cs" />\r
     <Compile Include="Services\Interfaces\IScan.cs" />\r
     <Compile Include="Services\Queue.cs" />\r
     <Compile Include="Services\Scan.cs" />\r
-    <Compile Include="Views\ExceptionWindow.cs">\r
-      <SubType>Form</SubType>\r
-    </Compile>\r
-    <Compile Include="Views\ExceptionWindow.designer.cs">\r
-      <DependentUpon>ExceptionWindow.cs</DependentUpon>\r
-    </Compile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="app.config" />\r
   </ItemGroup>\r
   <ItemGroup>\r
+    <None Include="Properties\AssemblyInfo.cs.tmpl" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
     <EmbeddedResource Include="Properties\Resources.resx">\r
-      <Generator>PublicResXFileCodeGenerator</Generator>\r
+      <Generator>ResXFileCodeGenerator</Generator>\r
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r
-      <SubType>Designer</SubType>\r
     </EmbeddedResource>\r
-    <EmbeddedResource Include="Views\ExceptionWindow.resx">\r
-      <DependentUpon>ExceptionWindow.cs</DependentUpon>\r
-    </EmbeddedResource>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <EmbeddedResource Include="Resources\logo64.png" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <EmbeddedResource Include="Resources\ErrorX.png" />\r
+    <None Include="Resources\logo64.png" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <None Include="Properties\AssemblyInfo.cs.tmpl" />\r
-    <EmbeddedResource Include="Resources\copy.png" />\r
+    <ProjectReference Include="..\HandBrake.Framework\HandBrake.Framework.csproj">\r
+      <Project>{49AD42C1-BF9B-4D78-A644-020878FAADE6}</Project>\r
+      <Name>HandBrake.Framework</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.targets" />\r
index bdebc7b..c1dd66e 100644 (file)
@@ -22,7 +22,7 @@ namespace HandBrake.ApplicationServices.Properties {
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]\r
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
-    public class Resources {\r
+    internal class Resources {\r
         \r
         private static global::System.Resources.ResourceManager resourceMan;\r
         \r
@@ -36,7 +36,7 @@ namespace HandBrake.ApplicationServices.Properties {
         ///   Returns the cached ResourceManager instance used by this class.\r
         /// </summary>\r
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
-        public static global::System.Resources.ResourceManager ResourceManager {\r
+        internal static global::System.Resources.ResourceManager ResourceManager {\r
             get {\r
                 if (object.ReferenceEquals(resourceMan, null)) {\r
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HandBrake.ApplicationServices.Properties.Resources", typeof(Resources).Assembly);\r
@@ -51,7 +51,7 @@ namespace HandBrake.ApplicationServices.Properties {
         ///   resource lookups using this strongly typed resource class.\r
         /// </summary>\r
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
-        public static global::System.Globalization.CultureInfo Culture {\r
+        internal static global::System.Globalization.CultureInfo Culture {\r
             get {\r
                 return resourceCulture;\r
             }\r
@@ -60,21 +60,7 @@ namespace HandBrake.ApplicationServices.Properties {
             }\r
         }\r
         \r
-        public static System.Drawing.Bitmap copy {\r
-            get {\r
-                object obj = ResourceManager.GetObject("copy", resourceCulture);\r
-                return ((System.Drawing.Bitmap)(obj));\r
-            }\r
-        }\r
-        \r
-        public static System.Drawing.Bitmap ErrorX {\r
-            get {\r
-                object obj = ResourceManager.GetObject("ErrorX", resourceCulture);\r
-                return ((System.Drawing.Bitmap)(obj));\r
-            }\r
-        }\r
-        \r
-        public static System.Drawing.Bitmap logo64 {\r
+        internal static System.Drawing.Bitmap logo64 {\r
             get {\r
                 object obj = ResourceManager.GetObject("logo64", resourceCulture);\r
                 return ((System.Drawing.Bitmap)(obj));\r
index 9971f5d..2e1c284 100644 (file)
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
-  <data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\Resources\copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
-  </data>\r
-  <data name="ErrorX" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\Resources\ErrorX.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
-  </data>\r
   <data name="logo64" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\logo64.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
index 42d2822..855f517 100644 (file)
@@ -12,10 +12,11 @@ namespace HandBrake.ApplicationServices.Services
     using System.Threading;\r
     using System.Windows.Forms;\r
 \r
+    using HandBrake.Framework.Services;\r
+    using HandBrake.Framework.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Functions;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
-    using HandBrake.ApplicationServices.Properties;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
     /// <summary>\r
index 4c4beda..ae5c437 100644 (file)
@@ -17,7 +17,6 @@ namespace HandBrake.ApplicationServices.Services
 \r
     using HandBrake.ApplicationServices.Functions;\r
     using HandBrake.ApplicationServices.Model;\r
-    using HandBrake.ApplicationServices.Properties;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
     /// <summary>\r
index be15098..45bd37a 100644 (file)
@@ -12,6 +12,8 @@ namespace HandBrake.ApplicationServices.Services
     using System.Threading;\r
     using System.Windows.Forms;\r
 \r
+    using HandBrake.Framework.Services;\r
+    using HandBrake.Framework.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Functions;\r
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
diff --git a/win/C#/HandBrake.Framework/HandBrake.Framework.csproj b/win/C#/HandBrake.Framework/HandBrake.Framework.csproj
new file mode 100644 (file)
index 0000000..861b79b
--- /dev/null
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+    <ProductVersion>8.0.30703</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{49AD42C1-BF9B-4D78-A644-020878FAADE6}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>HandBrake.Framework</RootNamespace>\r
+    <AssemblyName>HandBrake.Framework</AssemblyName>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>bin\Debug\</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>pdbonly</DebugType>\r
+    <Optimize>true</Optimize>\r
+    <OutputPath>bin\Release\</OutputPath>\r
+    <DefineConstants>TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System" />\r
+    <Reference Include="System.Core" />\r
+    <Reference Include="System.Drawing" />\r
+    <Reference Include="System.Windows.Forms" />\r
+    <Reference Include="System.Xml.Linq" />\r
+    <Reference Include="System.Data.DataSetExtensions" />\r
+    <Reference Include="System.Data" />\r
+    <Reference Include="System.Xml" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Helpers\AppcastReader.cs" />\r
+    <Compile Include="Model\UpdateCheckResult.cs" />\r
+    <Compile Include="Model\UpdateCheckInformation.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="Properties\Resources.Designer.cs">\r
+      <AutoGen>True</AutoGen>\r
+      <DesignTime>True</DesignTime>\r
+      <DependentUpon>Resources.resx</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="Services\ErrorService.cs" />\r
+    <Compile Include="Services\Interfaces\IErrorService.cs" />\r
+    <Compile Include="Services\UpdateService.cs" />\r
+    <Compile Include="Views\ExceptionWindow.cs">\r
+      <SubType>Form</SubType>\r
+    </Compile>\r
+    <Compile Include="Views\ExceptionWindow.designer.cs">\r
+      <DependentUpon>ExceptionWindow.cs</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="Views\DownloadUpdate.cs">\r
+      <SubType>Form</SubType>\r
+    </Compile>\r
+    <Compile Include="Views\DownloadUpdate.Designer.cs">\r
+      <DependentUpon>DownloadUpdate.cs</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="Views\UpdateInfo.cs">\r
+      <SubType>Form</SubType>\r
+    </Compile>\r
+    <Compile Include="Views\UpdateInfo.Designer.cs">\r
+      <DependentUpon>UpdateInfo.cs</DependentUpon>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <EmbeddedResource Include="Properties\Resources.resx">\r
+      <Generator>ResXFileCodeGenerator</Generator>\r
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Include="Views\ExceptionWindow.resx">\r
+      <DependentUpon>ExceptionWindow.cs</DependentUpon>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Include="Views\DownloadUpdate.resx">\r
+      <DependentUpon>DownloadUpdate.cs</DependentUpon>\r
+      <SubType>Designer</SubType>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Include="Views\UpdateInfo.resx">\r
+      <DependentUpon>UpdateInfo.cs</DependentUpon>\r
+      <SubType>Designer</SubType>\r
+    </EmbeddedResource>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Resources\copy.png" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Resources\errorx.png" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Resources\logo64.png" />\r
+  </ItemGroup>\r
+  <ItemGroup />\r
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+       Other similar extension points exist, see Microsoft.Common.targets.\r
+  <Target Name="BeforeBuild">\r
+  </Target>\r
+  <Target Name="AfterBuild">\r
+  </Target>\r
+  -->\r
+</Project>
\ No newline at end of file
similarity index 95%
rename from win/C#/Functions/AppcastReader.cs
rename to win/C#/HandBrake.Framework/Helpers/AppcastReader.cs
index 6b4a484..cba2e18 100644 (file)
@@ -1,9 +1,9 @@
-/*  RssReader.cs $\r
+/*  AppcastReader.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.Functions\r
+namespace HandBrake.Framework.Helpers\r
 {\r
     using System;\r
     using System.IO;\r
diff --git a/win/C#/HandBrake.Framework/Model/UpdateCheckInformation.cs b/win/C#/HandBrake.Framework/Model/UpdateCheckInformation.cs
new file mode 100644 (file)
index 0000000..6c1fd12
--- /dev/null
@@ -0,0 +1,39 @@
+/*  UpdateCheckInformation.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.Framework.Model\r
+{\r
+    using System;\r
+    using HandBrake.Framework.Helpers;\r
+\r
+    /// <summary>\r
+    /// Provides information about an update check.\r
+    /// </summary>\r
+    public struct UpdateCheckInformation\r
+    {\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether a New Version is Available.\r
+        /// </summary>\r
+        public bool NewVersionAvailable { get; set; }\r
+\r
+        /// <summary>\r
+        /// Gets a value indicating whether an Error Occured.\r
+        /// </summary>\r
+        public bool ErrorOccured\r
+        {\r
+            get { return this.Error != null; }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets information about the new build, if any. This will be null if there is no new verison.\r
+        /// </summary>\r
+        public AppcastReader BuildInformation { get; set; }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the error that occurred, if any. This will be null if no error occured.\r
+        /// </summary>\r
+        public Exception Error { get; set; }\r
+    }\r
+}\r
@@ -1,49 +1,20 @@
-/*  UpdateCheckInformation.cs $\r
+/*  UpdateCheckResult.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.Functions\r
+namespace HandBrake.Framework.Model\r
 {\r
     using System;\r
     using System.Threading;\r
 \r
     /// <summary>\r
-    /// Provides information about an update check.\r
-    /// </summary>\r
-    public struct UpdateCheckInformation\r
-    {\r
-        /// <summary>\r
-        /// Gets or sets a value indicating whether a New Version is Available.\r
-        /// </summary>\r
-        public bool NewVersionAvailable { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether an Error Occured.\r
-        /// </summary>\r
-        public bool ErrorOccured\r
-        {\r
-            get { return this.Error != null; }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Gets or sets information about the new build, if any. This will be null if there is no new verison.\r
-        /// </summary>\r
-        public AppcastReader BuildInformation { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets the error that occurred, if any. This will be null if no error occured.\r
-        /// </summary>\r
-        public Exception Error { get; set; }\r
-    }\r
-\r
-    /// <summary>\r
     /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
     /// </summary>\r
     public class UpdateCheckResult : IAsyncResult\r
     {\r
         /// <summary>\r
-        /// Initializes a new instance of the <see cref="UpdateCheckResult"/> class.\r
+        /// Initializes a new instance of the <see cref="HandBrake.Framework.Model.UpdateCheckResult"/> class.\r
         /// </summary>\r
         /// <param name="asyncState">\r
         /// The async state.\r
diff --git a/win/C#/HandBrake.Framework/Properties/AssemblyInfo.cs b/win/C#/HandBrake.Framework/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..d6b958c
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+\r
+// General Information about an assembly is controlled through the following \r
+// set of attributes. Change these attribute values to modify the information\r
+// associated with an assembly.\r
+[assembly: AssemblyTitle("HandBrake.Framework")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("HandBrake Team")]\r
+[assembly: AssemblyProduct("HandBrake.Framework")]\r
+[assembly: AssemblyCopyright("Copyright © HandBrake Team")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// Setting ComVisible to false makes the types in this assembly not visible \r
+// to COM components.  If you need to access a type in this assembly from \r
+// COM, set the ComVisible attribute to true on that type.\r
+[assembly: ComVisible(false)]\r
+\r
+// The following GUID is for the ID of the typelib if this project is exposed to COM\r
+[assembly: Guid("85248e69-53e0-4a37-a1a6-95c2e99fc750")]\r
+\r
+// Version information for an assembly consists of the following four values:\r
+//\r
+//      Major Version\r
+//      Minor Version \r
+//      Build Number\r
+//      Revision\r
+//\r
+// You can specify all the values or you can default the Build and Revision Numbers \r
+// by using the '*' as shown below:\r
+// [assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("0.9.5.0")]\r
+[assembly: AssemblyFileVersion("0.9.5.0")]\r
diff --git a/win/C#/HandBrake.Framework/Properties/Resources.Designer.cs b/win/C#/HandBrake.Framework/Properties/Resources.Designer.cs
new file mode 100644 (file)
index 0000000..0a0ed63
--- /dev/null
@@ -0,0 +1,84 @@
+//------------------------------------------------------------------------------\r
+// <auto-generated>\r
+//     This code was generated by a tool.\r
+//     Runtime Version:4.0.30319.1\r
+//\r
+//     Changes to this file may cause incorrect behavior and will be lost if\r
+//     the code is regenerated.\r
+// </auto-generated>\r
+//------------------------------------------------------------------------------\r
+\r
+namespace HandBrake.Framework.Properties {\r
+    using System;\r
+    \r
+    \r
+    /// <summary>\r
+    ///   A strongly-typed resource class, for looking up localized strings, etc.\r
+    /// </summary>\r
+    // This class was auto-generated by the StronglyTypedResourceBuilder\r
+    // class via a tool like ResGen or Visual Studio.\r
+    // To add or remove a member, edit your .ResX file then rerun ResGen\r
+    // with the /str option, or rebuild your VS project.\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]\r
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
+    internal class Resources {\r
+        \r
+        private static global::System.Resources.ResourceManager resourceMan;\r
+        \r
+        private static global::System.Globalization.CultureInfo resourceCulture;\r
+        \r
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]\r
+        internal Resources() {\r
+        }\r
+        \r
+        /// <summary>\r
+        ///   Returns the cached ResourceManager instance used by this class.\r
+        /// </summary>\r
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+        internal static global::System.Resources.ResourceManager ResourceManager {\r
+            get {\r
+                if (object.ReferenceEquals(resourceMan, null)) {\r
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HandBrake.Framework.Properties.Resources", typeof(Resources).Assembly);\r
+                    resourceMan = temp;\r
+                }\r
+                return resourceMan;\r
+            }\r
+        }\r
+        \r
+        /// <summary>\r
+        ///   Overrides the current thread's CurrentUICulture property for all\r
+        ///   resource lookups using this strongly typed resource class.\r
+        /// </summary>\r
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+        internal static global::System.Globalization.CultureInfo Culture {\r
+            get {\r
+                return resourceCulture;\r
+            }\r
+            set {\r
+                resourceCulture = value;\r
+            }\r
+        }\r
+        \r
+        internal static System.Drawing.Bitmap copy {\r
+            get {\r
+                object obj = ResourceManager.GetObject("copy", resourceCulture);\r
+                return ((System.Drawing.Bitmap)(obj));\r
+            }\r
+        }\r
+        \r
+        internal static System.Drawing.Bitmap ErrorX {\r
+            get {\r
+                object obj = ResourceManager.GetObject("ErrorX", resourceCulture);\r
+                return ((System.Drawing.Bitmap)(obj));\r
+            }\r
+        }\r
+        \r
+        internal static System.Drawing.Bitmap logo64 {\r
+            get {\r
+                object obj = ResourceManager.GetObject("logo64", resourceCulture);\r
+                return ((System.Drawing.Bitmap)(obj));\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/win/C#/HandBrake.Framework/Properties/Resources.resx b/win/C#/HandBrake.Framework/Properties/Resources.resx
new file mode 100644 (file)
index 0000000..347b5fe
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+  <!-- \r
+    Microsoft ResX Schema \r
+    \r
+    Version 2.0\r
+    \r
+    The primary goals of this format is to allow a simple XML format \r
+    that is mostly human readable. The generation and parsing of the \r
+    various data types are done through the TypeConverter classes \r
+    associated with the data types.\r
+    \r
+    Example:\r
+    \r
+    ... ado.net/XML headers & schema ...\r
+    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+    <resheader name="version">2.0</resheader>\r
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+    </data>\r
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+        <comment>This is a comment</comment>\r
+    </data>\r
+                \r
+    There are any number of "resheader" rows that contain simple \r
+    name/value pairs.\r
+    \r
+    Each data row contains a name, and value. The row also contains a \r
+    type or mimetype. Type corresponds to a .NET class that support \r
+    text/value conversion through the TypeConverter architecture. \r
+    Classes that don't support this are serialized and stored with the \r
+    mimetype set.\r
+    \r
+    The mimetype is used for serialized objects, and tells the \r
+    ResXResourceReader how to depersist the object. This is currently not \r
+    extensible. For a given mimetype the value must be set accordingly:\r
+    \r
+    Note - application/x-microsoft.net.object.binary.base64 is the format \r
+    that the ResXResourceWriter will generate, however the reader can \r
+    read any of the formats listed below.\r
+    \r
+    mimetype: application/x-microsoft.net.object.binary.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+            : and then encoded with base64 encoding.\r
+    \r
+    mimetype: application/x-microsoft.net.object.soap.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+            : and then encoded with base64 encoding.\r
+\r
+    mimetype: application/x-microsoft.net.object.bytearray.base64\r
+    value   : The object must be serialized into a byte array \r
+            : using a System.ComponentModel.TypeConverter\r
+            : and then encoded with base64 encoding.\r
+    -->\r
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+    <xsd:element name="root" msdata:IsDataSet="true">\r
+      <xsd:complexType>\r
+        <xsd:choice maxOccurs="unbounded">\r
+          <xsd:element name="metadata">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" use="required" type="xsd:string" />\r
+              <xsd:attribute name="type" type="xsd:string" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="assembly">\r
+            <xsd:complexType>\r
+              <xsd:attribute name="alias" type="xsd:string" />\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="data">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="resheader">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+        </xsd:choice>\r
+      </xsd:complexType>\r
+    </xsd:element>\r
+  </xsd:schema>\r
+  <resheader name="resmimetype">\r
+    <value>text/microsoft-resx</value>\r
+  </resheader>\r
+  <resheader name="version">\r
+    <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
+  </resheader>\r
+  <resheader name="writer">\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
+  <data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+    <value>..\Resources\copy.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+  </data>\r
+  <data name="ErrorX" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+    <value>..\Resources\errorx.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+  </data>\r
+  <data name="logo64" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
+    <value>..\Resources\logo64.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
+  </data>\r
+</root>
\ No newline at end of file
diff --git a/win/C#/HandBrake.Framework/Resources/logo64.png b/win/C#/HandBrake.Framework/Resources/logo64.png
new file mode 100644 (file)
index 0000000..12808f6
Binary files /dev/null and b/win/C#/HandBrake.Framework/Resources/logo64.png differ
@@ -3,14 +3,14 @@
     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
+namespace HandBrake.Framework.Services\r
 {\r
     using System;\r
     using System.IO;\r
     using System.Threading;\r
 \r
-    using Interfaces;\r
-    using Views;\r
+    using HandBrake.Framework.Services.Interfaces;\r
+    using HandBrake.Framework.Views;\r
 \r
     /// <summary>\r
     /// The Error Service\r
@@ -3,7 +3,7 @@
     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
+namespace HandBrake.Framework.Services.Interfaces\r
 {\r
     /// <summary>\r
     /// The Error service for showing the exception window.\r
diff --git a/win/C#/HandBrake.Framework/Services/UpdateService.cs b/win/C#/HandBrake.Framework/Services/UpdateService.cs
new file mode 100644 (file)
index 0000000..21688e0
--- /dev/null
@@ -0,0 +1,101 @@
+/*  UpdateService.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.Framework.Services\r
+{\r
+    using System;\r
+    using System.IO;\r
+    using System.Net;\r
+    using System.Threading;\r
+\r
+    using HandBrake.Framework.Helpers;\r
+    using HandBrake.Framework.Model;\r
+\r
+    public class UpdateService\r
+    {\r
+        /// <summary>\r
+        /// Begins checking for an update to HandBrake.\r
+        /// </summary>\r
+        /// <param name="callback">\r
+        /// The method that will be called when the check is finished.\r
+        /// </param>\r
+        /// <param name="debug">\r
+        /// Whether or not to execute this in debug mode.\r
+        /// </param>\r
+        /// <param name="url">\r
+        /// The url.\r
+        /// </param>\r
+        /// <param name="currentBuild">\r
+        /// The current Build.\r
+        /// </param>\r
+        /// <param name="skipBuild">\r
+        /// The skip Build.\r
+        /// </param>\r
+        /// <param name="currentVersion">\r
+        /// The current Version.\r
+        /// </param>\r
+        public static void BeginCheckForUpdates(AsyncCallback callback, bool debug, string url, int currentBuild, int skipBuild, string currentVersion)\r
+        {\r
+            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate\r
+            {\r
+                try\r
+                {\r
+                    // Initialize variables\r
+                    WebRequest request = WebRequest.Create(url);\r
+                    WebResponse response = request.GetResponse();\r
+                    AppcastReader reader = new AppcastReader();\r
+\r
+                    // Get the data, convert it to a string, and parse it into the AppcastReader\r
+                    reader.GetInfo(new StreamReader(response.GetResponseStream()).ReadToEnd());\r
+\r
+                    // Further parse the information\r
+                    string build = reader.Build;\r
+\r
+                    int latest = int.Parse(build);\r
+                    int current = currentBuild;\r
+                    int skip = skipBuild;\r
+\r
+                    // If the user wanted to skip this version, don't report the update\r
+                    if (latest == skip)\r
+                    {\r
+                        UpdateCheckInformation info =\r
+                            new UpdateCheckInformation\r
+                            {\r
+                                NewVersionAvailable = false,\r
+                                BuildInformation = null\r
+                            };\r
+                        callback(new UpdateCheckResult(debug, info));\r
+                        return;\r
+                    }\r
+\r
+                    UpdateCheckInformation info2 = new UpdateCheckInformation\r
+                        {\r
+                            NewVersionAvailable = latest > current,\r
+                            BuildInformation = reader\r
+                        };\r
+                    callback(new UpdateCheckResult(debug, info2));\r
+                }\r
+                catch (Exception exc)\r
+                {\r
+                    callback(new UpdateCheckResult(debug, new UpdateCheckInformation { Error = exc }));\r
+                }\r
+            }));\r
+        }\r
+\r
+        /// <summary>\r
+        /// End Check for Updates\r
+        /// </summary>\r
+        /// <param name="result">\r
+        /// The result.\r
+        /// </param>\r
+        /// <returns>\r
+        /// Update Check information\r
+        /// </returns>\r
+        public static UpdateCheckInformation EndCheckForUpdates(IAsyncResult result)\r
+        {\r
+            return ((UpdateCheckResult)result).Result;\r
+        }\r
+    }\r
+}\r
similarity index 95%
rename from win/C#/frmDownload.Designer.cs
rename to win/C#/HandBrake.Framework/Views/DownloadUpdate.Designer.cs
index 9fd186f..1311fa2 100644 (file)
@@ -4,9 +4,9 @@
     Homepage: <http://handbrake.fr>.\r
     It may be used under the terms of the GNU General Public License. */\r
 \r
-namespace Handbrake\r
+namespace HandBrake.Framework.Views\r
 {\r
-    partial class frmDownload\r
+    partial class DownloadUpdate\r
     {\r
         /// <summary>\r
         /// Required designer variable.\r
@@ -34,7 +34,7 @@ namespace Handbrake
         /// </summary>\r
         private void InitializeComponent()\r
         {\r
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDownload));\r
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DownloadUpdate));\r
             this.lblProgress = new System.Windows.Forms.Label();\r
             this.progress_download = new System.Windows.Forms.ProgressBar();\r
             this.btn_cancel = new System.Windows.Forms.Button();\r
@@ -98,7 +98,7 @@ namespace Handbrake
             // \r
             // PictureBox1\r
             // \r
-            this.PictureBox1.Image = global::Handbrake.Properties.Resources.logo64;\r
+            this.PictureBox1.Image = global::HandBrake.Framework.Properties.Resources.logo64;\r
             this.PictureBox1.InitialImage = null;\r
             this.PictureBox1.Location = new System.Drawing.Point(3, 3);\r
             this.PictureBox1.Name = "PictureBox1";\r
@@ -119,7 +119,7 @@ namespace Handbrake
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
             this.MaximizeBox = false;\r
             this.MinimizeBox = false;\r
-            this.Name = "frmDownload";\r
+            this.Name = "DownloadUpdate";\r
             this.Padding = new System.Windows.Forms.Padding(9);\r
             this.ShowIcon = false;\r
             this.ShowInTaskbar = false;\r
similarity index 93%
rename from win/C#/frmDownload.cs
rename to win/C#/HandBrake.Framework/Views/DownloadUpdate.cs
index e7f06f6..dc4aef1 100644 (file)
@@ -1,9 +1,9 @@
-/*  frmDownload.cs $\r
+/*  DownloadUpdate.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\r
+namespace HandBrake.Framework.Views\r
 {\r
     using System;\r
     using System.Diagnostics;\r
@@ -15,7 +15,7 @@ namespace Handbrake
     /// <summary>\r
     /// The Download Window\r
     /// </summary>\r
-    public partial class frmDownload : Form\r
+    public partial class DownloadUpdate : Form\r
     {\r
         private readonly Thread downloadThread;\r
         private Stream responceStream;\r
@@ -31,7 +31,7 @@ namespace Handbrake
 \r
         private delegate void DownloadFailedCallback();\r
 \r
-        public frmDownload(string filename)\r
+        public DownloadUpdate(string filename)\r
         {\r
             InitializeComponent();\r
 \r
@@ -1,9 +1,9 @@
-/*  frmExceptionWindow.cs $\r
+/*  ExceptionWindow.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.Views\r
+namespace HandBrake.Framework.Views\r
 {\r
     using System;\r
     using System.Windows.Forms;\r
@@ -1,4 +1,4 @@
-namespace HandBrake.ApplicationServices.Views\r
+namespace HandBrake.Framework.Views\r
 {\r
     partial class ExceptionWindow\r
     {\r
@@ -76,7 +76,7 @@
             // \r
             // PictureBox1\r
             // \r
-            this.PictureBox1.Image = global::HandBrake.ApplicationServices.Properties.Resources.ErrorX;\r
+            this.PictureBox1.Image = global::HandBrake.Framework.Properties.Resources.ErrorX;\r
             this.PictureBox1.InitialImage = null;\r
             this.PictureBox1.Location = new System.Drawing.Point(12, 12);\r
             this.PictureBox1.Name = "PictureBox1";\r
             this.btn_copy.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_copy.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_copy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_copy.Image = global::HandBrake.ApplicationServices.Properties.Resources.copy;\r
+            this.btn_copy.Image = global::HandBrake.Framework.Properties.Resources.copy;\r
             this.btn_copy.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\r
             this.btn_copy.Location = new System.Drawing.Point(14, 8);\r
             this.btn_copy.Name = "btn_copy";\r
             // \r
             // mnu_copy_log\r
             // \r
-            this.mnu_copy_log.Image = global::HandBrake.ApplicationServices.Properties.Resources.copy;\r
+            this.mnu_copy_log.Image = global::HandBrake.Framework.Properties.Resources.copy;\r
             this.mnu_copy_log.Name = "mnu_copy_log";\r
             this.mnu_copy_log.Size = new System.Drawing.Size(152, 22);\r
             this.mnu_copy_log.Text = "Copy";\r
similarity index 96%
rename from win/C#/frmUpdater.Designer.cs
rename to win/C#/HandBrake.Framework/Views/UpdateInfo.Designer.cs
index 7e377b4..986af5c 100644 (file)
@@ -3,9 +3,9 @@
     Homepage: <http://handbrake.fr>.\r
     It may be used under the terms of the GNU General Public License. */\r
 \r
-namespace Handbrake\r
+namespace HandBrake.Framework.Views\r
 {\r
-    partial class frmUpdater\r
+    partial class UpdateInfo\r
     {\r
         /// <summary>\r
         /// Required designer variable.\r
@@ -33,7 +33,7 @@ namespace Handbrake
         /// </summary>\r
         private void InitializeComponent()\r
         {\r
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmUpdater));\r
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateInfo));\r
             this.label1 = new System.Windows.Forms.Label();\r
             this.label6 = new System.Windows.Forms.Label();\r
             this.btn_skip = new System.Windows.Forms.Button();\r
@@ -43,21 +43,21 @@ namespace Handbrake
             this.lbl_update_text = new System.Windows.Forms.Label();\r
             this.panel1 = new System.Windows.Forms.Panel();\r
             this.panel2 = new System.Windows.Forms.Panel();\r
+            this.PictureBox1 = new System.Windows.Forms.PictureBox();\r
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();\r
             this.panel3 = new System.Windows.Forms.Panel();\r
             this.panel5 = new System.Windows.Forms.Panel();\r
             this.wBrowser = new System.Windows.Forms.WebBrowser();\r
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();\r
             this.button_container = new System.Windows.Forms.SplitContainer();\r
-            this.PictureBox1 = new System.Windows.Forms.PictureBox();\r
             this.panel1.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();\r
             this.splitContainer1.Panel1.SuspendLayout();\r
             this.splitContainer1.Panel2.SuspendLayout();\r
             this.splitContainer1.SuspendLayout();\r
             this.button_container.Panel1.SuspendLayout();\r
             this.button_container.Panel2.SuspendLayout();\r
             this.button_container.SuspendLayout();\r
-            ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();\r
             this.SuspendLayout();\r
             // \r
             // label1\r
@@ -172,6 +172,16 @@ namespace Handbrake
             this.panel2.Size = new System.Drawing.Size(710, 10);\r
             this.panel2.TabIndex = 59;\r
             // \r
+            // PictureBox1\r
+            // \r
+            this.PictureBox1.Image = global::HandBrake.Framework.Properties.Resources.logo64;\r
+            this.PictureBox1.InitialImage = null;\r
+            this.PictureBox1.Location = new System.Drawing.Point(12, 12);\r
+            this.PictureBox1.Name = "PictureBox1";\r
+            this.PictureBox1.Size = new System.Drawing.Size(64, 64);\r
+            this.PictureBox1.TabIndex = 24;\r
+            this.PictureBox1.TabStop = false;\r
+            // \r
             // statusStrip1\r
             // \r
             this.statusStrip1.Location = new System.Drawing.Point(0, 346);\r
@@ -244,17 +254,7 @@ namespace Handbrake
             this.button_container.SplitterDistance = 318;\r
             this.button_container.TabIndex = 0;\r
             // \r
-            // PictureBox1\r
-            // \r
-            this.PictureBox1.Image = global::Handbrake.Properties.Resources.logo64;\r
-            this.PictureBox1.InitialImage = null;\r
-            this.PictureBox1.Location = new System.Drawing.Point(12, 12);\r
-            this.PictureBox1.Name = "PictureBox1";\r
-            this.PictureBox1.Size = new System.Drawing.Size(64, 64);\r
-            this.PictureBox1.TabIndex = 24;\r
-            this.PictureBox1.TabStop = false;\r
-            // \r
-            // frmUpdater\r
+            // UpdateInfo\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
@@ -268,11 +268,12 @@ namespace Handbrake
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
             this.MaximizeBox = false;\r
             this.MinimumSize = new System.Drawing.Size(540, 300);\r
-            this.Name = "frmUpdater";\r
+            this.Name = "UpdateInfo";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
             this.Text = "Update";\r
             this.panel1.ResumeLayout(false);\r
             this.panel1.PerformLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).EndInit();\r
             this.splitContainer1.Panel1.ResumeLayout(false);\r
             this.splitContainer1.Panel2.ResumeLayout(false);\r
             this.splitContainer1.ResumeLayout(false);\r
@@ -281,7 +282,6 @@ namespace Handbrake
             this.button_container.Panel2.ResumeLayout(false);\r
             this.button_container.Panel2.PerformLayout();\r
             this.button_container.ResumeLayout(false);\r
-            ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).EndInit();\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
similarity index 60%
rename from win/C#/frmUpdater.cs
rename to win/C#/HandBrake.Framework/Views/UpdateInfo.cs
index 7d56c58..abeb9c3 100644 (file)
@@ -1,18 +1,19 @@
-/*  frmUpdater.cs $\r
+/*  UpdateInfo.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\r
+namespace HandBrake.Framework.Views\r
 {\r
     using System;\r
     using System.Windows.Forms;\r
-    using Functions;\r
+\r
+    using HandBrake.Framework.Helpers;\r
 \r
     /// <summary>\r
     /// A window to display update information.\r
     /// </summary>\r
-    public partial class frmUpdater : Form\r
+    public partial class UpdateInfo : Form\r
     {\r
         /// <summary>\r
         /// An instance of the Appcast Reader\r
@@ -20,19 +21,43 @@ namespace Handbrake
         private readonly AppcastReader appcast;\r
 \r
         /// <summary>\r
-        /// Initializes a new instance of the <see cref="frmUpdater"/> class.\r
+        /// The Current Version\r
+        /// </summary>\r
+        private readonly string currentVersion;\r
+\r
+        /// <summary>\r
+        /// The Current Build\r
+        /// </summary>\r
+        private readonly string currentBuild;\r
+\r
+        /// <summary>\r
+        /// Initializes a new instance of the <see cref="UpdateInfo"/> class.\r
         /// </summary>\r
         /// <param name="reader">\r
         /// The appcast reader.\r
         /// </param>\r
-        public frmUpdater(AppcastReader reader)\r
+        /// <param name="currentVersion">\r
+        /// The current Version.\r
+        /// </param>\r
+        /// <param name="currentBuild">\r
+        /// The current Build.\r
+        /// </param>\r
+        public UpdateInfo(AppcastReader reader, string currentVersion, string currentBuild)\r
         {\r
             InitializeComponent();\r
 \r
             appcast = reader;\r
+            this.currentVersion = currentVersion;\r
+            this.currentBuild = currentBuild;\r
             GetRss();\r
             SetVersions();\r
         }\r
+        \r
+        /// <summary>\r
+        /// Gets the SkipVersion number\r
+        /// </summary>\r
+        public int SkipVersion { get; private set; }\r
+\r
 \r
         /// <summary>\r
         /// Get the RSS feed\r
@@ -47,8 +72,7 @@ namespace Handbrake
         /// </summary>\r
         private void SetVersions()\r
         {\r
-            string old = "(You have: " + Properties.Settings.Default.hb_version.Trim() + " / " +\r
-                         Properties.Settings.Default.hb_build.ToString().Trim() + ")";\r
+            string old = "(You have: " + currentVersion + " / " + currentBuild + ")";\r
             string newBuild = appcast.Version.Trim() + " (" + appcast.Build + ")";\r
             lbl_update_text.Text = "HandBrake " + newBuild + " is now available. " + old;\r
         }\r
@@ -64,9 +88,9 @@ namespace Handbrake
         /// </param>\r
         private void BtnInstallUpdateClick(object sender, EventArgs e)\r
         {\r
-            frmDownload download = new frmDownload(appcast.DownloadFile);\r
+            DownloadUpdate download = new DownloadUpdate(appcast.DownloadFile);\r
             download.ShowDialog();\r
-            this.Close();\r
+            this.DialogResult = DialogResult.OK;\r
         }\r
 \r
         /// <summary>\r
@@ -80,7 +104,7 @@ namespace Handbrake
         /// </param>\r
         private void BtnRemindLaterClick(object sender, EventArgs e)\r
         {\r
-            this.Close();\r
+            this.DialogResult = DialogResult.Cancel;\r
         }\r
 \r
         /// <summary>\r
@@ -94,10 +118,8 @@ namespace Handbrake
         /// </param>\r
         private void BtnSkipClick(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.skipversion = int.Parse(appcast.Build);\r
-            Properties.Settings.Default.Save();\r
-\r
-            this.Close();\r
+            this.SkipVersion = int.Parse(appcast.Build);\r
+            this.DialogResult = DialogResult.OK;\r
         }\r
     }\r
 }
\ No newline at end of file
index 9b4e35b..84de6f5 100644 (file)
@@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeCS", "HandBrakeCS.
 EndProject\r
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.ApplicationServices", "HandBrake.ApplicationServices\HandBrake.ApplicationServices.csproj", "{087A2BA8-BAC2-4577-A46F-07FF9D420016}"\r
 EndProject\r
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.Framework", "HandBrake.Framework\HandBrake.Framework.csproj", "{49AD42C1-BF9B-4D78-A644-020878FAADE6}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Any CPU = Debug|Any CPU\r
@@ -45,6 +47,18 @@ Global
                {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
                {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.Build.0 = Release|Any CPU\r
                {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|x86.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.Build.0 = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|x86.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.Build.0 = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|x86.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.Build.0 = Release|Any CPU\r
+               {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|x86.ActiveCfg = Release|Any CPU\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index 5275cf8..407c465 100644 (file)
     <Compile Include="frmAddPreset.Designer.cs">\r
       <DependentUpon>frmAddPreset.cs</DependentUpon>\r
     </Compile>\r
-    <Compile Include="frmDownload.cs">\r
-      <SubType>Form</SubType>\r
-    </Compile>\r
-    <Compile Include="frmDownload.Designer.cs">\r
-      <DependentUpon>frmDownload.cs</DependentUpon>\r
-    </Compile>\r
     <Compile Include="frmMain.cs">\r
       <SubType>Form</SubType>\r
     </Compile>\r
     <Compile Include="frmQueue.Designer.cs">\r
       <DependentUpon>frmQueue.cs</DependentUpon>\r
     </Compile>\r
-    <Compile Include="frmUpdater.cs">\r
-      <SubType>Form</SubType>\r
-    </Compile>\r
-    <Compile Include="frmUpdater.designer.cs">\r
-      <DependentUpon>frmUpdater.cs</DependentUpon>\r
-    </Compile>\r
     <Compile Include="Functions\PresetLoader.cs" />\r
     <Compile Include="Functions\QueryGenerator.cs" />\r
     <Compile Include="Functions\Main.cs" />\r
-    <Compile Include="Functions\UpdateCheckInformation.cs" />\r
     <Compile Include="frmActivityWindow.cs">\r
       <SubType>Form</SubType>\r
     </Compile>\r
     <Compile Include="Presets\PlistPresetHandler.cs" />\r
     <Compile Include="Presets\Preset.cs" />\r
     <Compile Include="Presets\PresetsHandler.cs" />\r
-    <Compile Include="Functions\AppcastReader.cs" />\r
     <Compile Include="Functions\QueryParser.cs" />\r
     <Compile Include="Program.cs" />\r
     <Compile Include="ToolWindows\TitleSpecificScan.cs">\r
       <DependentUpon>frmAddPreset.cs</DependentUpon>\r
       <SubType>Designer</SubType>\r
     </EmbeddedResource>\r
-    <EmbeddedResource Include="frmDownload.resx">\r
-      <SubType>Designer</SubType>\r
-      <DependentUpon>frmDownload.cs</DependentUpon>\r
-    </EmbeddedResource>\r
     <EmbeddedResource Include="frmMain.resx">\r
       <SubType>Designer</SubType>\r
       <DependentUpon>frmMain.cs</DependentUpon>\r
       <SubType>Designer</SubType>\r
       <DependentUpon>frmQueue.cs</DependentUpon>\r
     </EmbeddedResource>\r
-    <EmbeddedResource Include="frmUpdater.resx">\r
-      <DependentUpon>frmUpdater.cs</DependentUpon>\r
-      <SubType>Designer</SubType>\r
-    </EmbeddedResource>\r
     <EmbeddedResource Include="frmActivityWindow.resx">\r
       <DependentUpon>frmActivityWindow.cs</DependentUpon>\r
       <SubType>Designer</SubType>\r
       <Project>{087A2BA8-BAC2-4577-A46F-07FF9D420016}</Project>\r
       <Name>HandBrake.ApplicationServices</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="HandBrake.Framework\HandBrake.Framework.csproj">\r
+      <Project>{49AD42C1-BF9B-4D78-A644-020878FAADE6}</Project>\r
+      <Name>HandBrake.Framework</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup />\r
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
index 6c0b4f2..c09ceb3 100644 (file)
@@ -13,7 +13,8 @@ namespace Handbrake
     using System.Threading;\r
     using System.Windows.Forms;\r
 \r
-    using HandBrake.ApplicationServices.Services;\r
+    using HandBrake.Framework.Services;\r
+    using HandBrake.Framework.Services.Interfaces;\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
     using Model;\r
index ba06ede..2c72afa 100644 (file)
@@ -16,6 +16,9 @@ namespace Handbrake
     using System.Windows.Forms;\r
     using Functions;\r
 \r
+    using HandBrake.Framework.Model;\r
+    using HandBrake.Framework.Services;\r
+    using HandBrake.Framework.Views;\r
     using HandBrake.ApplicationServices.Functions;\r
     using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Parsing;\r
@@ -108,7 +111,13 @@ namespace Handbrake
             {\r
                 if (DateTime.Now.Subtract(Settings.Default.lastUpdateCheckDate).TotalDays > Properties.Settings.Default.daysBetweenUpdateCheck)\r
                 {\r
-                    Main.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDone), false);\r
+                    // Set when the last update was\r
+                    Settings.Default.lastUpdateCheckDate = DateTime.Now;\r
+                    Settings.Default.Save();\r
+                    string url = Settings.Default.hb_build.ToString().EndsWith("1")\r
+                                                  ? Settings.Default.appcast_unstable\r
+                                                  : Settings.Default.appcast;\r
+                    UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDone), false, url, Settings.Default.hb_build, Settings.Default.skipversion, Settings.Default.hb_version);\r
                 }\r
             }\r
 \r
@@ -174,15 +183,13 @@ namespace Handbrake
                 return;\r
             }\r
 \r
-            UpdateCheckInformation info;\r
-\r
             try\r
             {\r
-                info = Main.EndCheckForUpdates(result);\r
+                UpdateCheckInformation info = UpdateService.EndCheckForUpdates(result);\r
 \r
                 if (info.NewVersionAvailable)\r
                 {\r
-                    frmUpdater updateWindow = new frmUpdater(info.BuildInformation);\r
+                    UpdateInfo updateWindow = new UpdateInfo(info.BuildInformation, Settings.Default.hb_version, Settings.Default.hb_build.ToString());\r
                     updateWindow.ShowDialog();\r
                 }\r
             }\r
@@ -532,7 +539,12 @@ namespace Handbrake
         private void mnu_UpdateCheck_Click(object sender, EventArgs e)\r
         {\r
             lbl_updateCheck.Visible = true;\r
-            Main.BeginCheckForUpdates(new AsyncCallback(this.UpdateCheckDoneMenu), false);\r
+            Settings.Default.lastUpdateCheckDate = DateTime.Now;\r
+            Settings.Default.Save();\r
+            string url = Settings.Default.hb_build.ToString().EndsWith("1")\r
+                                                  ? Settings.Default.appcast_unstable\r
+                                                  : Settings.Default.appcast;\r
+            UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDoneMenu), false, url, Settings.Default.hb_build, Settings.Default.skipversion, Settings.Default.hb_version);\r
         }\r
 \r
         /// <summary>\r
@@ -1317,7 +1329,7 @@ namespace Handbrake
                 {\r
                     sourceTitle = title.Title;\r
                     SelectSource(ISO_Open.FileName, sourceTitle);\r
-                }          \r
+                }\r
             }\r
             else\r
                 UpdateSourceLabel();\r
@@ -1420,7 +1432,7 @@ namespace Handbrake
                     drop_chapterFinish.Text = drop_chapterFinish.Items[drop_chapterFinish.Items.Count - 1].ToString();\r
 \r
                 // Populate the Audio Channels Dropdown\r
-                AudioSettings.SetTrackList(selectedTitle, this.currentlySelectedPreset);\r
+                AudioSettings.SetTrackListFromPreset(selectedTitle, this.currentlySelectedPreset);\r
 \r
                 // Populate the Subtitles dropdown\r
                 Subtitles.SetSubtitleTrackAuto(selectedTitle.Subtitles.ToArray());\r
@@ -2408,11 +2420,11 @@ namespace Handbrake
             try\r
             {\r
                 // Get the information about the new build, if any, and close the window\r
-                info = Main.EndCheckForUpdates(result);\r
+                info = UpdateService.EndCheckForUpdates(result);\r
 \r
                 if (info.NewVersionAvailable && info.BuildInformation != null)\r
                 {\r
-                    frmUpdater updateWindow = new frmUpdater(info.BuildInformation);\r
+                    UpdateInfo updateWindow = new UpdateInfo(info.BuildInformation, Settings.Default.hb_version, Settings.Default.hb_build.ToString());\r
                     updateWindow.ShowDialog();\r
                 }\r
                 else\r
index dc017b2..ef0cad2 100644 (file)
@@ -583,18 +583,6 @@ Clear the text box below to return to the internal query generation.</value>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>98</value>\r
   </metadata>\r
-  <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>664, 15</value>\r
-  </metadata>\r
-  <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>680, 54</value>\r
-  </metadata>\r
-  <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>787, 54</value>\r
-  </metadata>\r
-  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>98</value>\r
-  </metadata>\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r
@@ -974,4 +962,13 @@ Clear the text box below to return to the internal query generation.</value>
         AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==\r
 </value>\r
   </data>\r
+  <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>664, 15</value>\r
+  </metadata>\r
+  <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>680, 54</value>\r
+  </metadata>\r
+  <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>787, 54</value>\r
+  </metadata>\r
 </root>
\ No newline at end of file