OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 31 Aug 2007 12:23:42 +0000 (12:23 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 31 Aug 2007 12:23:42 +0000 (12:23 +0000)
- Cleaned up the Options window a bit.
- Added On Encode Complete Options (in options)
- A few small UI tweaks.

git-svn-id: svn://localhost/HandBrake/trunk@908 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.cs
win/C#/frmOptions.Designer.cs
win/C#/frmOptions.cs
win/C#/frmQueue.Designer.cs
win/C#/frmQueue.cs

index db4342b..6bfea18 100644 (file)
@@ -574,5 +574,17 @@ namespace Handbrake.Properties {
                 this["tooltipEnable"] = value;\r
             }\r
         }\r
+        \r
+        [global::System.Configuration.UserScopedSettingAttribute()]\r
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("Do Nothing")]\r
+        public string CompletionOption {\r
+            get {\r
+                return ((string)(this["CompletionOption"]));\r
+            }\r
+            set {\r
+                this["CompletionOption"] = value;\r
+            }\r
+        }\r
     }\r
 }\r
index 0bf338f..338ca66 100644 (file)
     <Setting Name="tooltipEnable" Type="System.String" Scope="User">\r
       <Value Profile="(Default)">Checked</Value>\r
     </Setting>\r
+    <Setting Name="CompletionOption" Type="System.String" Scope="User">\r
+      <Value Profile="(Default)">Do Nothing</Value>\r
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index a5239f9..19f1280 100644 (file)
             <setting name="tooltipEnable" serializeAs="String">\r
                 <value>Checked</value>\r
             </setting>\r
+            <setting name="CompletionOption" serializeAs="String">\r
+                <value>Do Nothing</value>\r
+            </setting>\r
         </Handbrake.Properties.Settings>\r
     </userSettings>\r
 </configuration>
\ No newline at end of file
index 27b7ac8..e6db91e 100644 (file)
@@ -1052,7 +1052,13 @@ namespace Handbrake
             process.setNull();\r
             lbl_encode.Text = "Encoding Canceled";\r
         }\r
-   \r
+\r
+\r
+        [DllImport("user32.dll")]\r
+        public static extern void LockWorkStation();\r
+        [DllImport("user32.dll")]\r
+        public static extern int ExitWindowsEx(int uFlags, int dwReason); \r
+\r
         private void procMonitor(object state)\r
         {\r
             // Make sure we are not already encoding and if we are then display an error.\r
@@ -1095,9 +1101,33 @@ namespace Handbrake
 \r
                 setEncodeLabel();\r
                 hbProc = null;\r
+\r
+                // Do something whent he encode ends.\r
+                switch (Properties.Settings.Default.CompletionOption)\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
+                    default:\r
+                        break;\r
+                }\r
             }\r
         }\r
+\r
         private delegate void UpdateUIHandler();\r
+\r
         private void setEncodeLabel()\r
         {\r
             if (this.InvokeRequired)\r
index 189958b..13ab096 100644 (file)
@@ -31,9 +31,8 @@ namespace Handbrake
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmOptions));\r
             this.drp_Priority = new System.Windows.Forms.ComboBox();\r
             this.GroupBox2 = new System.Windows.Forms.GroupBox();\r
-            this.Label1 = new System.Windows.Forms.Label();\r
+            this.check_tooltip = new System.Windows.Forms.CheckBox();\r
             this.check_updateCheck = new System.Windows.Forms.CheckBox();\r
-            this.Label2 = new System.Windows.Forms.Label();\r
             this.check_userDefaultSettings = new System.Windows.Forms.CheckBox();\r
             this.Label4 = new System.Windows.Forms.Label();\r
             this.check_verbose = new System.Windows.Forms.CheckBox();\r
@@ -44,11 +43,13 @@ namespace Handbrake
             this.GroupBox1 = new System.Windows.Forms.GroupBox();\r
             this.check_guiDebug = new System.Windows.Forms.CheckBox();\r
             this.btn_close = new System.Windows.Forms.Button();\r
-            this.label3 = new System.Windows.Forms.Label();\r
-            this.check_tooltip = new System.Windows.Forms.CheckBox();\r
+            this.groupBox4 = new System.Windows.Forms.GroupBox();\r
+            this.drp_completeOption = new System.Windows.Forms.ComboBox();\r
+            this.label5 = new System.Windows.Forms.Label();\r
             this.GroupBox2.SuspendLayout();\r
             this.GroupBox3.SuspendLayout();\r
             this.GroupBox1.SuspendLayout();\r
