diff options
author | sr55 <[email protected]> | 2011-04-03 17:49:44 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-03 17:49:44 +0000 |
commit | a6fbb52b6c9f4b639101e6e4d37e670ca2840c84 (patch) | |
tree | 5bf6b9a4d945365ba07dd07ba77fd05019d0e086 /win | |
parent | 80ebbf6f36a9084dd19e04e1cbfbd9ec93bfb6b6 (diff) |
WinGui:
- Move all user settings for the Services library into the services library.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3899 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
34 files changed, 836 insertions, 687 deletions
diff --git a/win/CS/Functions/Main.cs b/win/CS/Functions/Main.cs index c436f4336..a4098cad6 100644 --- a/win/CS/Functions/Main.cs +++ b/win/CS/Functions/Main.cs @@ -17,10 +17,13 @@ namespace Handbrake.Functions using System.Windows.Forms;
using System.Xml.Serialization;
+ using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Extensions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
using Handbrake.ToolWindows;
@@ -34,6 +37,8 @@ namespace Handbrake.Functions /// </summary>
private static readonly XmlSerializer Ser = new XmlSerializer(typeof(List<QueueTask>));
+ private static readonly IUserSettingService UserSettingService = new UserSettingService();
+
/// <summary>
/// Set's up the DataGridView on the Chapters tab (frmMain)
/// </summary>
@@ -313,13 +318,13 @@ namespace Handbrake.Functions int buildValue;
int.TryParse(build, out buildValue);
- Properties.Settings.Default.hb_build = buildValue;
- Properties.Settings.Default.hb_version = version;
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeBuild, buildValue);
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeVersion, version);
}
if (platform.Success)
{
- Properties.Settings.Default.hb_platform = platform.Value.Replace("-", string.Empty).Trim();
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim());
}
if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds.
@@ -332,11 +337,15 @@ namespace Handbrake.Functions }
}
- Properties.Settings.Default.CliExeHash = base64Hash;
- Properties.Settings.Default.Save();
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, base64Hash);
}
catch (Exception e)
{
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeBuild, string.Empty);
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty);
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeVersion, string.Empty);
+ UserSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty);
+
ShowExceptiowWindow("Unable to retrieve version information from the CLI.", e.ToString());
// Probably corrupted config. Delete config and let the user restart.
RecoverFromCorruptedLocalApplicationConfig();
@@ -421,7 +430,7 @@ namespace Handbrake.Functions }
else
{
- if (IsMultiInstance) return; // Don't tamper with the files if we are multi instance
+ if (GeneralUtilities.IsMultiInstance) return; // Don't tamper with the files if we are multi instance
foreach (string file in queueFiles)
{
@@ -432,18 +441,6 @@ namespace Handbrake.Functions }
/// <summary>
- /// Gets a value indicating whether HandBrake is running in multi instance mode
- /// </summary>
- /// <returns>True if the UI has another instance running</returns>
- public static bool IsMultiInstance
- {
- get
- {
- return Process.GetProcessesByName("HandBrake").Length > 0 ? true : false;
- }
- }
-
- /// <summary>
/// Show the Exception Window
/// </summary>
/// <param name="shortError">
diff --git a/win/CS/Functions/PresetLoader.cs b/win/CS/Functions/PresetLoader.cs index 373d30ff8..7b36ab92f 100644 --- a/win/CS/Functions/PresetLoader.cs +++ b/win/CS/Functions/PresetLoader.cs @@ -8,14 +8,19 @@ namespace Handbrake.Functions using System.Drawing;
using System.Windows.Forms;
+ using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services;
+ using HandBrake.ApplicationServices.Services.Interfaces;
/// <summary>
/// Load a preset into the main Window
/// </summary>
public class PresetLoader
{
+ private static readonly IUserSettingService UserSettingService = new UserSettingService();
+
/// <summary>
/// This function takes in a Query which has been parsed by QueryParser and
/// set's all the GUI widgets correctly.
@@ -300,7 +305,7 @@ namespace Handbrake.Functions sliderValue = 32 - (int)value;
break;
case VideoEncoder.X264:
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = UserSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
sliderValue = (int)((51.0 / cqStep) - (value / cqStep));
break;
case VideoEncoder.Theora:
diff --git a/win/CS/Functions/QueryGenerator.cs b/win/CS/Functions/QueryGenerator.cs index ce9f6f00b..297b0ab44 100644 --- a/win/CS/Functions/QueryGenerator.cs +++ b/win/CS/Functions/QueryGenerator.cs @@ -11,6 +11,10 @@ namespace Handbrake.Functions using System.IO;
using System.Windows.Forms;
+ using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Services;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
using Handbrake.Model;
/// <summary>
@@ -18,6 +22,9 @@ namespace Handbrake.Functions /// </summary>
public class QueryGenerator
{
+ private static readonly IUserSettingService UserSettingService = new UserSettingService();
+
+
public static string GenerateQueryForPreset(frmMain mainWindow, QueryPictureSettingsMode mode, bool filters, int width, int height)
{
string query = string.Empty;
@@ -112,7 +119,7 @@ namespace Handbrake.Functions query += " -t " + titleInfo[0];
}
- if (!Properties.Settings.Default.noDvdNav && mainWindow.drop_angle.Items.Count != 0)
+ if (!UserSettingService.GetUserSettingBoolean(UserSettingConstants.DisableLibDvdNav) && mainWindow.drop_angle.Items.Count != 0)
query += " --angle " + mainWindow.drop_angle.SelectedItem;
// Decide what part of the video we want to encode.
@@ -310,7 +317,7 @@ namespace Handbrake.Functions // Video Quality Setting
if (mainWindow.radio_cq.Checked)
{
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = UserSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
double value;
switch (mainWindow.drp_videoEncoder.Text)
{
@@ -568,10 +575,10 @@ namespace Handbrake.Functions string query = string.Empty;
// Verbosity Level
- query += " --verbose=" + Properties.Settings.Default.verboseLevel;
+ query += " --verbose=" + UserSettingService.GetUserSettingInt(UserSettingConstants.Verbosity);
// LibDVDNav
- if (Properties.Settings.Default.noDvdNav)
+ if (UserSettingService.GetUserSettingBoolean(UserSettingConstants.DisableLibDvdNav))
query += " --no-dvdnav";
return query;
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index 4edad2011..fcfb2fe03 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -96,7 +96,6 @@ <Compile Include="Functions\System.cs" />
<Compile Include="Functions\Win32.cs" />
<Compile Include="Functions\Win7.cs" />
- <Compile Include="Init.cs" />
<Compile Include="Model\DriveInformation.cs" />
<Compile Include="Model\Encoding\AudioTrack.cs" />
<Compile Include="Model\Encoding\Anamorphic.cs" />
@@ -142,12 +141,15 @@ <Compile Include="Services\Interfaces\IQueueProcessor.cs" />
<Compile Include="Services\Interfaces\IScan.cs" />
<Compile Include="Services\Interfaces\IPresetService.cs" />
+ <Compile Include="Services\Interfaces\IUserSettingService.cs" />
<Compile Include="Services\LibScan.cs" />
<Compile Include="Services\PresetService.cs" />
<Compile Include="Services\QueueManager.cs" />
<Compile Include="Services\QueueProcessor.cs" />
<Compile Include="Services\ScanService.cs" />
<Compile Include="Services\UpdateService.cs" />
+ <Compile Include="Services\UserSettingService.cs" />
+ <Compile Include="UserSettingConstants.cs" />
<Compile Include="Utilities\AppcastReader.cs" />
<Compile Include="Utilities\GeneralUtilities.cs" />
<Compile Include="Utilities\LanguageUtilities.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Init.cs b/win/CS/HandBrake.ApplicationServices/Init.cs deleted file mode 100644 index e51683ab8..000000000 --- a/win/CS/HandBrake.ApplicationServices/Init.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* Init.cs $
- This file is part of the HandBrake source code.
- Homepage: <http://handbrake.fr>.
- It may be used under the terms of the GNU General Public License. */
-
-namespace HandBrake.ApplicationServices
-{
- using System;
- using System.Reflection;
-
- /// <summary>
- /// Initialize ApplicationServices
- /// </summary>
- public class Init
- {
- /**
- * I really dislike this, Need to replace this sooner rather than later.
- **/
-
- /// <summary>
- /// Setup the Settings used by the applicaiton with this library
- /// </summary>
- /// <param name="versionString">
- /// The version / name of the application that's using this DLL.
- /// </param>
- /// <param name="instanceId">
- /// The Instance ID
- /// </param>
- /// <param name="completionOption">
- /// The completion option.
- /// </param>
- /// <param name="disableDvdNav">
- /// The disable dvd nav.
- /// </param>
- /// <param name="growlEncode">
- /// The growl encode.
- /// </param>
- /// <param name="growlQueue">
- /// The growl queue.
- /// </param>
- /// <param name="processPriority">
- /// The process priority.
- /// </param>
- /// <param name="saveLogPath">
- /// The save log path.
- /// </param>
- /// <param name="saveLogToSpecifiedPath">
- /// The save log to specified path.
- /// </param>
- /// <param name="saveLogWithVideo">
- /// The save log with video.
- /// </param>
- /// <param name="showCliForInGuiEncodeStatus">
- /// The show cli for in gui encode status.
- /// </param>
- /// <param name="preventSleep">
- /// Prevent the system from sleeping
- /// </param>
- public static void SetupSettings(string versionString, string version, int build, int instanceId, string completionOption, bool disableDvdNav,
- bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
- bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
- {
- InstanceId = instanceId;
- HandBrakeGuiVersionString = versionString;
- Version = version;
- Build = build;
- CompletionOption = completionOption;
- DisableDvdNav = disableDvdNav;
- GrowlEncode = growlEncode;
- GrowlQueue = growlQueue;
- ProcessPriority = processPriority;
- SaveLogPath = saveLogPath;
- SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
- SaveLogWithVideo = saveLogWithVideo;
- ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
- PreventSleep = preventSleep;
- }
-
- /// <summary>
- /// Gets the Assembly version.
- /// </summary>
- /// <returns>
- /// Version data
- /// </returns>
- public static Version AssemblyVersion()
- {
- return Assembly.GetExecutingAssembly().GetName().Version;
- }
-
- /// <summary>
- /// The instance ID used by the Main Applicaiton
- /// </summary>
- public static int InstanceId;
-
- /// <summary>
- /// The Applicaiton that uses this DLL can pass in it's version string.
- /// </summary>
- public static string HandBrakeGuiVersionString;
-
- /// <summary>
- /// HandBrakes Version or Svn revision
- /// </summary>
- public static string Version;
-
- /// <summary>
- /// Handbrakes Build number
- /// </summary>
- public static int Build;
-
- /// <summary>
- /// What to do when the encode completes.
- /// </summary>
- public static string CompletionOption;
-
- /// <summary>
- /// Disable LibDvdNav
- /// </summary>
- public static bool DisableDvdNav;
-
- /// <summary>
- /// Growl when an encode has finished.
- /// </summary>
- public static bool GrowlEncode;
-
- /// <summary>
- /// Growl when a queue has finished.
- /// </summary>
- public static bool GrowlQueue;
-
- /// <summary>
- /// The Process Priority for HandBrakeCLI
- /// </summary>
- public static string ProcessPriority;
-
- /// <summary>
- /// Path to save log files to.
- /// </summary>
- public static string SaveLogPath;
-
- /// <summary>
- /// Copy log files to the SaveLogPath
- /// </summary>
- public static bool SaveLogToSpecifiedPath;
-
- /// <summary>
- /// Save a copy of the log files with the video
- /// </summary>
- public static bool SaveLogWithVideo;
-
- /// <summary>
- /// Show the CLI window when encoding.
- /// </summary>
- public static bool ShowCliForInGuiEncodeStatus;
-
- /// <summary>
- /// Prevent system sleep
- /// </summary>
- public static bool PreventSleep;
- }
-}
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs index 7f4bf9b78..2f08eb19e 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs @@ -149,7 +149,7 @@ namespace HandBrake.ApplicationServices.Parsing }
// Multi-Angle Support if LibDvdNav is enabled
- if (!Init.DisableDvdNav)
+ if (!Properties.Settings.Default.DisableLibDvdNav)
{
m = Regex.Match(nextLine, @" \+ angle\(s\) ([0-9])");
if (m.Success)
diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs b/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs index dab4d168f..228bdbe14 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs +++ b/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs @@ -22,5 +22,209 @@ namespace HandBrake.ApplicationServices.Properties { return defaultInstance;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("1")]
+ public int Verbosity {
+ get {
+ return ((int)(this["Verbosity"]));
+ }
+ set {
+ this["Verbosity"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0.5")]
+ public double X264Step {
+ get {
+ return ((double)(this["X264Step"]));
+ }
+ set {
+ this["X264Step"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Do Nothing")]
+ public string WhenCompleteAction {
+ get {
+ return ((string)(this["WhenCompleteAction"]));
+ }
+ set {
+ this["WhenCompleteAction"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool GrowlEncode {
+ get {
+ return ((bool)(this["GrowlEncode"]));
+ }
+ set {
+ this["GrowlEncode"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool GrowlQueue {
+ get {
+ return ((bool)(this["GrowlQueue"]));
+ }
+ set {
+ this["GrowlQueue"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Below Normal")]
+ public string ProcessPriority {
+ get {
+ return ((string)(this["ProcessPriority"]));
+ }
+ set {
+ this["ProcessPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ public bool PreventSleep {
+ get {
+ return ((bool)(this["PreventSleep"]));
+ }
+ set {
+ this["PreventSleep"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool ShowCLI {
+ get {
+ return ((bool)(this["ShowCLI"]));
+ }
+ set {
+ this["ShowCLI"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool SaveLogToCopyDirectory {
+ get {
+ return ((bool)(this["SaveLogToCopyDirectory"]));
+ }
+ set {
+ this["SaveLogToCopyDirectory"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool SaveLogWithVideo {
+ get {
+ return ((bool)(this["SaveLogWithVideo"]));
+ }
+ set {
+ this["SaveLogWithVideo"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string SaveLogCopyDirectory {
+ get {
+ return ((string)(this["SaveLogCopyDirectory"]));
+ }
+ set {
+ this["SaveLogCopyDirectory"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string HandBrakeVersion {
+ get {
+ return ((string)(this["HandBrakeVersion"]));
+ }
+ set {
+ this["HandBrakeVersion"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ public int HandBrakeBuild {
+ get {
+ return ((int)(this["HandBrakeBuild"]));
+ }
+ set {
+ this["HandBrakeBuild"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string InstanceId {
+ get {
+ return ((string)(this["InstanceId"]));
+ }
+ set {
+ this["InstanceId"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool DisableLibDvdNav {
+ get {
+ return ((bool)(this["DisableLibDvdNav"]));
+ }
+ set {
+ this["DisableLibDvdNav"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string HandBrakePlatform {
+ get {
+ return ((string)(this["HandBrakePlatform"]));
+ }
+ set {
+ this["HandBrakePlatform"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string HandBrakeExeHash {
+ get {
+ return ((string)(this["HandBrakeExeHash"]));
+ }
+ set {
+ this["HandBrakeExeHash"] = value;
+ }
+ }
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings b/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings index 15034e76c..66c42127e 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings +++ b/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings @@ -1,6 +1,57 @@ <?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
- <Profiles>
- <Profile Name="(Default)" />
- </Profiles>
-</SettingsFile>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HandBrake.ApplicationServices.Properties" GeneratedClassName="Settings">
+ <Profiles />
+ <Settings>
+ <Setting Name="Verbosity" Type="System.Int32" Scope="User">
+ <Value Profile="(Default)">1</Value>
+ </Setting>
+ <Setting Name="X264Step" Type="System.Double" Scope="User">
+ <Value Profile="(Default)">0.5</Value>
+ </Setting>
+ <Setting Name="WhenCompleteAction" Type="System.String" Scope="User">
+ <Value Profile="(Default)">Do Nothing</Value>
+ </Setting>
+ <Setting Name="GrowlEncode" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="GrowlQueue" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="ProcessPriority" Type="System.String" Scope="User">
+ <Value Profile="(Default)">Below Normal</Value>
+ </Setting>
+ <Setting Name="PreventSleep" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">True</Value>
+ </Setting>
+ <Setting Name="ShowCLI" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="SaveLogToCopyDirectory" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="SaveLogWithVideo" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="SaveLogCopyDirectory" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="HandBrakeVersion" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="HandBrakeBuild" Type="System.Int32" Scope="User">
+ <Value Profile="(Default)">0</Value>
+ </Setting>
+ <Setting Name="InstanceId" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="DisableLibDvdNav" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
+ <Setting Name="HandBrakePlatform" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="HandBrakeExeHash" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ </Settings>
+</SettingsFile>
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index d64a4479e..0208eaf98 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -28,6 +28,11 @@ namespace HandBrake.ApplicationServices.Services #region Private Variables
/// <summary>
+ /// The User Setting Service
+ /// </summary>
+ private IUserSettingService userSettingService = new UserSettingService();
+
+ /// <summary>
/// The Log Buffer
/// </summary>
private StringBuilder logBuffer;
@@ -159,7 +164,7 @@ namespace HandBrake.ApplicationServices.Services }
}
- if (Init.PreventSleep)
+ if (Properties.Settings.Default.PreventSleep)
{
Win32.PreventSleep();
}
@@ -170,7 +175,7 @@ namespace HandBrake.ApplicationServices.Services RedirectStandardOutput = true,
RedirectStandardError = enableLogging ? true : false,
UseShellExecute = false,
- CreateNoWindow = !Init.ShowCliForInGuiEncodeStatus ? true : false
+ CreateNoWindow = !Properties.Settings.Default.ShowCLI ? true : false
};
this.HbProcess = new Process { StartInfo = cliStart };
@@ -194,7 +199,7 @@ namespace HandBrake.ApplicationServices.Services }
// Set the Process Priority
- switch (Init.ProcessPriority)
+ switch (Properties.Settings.Default.ProcessPriority)
{
case "Realtime":
this.HbProcess.PriorityClass = ProcessPriorityClass.RealTime;
@@ -304,7 +309,7 @@ namespace HandBrake.ApplicationServices.Services {
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\HandBrake\\logs";
- string tempLogFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", Init.InstanceId));
+ string tempLogFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.GetInstanceCount));
string encodeDestinationPath = Path.GetDirectoryName(destination);
string destinationFile = Path.GetFileName(destination);
@@ -319,13 +324,12 @@ namespace HandBrake.ApplicationServices.Services File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
// Save a copy of the log file in the same location as the enocde.
- if (Init.SaveLogWithVideo)
+ if (Properties.Settings.Default.SaveLogWithVideo)
File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
// Save a copy of the log file to a user specified location
- if (Directory.Exists(Init.SaveLogPath))
- if (Init.SaveLogPath != String.Empty && Init.SaveLogToSpecifiedPath)
- File.Copy(tempLogFile, Path.Combine(Init.SaveLogPath, encodeLogFile));
+ if (Directory.Exists(Properties.Settings.Default.SaveLogCopyDirectory) && Properties.Settings.Default.SaveLogToCopyDirectory)
+ File.Copy(tempLogFile, Path.Combine(Properties.Settings.Default.SaveLogCopyDirectory, encodeLogFile));
}
catch (Exception exc)
{
@@ -354,7 +358,7 @@ namespace HandBrake.ApplicationServices.Services windowsSeven.SetTaskBarProgressToNoProgress();
}
- if (Init.PreventSleep)
+ if (Properties.Settings.Default.PreventSleep)
{
Win32.AllowSleep();
}
@@ -398,8 +402,8 @@ namespace HandBrake.ApplicationServices.Services private void SetupLogging(QueueTask encodeQueueTask)
{
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", Init.InstanceId));
- string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", Init.InstanceId));
+ string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.GetInstanceCount));
+ string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", GeneralUtilities.GetInstanceCount));
try
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs new file mode 100644 index 000000000..46ca316f4 --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IUserSettingService.cs @@ -0,0 +1,69 @@ +/* IUserSettingService.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+
+namespace HandBrake.ApplicationServices.Services.Interfaces
+{
+ /// <summary>
+ /// The User Setting Service Interace.
+ /// </summary>
+ public interface IUserSettingService
+ {
+ /// <summary>
+ /// Set the specified user setting.
+ /// </summary>
+ /// <param name="name">
+ /// Name of the property
+ /// </param>
+ /// <param name="value">
+ /// The value to store.
+ /// </param>
+ void SetUserSetting(string name, object value);
+
+ /// <summary>
+ /// Get an Integer type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ int GetUserSettingInt(string name);
+
+ /// <summary>
+ /// Get an String type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ string GetUserSettingString(string name);
+
+ /// <summary>
+ /// Get an Boolean type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ bool GetUserSettingBoolean(string name);
+
+ /// <summary>
+ /// Get an Double type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ double GetUserSettingDouble(string name);
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs index f46a8bad1..6381bb177 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs @@ -8,12 +8,10 @@ namespace HandBrake.ApplicationServices.Services using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
- using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
- using System.Windows.Data;
using System.Xml.Serialization;
using HandBrake.ApplicationServices.Model;
@@ -250,7 +248,7 @@ namespace HandBrake.ApplicationServices.Services Category = category,
Name = presetName[0].Replace("+", string.Empty).Trim(),
Query = presetName[2],
- Version = Init.Version,
+ Version = Properties.Settings.Default.HandBrakeVersion,
CropSettings = pic,
Description = string.Empty, // Maybe one day we will populate this.
IsBuildIn = true
@@ -276,7 +274,7 @@ namespace HandBrake.ApplicationServices.Services // Update built-in Presets if the built-in Presets belong to an older version.
if (this.presets.Count != 0)
{
- if (this.presets[0].Version != Init.Version)
+ if (this.presets[0].Version != Properties.Settings.Default.HandBrakeVersion)
{
this.UpdateBuiltInPresets(string.Empty);
return true;
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 130e1fc46..6f3bf2c1a 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -193,7 +193,7 @@ namespace HandBrake.ApplicationServices.Services private void EncodeServiceEncodeCompleted(object sender, EncodeCompletedEventArgs e)
{
// Growl
- if (Init.GrowlEncode)
+ if (Properties.Settings.Default.GrowlEncode)
GrowlCommunicator.Notify("Encode Completed",
"Put down that cocktail...\nyour Handbrake encode is done.");
@@ -247,11 +247,11 @@ namespace HandBrake.ApplicationServices.Services private static void Finish()
{
// Growl
- if (Init.GrowlQueue)
+ if (Properties.Settings.Default.GrowlQueue)
GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
// Do something whent he encode ends.
- switch (Init.CompletionOption)
+ switch (Properties.Settings.Default.WhenCompleteAction)
{
case "Shutdown":
Process.Start("Shutdown", "-s -t 60");
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index 38dddd2d6..e5bc320e2 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -159,7 +159,7 @@ namespace HandBrake.ApplicationServices.Services "\\HandBrake\\logs";
string dvdInfoPath = Path.Combine(
logDir,
- string.Format("last_scan_log{0}.txt", Init.InstanceId == 0 ? string.Empty : Init.InstanceId.ToString()));
+ string.Format("last_scan_log{0}.txt", GeneralUtilities.GetInstanceCount));
// Make we don't pick up a stale last_encode_log.txt (and that we have rights to the file)
if (File.Exists(dvdInfoPath))
@@ -168,7 +168,7 @@ namespace HandBrake.ApplicationServices.Services }
string extraArguments = string.Empty;
- if (Init.DisableDvdNav)
+ if (Properties.Settings.Default.DisableLibDvdNav)
{
extraArguments = " --no-dvdnav";
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/UpdateService.cs b/win/CS/HandBrake.ApplicationServices/Services/UpdateService.cs index 5e65021e5..a932feee5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/UpdateService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/UpdateService.cs @@ -1,4 +1,9 @@ -namespace HandBrake.ApplicationServices.Services
+/* UpdateService.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Services
{
using System;
using System.IO;
diff --git a/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs new file mode 100644 index 000000000..87d77324f --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs @@ -0,0 +1,95 @@ +/* UserSettingService.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Services
+{
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ /// <summary>
+ /// The User Setting Serivce
+ /// </summary>
+ public class UserSettingService : IUserSettingService
+ {
+ /// <summary>
+ /// Set the specified user setting.
+ /// </summary>
+ /// <param name="name">
+ /// Name of the property
+ /// </param>
+ /// <param name="value">
+ /// The value to store.
+ /// </param>
+ public void SetUserSetting(string name, object value)
+ {
+ Properties.Settings.Default[name] = value;
+ Properties.Settings.Default.Save();
+ }
+
+ /// <summary>
+ /// Get an Integer type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ public int GetUserSettingInt(string name)
+ {
+ int value;
+ int.TryParse(Properties.Settings.Default[name].ToString(), out value);
+
+ return value;
+ }
+
+ /// <summary>
+ /// Get an String type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ public string GetUserSettingString(string name)
+ {
+ return Properties.Settings.Default[name].ToString();
+ }
+
+ /// <summary>
+ /// Get an Boolean type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ public bool GetUserSettingBoolean(string name)
+ {
+ bool value;
+ bool.TryParse(Properties.Settings.Default[name].ToString(), out value);
+
+ return value;
+ }
+
+ /// <summary>
+ /// Get an Double type user setting
+ /// </summary>
+ /// <param name="name">
+ /// The setting name
+ /// </param>
+ /// <returns>
+ /// The settings value
+ /// </returns>
+ public double GetUserSettingDouble(string name)
+ {
+ double value;
+ double.TryParse(Properties.Settings.Default[name].ToString(), out value);
+
+ return value;
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Settings.StyleCop b/win/CS/HandBrake.ApplicationServices/Settings.StyleCop index e61afbf69..7f55ce6c6 100644 --- a/win/CS/HandBrake.ApplicationServices/Settings.StyleCop +++ b/win/CS/HandBrake.ApplicationServices/Settings.StyleCop @@ -1,14 +1 @@ -<StyleCopSettings Version="4.3">
- <Analyzers>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">
- <Rules>
- <Rule Name="ElementsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">True</BooleanProperty>
- </RuleSettings>
- </Rule>
- </Rules>
- <AnalyzerSettings />
- </Analyzer>
- </Analyzers>
-</StyleCopSettings>
\ No newline at end of file +<StyleCopSettings Version="4.3" />
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs b/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs new file mode 100644 index 000000000..ba61a8255 --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs @@ -0,0 +1,99 @@ +/* UserSettingConstants.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices
+{
+ /// <summary>
+ /// Constants for the User Settings Service
+ /// </summary>
+ public class UserSettingConstants
+ {
+ /// <summary>
+ /// The Verbosity
+ /// </summary>
+ public const string Verbosity = "Verbosity";
+
+ /// <summary>
+ /// The X264 Stepper
+ /// </summary>
+ public const string X264Step = "X264Step";
+
+ /// <summary>
+ /// When Complete Action
+ /// </summary>
+ public const string WhenCompleteAction = "WhenCompleteAction";
+
+ /// <summary>
+ /// Growl Encodes
+ /// </summary>
+ public const string GrowlEncode = "GrowlEncode";
+
+ /// <summary>
+ /// Growl Queues
+ /// </summary>
+ public const string GrowlQueue = "GrowlQueue";
+
+ /// <summary>
+ /// Process Priority
+ /// </summary>
+ public const string ProcessPriority = "ProcessPriority";
+
+ /// <summary>
+ /// Prevent Sleep
+ /// </summary>
+ public const string PreventSleep = "PreventSleep";
+
+ /// <summary>
+ /// Show the CLI window
+ /// </summary>
+ public const string ShowCLI = "ShowCLI";
+
+ /// <summary>
+ /// Save Log Directory
+ /// </summary>
+ public const string SaveLogToCopyDirectory = "SaveLogToCopyDirectory";
+
+ /// <summary>
+ /// Save log with video
+ /// </summary>
+ public const string SaveLogWithVideo = "SaveLogWithVideo";
+
+ /// <summary>
+ /// Save copy of the log to a directory
+ /// </summary>
+ public const string SaveLogCopyDirectory = "SaveLogCopyDirectory";
+
+ /// <summary>
+ /// HandBrakes version
+ /// </summary>
+ public const string HandBrakeVersion = "HandBrakeVersion";
+
+ /// <summary>
+ /// HandBrakes build
+ /// </summary>
+ public const string HandBrakeBuild = "HandBrakeBuild";
+
+ /// <summary>
+ /// HandBrakes build
+ /// </summary>
+ public const string HandBrakePlatform = "HandBrakePlatform";
+
+
+ /// <summary>
+ /// HandBrakes CLI Exe SHA1 Hash
+ /// </summary>
+ public const string HandBrakeExeHash = "HandBrakeExeHash";
+
+ /// <summary>
+ /// The Instance Id
+ /// </summary>
+ public const string InstanceId = "InstanceId";
+
+ /// <summary>
+ /// Disable Libdvdnav
+ /// </summary>
+ public const string DisableLibDvdNav = "DisableLibDvdNav";
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs index 3f56213e8..e267e45f4 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs @@ -109,7 +109,7 @@ namespace HandBrake.ApplicationServices.Utilities {
StringBuilder logHeader = new StringBuilder();
- logHeader.AppendLine(String.Format("{0}", Init.HandBrakeGuiVersionString));
+ logHeader.AppendLine(String.Format("HandBrake {0} {1}", Properties.Settings.Default.HandBrakeVersion, Properties.Settings.Default.HandBrakeBuild));
logHeader.AppendLine(String.Format("OS: {0}", Environment.OSVersion));
logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount));
logHeader.Append(String.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory));
@@ -140,5 +140,27 @@ namespace HandBrake.ApplicationServices.Utilities return string.Format("[{0}] {1}", DateTime.Now.TimeOfDay, message);
}
+ /// <summary>
+ /// Gets a value indicating whether HandBrake is running in multi instance mode
+ /// </summary>
+ /// <returns>True if the UI has another instance running</returns>
+ public static bool IsMultiInstance
+ {
+ get
+ {
+ return Process.GetProcessesByName("HandBrake").Length > 0 ? true : false;
+ }
+ }
+
+ /// <summary>
+ /// Gets the number of HandBrake instances running.
+ /// </summary>
+ public static string GetInstanceCount
+ {
+ get
+ {
+ return Process.GetProcessesByName("HandBrake").Length == 0 ? string.Empty : Process.GetProcessesByName("HandBrake").Length.ToString();
+ }
+ }
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs index 4aed1799f..0a8aa72ec 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs @@ -516,7 +516,7 @@ namespace HandBrake.ApplicationServices.Utilities AddEncodeElement(xmlWriter, "PictureWidth", "integer", parsed.Width.ToString());
// Preset Information
- AddEncodeElement(xmlWriter, "PresetBuildNumber", "string", Init.Build.ToString());
+ AddEncodeElement(xmlWriter, "PresetBuildNumber", "string", Properties.Settings.Default.HandBrakeBuild.ToString());
AddEncodeElement(xmlWriter, "PresetDescription", "string", "No Description");
AddEncodeElement(xmlWriter, "PresetName", "string", preset.Name);
AddEncodeElement(xmlWriter, "Type", "integer", "1"); // 1 is user preset, 0 is built in
diff --git a/win/CS/HandBrake.ApplicationServices/app.config b/win/CS/HandBrake.ApplicationServices/app.config index e092c6c7c..d47fd40c8 100644 --- a/win/CS/HandBrake.ApplicationServices/app.config +++ b/win/CS/HandBrake.ApplicationServices/app.config @@ -1,8 +1,68 @@ <?xml version="1.0"?>
<configuration>
- <configSections>
- <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <section name="HandBrake.ApplicationServices.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
- </sectionGroup>
- </configSections>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
+ <configSections>
+ <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <section name="HandBrake.ApplicationServices.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
+ </sectionGroup>
+ </configSections>
+ <startup>
+
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
+ </startup>
+ <userSettings>
+
+ <HandBrake.ApplicationServices.Properties.Settings>
+ <setting name="Verbosity" serializeAs="String">
+ <value>1</value>
+ </setting>
+ <setting name="X264Step" serializeAs="String">
+ <value>0.5</value>
+ </setting>
+ <setting name="WhenCompleteAction" serializeAs="String">
+ <value>Do Nothing</value>
+ </setting>
+ <setting name="GrowlEncode" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="GrowlQueue" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="ProcessPriority" serializeAs="String">
+ <value>Below Normal</value>
+ </setting>
+ <setting name="PreventSleep" serializeAs="String">
+ <value>True</value>
+ </setting>
+ <setting name="ShowCLI" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="SaveLogToCopyDirectory" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="SaveLogWithVideo" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="SaveLogCopyDirectory" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="HandBrakeVersion" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="HandBrakeBuild" serializeAs="String">
+ <value>0</value>
+ </setting>
+ <setting name="InstanceId" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="DisableLibDvdNav" serializeAs="String">
+ <value>False</value>
+ </setting>
+ <setting name="HandBrakePlatform" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="HandBrakeExeHash" serializeAs="String">
+ <value />
+ </setting>
+ </HandBrake.ApplicationServices.Properties.Settings>
+ </userSettings>
+</configuration>
diff --git a/win/CS/Program.cs b/win/CS/Program.cs index ec23be6ca..acdaf0266 100644 --- a/win/CS/Program.cs +++ b/win/CS/Program.cs @@ -7,11 +7,9 @@ namespace Handbrake {
using System;
using System.Diagnostics;
- using System.Drawing;
using System.IO;
using System.Windows.Forms;
- using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Services;
using Handbrake.Properties;
@@ -62,13 +60,9 @@ namespace Handbrake if (Settings.Default.UpdateRequired)
{
Settings.Default.Upgrade();
- // Reset some settings
Settings.Default.UpdateRequired = false;
- Settings.Default.CliExeHash = null;
- Settings.Default.hb_build = 0;
- Settings.Default.hb_platform = null;
- Settings.Default.hb_version = null;
-
+ Settings.Default.Save();
+
// Re-detect the CLI version data.
Functions.Main.SetCliVersionData();
}
@@ -103,8 +97,6 @@ namespace Handbrake x.UpdateBuiltInPresets(string.Empty);
}
- InitializeApplicationServices();
-
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain(args));
@@ -112,18 +104,6 @@ namespace Handbrake }
/// <summary>
- /// Initialize App Services
- /// </summary>
- private static void InitializeApplicationServices()
- {
- string versionId = String.Format("Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);
- Init.SetupSettings(versionId, Settings.Default.hb_version, Settings.Default.hb_build, InstanceId, Settings.Default.CompletionOption, Settings.Default.noDvdNav,
- Settings.Default.growlEncode, Settings.Default.growlQueue,
- Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,
- Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus, Settings.Default.preventSleep);
- }
-
- /// <summary>
/// Throw up an error message for any unhandled exceptions.
/// </summary>
/// <param name="sender">The sender</param>
diff --git a/win/CS/Properties/Settings.Designer.cs b/win/CS/Properties/Settings.Designer.cs index 4651d1303..55efd1322 100644 --- a/win/CS/Properties/Settings.Designer.cs +++ b/win/CS/Properties/Settings.Designer.cs @@ -25,18 +25,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Below Normal")]
- public string processPriority {
- get {
- return ((string)(this["processPriority"]));
- }
- set {
- this["processPriority"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool updateStatus {
get {
@@ -49,18 +37,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("{hb_version}")]
- public string hb_version {
- get {
- return ((string)(this["hb_version"]));
- }
- set {
- this["hb_version"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool tooltipEnable {
get {
@@ -73,18 +49,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Do Nothing")]
- public string CompletionOption {
- get {
- return ((string)(this["CompletionOption"]));
- }
- set {
- this["CompletionOption"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string defaultPreset {
get {
@@ -98,18 +62,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
- public int hb_build {
- get {
- return ((int)(this["hb_build"]));
- }
- set {
- this["hb_build"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
public int skipversion {
get {
return ((int)(this["skipversion"]));
@@ -181,42 +133,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool saveLogToSpecifiedPath {
- get {
- return ((bool)(this["saveLogToSpecifiedPath"]));
- }
- set {
- this["saveLogToSpecifiedPath"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string saveLogPath {
- get {
- return ((string)(this["saveLogPath"]));
- }
- set {
- this["saveLogPath"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool saveLogWithVideo {
- get {
- return ((bool)(this["saveLogWithVideo"]));
- }
- set {
- this["saveLogWithVideo"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\Program Files\\VideoLAN\\vlc\\vlc.exe")]
public string VLC_Path {
get {
@@ -253,42 +169,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0.25")]
- public double x264cqstep {
- get {
- return ((double)(this["x264cqstep"]));
- }
- set {
- this["x264cqstep"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("1")]
- public int verboseLevel {
- get {
- return ((int)(this["verboseLevel"]));
- }
- set {
- this["verboseLevel"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool noDvdNav {
- get {
- return ((bool)(this["noDvdNav"]));
- }
- set {
- this["noDvdNav"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool presetNotification {
get {
@@ -385,42 +265,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
- public string hb_platform {
- get {
- return ((string)(this["hb_platform"]));
- }
- set {
- this["hb_platform"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool growlQueue {
- get {
- return ((bool)(this["growlQueue"]));
- }
- set {
- this["growlQueue"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool growlEncode {
- get {
- return ((bool)(this["growlEncode"]));
- }
- set {
- this["growlEncode"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
public string CliExeHash {
get {
return ((string)(this["CliExeHash"]));
@@ -456,19 +300,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool showCliForInGuiEncodeStatus {
- get {
- return ((bool)(this["showCliForInGuiEncodeStatus"]));
- }
- set {
- this["showCliForInGuiEncodeStatus"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AutoNameTitleCase {
get {
return ((bool)(this["AutoNameTitleCase"]));
@@ -480,7 +312,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AutoNameRemoveUnderscore {
get {
return ((bool)(this["AutoNameRemoveUnderscore"]));
@@ -517,18 +349,6 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool preventSleep {
- get {
- return ((bool)(this["preventSleep"]));
- }
- set {
- this["preventSleep"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool useClosedCaption {
get {
return ((bool)(this["useClosedCaption"]));
diff --git a/win/CS/Properties/Settings.settings b/win/CS/Properties/Settings.settings index 032e9da8b..1e27ad776 100644 --- a/win/CS/Properties/Settings.settings +++ b/win/CS/Properties/Settings.settings @@ -2,27 +2,15 @@ <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Handbrake.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
- <Setting Name="processPriority" Type="System.String" Scope="User">
- <Value Profile="(Default)">Below Normal</Value>
- </Setting>
<Setting Name="updateStatus" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
- <Setting Name="hb_version" Type="System.String" Scope="User">
- <Value Profile="(Default)">{hb_version}</Value>
- </Setting>
<Setting Name="tooltipEnable" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
- <Setting Name="CompletionOption" Type="System.String" Scope="User">
- <Value Profile="(Default)">Do Nothing</Value>
- </Setting>
<Setting Name="defaultPreset" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
- <Setting Name="hb_build" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">0</Value>
- </Setting>
<Setting Name="skipversion" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
@@ -41,15 +29,6 @@ <Setting Name="autoNameFormat" Type="System.String" Scope="User">
<Value Profile="(Default)">{source}-{title}</Value>
</Setting>
- <Setting Name="saveLogToSpecifiedPath" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="saveLogPath" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
- </Setting>
- <Setting Name="saveLogWithVideo" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="VLC_Path" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\Program Files\VideoLAN\vlc\vlc.exe</Value>
</Setting>
@@ -59,15 +38,6 @@ <Setting Name="QueryEditorTab" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
- <Setting Name="x264cqstep" Type="System.Double" Scope="User">
- <Value Profile="(Default)">0.25</Value>
- </Setting>
- <Setting Name="verboseLevel" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">1</Value>
- </Setting>
- <Setting Name="noDvdNav" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="presetNotification" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
@@ -92,15 +62,6 @@ <Setting Name="DubMode" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
- <Setting Name="hb_platform" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
- </Setting>
- <Setting Name="growlQueue" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="growlEncode" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="CliExeHash" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
@@ -110,14 +71,11 @@ <Setting Name="clearOldLogs" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
- <Setting Name="showCliForInGuiEncodeStatus" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="AutoNameTitleCase" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
+ <Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoNameRemoveUnderscore" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
+ <Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="UpdateRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
@@ -125,9 +83,6 @@ <Setting Name="ActivityWindowLastMode" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
- <Setting Name="preventSleep" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="useClosedCaption" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
diff --git a/win/CS/app.config b/win/CS/app.config index 5b8f53d30..1ec2d1e86 100644 --- a/win/CS/app.config +++ b/win/CS/app.config @@ -10,27 +10,15 @@ <userSettings>
<Handbrake.Properties.Settings>
- <setting name="processPriority" serializeAs="String">
- <value>Below Normal</value>
- </setting>
<setting name="updateStatus" serializeAs="String">
<value>True</value>
</setting>
- <setting name="hb_version" serializeAs="String">
- <value>{hb_version}</value>
- </setting>
<setting name="tooltipEnable" serializeAs="String">
<value>True</value>
</setting>
- <setting name="CompletionOption" serializeAs="String">
- <value>Do Nothing</value>
- </setting>
<setting name="defaultPreset" serializeAs="String">
<value />
</setting>
- <setting name="hb_build" serializeAs="String">
- <value>0</value>
- </setting>
<setting name="skipversion" serializeAs="String">
<value>0</value>
</setting>
@@ -49,15 +37,6 @@ <setting name="autoNameFormat" serializeAs="String">
<value>{source}-{title}</value>
</setting>
- <setting name="saveLogToSpecifiedPath" serializeAs="String">
- <value>False</value>
- </setting>
- <setting name="saveLogPath" serializeAs="String">
- <value />
- </setting>
- <setting name="saveLogWithVideo" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="VLC_Path" serializeAs="String">
<value>C:\Program Files\VideoLAN\vlc\vlc.exe</value>
</setting>
@@ -67,15 +46,6 @@ <setting name="QueryEditorTab" serializeAs="String">
<value>False</value>
</setting>
- <setting name="x264cqstep" serializeAs="String">
- <value>0.25</value>
- </setting>
- <setting name="verboseLevel" serializeAs="String">
- <value>1</value>
- </setting>
- <setting name="noDvdNav" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="presetNotification" serializeAs="String">
<value>False</value>
</setting>
@@ -100,15 +70,6 @@ <setting name="DubMode" serializeAs="String">
<value>0</value>
</setting>
- <setting name="hb_platform" serializeAs="String">
- <value />
- </setting>
- <setting name="growlQueue" serializeAs="String">
- <value>False</value>
- </setting>
- <setting name="growlEncode" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="CliExeHash" serializeAs="String">
<value />
</setting>
@@ -118,14 +79,11 @@ <setting name="clearOldLogs" serializeAs="String">
<value>True</value>
</setting>
- <setting name="showCliForInGuiEncodeStatus" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="AutoNameTitleCase" serializeAs="String">
- <value>False</value>
+ <value>True</value>
</setting>
<setting name="AutoNameRemoveUnderscore" serializeAs="String">
- <value>False</value>
+ <value>True</value>
</setting>
<setting name="UpdateRequired" serializeAs="String">
<value>True</value>
@@ -133,9 +91,6 @@ <setting name="ActivityWindowLastMode" serializeAs="String">
<value>0</value>
</setting>
- <setting name="preventSleep" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="useClosedCaption" serializeAs="String">
<value>False</value>
</setting>
diff --git a/win/CS/frmAbout.Designer.cs b/win/CS/frmAbout.Designer.cs index 00d2f76cc..7aea6f863 100644 --- a/win/CS/frmAbout.Designer.cs +++ b/win/CS/frmAbout.Designer.cs @@ -63,9 +63,9 @@ namespace Handbrake this.label1.Location = new System.Drawing.Point(125, 36);
this.label1.Margin = new System.Windows.Forms.Padding(3);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(224, 13);
+ this.label1.Size = new System.Drawing.Size(196, 13);
this.label1.TabIndex = 33;
- this.label1.Text = "Copyright 2003-2011 HandBrake Developers";
+ this.label1.Text = "Copyright 2003-2011 HandBrake Team";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// PictureBox1
diff --git a/win/CS/frmAbout.cs b/win/CS/frmAbout.cs index 70fc92250..05a2765c2 100644 --- a/win/CS/frmAbout.cs +++ b/win/CS/frmAbout.cs @@ -8,11 +8,17 @@ namespace Handbrake using System;
using System.Windows.Forms;
+ using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Services;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
/// <summary>
/// The About Window
/// </summary>
public partial class frmAbout : Form
{
+ IUserSettingService userSettingService = new UserSettingService();
+
/// <summary>
/// Initializes a new instance of the <see cref="frmAbout"/> class.
/// </summary>
@@ -20,8 +26,8 @@ namespace Handbrake {
InitializeComponent();
- string nightly = Properties.Settings.Default.hb_version.Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;
- lbl_GUIBuild.Text = Properties.Settings.Default.hb_version + " (" + Properties.Settings.Default.hb_build + ") " + nightly;
+ string nightly = userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;
+ lbl_GUIBuild.Text = userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion) + " (" + userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeBuild) + ") " + nightly;
}
/// <summary>
diff --git a/win/CS/frmAbout.resx b/win/CS/frmAbout.resx index 796f0d5e9..c3802fbe8 100644 --- a/win/CS/frmAbout.resx +++ b/win/CS/frmAbout.resx @@ -112,10 +112,10 @@ <value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="richTextBox1.Text" xml:space="preserve">
<value>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -124,7 +124,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</value>
</data>
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
diff --git a/win/CS/frmMain.Designer.cs b/win/CS/frmMain.Designer.cs index a7b228b72..1171afa78 100644 --- a/win/CS/frmMain.Designer.cs +++ b/win/CS/frmMain.Designer.cs @@ -698,7 +698,7 @@ namespace Handbrake // mnu_killCLI
//
this.mnu_killCLI.Name = "mnu_killCLI";
- this.mnu_killCLI.Size = new System.Drawing.Size(152, 22);
+ this.mnu_killCLI.Size = new System.Drawing.Size(138, 22);
this.mnu_killCLI.Text = "Cancel Scan";
this.mnu_killCLI.Visible = false;
this.mnu_killCLI.Click += new System.EventHandler(this.mnu_killCLI_Click);
@@ -707,7 +707,7 @@ namespace Handbrake //
this.mnu_exit.Name = "mnu_exit";
this.mnu_exit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
- this.mnu_exit.Size = new System.Drawing.Size(152, 22);
+ this.mnu_exit.Size = new System.Drawing.Size(138, 22);
this.mnu_exit.Text = "E&xit";
this.mnu_exit.Click += new System.EventHandler(this.mnu_exit_Click);
//
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs index ff3594a65..268a297b2 100644 --- a/win/CS/frmMain.cs +++ b/win/CS/frmMain.cs @@ -18,6 +18,7 @@ namespace Handbrake using Functions;
+ using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model.General;
using HandBrake.ApplicationServices.Utilities;
@@ -41,6 +42,7 @@ namespace Handbrake {
#region Private Varibles
// Objects which may be used by one or more other objects *************
+ private IUserSettingService userSettingService = new UserSettingService();
private IQueueProcessor queueProcessor = new QueueProcessor(Program.InstanceId);
private PresetService presetHandler = new PresetService();
@@ -129,9 +131,9 @@ namespace Handbrake // Update the users config file with the CLI version data.
Main.SetCliVersionData();
- if (Settings.Default.hb_version.Contains("svn"))
+ if (userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion).Contains("svn"))
{
- this.Text += " " + Settings.Default.hb_version;
+ this.Text += " " + userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion);
}
// Check for new versions, if update checking is enabled
@@ -142,10 +144,10 @@ namespace Handbrake // Set when the last update was
Settings.Default.lastUpdateCheckDate = DateTime.Now;
Settings.Default.Save();
- string url = Settings.Default.hb_build.ToString().EndsWith("1")
+ string url = this.userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeBuild).EndsWith("1")
? Settings.Default.appcast_unstable
: Settings.Default.appcast;
- UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDone), false, url, Settings.Default.hb_build, Settings.Default.skipversion, Settings.Default.hb_version);
+ UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDone), false, url, userSettingService.GetUserSettingInt(UserSettingConstants.HandBrakeBuild), Settings.Default.skipversion, userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion));
}
}
@@ -217,7 +219,7 @@ namespace Handbrake if (info.NewVersionAvailable)
{
- UpdateInfo updateWindow = new UpdateInfo(info, Settings.Default.hb_version, Settings.Default.hb_build.ToString());
+ UpdateInfo updateWindow = new UpdateInfo(info, userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion), userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeBuild));
updateWindow.ShowDialog();
}
}
@@ -459,10 +461,10 @@ namespace Handbrake lbl_updateCheck.Visible = true;
Settings.Default.lastUpdateCheckDate = DateTime.Now;
Settings.Default.Save();
- string url = Settings.Default.hb_build.ToString().EndsWith("1")
+ string url = userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeBuild).EndsWith("1")
? Settings.Default.appcast_unstable
: Settings.Default.appcast;
- UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDoneMenu), false, url, Settings.Default.hb_build, Settings.Default.skipversion, Settings.Default.hb_version);
+ UpdateService.BeginCheckForUpdates(new AsyncCallback(UpdateCheckDoneMenu), false, url, userSettingService.GetUserSettingInt(UserSettingConstants.HandBrakeBuild), Settings.Default.skipversion, userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion));
}
/// <summary>
@@ -912,7 +914,7 @@ namespace Handbrake {
if (btn_start.Text == "Stop")
{
- DialogResult result = !Properties.Settings.Default.showCliForInGuiEncodeStatus
+ DialogResult result = !userSettingService.GetUserSettingBoolean(UserSettingConstants.ShowCLI)
? MessageBox.Show(
"Are you sure you wish to cancel the encode?\n\nPlease note: Stopping this encode will render the file unplayable. ",
"Cancel Encode?",
@@ -929,7 +931,7 @@ namespace Handbrake // Pause The Queue
this.queueProcessor.Pause();
- if (Settings.Default.showCliForInGuiEncodeStatus)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.ShowCLI))
this.queueProcessor.EncodeService.SafelyStop();
else
this.queueProcessor.EncodeService.Stop();
@@ -1405,7 +1407,7 @@ namespace Handbrake // Populate the Angles dropdown
drop_angle.Items.Clear();
- if (!Properties.Settings.Default.noDvdNav)
+ if (!userSettingService.GetUserSettingBoolean(UserSettingConstants.DisableLibDvdNav))
{
drop_angle.Visible = true;
lbl_angle.Visible = true;
@@ -1757,11 +1759,11 @@ namespace Handbrake case "H.264 (x264)":
slider_videoQuality.Minimum = 0;
slider_videoQuality.TickFrequency = 1;
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
double multiplier = 1.0 / cqStep;
double value = slider_videoQuality.Value * multiplier;
- slider_videoQuality.Maximum = (int)(51 / Properties.Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step));
if (value < slider_videoQuality.Maximum)
slider_videoQuality.Value = slider_videoQuality.Maximum - (int)value;
@@ -1819,25 +1821,30 @@ namespace Handbrake }
}
- private double cachedCqStep = Properties.Settings.Default.x264cqstep;
+ private double cachedCqStep;
/// <summary>
/// Update the CQ slider for x264 for a new CQ step. This is set from option
/// </summary>
public void setQualityFromSlider()
{
+ if (cachedCqStep == 0)
+ {
+ cachedCqStep = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
+ }
+
// Work out the current RF value.
double cqStep = this.cachedCqStep;
double rfValue = 51.0 - slider_videoQuality.Value * cqStep;
// Change the maximum value for the slider
- slider_videoQuality.Maximum = (int)(51 / Properties.Settings.Default.x264cqstep);
+ slider_videoQuality.Maximum = (int)(51 / userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step));
// Reset the CQ slider to RF0
slider_videoQuality.Value = slider_videoQuality.Maximum;
// Reset the CQ slider back to the previous value as close as possible
- double cqStepNew = Properties.Settings.Default.x264cqstep;
+ double cqStepNew = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
double rfValueCurrent = 51.0 - slider_videoQuality.Value * cqStepNew;
while (rfValueCurrent < rfValue)
{
@@ -1846,12 +1853,12 @@ namespace Handbrake }
// Cache the CQ step for the next calculation
- this.cachedCqStep = Properties.Settings.Default.x264cqstep;
+ this.cachedCqStep = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
}
private void slider_videoQuality_Scroll(object sender, EventArgs e)
{
- double cqStep = Properties.Settings.Default.x264cqstep;
+ double cqStep = userSettingService.GetUserSettingDouble(UserSettingConstants.X264Step);
switch (drp_videoEncoder.Text)
{
case "MPEG-4 (FFmpeg)":
@@ -2453,7 +2460,7 @@ namespace Handbrake if (info.NewVersionAvailable)
{
- UpdateInfo updateWindow = new UpdateInfo(info, Settings.Default.hb_version, Settings.Default.hb_build.ToString());
+ UpdateInfo updateWindow = new UpdateInfo(info, userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeVersion), userSettingService.GetUserSettingString(UserSettingConstants.HandBrakeBuild));
updateWindow.ShowDialog();
}
else
diff --git a/win/CS/frmOptions.Designer.cs b/win/CS/frmOptions.Designer.cs index 3d44d4afe..7fefefbd3 100644 --- a/win/CS/frmOptions.Designer.cs +++ b/win/CS/frmOptions.Designer.cs @@ -60,10 +60,10 @@ namespace Handbrake this.label13 = new System.Windows.Forms.Label();
this.text_an_path = new System.Windows.Forms.TextBox();
this.tab_picture = new System.Windows.Forms.TabPage();
- this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
- this.label29 = new System.Windows.Forms.Label();
this.btn_vlcPath = new System.Windows.Forms.Button();
+ this.label29 = new System.Windows.Forms.Label();
this.txt_vlcPath = new System.Windows.Forms.TextBox();
+ this.label36 = new System.Windows.Forms.Label();
this.tab_audio_sub = new System.Windows.Forms.TabPage();
this.radio_preferredAudioAndSubs = new System.Windows.Forms.RadioButton();
this.check_AddCCTracks = new System.Windows.Forms.CheckBox();
@@ -138,11 +138,11 @@ namespace Handbrake this.label27 = new System.Windows.Forms.Label();
this.openFile_vlc = new System.Windows.Forms.OpenFileDialog();
this.panel1 = new System.Windows.Forms.Panel();
+ this.label37 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.tab_options.SuspendLayout();
this.tab_general.SuspendLayout();
this.tab_picture.SuspendLayout();
- this.tableLayoutPanel2.SuspendLayout();
this.tab_audio_sub.SuspendLayout();
this.tab_cli.SuspendLayout();
this.tab_advanced.SuspendLayout();
@@ -468,55 +468,25 @@ namespace Handbrake //
// tab_picture
//
- this.tab_picture.Controls.Add(this.tableLayoutPanel2);
+ this.tab_picture.Controls.Add(this.btn_vlcPath);
+ this.tab_picture.Controls.Add(this.label29);
+ this.tab_picture.Controls.Add(this.txt_vlcPath);
+ this.tab_picture.Controls.Add(this.label36);
this.tab_picture.Location = new System.Drawing.Point(4, 22);
this.tab_picture.Name = "tab_picture";
this.tab_picture.Padding = new System.Windows.Forms.Padding(10);
this.tab_picture.Size = new System.Drawing.Size(580, 357);
this.tab_picture.TabIndex = 5;
- this.tab_picture.Text = "Picture";
+ this.tab_picture.Text = "Preview";
this.tab_picture.UseVisualStyleBackColor = true;
//
- // tableLayoutPanel2
- //
- this.tableLayoutPanel2.AutoSize = true;
- this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.tableLayoutPanel2.ColumnCount = 4;
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.Controls.Add(this.label29, 0, 0);
- this.tableLayoutPanel2.Controls.Add(this.btn_vlcPath, 3, 0);
- this.tableLayoutPanel2.Controls.Add(this.txt_vlcPath, 2, 0);
- this.tableLayoutPanel2.Location = new System.Drawing.Point(10, 10);
- this.tableLayoutPanel2.Name = "tableLayoutPanel2";
- this.tableLayoutPanel2.RowCount = 2;
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.tableLayoutPanel2.Size = new System.Drawing.Size(560, 28);
- this.tableLayoutPanel2.TabIndex = 84;
- //
- // label29
- //
- this.label29.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.label29.AutoSize = true;
- this.label29.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label29.Location = new System.Drawing.Point(3, 5);
- this.label29.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
- this.label29.Name = "label29";
- this.tableLayoutPanel2.SetRowSpan(this.label29, 2);
- this.label29.Size = new System.Drawing.Size(59, 13);
- this.label29.TabIndex = 79;
- this.label29.Text = "VLC Path:";
- //
// btn_vlcPath
//
this.btn_vlcPath.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.btn_vlcPath.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btn_vlcPath.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_vlcPath.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_vlcPath.Location = new System.Drawing.Point(489, 3);
+ this.btn_vlcPath.Location = new System.Drawing.Point(479, 11);
this.btn_vlcPath.Name = "btn_vlcPath";
this.btn_vlcPath.Size = new System.Drawing.Size(68, 22);
this.btn_vlcPath.TabIndex = 83;
@@ -524,10 +494,22 @@ namespace Handbrake this.btn_vlcPath.UseVisualStyleBackColor = true;
this.btn_vlcPath.Click += new System.EventHandler(this.btn_vlcPath_Click);
//
+ // label29
+ //
+ this.label29.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.label29.AutoSize = true;
+ this.label29.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label29.Location = new System.Drawing.Point(13, 15);
+ this.label29.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
+ this.label29.Name = "label29";
+ this.label29.Size = new System.Drawing.Size(59, 13);
+ this.label29.TabIndex = 79;
+ this.label29.Text = "VLC Path:";
+ //
// txt_vlcPath
//
this.txt_vlcPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.txt_vlcPath.Location = new System.Drawing.Point(88, 3);
+ this.txt_vlcPath.Location = new System.Drawing.Point(78, 12);
this.txt_vlcPath.Name = "txt_vlcPath";
this.txt_vlcPath.Size = new System.Drawing.Size(395, 21);
this.txt_vlcPath.TabIndex = 81;
@@ -535,6 +517,15 @@ namespace Handbrake "ew feature.");
this.txt_vlcPath.TextChanged += new System.EventHandler(this.txt_vlcPath_TextChanged);
//
+ // label36
+ //
+ this.label36.AutoSize = true;
+ this.label36.Location = new System.Drawing.Point(75, 36);
+ this.label36.Name = "label36";
+ this.label36.Size = new System.Drawing.Size(255, 13);
+ this.label36.TabIndex = 85;
+ this.label36.Text = "This path is used for the view preview feature only.";
+ //
// tab_audio_sub
//
this.tab_audio_sub.Controls.Add(this.radio_preferredAudioAndSubs);
@@ -549,7 +540,7 @@ namespace Handbrake this.tab_audio_sub.Padding = new System.Windows.Forms.Padding(3);
this.tab_audio_sub.Size = new System.Drawing.Size(580, 357);
this.tab_audio_sub.TabIndex = 6;
- this.tab_audio_sub.Text = "Audio / Subtitles";
+ this.tab_audio_sub.Text = "Audio and Subtitles";
this.tab_audio_sub.UseVisualStyleBackColor = true;
//
// radio_preferredAudioAndSubs
@@ -660,7 +651,7 @@ namespace Handbrake this.tab_cli.Padding = new System.Windows.Forms.Padding(10);
this.tab_cli.Size = new System.Drawing.Size(580, 357);
this.tab_cli.TabIndex = 2;
- this.tab_cli.Text = "CLI / System / Logging";
+ this.tab_cli.Text = "System and Logging";
this.tab_cli.UseVisualStyleBackColor = true;
//
// label11
@@ -681,7 +672,7 @@ namespace Handbrake this.check_preventSleep.AutoSize = true;
this.check_preventSleep.Location = new System.Drawing.Point(73, 45);
this.check_preventSleep.Name = "check_preventSleep";
- this.check_preventSleep.Size = new System.Drawing.Size(266, 17);
+ this.check_preventSleep.Size = new System.Drawing.Size(260, 17);
this.check_preventSleep.TabIndex = 91;
this.check_preventSleep.Text = "Prevent the system from sleeping when encoding.";
this.ToolTip.SetToolTip(this.check_preventSleep, "Prevent system from sleeping during encoding.");
@@ -694,7 +685,7 @@ namespace Handbrake this.check_clearOldLogs.AutoSize = true;
this.check_clearOldLogs.Location = new System.Drawing.Point(73, 234);
this.check_clearOldLogs.Name = "check_clearOldLogs";
- this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);
+ this.check_clearOldLogs.Size = new System.Drawing.Size(162, 17);
this.check_clearOldLogs.TabIndex = 90;
this.check_clearOldLogs.Text = "Clear logs older than 30 days";
this.ToolTip.SetToolTip(this.check_clearOldLogs, "Clear logs which are older than 30 days.\r\nThis only applies to HandBrakes Applica" +
@@ -789,7 +780,7 @@ namespace Handbrake this.check_logsInSpecifiedLocation.AutoSize = true;
this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 139);
this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";
- this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);
+ this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(305, 17);
this.check_logsInSpecifiedLocation.TabIndex = 87;
this.check_logsInSpecifiedLocation.Text = "Put a copy of individual encode logs in a specified location:";
this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");
@@ -891,7 +882,7 @@ namespace Handbrake this.tab_advanced.Padding = new System.Windows.Forms.Padding(10);
this.tab_advanced.Size = new System.Drawing.Size(580, 357);
this.tab_advanced.TabIndex = 4;
- this.tab_advanced.Text = "Advanced / Other";
+ this.tab_advanced.Text = "Advanced";
this.tab_advanced.UseVisualStyleBackColor = true;
//
// check_showCliForInGUIEncode
@@ -1086,11 +1077,11 @@ namespace Handbrake //
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label8.Location = new System.Drawing.Point(51, 19);
+ this.label8.Location = new System.Drawing.Point(51, 11);
this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(115, 13);
+ this.label8.Size = new System.Drawing.Size(50, 13);
this.label8.TabIndex = 61;
- this.label8.Text = "HandBrake Options";
+ this.label8.Text = "Options";
//
// pictureBox2
//
@@ -1444,6 +1435,7 @@ namespace Handbrake // panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
+ this.panel1.Controls.Add(this.label37);
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.label8);
this.panel1.Controls.Add(this.pictureBox2);
@@ -1454,6 +1446,16 @@ namespace Handbrake this.panel1.Size = new System.Drawing.Size(615, 65);
this.panel1.TabIndex = 62;
//
+ // label37
+ //
+ this.label37.AutoSize = true;
+ this.label37.Location = new System.Drawing.Point(51, 27);
+ this.label37.Margin = new System.Windows.Forms.Padding(3);
+ this.label37.Name = "label37";
+ this.label37.Size = new System.Drawing.Size(202, 13);
+ this.label37.TabIndex = 105;
+ this.label37.Text = "Configure the HandBrake user interface.";
+ //
// panel2
//
this.panel2.BackColor = System.Drawing.SystemColors.Control;
@@ -1484,14 +1486,12 @@ namespace Handbrake this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "HandBrake Options";
+ this.Text = "Options";
this.tab_options.ResumeLayout(false);
this.tab_general.ResumeLayout(false);
this.tab_general.PerformLayout();
this.tab_picture.ResumeLayout(false);
this.tab_picture.PerformLayout();
- this.tableLayoutPanel2.ResumeLayout(false);
- this.tableLayoutPanel2.PerformLayout();
this.tab_audio_sub.ResumeLayout(false);
this.tab_audio_sub.PerformLayout();
this.tab_cli.ResumeLayout(false);
@@ -1584,7 +1584,6 @@ namespace Handbrake private System.Windows.Forms.Button btn_viewLogs;
private System.Windows.Forms.Button btn_clearLogs;
internal System.Windows.Forms.ComboBox drop_updateCheckDays;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
internal System.Windows.Forms.ComboBox drp_Priority;
private System.Windows.Forms.CheckBox check_promptOnUnmatchingQueries;
private System.Windows.Forms.TabPage tab_audio_sub;
@@ -1611,5 +1610,7 @@ namespace Handbrake private System.Windows.Forms.Label label34;
internal System.Windows.Forms.Label label35;
internal System.Windows.Forms.ComboBox cb_mp4FileMode;
+ private System.Windows.Forms.Label label36;
+ private System.Windows.Forms.Label label37;
}
}
\ No newline at end of file diff --git a/win/CS/frmOptions.cs b/win/CS/frmOptions.cs index cbfafcd96..24dc6c30f 100644 --- a/win/CS/frmOptions.cs +++ b/win/CS/frmOptions.cs @@ -12,9 +12,10 @@ namespace Handbrake using System.Windows.Forms;
using HandBrake.ApplicationServices;
+ using HandBrake.ApplicationServices.Services;
+ using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
- using Handbrake.Functions;
using Handbrake.Properties;
/// <summary>
@@ -22,7 +23,9 @@ namespace Handbrake /// </summary>
public partial class frmOptions : Form
{
- private frmMain mainWindow;
+ private readonly frmMain mainWindow;
+
+ private readonly IUserSettingService userSettingService = new UserSettingService();
private bool optionsWindowLoading = true;
public frmOptions(frmMain mw)
@@ -64,13 +67,13 @@ namespace Handbrake }
// On Encode Completeion Action
- drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
+ drp_completeOption.Text = userSettingService.GetUserSettingString("WhenCompleteAction");
// Growl.
- if (Properties.Settings.Default.growlEncode)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.GrowlEncode))
check_growlEncode.CheckState = CheckState.Checked;
- if (Properties.Settings.Default.growlQueue)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.GrowlQueue))
check_GrowlQueue.CheckState = CheckState.Checked;
// Enable auto naming feature.
@@ -127,23 +130,23 @@ namespace Handbrake // #############################
// Priority level for encodes
- drp_Priority.Text = Properties.Settings.Default.processPriority;
+ drp_Priority.Text = userSettingService.GetUserSettingString(UserSettingConstants.ProcessPriority);
- check_preventSleep.Checked = Properties.Settings.Default.preventSleep;
+ check_preventSleep.Checked = userSettingService.GetUserSettingBoolean(UserSettingConstants.PreventSleep);
// Log Verbosity Level
- cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;
+ cb_logVerboseLvl.SelectedIndex = userSettingService.GetUserSettingInt(UserSettingConstants.Verbosity);
// Save logs in the same directory as encoded files
- if (Properties.Settings.Default.saveLogWithVideo)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.SaveLogWithVideo))
check_saveLogWithVideo.CheckState = CheckState.Checked;
// Save Logs in a specified path
- if (Properties.Settings.Default.saveLogToSpecifiedPath)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.SaveLogToCopyDirectory))
check_logsInSpecifiedLocation.CheckState = CheckState.Checked;
// The saved log path
- text_logPath.Text = Properties.Settings.Default.saveLogPath;
+ text_logPath.Text = userSettingService.GetUserSettingString(UserSettingConstants.SaveLogCopyDirectory);
check_clearOldLogs.Checked = Properties.Settings.Default.clearOldLogs;
@@ -172,13 +175,13 @@ namespace Handbrake check_disablePresetNotification.CheckState = CheckState.Checked;
// Show CLI Window
- check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;
+ check_showCliForInGUIEncode.Checked = userSettingService.GetUserSettingBoolean(UserSettingConstants.ShowCLI);
// Set the preview count
drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();
// x264 step
- string step = Properties.Settings.Default.x264cqstep.ToString(new CultureInfo("en-US"));
+ string step = userSettingService.GetUserSettingString(UserSettingConstants.X264Step).ToString(new CultureInfo("en-US"));
switch (step)
{
case "1":
@@ -196,7 +199,7 @@ namespace Handbrake }
// Use Experimental dvdnav
- if (Properties.Settings.Default.noDvdNav)
+ if (userSettingService.GetUserSettingBoolean(UserSettingConstants.DisableLibDvdNav))
check_dvdnav.CheckState = CheckState.Checked;
optionsWindowLoading = false;
@@ -232,17 +235,17 @@ namespace Handbrake private void drp_completeOption_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.CompletionOption = drp_completeOption.Text;
+ userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, drp_completeOption.Text);
}
private void check_GrowlQueue_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.growlQueue = check_GrowlQueue.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.GrowlQueue, check_GrowlQueue.Checked);
}
private void check_growlEncode_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.growlEncode = check_growlEncode.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.GrowlEncode, check_growlEncode.Checked);
}
private void check_autoNaming_CheckedChanged(object sender, EventArgs e)
@@ -354,27 +357,27 @@ namespace Handbrake private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.processPriority = drp_Priority.Text;
+ userSettingService.SetUserSetting(UserSettingConstants.ProcessPriority, drp_Priority.Text);
}
private void check_preventSleep_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.preventSleep = check_preventSleep.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.PreventSleep, check_preventSleep.Checked);
}
private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;
+ userSettingService.SetUserSetting(UserSettingConstants.Verbosity, cb_logVerboseLvl.SelectedIndex);
}
private void check_saveLogWithVideo_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.SaveLogWithVideo, check_saveLogWithVideo.Checked);
}
private void check_logsInSpecifiedLocation_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.SaveLogToCopyDirectory, check_logsInSpecifiedLocation.Checked);
}
private void btn_saveLog_Click(object sender, EventArgs e)
@@ -387,7 +390,7 @@ namespace Handbrake private void text_logPath_TextChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.saveLogPath = text_logPath.Text;
+ userSettingService.SetUserSetting(UserSettingConstants.SaveLogCopyDirectory, text_logPath.Text);
}
private void btn_viewLogs_Click(object sender, EventArgs e)
@@ -450,7 +453,7 @@ namespace Handbrake private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.ShowCLI, check_showCliForInGUIEncode.Checked);
}
private void drop_previewScanCount_SelectedIndexChanged(object sender, EventArgs e)
@@ -463,16 +466,16 @@ namespace Handbrake switch (drop_x264step.SelectedIndex)
{
case 0:
- Properties.Settings.Default.x264cqstep = 1.0;
+ userSettingService.SetUserSetting(UserSettingConstants.X264Step, 1.0);
break;
case 1:
- Properties.Settings.Default.x264cqstep = 0.50;
+ userSettingService.SetUserSetting(UserSettingConstants.X264Step, 0.5);
break;
case 2:
- Properties.Settings.Default.x264cqstep = 0.25;
+ userSettingService.SetUserSetting(UserSettingConstants.X264Step, 0.25);
break;
case 3:
- Properties.Settings.Default.x264cqstep = 0.20;
+ userSettingService.SetUserSetting(UserSettingConstants.X264Step, 0.2);
break;
}
mainWindow.setQualityFromSlider();
@@ -480,41 +483,15 @@ namespace Handbrake private void check_dvdnav_CheckedChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.noDvdNav = check_dvdnav.Checked;
+ userSettingService.SetUserSetting(UserSettingConstants.DisableLibDvdNav, check_dvdnav.Checked);
}
#endregion
private void btn_close_Click(object sender, EventArgs e)
{
- Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this
- UpdateApplicationServicesSettings();
-
+ Properties.Settings.Default.Save();
this.Close();
}
-
- /// <summary>
- /// Initialize App Services
- /// </summary>
- private static void UpdateApplicationServicesSettings()
- {
- string versionId = String.Format(
- "Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);
- Init.SetupSettings(
- versionId,
- Settings.Default.hb_version,
- Settings.Default.hb_build,
- Program.InstanceId,
- Settings.Default.CompletionOption,
- Settings.Default.noDvdNav,
- Settings.Default.growlEncode,
- Settings.Default.growlQueue,
- Settings.Default.processPriority,
- Settings.Default.saveLogPath,
- Settings.Default.saveLogToSpecifiedPath,
- Settings.Default.saveLogWithVideo,
- Settings.Default.showCliForInGuiEncodeStatus,
- Settings.Default.preventSleep);
- }
}
}
\ No newline at end of file diff --git a/win/CS/frmQueue.Designer.cs b/win/CS/frmQueue.Designer.cs index 13ba68e28..61e6df6d7 100644 --- a/win/CS/frmQueue.Designer.cs +++ b/win/CS/frmQueue.Designer.cs @@ -54,12 +54,12 @@ namespace Handbrake this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.SaveFile = new System.Windows.Forms.SaveFileDialog();
this.list_queue = new System.Windows.Forms.ListView();
- this.Title = new System.Windows.Forms.ColumnHeader();
- this.Chapters = new System.Windows.Forms.ColumnHeader();
- this.Source = new System.Windows.Forms.ColumnHeader();
- this.Destination = new System.Windows.Forms.ColumnHeader();
- this.EncoderVideo = new System.Windows.Forms.ColumnHeader();
- this.Audio = new System.Windows.Forms.ColumnHeader();
+ this.Title = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.Chapters = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.Source = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.Destination = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.EncoderVideo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.Audio = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.mnu_queue = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnu_up = new System.Windows.Forms.ToolStripMenuItem();
this.mnu_Down = new System.Windows.Forms.ToolStripMenuItem();
@@ -79,6 +79,7 @@ namespace Handbrake this.toolStrip1.SuspendLayout();
this.mnu_queue.SuspendLayout();
this.statusStrip1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@@ -477,6 +478,7 @@ namespace Handbrake this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
diff --git a/win/CS/frmQueue.cs b/win/CS/frmQueue.cs index c305e6b75..e5b2d68d7 100644 --- a/win/CS/frmQueue.cs +++ b/win/CS/frmQueue.cs @@ -14,6 +14,7 @@ namespace Handbrake using System.Windows.Forms;
using Functions;
+ using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
@@ -43,6 +44,8 @@ namespace Handbrake /// </summary>
private readonly frmMain mainWindow;
+ private readonly IUserSettingService userSettingService = new UserSettingService();
+
/// <summary>
/// Initializes a new instance of the <see cref="frmQueue"/> class.
/// </summary>
@@ -67,7 +70,7 @@ namespace Handbrake queue.EncodeService.EncodeStarted += this.queue_EncodeStarted;
queue.EncodeService.EncodeCompleted += this.queue_EncodeEnded;
- drp_completeOption.Text = Properties.Settings.Default.CompletionOption;
+ drp_completeOption.Text = userSettingService.GetUserSettingString(UserSettingConstants.WhenCompleteAction);
}
/// <summary>
@@ -705,9 +708,7 @@ namespace Handbrake /// </param>
private void CompleteOptionChanged(object sender, EventArgs e)
{
- Properties.Settings.Default.CompletionOption = drp_completeOption.Text;
- HandBrake.ApplicationServices.Init.CompletionOption = drp_completeOption.Text;
- Properties.Settings.Default.Save();
+ userSettingService.SetUserSetting(UserSettingConstants.WhenCompleteAction, drp_completeOption.Text);
}
}
}
\ No newline at end of file diff --git a/win/CS/frmQueue.resx b/win/CS/frmQueue.resx index 90014fcee..0922a609b 100644 --- a/win/CS/frmQueue.resx +++ b/win/CS/frmQueue.resx @@ -112,18 +112,18 @@ <value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
- <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>114, 17</value>
</metadata>
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@@ -139,19 +139,19 @@ KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC
</value>
</data>
- <metadata name="SaveFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="SaveFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>219, 17</value>
</metadata>
- <metadata name="mnu_queue.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="mnu_queue.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>530, 17</value>
</metadata>
- <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>414, 17</value>
</metadata>
- <metadata name="OpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="OpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>314, 17</value>
</metadata>
- <metadata name="splitContainer1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <metadata name="splitContainer1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|