OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 9 Jul 2010 19:15:08 +0000 (19:15 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 9 Jul 2010 19:15:08 +0000 (19:15 +0000)
- Added a new preference that allows the user to prevent the system from going to sleep during an encode.

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

win/C#/Functions/Win32.cs
win/C#/HandBrake.ApplicationServices/Functions/Win32.cs
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#/frmOptions.resx

index 89a0c29..a501026 100644 (file)
@@ -139,5 +139,32 @@ namespace Handbrake.Functions
             /// </summary>\r
             CTRL_CLOSE = 2,\r
         }\r
+\r
+        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]\r
+        static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);\r
+\r
+        [FlagsAttribute]\r
+        public enum EXECUTION_STATE : uint\r
+        {\r
+            ES_SYSTEM_REQUIRED = 0x00000001,\r
+            ES_CONTINUOUS = 0x80000000,\r
+            ES_AWAYMODE_REQUIRED = 0x00000040\r
+        }\r
+\r
+        /// <summary>\r
+        /// Prevent the system from sleeping\r
+        /// </summary>\r
+        public static void PreventSleep()\r
+        {\r
+            SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_AWAYMODE_REQUIRED);\r
+        }\r
+\r
+        /// <summary>\r
+        ///  Allow the system to sleep.\r
+        /// </summary>\r
+        public static void AllowSleep()\r
+        {\r
+            SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);\r
+        }\r
     }\r
 }\r
index a3caf38..72e4d8d 100644 (file)
@@ -139,5 +139,32 @@ namespace HandBrake.ApplicationServices.Functions
             /// </summary>\r
             CTRL_CLOSE = 2,\r
         }\r
+\r
+        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]\r
+        static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);\r
+\r
+        [FlagsAttribute]\r
+        public enum EXECUTION_STATE : uint\r
+        {\r
+            ES_SYSTEM_REQUIRED = 0x00000001,\r
+            ES_CONTINUOUS = 0x80000000,\r
+            ES_AWAYMODE_REQUIRED = 0x00000040\r
+        }\r
+\r
+        /// <summary>\r
+        /// Prevent the system from sleeping\r
+        /// </summary>\r
+        public void PreventSleep()\r
+        {\r
+            SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_AWAYMODE_REQUIRED);\r
+        }\r
+\r
+        /// <summary>\r
+        ///  Allow the system to sleep.\r
+        /// </summary>\r
+        public void AllowSleep()\r
+        {\r
+            SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);\r
+        }\r
     }\r
 }\r
index 7a66da4..a6e909f 100644 (file)
@@ -560,5 +560,17 @@ namespace Handbrake.Properties {
                 this["ActivityWindowLastMode"] = value;\r
             }\r
         }\r
+        \r
+        [global::System.Configuration.UserScopedSettingAttribute()]\r
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("False")]\r
+        public bool preventSleep {\r
+            get {\r
+                return ((bool)(this["preventSleep"]));\r
+            }\r
+            set {\r
+                this["preventSleep"] = value;\r
+            }\r
+        }\r
     }\r
 }\r
index 5444f20..770a6fb 100644 (file)
     <Setting Name="ActivityWindowLastMode" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)">0</Value>\r
     </Setting>\r
+    <Setting Name="preventSleep" Type="System.Boolean" Scope="User">\r
+      <Value Profile="(Default)">False</Value>\r
+    </Setting>\r
   </Settings>\r
 </SettingsFile>
\ No newline at end of file
index 377f3bb..d8e0ef4 100644 (file)
       <setting name="ActivityWindowLastMode" serializeAs="String">\r
         <value>0</value>\r
       </setting>\r
+      <setting name="preventSleep" serializeAs="String">\r
+        <value>False</value>\r
+      </setting>\r
     </Handbrake.Properties.Settings>\r
   </userSettings>\r
   <startup />\r
