X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmActivityWindow.cs;h=9509500a61036066dc2b4ba7154f7912baf044cb;hb=b4464b6d962bb939a8f38b4d50057c441ab48111;hp=86ed53d06b5261e62552d9e2f8142d697b3665ae;hpb=0b4d63982128ed37eb92b3d4d724adc963274a1a;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmActivityWindow.cs b/win/C#/frmActivityWindow.cs index 86ed53d0..9509500a 100644 --- a/win/C#/frmActivityWindow.cs +++ b/win/C#/frmActivityWindow.cs @@ -24,6 +24,7 @@ namespace Handbrake private int _position; // Position in the arraylist reached by the current log output in the rtf box. private readonly frmMain _mainWin; private Boolean _lastUpdate; + private Boolean fileNotFoundQuickFix; public frmActivityWindow(string file, EncodeAndQueueHandler eh, frmMain mw) { @@ -32,6 +33,8 @@ namespace Handbrake _encodeQueue = eh; _mainWin = mw; + fileNotFoundQuickFix = false; + if (file == "last_scan_log.txt") SetLogView(true); else @@ -173,11 +176,15 @@ namespace Handbrake // Copy the log file. if (File.Exists(logFile)) - File.Copy(logFile, logFile2); + File.Copy(logFile, logFile2, true); else + { + if (fileNotFoundQuickFix) + return ""; + fileNotFoundQuickFix = true; return "\n\n\nERROR: The log file could not be found. \nMaybe you cleared your system's tempory folder or maybe you just havn't run an encode yet. \nTried to find the log file in: " + logFile; - - // Open the copied log file for reading + } + StreamReader sr = new StreamReader(logFile2); string line; int i = 1; @@ -197,9 +204,8 @@ namespace Handbrake } catch (Exception exc) { - MessageBox.Show("Error in ReadFile() \n Unable to read the log file.\n You may have to restart HandBrake.\n Error Information: \n\n" + exc, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return "Error in ReadFile() \n Unable to read the log file.\n You may have to restart HandBrake. Will try reading the file again in a few seconds... \n Error Information: \n\n" + exc; } - return null; } protected override void OnClosing(CancelEventArgs e)