private int _position; // Position in the arraylist reached by the current log output in the rtf box.\r
private readonly frmMain _mainWin;\r
private Boolean _lastUpdate;\r
+ private Boolean fileNotFoundQuickFix;\r
\r
public frmActivityWindow(string file, EncodeAndQueueHandler eh, frmMain mw)\r
{\r
_encodeQueue = eh;\r
_mainWin = mw;\r
\r
+ fileNotFoundQuickFix = false;\r
+\r
if (file == "last_scan_log.txt")\r
SetLogView(true);\r
else\r
\r
// Copy the log file.\r
if (File.Exists(logFile))\r
- File.Copy(logFile, logFile2);\r
+ File.Copy(logFile, logFile2, true);\r
else\r
+ {\r
+ if (fileNotFoundQuickFix)\r
+ return "";\r
+ fileNotFoundQuickFix = true;\r
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;\r
-\r
- // Open the copied log file for reading\r
+ }\r
+ \r
StreamReader sr = new StreamReader(logFile2);\r
string line;\r
int i = 1;\r
}\r
catch (Exception exc)\r
{\r
- 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);\r
+ 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;\r
}\r
- return null;\r
}\r
\r
protected override void OnClosing(CancelEventArgs e)\r