+            this.groupBox4.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // drp_Priority\r
@@ -63,7 +64,7 @@ namespace Handbrake
             "Normal",\r
             "Below Normal",\r
             "Low"});\r
-            this.drp_Priority.Location = new System.Drawing.Point(15, 91);\r
+            this.drp_Priority.Location = new System.Drawing.Point(223, 58);\r
             this.drp_Priority.Name = "drp_Priority";\r
             this.drp_Priority.Size = new System.Drawing.Size(111, 21);\r
             this.drp_Priority.TabIndex = 43;\r
@@ -72,61 +73,50 @@ namespace Handbrake
             // GroupBox2\r
             // \r
             this.GroupBox2.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.GroupBox2.Controls.Add(this.label3);\r
             this.GroupBox2.Controls.Add(this.check_tooltip);\r
-            this.GroupBox2.Controls.Add(this.Label1);\r
             this.GroupBox2.Controls.Add(this.check_updateCheck);\r
-            this.GroupBox2.Controls.Add(this.Label2);\r
             this.GroupBox2.Controls.Add(this.check_userDefaultSettings);\r
             this.GroupBox2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.GroupBox2.Location = new System.Drawing.Point(12, 11);\r
             this.GroupBox2.Name = "GroupBox2";\r
-            this.GroupBox2.Size = new System.Drawing.Size(386, 173);\r
+            this.GroupBox2.Size = new System.Drawing.Size(386, 103);\r
             this.GroupBox2.TabIndex = 55;\r
             this.GroupBox2.TabStop = false;\r
             this.GroupBox2.Text = "General Settings";\r
             // \r
-            // Label1\r
+            // check_tooltip\r
             // \r
-            this.Label1.AutoSize = true;\r
-            this.Label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label1.Location = new System.Drawing.Point(13, 22);\r
-            this.Label1.Name = "Label1";\r
-            this.Label1.Size = new System.Drawing.Size(151, 13);\r
-            this.Label1.TabIndex = 0;\r
-            this.Label1.Text = "Update Check on Startup";\r
+            this.check_tooltip.AutoSize = true;\r
+            this.check_tooltip.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.check_tooltip.Location = new System.Drawing.Point(15, 71);\r
+            this.check_tooltip.Name = "check_tooltip";\r
+            this.check_tooltip.Size = new System.Drawing.Size(135, 17);\r
+            this.check_tooltip.TabIndex = 49;\r
+            this.check_tooltip.Text = "Enable GUI tooltips";\r
+            this.check_tooltip.UseVisualStyleBackColor = true;\r
+            this.check_tooltip.CheckedChanged += new System.EventHandler(this.check_tooltip_CheckedChanged);\r
             // \r
             // check_updateCheck\r
             // \r
             this.check_updateCheck.AutoSize = true;\r
             this.check_updateCheck.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_updateCheck.Location = new System.Drawing.Point(16, 43);\r
+            this.check_updateCheck.Location = new System.Drawing.Point(15, 25);\r
             this.check_updateCheck.Name = "check_updateCheck";\r
-            this.check_updateCheck.Size = new System.Drawing.Size(71, 17);\r
+            this.check_updateCheck.Size = new System.Drawing.Size(170, 17);\r
             this.check_updateCheck.TabIndex = 1;\r
-            this.check_updateCheck.Text = "Enabled";\r
+            this.check_updateCheck.Text = "Update Check on Startup";\r
             this.check_updateCheck.UseVisualStyleBackColor = true;\r
             this.check_updateCheck.CheckedChanged += new System.EventHandler(this.check_updateCheck_CheckedChanged);\r
             // \r
-            // Label2\r
-            // \r
-            this.Label2.AutoSize = true;\r
-            this.Label2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label2.Location = new System.Drawing.Point(13, 67);\r
-            this.Label2.Name = "Label2";\r
-            this.Label2.Size = new System.Drawing.Size(229, 13);\r
-            this.Label2.TabIndex = 46;\r
-            this.Label2.Text = "Load Users Default Settings on Startup";\r
-            // \r
             // check_userDefaultSettings\r
             // \r
             this.check_userDefaultSettings.AutoSize = true;\r
             this.check_userDefaultSettings.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_userDefaultSettings.Location = new System.Drawing.Point(16, 88);\r
+            this.check_userDefaultSettings.Location = new System.Drawing.Point(15, 48);\r
             this.check_userDefaultSettings.Name = "check_userDefaultSettings";\r
