]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Thu, 6 Sep 2007 18:53:12 +0000 (18:53 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 6 Sep 2007 18:53:12 +0000 (18:53 +0000)
- Fixes a few issues with the queue. Should no longer miss items at random. Should also be a little more stable now too.

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

win/C#/HandBrakeCS.csproj
win/C#/frmQueue.cs

index 4c257c5b959b86a6080ff48cac3b16a82fa53961..97918ad34914b3c70d498e982ce15c6f1ca74f6e 100644 (file)
     <Compile Include="Parsing\Parser.cs" />\r
     <Compile Include="Parsing\Subtitle.cs" />\r
     <Compile Include="Parsing\Title.cs" />\r
-    <Compile Include="PictureController.cs">\r
-      <SubType>Form</SubType>\r
-    </Compile>\r
-    <Compile Include="PictureController.Designer.cs">\r
-      <DependentUpon>PictureController.cs</DependentUpon>\r
-    </Compile>\r
     <Compile Include="Program.cs" />\r
     <Compile Include="Properties\AssemblyInfo.cs" />\r
     <EmbeddedResource Include="frmAbout.resx">\r
       <SubType>Designer</SubType>\r
       <DependentUpon>frmQuickStart.cs</DependentUpon>\r
     </EmbeddedResource>\r
-    <EmbeddedResource Include="PictureController.resx">\r
-      <SubType>Designer</SubType>\r
-      <DependentUpon>PictureController.cs</DependentUpon>\r
-    </EmbeddedResource>\r
     <EmbeddedResource Include="Properties\Resources.resx">\r
       <Generator>ResXFileCodeGenerator</Generator>\r
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r
index 5d2b7ba2b22c40fee93f629a5bd5af74526b4414..5dfdec47b774d097ddee22f5beab661a2ad4543f 100644 (file)
@@ -42,59 +42,64 @@ namespace Handbrake
         [DllImport("user32.dll")]\r
         public static extern void LockWorkStation();\r
         [DllImport("user32.dll")]\r
-        public static extern int ExitWindowsEx(int uFlags, int dwReason); \r
+        public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
 \r
+        private void processItem()\r
+        {\r
+\r
+        }\r
 \r
         private void startProc(object state)\r
         {\r
-            started = true;\r
-            initialListCount = list_queue.Items.Count;\r
-            for (int i = 0; i < initialListCount; i++)\r
+            try\r
             {\r
-                string query = list_queue.Items[0].ToString();\r
+                initialListCount = list_queue.Items.Count;\r
+                while (list_queue.Items.Count != 0)\r
+                {\r
+                    string query = list_queue.Items[0].ToString();\r
+                    updateUIElements();\r
+                        \r
+                    Functions.CLI process = new Functions.CLI();\r
+                    Process hbProc = process.runCli(this, query, false, false, false, false);\r
+\r
+                    hbProc.WaitForExit();\r
+                    hbProc.Close();\r
+                    hbProc.Dispose();\r
+                }\r
 \r
-                Functions.CLI process = new Functions.CLI();\r
-                Process hbProc = process.runCli(this, query, false, false, false, false);\r
-                \r
-                hbProc.WaitForExit();\r
-                hbProc.Close();\r
-                hbProc.Dispose();\r
-                updateUIElements();\r
+                resetQueue();\r
 \r
-                if ((initialListCount - i) != (list_queue.Items.Count))\r
+                // Do something whent he encode ends.\r
+                switch (Properties.Settings.Default.CompletionOption)\r
                 {\r
-                    initialListCount++;\r
+                    case "Shutdown":\r
+                        System.Diagnostics.Process.Start("Shutdown", "-s -t 60");\r
+                        break;\r
+                    case "Log Off":\r
+                        ExitWindowsEx(0, 0);\r
+                        break;\r
+                    case "Suspend":\r
+                        Application.SetSuspendState(PowerState.Suspend, true, true);\r
+                        break;\r
+                    case "Hibernate":\r
+                        Application.SetSuspendState(PowerState.Hibernate, true, true);\r
+                        break;\r
+                    case "Lock System":\r
+                        LockWorkStation();\r
+                        break;\r
+                    case "Quit HandBrake":\r
+                        Application.Exit();\r
+                        break;\r
+                    default:\r
+                        break;\r
                 }\r
-            }\r
-            started = false;\r
-            resetQueue();\r
 \r
-            // Do something whent he encode ends.\r
-            switch (Properties.Settings.Default.CompletionOption)\r
+                MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
+            }\r
+            catch (Exception exc)\r
             {\r
-                case "Shutdown":\r
-                    System.Diagnostics.Process.Start("Shutdown", "-s -t 60");\r
-                    break;\r
-                case "Log Off":\r
-                    ExitWindowsEx(0, 0);\r
-                    break;\r
-                case "Suspend":\r
-                    Application.SetSuspendState(PowerState.Suspend, true, true);\r
-                    break;\r
-                case "Hibernate":\r
-                    Application.SetSuspendState(PowerState.Hibernate, true, true);\r
-                    break;\r
-                case "Lock System":\r
-                    LockWorkStation();\r
-                    break;\r
-                case "Quit HandBrake":\r
-                    Application.Exit();\r
-                    break;\r
-                default:\r
-                    break;\r
+                MessageBox.Show(exc.ToString());\r
             }\r
-\r
-            MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
         }\r
 \r
         private void updateUIElements()\r
@@ -167,8 +172,6 @@ namespace Handbrake
         private void btn_delete_Click(object sender, EventArgs e)\r
         {\r
             list_queue.Items.Remove(list_queue.SelectedItem);\r
-            if (started == true)\r
-                initialListCount--;\r
         }\r
         #endregion\r
 \r