summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/Encode.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-10-30 21:15:28 +0000
committersr55 <[email protected]>2008-10-30 21:15:28 +0000
commitdb7164860c6d50c56a0a14689ee6251011a6a994 (patch)
tree7f772927154288a5128a3eac1453c7763399e23c /win/C#/Functions/Encode.cs
parent9834623a06e533d557ec8919e4238e207886f9a7 (diff)
WinGui:
- Activity logs for individual encodes can now be saved either: + With the encoded file + or to a a directory which is configured from options. Log file format: "YYYY-MM-DD HH-MM-SS {Destination File Name}.txt" Feature is disabled by default git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1883 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/Encode.cs')
-rw-r--r--win/C#/Functions/Encode.cs35
1 files changed, 34 insertions, 1 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs
index f2fb11440..f79f45a9b 100644
--- a/win/C#/Functions/Encode.cs
+++ b/win/C#/Functions/Encode.cs
@@ -16,7 +16,7 @@ using System.Runtime.InteropServices;
namespace Handbrake.Functions
{
public class Encode
- {
+ {
/// <summary>
/// CLI output is based on en-US locale,
/// we use this CultureInfo as IFormatProvider to *.Parse() calls
@@ -106,5 +106,38 @@ namespace Handbrake.Functions
break;
}
}
+
+ public void copyLog(string query)
+ {
+ // The user may wish to do something with the log.
+ if (Properties.Settings.Default.saveLog == "Checked")
+ {
+ string logPath = Path.Combine(Path.GetTempPath(), "hb_encode_log.dat");
+ Functions.QueryParser parsed = Functions.QueryParser.Parse(query);
+
+ if (Properties.Settings.Default.saveLogWithVideo == "Checked")
+ {
+ string[] destName = parsed.Destination.Split('\\');
+ string destinationFile = "";
+ for (int i = 0; i < destName.Length - 1; i++)
+ {
+ destinationFile += destName[i] + "\\";
+ }
+
+ destinationFile += DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + destName[destName.Length - 1] + ".txt";
+
+ File.Copy(logPath, destinationFile);
+ }
+ else if (Properties.Settings.Default.saveLogPath != String.Empty)
+ {
+ string[] destName = parsed.Destination.Split('\\');
+ string dest = destName[destName.Length - 1];
+ string filename = DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + dest + ".txt";
+ string useDefinedLogPath = Path.Combine(Properties.Settings.Default.saveLogPath, filename);
+
+ File.Copy(logPath, useDefinedLogPath);
+ }
+ }
+ }
}
}