-            this.check_userDefaultSettings.Size = new System.Drawing.Size(71, 17);\r
+            this.check_userDefaultSettings.Size = new System.Drawing.Size(248, 17);\r
             this.check_userDefaultSettings.TabIndex = 47;\r
-            this.check_userDefaultSettings.Text = "Enabled";\r
+            this.check_userDefaultSettings.Text = "Load Users Default Settings on Startup";\r
             this.check_userDefaultSettings.UseVisualStyleBackColor = true;\r
             this.check_userDefaultSettings.CheckedChanged += new System.EventHandler(this.check_userDefaultSettings_CheckedChanged);\r
             // \r
@@ -134,7 +124,7 @@ namespace Handbrake
             // \r
             this.Label4.AutoSize = true;\r
             this.Label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label4.Location = new System.Drawing.Point(12, 73);\r
+            this.Label4.Location = new System.Drawing.Point(13, 61);\r
             this.Label4.Name = "Label4";\r
             this.Label4.Size = new System.Drawing.Size(132, 13);\r
             this.Label4.TabIndex = 42;\r
@@ -167,7 +157,7 @@ namespace Handbrake
             "6",\r
             "7",\r
             "8"});\r
-            this.drp_processors.Location = new System.Drawing.Point(15, 40);\r
+            this.drp_processors.Location = new System.Drawing.Point(223, 22);\r
             this.drp_processors.Name = "drp_processors";\r
             this.drp_processors.Size = new System.Drawing.Size(111, 21);\r
             this.drp_processors.TabIndex = 41;\r
@@ -182,7 +172,7 @@ namespace Handbrake
             // \r
             this.Label11.AutoSize = true;\r
             this.Label11.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label11.Location = new System.Drawing.Point(12, 22);\r
+            this.Label11.Location = new System.Drawing.Point(12, 25);\r
             this.Label11.Name = "Label11";\r
             this.Label11.Size = new System.Drawing.Size(142, 13);\r
             this.Label11.TabIndex = 40;\r
@@ -196,9 +186,9 @@ namespace Handbrake
             this.GroupBox3.Controls.Add(this.drp_processors);\r
             this.GroupBox3.Controls.Add(this.Label11);\r
             this.GroupBox3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.GroupBox3.Location = new System.Drawing.Point(13, 190);\r
+            this.GroupBox3.Location = new System.Drawing.Point(12, 191);\r
             this.GroupBox3.Name = "GroupBox3";\r
-            this.GroupBox3.Size = new System.Drawing.Size(386, 128);\r
+            this.GroupBox3.Size = new System.Drawing.Size(386, 94);\r
             this.GroupBox3.TabIndex = 56;\r
             this.GroupBox3.TabStop = false;\r
             this.GroupBox3.Text = "Processor Detection";\r
@@ -209,7 +199,7 @@ namespace Handbrake
             this.GroupBox1.Controls.Add(this.check_guiDebug);\r
             this.GroupBox1.Controls.Add(this.check_verbose);\r
             this.GroupBox1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.GroupBox1.Location = new System.Drawing.Point(13, 324);\r
+            this.GroupBox1.Location = new System.Drawing.Point(12, 291);\r
             this.GroupBox1.Name = "GroupBox1";\r
             this.GroupBox1.Size = new System.Drawing.Size(386, 70);\r
             this.GroupBox1.TabIndex = 54;\r
@@ -220,7 +210,7 @@ namespace Handbrake
             // \r
             this.check_guiDebug.AutoSize = true;\r
             this.check_guiDebug.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_guiDebug.Location = new System.Drawing.Point(187, 31);\r
+            this.check_guiDebug.Location = new System.Drawing.Point(223, 31);\r
             this.check_guiDebug.Name = "check_guiDebug";\r
             this.check_guiDebug.Size = new System.Drawing.Size(131, 17);\r
             this.check_guiDebug.TabIndex = 52;\r
@@ -235,7 +225,7 @@ namespace Handbrake
             this.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_close.Location = new System.Drawing.Point(292, 410);\r
+            this.btn_close.Location = new System.Drawing.Point(291, 371);\r
             this.btn_close.Name = "btn_close";\r
             this.btn_close.Size = new System.Drawing.Size(107, 22);\r
             this.btn_close.TabIndex = 53;\r
@@ -243,32 +233,51 @@ namespace Handbrake
             this.btn_close.UseVisualStyleBackColor = false;\r
             this.btn_close.Click += new System.EventHandler(this.btn_close_Click);\r
             // \r