index 6937c59..4cf0483 100644 (file)
@@ -351,12 +351,20 @@ namespace Handbrake
 \r
         private void encodeStarted(object sender, EventArgs e)\r
         {\r
+            if (Properties.Settings.Default.preventSleep)\r
+            {\r
+                Win32.PreventSleep();\r
+            }    \r
             SetEncodeStarted();\r
             encodeQueue.EncodeStatusChanged += EncodeQueue_EncodeStatusChanged;\r
         }\r
 \r
         private void encodeEnded(object sender, EventArgs e)\r
         {\r
+            if (Properties.Settings.Default.preventSleep)\r
+            {\r
+                Win32.AllowSleep();\r
+            }\r
             encodeQueue.EncodeStatusChanged -= EncodeQueue_EncodeStatusChanged;\r
             SetEncodeFinished();\r
         }\r
index 1f22786..71aa2e4 100644 (file)
@@ -69,6 +69,7 @@ namespace Handbrake
             this.drop_preferredLang = new System.Windows.Forms.ComboBox();\r
             this.radio_dub = new System.Windows.Forms.RadioButton();\r
             this.tab_cli = new System.Windows.Forms.TabPage();\r
+            this.check_preventSleep = new System.Windows.Forms.CheckBox();\r
             this.check_clearOldLogs = new System.Windows.Forms.CheckBox();\r
             this.label12 = new System.Windows.Forms.Label();\r
             this.check_cli_minimized = new System.Windows.Forms.CheckBox();\r
@@ -136,6 +137,7 @@ namespace Handbrake
             this.label27 = new System.Windows.Forms.Label();\r
             this.openFile_vlc = new System.Windows.Forms.OpenFileDialog();\r
             this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();\r
+            this.label11 = new System.Windows.Forms.Label();\r
             this.tab_options.SuspendLayout();\r
             this.tab_general.SuspendLayout();\r
             this.tab_picture.SuspendLayout();\r
@@ -570,7 +572,7 @@ namespace Handbrake
             this.radio_foreignAndSubs.AutoSize = true;\r
             this.radio_foreignAndSubs.Location = new System.Drawing.Point(200, 76);\r
             this.radio_foreignAndSubs.Name = "radio_foreignAndSubs";\r
-            this.radio_foreignAndSubs.Size = new System.Drawing.Size(347, 17);\r
+            this.radio_foreignAndSubs.Size = new System.Drawing.Size(358, 17);\r
             this.radio_foreignAndSubs.TabIndex = 90;\r
             this.radio_foreignAndSubs.TabStop = true;\r
             this.radio_foreignAndSubs.Text = "Use foreign language audio and add first preferred language subtitle.";\r
@@ -595,7 +597,7 @@ namespace Handbrake
             this.radio_dub.AutoSize = true;\r
             this.radio_dub.Location = new System.Drawing.Point(200, 53);\r
             this.radio_dub.Name = "radio_dub";\r
-            this.radio_dub.Size = new System.Drawing.Size(167, 17);\r
+            this.radio_dub.Size = new System.Drawing.Size(164, 17);\r
             this.radio_dub.TabIndex = 89;\r
             this.radio_dub.TabStop = true;\r
             this.radio_dub.Text = "DUB Foreign Language Audio";\r
@@ -606,6 +608,8 @@ namespace Handbrake
             // \r
             // tab_cli\r
             // \r
+            this.tab_cli.Controls.Add(this.label11);\r
+            this.tab_cli.Controls.Add(this.check_preventSleep);\r
             this.tab_cli.Controls.Add(this.check_clearOldLogs);\r
             this.tab_cli.Controls.Add(this.label12);\r
             this.tab_cli.Controls.Add(this.check_cli_minimized);\r
@@ -626,16 +630,29 @@ namespace Handbrake
             this.tab_cli.Padding = new System.Windows.Forms.Padding(10);\r
             this.tab_cli.Size = new System.Drawing.Size(580, 334);\r
             this.tab_cli.TabIndex = 2;\r
-            this.tab_cli.Text = "CLI";\r
+            this.tab_cli.Text = "CLI / System / Logging";\r
             this.tab_cli.UseVisualStyleBackColor = true;\r
             // \r
