diff options
-rw-r--r-- | win/C#/Functions/Encode.cs | 26 | ||||
-rw-r--r-- | win/C#/HandBrakeCS.csproj | 16 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 3 | ||||
-rw-r--r-- | win/C#/frmQueue.cs | 1 |
4 files changed, 44 insertions, 2 deletions
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 }
}
+ /// <summary>
+ /// Append the CLI query to the start of the log file.
+ /// </summary>
+ /// <param name="query"></param>
+ 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();
+ }
+
+ /// <summary>
+ /// Save a copy of the log to the users desired location or a default location
+ /// if this feature is enabled in options.
+ /// </summary>
+ /// <param name="query"></param>
public void copyLog(string query)
{
// The user may wish to do something with the log.
diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index 4ff6d0a23..7c25cb4cc 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -18,7 +18,7 @@ <UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<SignManifests>false</SignManifests>
<PublishUrl>publish\</PublishUrl>
@@ -35,6 +35,8 @@ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -88,6 +90,12 @@ <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="PresentationCore">
+ <RequiredTargetFramework>3.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="PresentationFramework">
+ <RequiredTargetFramework>3.0</RequiredTargetFramework>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
@@ -96,6 +104,12 @@ <Reference Include="System.Messaging" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
+ <Reference Include="UIAutomationProvider">
+ <RequiredTargetFramework>3.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="WindowsBase">
+ <RequiredTargetFramework>3.0</RequiredTargetFramework>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="frmActivityWindow.cs">
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 37f4160a6..94d826494 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1890,7 +1890,8 @@ namespace Handbrake }
// After the encode is done, we may want to shutdown, suspend etc.
- cliObj.copyLog((string)state);
+ cliObj.addCLIQueryToLog((string)state);
+ cliObj.copyLog((string)state); // Make a copy of the log in the users desired location if necessary
cliObj.afterEncodeAction();
}
}
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 7b6d2d677..88acf24e9 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -147,6 +147,7 @@ namespace Handbrake hbProc = cliObj.runCli(this, query);
hbProc.WaitForExit();
+ cliObj.addCLIQueryToLog(query);
cliObj.copyLog(query);
hbProc.Close();
|