diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs | 11 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Constants.cs | 27 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/UpdateService.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/UserSettingConstants.cs | 15 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/defaultsettings.xml | 25 |
7 files changed, 42 insertions, 53 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs b/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs index a8860f5ee..b1a90d3e0 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs @@ -53,5 +53,16 @@ namespace HandBrake.ApplicationServices.Utilities {
return System.Environment.Is64BitProcess ? "64bit Version" : "32bit Version";
}
+
+ /// <summary>
+ /// Is a 64 bit app.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="string"/>.
+ /// </returns>
+ public static bool Is64Bit()
+ {
+ return System.Environment.Is64BitProcess;
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/Constants.cs b/win/CS/HandBrakeWPF/Constants.cs new file mode 100644 index 000000000..862f08011 --- /dev/null +++ b/win/CS/HandBrakeWPF/Constants.cs @@ -0,0 +1,27 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Constants.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Application Constants
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF
+{
+ /// <summary>
+ /// Application Constants
+ /// </summary>
+ public class Constants
+ {
+ /// <summary>
+ /// The appcast 64.
+ /// </summary>
+ public const string Appcast64 = "http://handbrake.fr/appcast.x86_64.xml";
+
+ /// <summary>
+ /// The appcast 32.
+ /// </summary>
+ public const string Appcast32 = "http://handbrake.fr/appcast.i386.xml";
+ }
+}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 09270768b..d7c81d861 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -130,6 +130,7 @@ <Compile Include="Commands\ProcessShortcutCommand.cs" />
<Compile Include="Commands\SourceMenuCommand.cs" />
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
+ <Compile Include="Constants.cs" />
<Compile Include="Controls\TimeSpanBox.xaml.cs">
<DependentUpon>TimeSpanBox.xaml</DependentUpon>
</Compile>
diff --git a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs index cfafe3cec..2e69eacec 100644 --- a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs @@ -77,10 +77,8 @@ namespace HandBrakeWPF.Helpers while ((line = stdOutput.ReadLine()) != null)
{
Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \(([0-9]*)\)");
- Match platform = Regex.Match(line, @"- ([A-Za-z0-9\s ]*) -");
if (m.Success)
{
- string version = m.Groups[1].Success ? m.Groups[1].Value : string.Empty;
string build = m.Groups[2].Success ? m.Groups[2].Value : string.Empty;
int buildValue;
@@ -89,12 +87,6 @@ namespace HandBrakeWPF.Helpers userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, buildValue);
success = true;
}
-
- if (platform.Success)
- {
- userSettingService.SetUserSetting(
- UserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim());
- }
}
while (!cliProcess.HasExited)
@@ -117,7 +109,6 @@ namespace HandBrakeWPF.Helpers catch (Exception e)
{
userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, 0);
- userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty);
userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty);
errorService.ShowError(
diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs index 112493ac7..b95a1d862 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs @@ -87,10 +87,9 @@ namespace HandBrakeWPF.Services try
{
string url =
- this.userSettingService.GetUserSetting<string>(UserSettingConstants.HandBrakePlatform)
- .Contains("x86_64")
- ? this.userSettingService.GetUserSetting<string>(UserSettingConstants.Appcast_x64)
- : this.userSettingService.GetUserSetting<string>(UserSettingConstants.Appcast_i686);
+ VersionHelper.Is64Bit()
+ ? Constants.Appcast64
+ : Constants.Appcast32;
var currentBuild =
this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild);
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 030cdedac..a90094cb5 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -22,16 +22,6 @@ namespace HandBrakeWPF public const string AddOnlyOneAudioPerLanguage = "addOnlyOneAudioPerLanguage";
/// <summary>
- /// Appcast i686
- /// </summary>
- public const string Appcast_i686 = "appcast_i686";
-
- /// <summary>
- /// Appcast 64
- /// </summary>
- public const string Appcast_x64 = "appcast_x64";
-
- /// <summary>
/// Auto name format
/// </summary>
public const string AutoNameFormat = "autoNameFormat";
@@ -197,11 +187,6 @@ namespace HandBrakeWPF public const string X264Step = "X264Step";
/// <summary>
- /// HandBrakes build
- /// </summary>
- public const string HandBrakePlatform = "HandBrakePlatform";
-
- /// <summary>
/// The show advanced tab.
/// </summary>
public const string ShowAdvancedTab = "ShowAdvancedTab";
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 75810a442..690930721 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -154,22 +154,6 @@ </item>
<item>
<key>
- <string>appcast_i686</string>
- </key>
- <value>
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast.i386.xml</anyType>
- </value>
- </item>
- <item>
- <key>
- <string>appcast_x64</string>
- </key>
- <value>
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast.86_64.xml</anyType>
- </value>
- </item>
- <item>
- <key>
<string>autoNameFormat</string>
</key>
<value>
@@ -402,21 +386,12 @@ </item>
<item>
<key>
- <string>HandBrakePlatform</string>
- </key>
- <value>
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">MinGW i686</anyType>
- </value>
- </item>
- <item>
- <key>
<string>ClearCompletedFromQueue</string>
</key>
<value>
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
</value>
</item>
-
<item>
<key>
<string>ServerPort</string>
|