-            // label3\r
-            // \r
-            this.label3.AutoSize = true;\r
-            this.label3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label3.Location = new System.Drawing.Point(13, 117);\r
-            this.label3.Name = "label3";\r
-            this.label3.Size = new System.Drawing.Size(116, 13);\r
-            this.label3.TabIndex = 48;\r
-            this.label3.Text = "Enable GUI tooltips";\r
-            // \r
-            // check_tooltip\r
-            // \r
-            this.check_tooltip.AutoSize = true;\r
-            this.check_tooltip.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.check_tooltip.Location = new System.Drawing.Point(16, 138);\r
-            this.check_tooltip.Name = "check_tooltip";\r
-            this.check_tooltip.Size = new System.Drawing.Size(71, 17);\r
-            this.check_tooltip.TabIndex = 49;\r
-            this.check_tooltip.Text = "Enabled";\r
-            this.check_tooltip.UseVisualStyleBackColor = true;\r
-            this.check_tooltip.CheckedChanged += new System.EventHandler(this.check_tooltip_CheckedChanged);\r
+            // groupBox4\r
+            // \r
+            this.groupBox4.Controls.Add(this.drp_completeOption);\r
+            this.groupBox4.Controls.Add(this.label5);\r
+            this.groupBox4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.groupBox4.Location = new System.Drawing.Point(12, 120);\r
+            this.groupBox4.Name = "groupBox4";\r
+            this.groupBox4.Size = new System.Drawing.Size(386, 65);\r
+            this.groupBox4.TabIndex = 57;\r
+            this.groupBox4.TabStop = false;\r
+            this.groupBox4.Text = "On Completion Options";\r
+            // \r
+            // drp_completeOption\r
+            // \r
+            this.drp_completeOption.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.drp_completeOption.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.drp_completeOption.FormattingEnabled = true;\r
+            this.drp_completeOption.Items.AddRange(new object[] {\r
+            "Do Nothing",\r
+            "Shutdown",\r
+            "Suspend",\r
+            "Hibernate",\r
+            "Lock System",\r
+            "Log Off"});\r
+            this.drp_completeOption.Location = new System.Drawing.Point(223, 29);\r
+            this.drp_completeOption.Name = "drp_completeOption";\r
+            this.drp_completeOption.Size = new System.Drawing.Size(111, 21);\r
+            this.drp_completeOption.TabIndex = 43;\r
+            this.drp_completeOption.SelectedIndexChanged += new System.EventHandler(this.drp_completeOption_SelectedIndexChanged);\r
+            // \r
+            // label5\r
+            // \r
+            this.label5.AutoSize = true;\r
+            this.label5.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label5.Location = new System.Drawing.Point(13, 29);\r
+            this.label5.Name = "label5";\r
+            this.label5.Size = new System.Drawing.Size(173, 13);\r
+            this.label5.TabIndex = 42;\r
+            this.label5.Text = "When the encode completes:";\r
             // \r
             // frmOptions\r
             // \r
             this.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.ClientSize = new System.Drawing.Size(411, 444);\r
+            this.ClientSize = new System.Drawing.Size(411, 405);\r
+            this.Controls.Add(this.groupBox4);\r
             this.Controls.Add(this.GroupBox2);\r
             this.Controls.Add(this.GroupBox3);\r
             this.Controls.Add(this.GroupBox1);\r
@@ -286,6 +295,8 @@ namespace Handbrake
             this.GroupBox3.PerformLayout();\r
             this.GroupBox1.ResumeLayout(false);\r
             this.GroupBox1.PerformLayout();\r
+            this.groupBox4.ResumeLayout(false);\r
+            this.groupBox4.PerformLayout();\r
             this.ResumeLayout(false);\r
 \r
         }\r
@@ -294,9 +305,7 @@ namespace Handbrake
 \r
         internal System.Windows.Forms.ComboBox drp_Priority;\r
         internal System.Windows.Forms.GroupBox GroupBox2;\r
-        internal System.Windows.Forms.Label Label1;\r
         internal System.Windows.Forms.CheckBox check_updateCheck;\r
-        internal System.Windows.Forms.Label Label2;\r
         internal System.Windows.Forms.CheckBox check_userDefaultSettings;\r
         internal System.Windows.Forms.Label Label4;\r
         internal System.Windows.Forms.CheckBox check_verbose;\r
@@ -307,7 +316,9 @@ namespace Handbrake
         internal System.Windows.Forms.GroupBox GroupBox1;\r
         internal System.Windows.Forms.Button btn_close;\r
         internal System.Windows.Forms.CheckBox check_guiDebug;\r