+            // check_preventSleep\r
+            // \r
+            this.check_preventSleep.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
+            this.check_preventSleep.AutoSize = true;\r
+            this.check_preventSleep.Location = new System.Drawing.Point(73, 71);\r
+            this.check_preventSleep.Name = "check_preventSleep";\r
+            this.check_preventSleep.Size = new System.Drawing.Size(272, 17);\r
+            this.check_preventSleep.TabIndex = 91;\r
+            this.check_preventSleep.Text = "Prevent the system from sleepping when encoding.";\r
+            this.ToolTip.SetToolTip(this.check_preventSleep, "Prevent system from sleeping during encoding.");\r
+            this.check_preventSleep.UseVisualStyleBackColor = true;\r
+            this.check_preventSleep.CheckedChanged += new System.EventHandler(this.check_preventSleep_CheckedChanged);\r
+            // \r
             // check_clearOldLogs\r
             // \r
             this.check_clearOldLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.check_clearOldLogs.AutoSize = true;\r
-            this.check_clearOldLogs.Location = new System.Drawing.Point(73, 226);\r
+            this.check_clearOldLogs.Location = new System.Drawing.Point(73, 260);\r
             this.check_clearOldLogs.Name = "check_clearOldLogs";\r
-            this.check_clearOldLogs.Size = new System.Drawing.Size(162, 17);\r
+            this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);\r
             this.check_clearOldLogs.TabIndex = 90;\r
             this.check_clearOldLogs.Text = "Clear logs older than 30 days";\r
             this.ToolTip.SetToolTip(this.check_clearOldLogs, "Clear logs which are older than 30 days.\r\nThis only applies to HandBrakes Applica" +\r
@@ -648,7 +665,7 @@ namespace Handbrake
             this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
             this.label12.AutoSize = true;\r
             this.label12.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label12.Location = new System.Drawing.Point(15, 15);\r
+            this.label12.Location = new System.Drawing.Point(7, 15);\r
             this.label12.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);\r
             this.label12.Name = "label12";\r
             this.label12.Size = new System.Drawing.Size(28, 13);\r
@@ -661,7 +678,7 @@ namespace Handbrake
             this.check_cli_minimized.AutoSize = true;\r
             this.check_cli_minimized.Location = new System.Drawing.Point(73, 14);\r
             this.check_cli_minimized.Name = "check_cli_minimized";\r
-            this.check_cli_minimized.Size = new System.Drawing.Size(135, 17);\r
+            this.check_cli_minimized.Size = new System.Drawing.Size(137, 17);\r
             this.check_cli_minimized.TabIndex = 76;\r
             this.check_cli_minimized.Text = "Start window minimized";\r
             this.ToolTip.SetToolTip(this.check_cli_minimized, "Starts a CLI window minimized.");\r
@@ -673,7 +690,7 @@ namespace Handbrake
             this.btn_viewLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.btn_viewLogs.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_viewLogs.ForeColor = System.Drawing.Color.DarkOrange;\r
-            this.btn_viewLogs.Location = new System.Drawing.Point(129, 188);\r
+            this.btn_viewLogs.Location = new System.Drawing.Point(129, 222);\r
             this.btn_viewLogs.Name = "btn_viewLogs";\r
             this.btn_viewLogs.Size = new System.Drawing.Size(139, 23);\r
             this.btn_viewLogs.TabIndex = 89;\r
@@ -686,7 +703,7 @@ namespace Handbrake
             this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
             this.label9.AutoSize = true;\r
             this.label9.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label9.Location = new System.Drawing.Point(7, 84);\r
+            this.label9.Location = new System.Drawing.Point(7, 118);\r
             this.label9.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);\r
             this.label9.Name = "label9";\r
             this.label9.Size = new System.Drawing.Size(36, 13);\r
@@ -698,7 +715,7 @@ namespace Handbrake
             this.Label4.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.Label4.AutoSize = true;\r
             this.Label4.BackColor = System.Drawing.Color.Transparent;\r
