From d99095dd075535212881be4a1d7544e9aca91b5b Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 12 Nov 2008 15:57:39 +0000 Subject: WinGui: - Adds the CLI query to the top of every log file generated after an encode finishes. Note: CLI query will only display in the activity window after the CLI has exited. This can be sorted later. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1917 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/Encode.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'win/C#/Functions/Encode.cs') diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs index f79f45a9b..0445392d0 100644 --- a/win/C#/Functions/Encode.cs +++ b/win/C#/Functions/Encode.cs @@ -107,6 +107,32 @@ namespace Handbrake.Functions } } + /// + /// Append the CLI query to the start of the log file. + /// + /// + public void addCLIQueryToLog(string query) + { + string logPath = Path.Combine(Path.GetTempPath(), "hb_encode_log.dat"); + + StreamReader reader = new StreamReader(File.Open(logPath, FileMode.Open, FileAccess.Read)); + String log = reader.ReadToEnd(); + reader.Close(); + + StreamWriter writer = new StreamWriter(File.Create(logPath)); + + writer.Write("### CLI Query: " + query + "\n\n"); + writer.Write("#########################################\n\n"); + writer.WriteLine(log); + writer.Flush(); + writer.Close(); + } + + /// + /// Save a copy of the log to the users desired location or a default location + /// if this feature is enabled in options. + /// + /// public void copyLog(string query) { // The user may wish to do something with the log. -- cgit v1.2.3