-        internal System.Windows.Forms.Label label3;\r
         internal System.Windows.Forms.CheckBox check_tooltip;\r
+        private System.Windows.Forms.GroupBox groupBox4;\r
+        internal System.Windows.Forms.ComboBox drp_completeOption;\r
+        internal System.Windows.Forms.Label label5;\r
     }\r
 }
\ No newline at end of file
index a857924..bc511f2 100644 (file)
@@ -27,6 +27,7 @@ namespace Handbrake
             }\r
             drp_processors.Text = Properties.Settings.Default.Processors;\r
             drp_Priority.Text = Properties.Settings.Default.processPriority;\r
+            drp_completeOption.Text = Properties.Settings.Default.CompletionOption;\r
 \r
             if (Properties.Settings.Default.verbose == "Checked")\r
             {\r
@@ -85,6 +86,13 @@ namespace Handbrake
             Properties.Settings.Default.tooltipEnable = check_tooltip.CheckState.ToString();\r
         }\r
 \r
+        private void drp_completeOption_SelectedIndexChanged(object sender, EventArgs e)\r
+        {\r
+            Properties.Settings.Default.CompletionOption = drp_completeOption.Text;\r
+        }\r
+\r
+    \r
\r
 \r
     }\r
 }
\ No newline at end of file
index f5db97d..f3bb3e6 100644 (file)
@@ -49,12 +49,12 @@ namespace Handbrake
             this.btn_down.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_down.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_down.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_down.Location = new System.Drawing.Point(540, 9);\r
+            this.btn_down.Location = new System.Drawing.Point(585, 9);\r
             this.btn_down.Name = "btn_down";\r
-            this.btn_down.Size = new System.Drawing.Size(100, 22);\r
+            this.btn_down.Size = new System.Drawing.Size(55, 22);\r
             this.btn_down.TabIndex = 33;\r
             this.btn_down.TabStop = false;\r
-            this.btn_down.Text = "Move Down";\r
+            this.btn_down.Text = "Down";\r
             this.btn_down.UseVisualStyleBackColor = false;\r
             this.btn_down.Click += new System.EventHandler(this.btn_down_Click);\r
             // \r
@@ -65,12 +65,12 @@ namespace Handbrake
             this.btn_up.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_up.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_up.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_up.Location = new System.Drawing.Point(434, 9);\r
+            this.btn_up.Location = new System.Drawing.Point(539, 9);\r
             this.btn_up.Name = "btn_up";\r
-            this.btn_up.Size = new System.Drawing.Size(100, 22);\r
+            this.btn_up.Size = new System.Drawing.Size(40, 22);\r
             this.btn_up.TabIndex = 32;\r
             this.btn_up.TabStop = false;\r
-            this.btn_up.Text = "Move Up";\r
+            this.btn_up.Text = "Up";\r
             this.btn_up.UseVisualStyleBackColor = false;\r
             this.btn_up.Click += new System.EventHandler(this.btn_up_Click);\r
             // \r
@@ -189,6 +189,7 @@ namespace Handbrake
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.SystemColors.ControlLight;\r
             this.ClientSize = new System.Drawing.Size(657, 406);\r
+            this.ControlBox = false;\r
             this.Controls.Add(this.btn_minimise);\r
             this.Controls.Add(this.lbl_progressValue);\r
             this.Controls.Add(this.label2);\r
index c61b907..add7c45 100644 (file)
@@ -7,6 +7,7 @@ using System.Text;
 using System.Windows.Forms;\r
 using System.Threading;\r
 using System.Diagnostics;\r
+using System.Runtime.InteropServices;\r
 \r
 namespace Handbrake\r
 {\r
@@ -37,6 +38,13 @@ namespace Handbrake
          * Code to Handle the CLI and updating of the UI as each process is completed.\r
          * \r
          */\r
+\r
+        [DllImport("user32.dll")]\r
+        public static extern void LockWorkStation();\r
+        [DllImport("user32.dll")]\r
+        public static extern int ExitWindowsEx(int uFlags, int dwReason); \r
+\r
+\r
         private void startProc(object state)\r
         {\r
             started = true;\r
@@ -60,6 +68,29 @@ namespace Handbrake
             }\r
             started = false;\r
             resetQueue();\r
+\r
+            // Do something whent he encode ends.\r
+            switch (Properties.Settings.Default.CompletionOption)\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
+                default:\r
+                    break;\r
+            }\r
+\r
             MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);\r
         }\r
 \r