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
BtnAddSubTrackClick(this, new EventArgs());\r
}\r
}\r
- } \r
+ }\r
}\r
}\r
}\r
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
}\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
{\r
using System.Diagnostics;\r
\r
- using HandBrake.ApplicationServices.Views;\r
-\r
/// <summary>\r
/// Useful functions which various screens can use.\r
/// </summary>\r
<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
[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
/// 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
/// 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
}\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
<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
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
\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
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
--- /dev/null
+<?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
-/* 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
--- /dev/null
+/* 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
-/* 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
--- /dev/null
+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
--- /dev/null
+//------------------------------------------------------------------------------\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
--- /dev/null
+<?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
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
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
--- /dev/null
+/* 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
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
/// </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
// \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
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
-/* 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
/// <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
\r
private delegate void DownloadFailedCallback();\r
\r
- public frmDownload(string filename)\r
+ public DownloadUpdate(string filename)\r
{\r
InitializeComponent();\r
\r
-/* 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
-namespace HandBrake.ApplicationServices.Views\r
+namespace HandBrake.Framework.Views\r
{\r
partial class ExceptionWindow\r
{\r
// \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
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
/// </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
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
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
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
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
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
-/* 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
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
/// </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
/// </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
/// </param>\r
private void BtnRemindLaterClick(object sender, EventArgs e)\r
{\r
- this.Close();\r
+ this.DialogResult = DialogResult.Cancel;\r
}\r
\r
/// <summary>\r
/// </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
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
{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
<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
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
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
{\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
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
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
{\r
sourceTitle = title.Title;\r
SelectSource(ISO_Open.FileName, sourceTitle);\r
- } \r
+ }\r
}\r
else\r
UpdateSourceLabel();\r
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
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
<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
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