]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Wed, 17 Jun 2009 21:28:05 +0000 (21:28 +0000)
committersr55 <sr55.hb@outlook.com>
Wed, 17 Jun 2009 21:28:05 +0000 (21:28 +0000)
- Overwrite warning after clicking "start" for those users who don't seem to use the "Browse" feature.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2563 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmMain.cs

index 8329cc7c53ebdbf0a117e7c0555998906fc75164..55da10ae337faf54b384e3f892d0997007eec56b 100644 (file)
@@ -542,21 +542,26 @@ namespace Handbrake
             {\r
                 if (encodeQueue.count() != 0 || (text_source.Text != string.Empty && text_source.Text != "Click 'Source' to continue" && text_destination.Text != string.Empty))\r
                 {\r
-                    // Set the last action to encode. \r
-                    // This is used for tracking which file to load in the activity window\r
-                    lastAction = "encode";\r
-\r
                     String query = rtf_query.Text != "" ? rtf_query.Text : queryGen.generateTheQuery(this);\r
 \r
-                    if (encodeQueue.count() == 0)\r
-                        encodeQueue.add(query, text_source.Text, text_destination.Text);\r
+                    DialogResult overwrite = DialogResult.Yes;\r
+                    if (text_destination.Text != "")\r
+                        if (File.Exists(text_destination.Text))\r
+                            overwrite = MessageBox.Show("The destination file already exists. Are you sure you want to overwrite it?", "Overwrite File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);\r
 \r
-                    queueWindow.setQueue();\r
-                    if (encodeQueue.count() > 1)\r
-                        queueWindow.Show(false);\r
+                    if (overwrite == DialogResult.Yes)\r
+                    {\r
+                        if (encodeQueue.count() == 0)\r
+                            encodeQueue.add(query, text_source.Text, text_destination.Text);\r
 \r
-                    setEncodeStarted(); // Encode is running, so setup the GUI appropriately\r
-                    encodeQueue.startEncode(); // Start The Queue Encoding Process\r
+                        queueWindow.setQueue();\r
+                        if (encodeQueue.count() > 1)\r
+                            queueWindow.Show(false);\r
+\r
+                        setEncodeStarted(); // Encode is running, so setup the GUI appropriately\r
+                        encodeQueue.startEncode(); // Start The Queue Encoding Process\r
+                        lastAction = "encode";   // Set the last action to encode - Used for activity window.\r
+                    }\r
                     this.Focus();\r
                 }\r
                 else if (text_source.Text == string.Empty || text_source.Text == "Click 'Source' to continue" || text_destination.Text == string.Empty)\r