-            this.Label4.Location = new System.Drawing.Point(70, 45);\r
+            this.Label4.Location = new System.Drawing.Point(70, 34);\r
             this.Label4.Name = "Label4";\r
             this.Label4.Size = new System.Drawing.Size(70, 13);\r
             this.Label4.TabIndex = 42;\r
@@ -709,7 +726,7 @@ namespace Handbrake
             this.btn_clearLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.btn_clearLogs.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_clearLogs.ForeColor = System.Drawing.Color.DarkOrange;\r
-            this.btn_clearLogs.Location = new System.Drawing.Point(274, 188);\r
+            this.btn_clearLogs.Location = new System.Drawing.Point(274, 222);\r
             this.btn_clearLogs.Name = "btn_clearLogs";\r
             this.btn_clearLogs.Size = new System.Drawing.Size(135, 23);\r
             this.btn_clearLogs.TabIndex = 88;\r
@@ -729,7 +746,7 @@ namespace Handbrake
             "Normal",\r
             "Below Normal",\r
             "Low"});\r
-            this.drp_Priority.Location = new System.Drawing.Point(177, 42);\r
+            this.drp_Priority.Location = new System.Drawing.Point(177, 31);\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
@@ -741,9 +758,9 @@ namespace Handbrake
             // \r
             this.check_logsInSpecifiedLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.check_logsInSpecifiedLocation.AutoSize = true;\r
-            this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 131);\r
+            this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 165);\r
             this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";\r
-            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(305, 17);\r
+            this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);\r
             this.check_logsInSpecifiedLocation.TabIndex = 87;\r
             this.check_logsInSpecifiedLocation.Text = "Put a copy of individual encode logs in a specified location:";\r
             this.ToolTip.SetToolTip(this.check_logsInSpecifiedLocation, "Place a copy of the encode log in the same folder as the encoded movie.");\r
@@ -754,7 +771,7 @@ namespace Handbrake
             // \r
             this.check_saveLogWithVideo.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.check_saveLogWithVideo.AutoSize = true;\r
-            this.check_saveLogWithVideo.Location = new System.Drawing.Point(73, 108);\r
+            this.check_saveLogWithVideo.Location = new System.Drawing.Point(73, 142);\r
             this.check_saveLogWithVideo.Name = "check_saveLogWithVideo";\r
             this.check_saveLogWithVideo.Size = new System.Drawing.Size(382, 17);\r
             this.check_saveLogWithVideo.TabIndex = 83;\r
@@ -768,7 +785,7 @@ namespace Handbrake
             this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.label3.AutoSize = true;\r
             this.label3.BackColor = System.Drawing.Color.Transparent;\r
-            this.label3.Location = new System.Drawing.Point(70, 84);\r
+            this.label3.Location = new System.Drawing.Point(70, 118);\r
             this.label3.Name = "label3";\r
             this.label3.Size = new System.Drawing.Size(101, 13);\r
             this.label3.TabIndex = 85;\r
@@ -780,7 +797,7 @@ namespace Handbrake
             this.btn_saveLog.FlatAppearance.BorderColor = System.Drawing.Color.Black;\r
             this.btn_saveLog.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_saveLog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_saveLog.Location = new System.Drawing.Point(437, 161);\r
+            this.btn_saveLog.Location = new System.Drawing.Point(437, 195);\r
             this.btn_saveLog.Name = "btn_saveLog";\r
             this.btn_saveLog.Size = new System.Drawing.Size(77, 22);\r
             this.btn_saveLog.TabIndex = 82;\r
@@ -797,7 +814,7 @@ namespace Handbrake
             "0",\r
             "1",\r
             "2"});\r
-            this.cb_logVerboseLvl.Location = new System.Drawing.Point(177, 81);\r
+            this.cb_logVerboseLvl.Location = new System.Drawing.Point(177, 115);\r
             this.cb_logVerboseLvl.Name = "cb_logVerboseLvl";\r
             this.cb_logVerboseLvl.Size = new System.Drawing.Size(111, 21);\r
             this.cb_logVerboseLvl.TabIndex = 86;\r
