OSDN Git Service

LinGui: don't remove srt subs when changing from mkv to mp4
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmActivityWindow.cs
index 86ed53d..9509500 100644 (file)
@@ -24,6 +24,7 @@ namespace Handbrake
         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
@@ -32,6 +33,8 @@ namespace Handbrake
             _encodeQueue = eh;\r
             _mainWin = mw;\r
 \r
+            fileNotFoundQuickFix = false;\r
+\r
             if (file == "last_scan_log.txt")\r
                 SetLogView(true);\r
             else\r
@@ -173,11 +176,15 @@ namespace Handbrake
 \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
@@ -197,9 +204,8 @@ namespace Handbrake
             }\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