From f6357dbdf13e7f9712d51317d2d7b5f97ff7a6ea Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 24 Jan 2010 17:39:17 +0000 Subject: WinGui: - Quick patch to allow "," to be used in CSV files when importing into the gui. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3085 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/Main.cs | 32 +++--------------------------- win/C#/Functions/QueryGenerator.cs | 2 +- win/C#/Functions/UpdateCheckInformation.cs | 27 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 30 deletions(-) (limited to 'win') diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index e9c4442b0..8c92d7668 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -97,10 +97,11 @@ namespace Handbrake.Functions { if (csv.Trim() != "") { + csv = csv.Replace("\\,", ""); string[] contents = csv.Split(','); int chapter; int.TryParse(contents[0], out chapter); - chapterMap.Add(chapter, contents[1]); + chapterMap.Add(chapter, contents[1].Replace("", ",")); } csv = sr.ReadLine(); } @@ -435,32 +436,6 @@ namespace Handbrake.Functions return checkResult.Result; } - /// - /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern. - /// - private class UpdateCheckResult : IAsyncResult - { - public UpdateCheckResult(object asyncState, UpdateCheckInformation info) - { - AsyncState = asyncState; - Result = info; - } - - /// - /// Gets whether the check was executed in debug mode. - /// - public object AsyncState { get; private set; } - - /// - /// Gets the result of the update check. - /// - public UpdateCheckInformation Result { get; private set; } - - public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } } - public bool CompletedSynchronously { get { throw new NotImplementedException(); } } - public bool IsCompleted { get { throw new NotImplementedException(); } } - } - /// /// Map languages and their iso639_2 value into a IDictionary /// @@ -658,6 +633,5 @@ namespace Handbrake.Functions }; return languageMap; } - } -} +} \ No newline at end of file diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs index 37e5b66be..3c15f7352 100644 --- a/win/C#/Functions/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -590,7 +590,7 @@ namespace Handbrake.Functions { csv += row.Cells[0].Value.ToString(); csv += ","; - csv += row.Cells[1].Value.ToString(); + csv += row.Cells[1].Value.ToString().Replace(",","\\,"); csv += Environment.NewLine; } StreamWriter file = new StreamWriter(filePathName); diff --git a/win/C#/Functions/UpdateCheckInformation.cs b/win/C#/Functions/UpdateCheckInformation.cs index 253817866..c157f8a68 100644 --- a/win/C#/Functions/UpdateCheckInformation.cs +++ b/win/C#/Functions/UpdateCheckInformation.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; namespace Handbrake.Functions { @@ -20,4 +21,30 @@ namespace Handbrake.Functions /// public Exception Error { get; set; } } + + /// + /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern. + /// + public class UpdateCheckResult : IAsyncResult + { + public UpdateCheckResult(object asyncState, UpdateCheckInformation info) + { + AsyncState = asyncState; + Result = info; + } + + /// + /// Gets whether the check was executed in debug mode. + /// + public object AsyncState { get; private set; } + + /// + /// Gets the result of the update check. + /// + public UpdateCheckInformation Result { get; private set; } + + public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } } + public bool CompletedSynchronously { get { throw new NotImplementedException(); } } + public bool IsCompleted { get { throw new NotImplementedException(); } } + } } -- cgit v1.2.3