@@ -807,7 +824,7 @@ namespace Handbrake
             // text_logPath\r
             // \r
             this.text_logPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));\r
-            this.text_logPath.Location = new System.Drawing.Point(129, 161);\r
+            this.text_logPath.Location = new System.Drawing.Point(129, 195);\r
             this.text_logPath.Name = "text_logPath";\r
             this.text_logPath.Size = new System.Drawing.Size(302, 21);\r
             this.text_logPath.TabIndex = 80;\r
@@ -818,7 +835,7 @@ namespace Handbrake
             // \r
             this.label14.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
             this.label14.AutoSize = true;\r
-            this.label14.Location = new System.Drawing.Point(70, 164);\r
+            this.label14.Location = new System.Drawing.Point(70, 198);\r
             this.label14.Name = "label14";\r
             this.label14.Size = new System.Drawing.Size(53, 13);\r
             this.label14.TabIndex = 81;\r
@@ -856,7 +873,7 @@ namespace Handbrake
             this.check_showCliForInGUIEncode.BackColor = System.Drawing.Color.Transparent;\r
             this.check_showCliForInGUIEncode.Location = new System.Drawing.Point(100, 152);\r
             this.check_showCliForInGUIEncode.Name = "check_showCliForInGUIEncode";\r
-            this.check_showCliForInGUIEncode.Size = new System.Drawing.Size(324, 17);\r
+            this.check_showCliForInGUIEncode.Size = new System.Drawing.Size(330, 17);\r
             this.check_showCliForInGUIEncode.TabIndex = 96;\r
             this.check_showCliForInGUIEncode.Text = "Show CLI window (Allows you to cleanly exit encode with ctrl-c)";\r
             this.ToolTip.SetToolTip(this.check_showCliForInGUIEncode, resources.GetString("check_showCliForInGUIEncode.ToolTip"));\r
@@ -910,7 +927,7 @@ namespace Handbrake
             this.check_trayStatusAlerts.BackColor = System.Drawing.Color.Transparent;\r
             this.check_trayStatusAlerts.Location = new System.Drawing.Point(81, 37);\r
             this.check_trayStatusAlerts.Name = "check_trayStatusAlerts";\r
-            this.check_trayStatusAlerts.Size = new System.Drawing.Size(288, 17);\r
+            this.check_trayStatusAlerts.Size = new System.Drawing.Size(296, 17);\r
             this.check_trayStatusAlerts.TabIndex = 93;\r
             this.check_trayStatusAlerts.Text = "Display status messages from tray icon (balloon popups)";\r
             this.ToolTip.SetToolTip(this.check_trayStatusAlerts, "Minimize the window to the system tray rather than the task bar.\r\nThe system tray" +\r
@@ -926,7 +943,7 @@ namespace Handbrake
             this.check_mainMinimize.BackColor = System.Drawing.Color.Transparent;\r
             this.check_mainMinimize.Location = new System.Drawing.Point(81, 14);\r
             this.check_mainMinimize.Name = "check_mainMinimize";\r
-            this.check_mainMinimize.Size = new System.Drawing.Size(133, 17);\r
+            this.check_mainMinimize.Size = new System.Drawing.Size(138, 17);\r
             this.check_mainMinimize.TabIndex = 82;\r
             this.check_mainMinimize.Text = "Minimize to system tray";\r
             this.ToolTip.SetToolTip(this.check_mainMinimize, "Minimize the window to the system tray rather than the task bar.\r\nThe system tray" +\r
@@ -940,7 +957,7 @@ namespace Handbrake
             this.check_promptOnUnmatchingQueries.AutoSize = true;\r
             this.check_promptOnUnmatchingQueries.Location = new System.Drawing.Point(100, 83);\r
             this.check_promptOnUnmatchingQueries.Name = "check_promptOnUnmatchingQueries";\r
-            this.check_promptOnUnmatchingQueries.Size = new System.Drawing.Size(300, 17);\r
+            this.check_promptOnUnmatchingQueries.Size = new System.Drawing.Size(305, 17);\r
             this.check_promptOnUnmatchingQueries.TabIndex = 63;\r
             this.check_promptOnUnmatchingQueries.Text = "Prompt when a manual query does not match GUI settings";\r
             this.check_promptOnUnmatchingQueries.UseVisualStyleBackColor = true;\r
@@ -953,7 +970,7 @@ namespace Handbrake
             this.check_dvdnav.BackColor = System.Drawing.Color.Transparent;\r
             this.check_dvdnav.Location = new System.Drawing.Point(82, 247);\r
             this.check_dvdnav.Name = "check_dvdnav";\r
-            this.check_dvdnav.Size = new System.Drawing.Size(277, 17);\r
+            this.check_dvdnav.Size = new System.Drawing.Size(276, 17);\r
             this.check_dvdnav.TabIndex = 90;\r
             this.check_dvdnav.Text = "Disable LibDVDNav. (libdvdread will be used instead)";\r
             this.check_dvdnav.UseVisualStyleBackColor = false;\r
@@ -966,7 +983,7 @@ namespace Handbrake
             this.check_queryEditorTab.BackColor = System.Drawing.Color.Transparent;\r
             this.check_queryEditorTab.Location = new System.Drawing.Point(81, 60);\r
             this.check_queryEditorTab.Name = "check_queryEditorTab";\r
-            this.check_queryEditorTab.Size = new System.Drawing.Size(236, 17);\r
+            this.check_queryEditorTab.Size = new System.Drawing.Size(241, 17);\r
             this.check_queryEditorTab.TabIndex = 84;\r
             this.check_queryEditorTab.Text = "Enable \"Query Editor\" tab (Requires Restart)";\r
             this.ToolTip.SetToolTip(this.check_queryEditorTab, "Enables the Query Editor tab on the main window. Requires program restart to take" +\r
@@ -1018,7 +1035,7 @@ namespace Handbrake
             this.check_disablePresetNotification.BackColor = System.Drawing.Color.Transparent;\r
             this.check_disablePresetNotification.Location = new System.Drawing.Point(81, 106);\r
             this.check_disablePresetNotification.Name = "check_disablePresetNotification";\r
-            this.check_disablePresetNotification.Size = new System.Drawing.Size(216, 17);\r
+            this.check_disablePresetNotification.Size = new System.Drawing.Size(222, 17);\r
             this.check_disablePresetNotification.TabIndex = 91;\r
             this.check_disablePresetNotification.Text = "Disable built-in preset update notification";\r
             this.ToolTip.SetToolTip(this.check_disablePresetNotification, "Disables the notification you recieve when presets are updated when a new version" +\r
@@ -1044,9 +1061,9 @@ namespace Handbrake
             this.check_inGuiStatus.BackColor = System.Drawing.Color.Transparent;\r
             this.check_inGuiStatus.Location = new System.Drawing.Point(81, 129);\r
             this.check_inGuiStatus.Name = "check_inGuiStatus";\r
-            this.check_inGuiStatus.Size = new System.Drawing.Size(230, 17);\r
+            this.check_inGuiStatus.Size = new System.Drawing.Size(162, 17);\r
             this.check_inGuiStatus.TabIndex = 92;\r
-            this.check_inGuiStatus.Text = "Enable in-GUI encode status (experimental)";\r
+            this.check_inGuiStatus.Text = "Enable in-GUI encode status";\r
             this.ToolTip.SetToolTip(this.check_inGuiStatus, "Displays the CLI status in the GUI windows instead of the CLI window.");\r
             this.check_inGuiStatus.UseVisualStyleBackColor = false;\r
             this.check_inGuiStatus.CheckedChanged += new System.EventHandler(this.check_inGuiStatus_CheckedChanged);\r
@@ -1067,7 +1084,7 @@ namespace Handbrake
             this.check_disableResCalc.AutoSize = true;\r
             this.check_disableResCalc.Location = new System.Drawing.Point(13, 15);\r
             this.check_disableResCalc.Name = "check_disableResCalc";\r
-            this.check_disableResCalc.Size = new System.Drawing.Size(329, 17);\r
+            this.check_disableResCalc.Size = new System.Drawing.Size(327, 17);\r
             this.check_disableResCalc.TabIndex = 0;\r
             this.check_disableResCalc.Text = "Disable Resolution Calculation for \"None\" and \"Custom\" modes.";\r
             this.ToolTip.SetToolTip(this.check_disableResCalc, resources.GetString("check_disableResCalc.ToolTip"));\r
@@ -1454,6 +1471,18 @@ namespace Handbrake
             this.tableLayoutPanel5.Size = new System.Drawing.Size(594, 429);\r
             this.tableLayoutPanel5.TabIndex = 62;\r
             // \r
+            // label11\r
+            // \r
+            this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
+            this.label11.AutoSize = true;\r
+            this.label11.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label11.Location = new System.Drawing.Point(7, 72);\r
+            this.label11.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);\r
+            this.label11.Name = "label11";\r
+            this.label11.Size = new System.Drawing.Size(53, 13);\r
+            this.label11.TabIndex = 92;\r
+            this.label11.Text = "System:";\r
+            // \r
             // frmOptions\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);\r
@@ -1599,5 +1628,7 @@ namespace Handbrake
         internal System.Windows.Forms.CheckBox check_showCliForInGUIEncode;\r
         internal System.Windows.Forms.CheckBox check_TitleCase;\r
         internal System.Windows.Forms.CheckBox check_removeUnderscores;\r
+        internal System.Windows.Forms.CheckBox check_preventSleep;\r
+        private System.Windows.Forms.Label label11;\r
     }\r
 }
\ No newline at end of file
index 64b778f..399cf01 100644 (file)
@@ -119,6 +119,8 @@ namespace Handbrake
             // Priority level for encodes\r
             drp_Priority.Text = Properties.Settings.Default.processPriority;\r
 \r
+            check_preventSleep.Checked = Properties.Settings.Default.preventSleep; \r
+\r
             // Log Verbosity Level\r
             cb_logVerboseLvl.SelectedIndex = Properties.Settings.Default.verboseLevel;\r
 \r
@@ -334,6 +336,11 @@ namespace Handbrake
             Properties.Settings.Default.processPriority = drp_Priority.Text;\r
         }\r
 \r
+        private void check_preventSleep_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            Properties.Settings.Default.preventSleep = check_preventSleep.Checked;\r
+        }\r
+\r
         private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.verboseLevel = cb_logVerboseLvl.SelectedIndex;\r
@@ -502,6 +509,5 @@ namespace Handbrake
                                Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,\r
                                Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus);\r
         }\r
-\r
     }\r
 }
\ No newline at end of file
index 02f2ee7..a697821 100644 (file)
   <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>132, 18</value>\r
   </metadata>\r
+  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>132, 18</value>\r
+  </metadata>\r
+  <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">\r
+    <value>Shows the CLI window when "Encode In-Gui encode status" is enabled.\r
+You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c\r
+meaing you'll have playable files if you choose to end the encode early.</value>\r
+  </data>\r
+  <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>132, 18</value>\r
+  </metadata>\r
   <data name="check_m4v.ToolTip" xml:space="preserve">\r
     <value>Use .m4v instead of .mp4 for MP4 files\r
 \r
@@ -127,11 +138,6 @@ Chapter Markers, AC3 Audio and SRT Subtitles will require the m4v extension if y
 When this option is disabled, Chapter Markers, AC3 audio and SRT subtitiles will still automatically change the file extension to m4v.\r
 </value>\r
   </data>\r
-  <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">\r
-    <value>Shows the CLI window when "Encode In-Gui encode status" is enabled.\r
-You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c\r
-meaing you'll have playable files if you choose to end the encode early.</value>\r
-  </data>\r
   <data name="check_disableResCalc.ToolTip" xml:space="preserve">\r
     <value>If the new Picture Settings panel is causing you problems, enable this option.\r
 It disables some of the resolution calcuation code for None and Custom modes.\r