OSDN Git Service

WinGui: Re-checkin updated stylecop settings
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmOptions.cs
index b5b7429..4475d90 100644 (file)
@@ -1,8 +1,7 @@
 /*  frmOptions.cs $\r
-       \r
-          This file is part of the HandBrake source code.\r
-          Homepage: <http://handbrake.fr>.\r
-          It may be used under the terms of the GNU General Public License. */\r
+    This file is part of the HandBrake source code.\r
+    Homepage: <http://handbrake.fr>.\r
+    It may be used under the terms of the GNU General Public License. */\r
 \r
 namespace Handbrake\r
 {\r
@@ -13,6 +12,10 @@ namespace Handbrake
     using System.Windows.Forms;\r
     using Functions;\r
 \r
+    using HandBrake.ApplicationServices;\r
+\r
+    using Handbrake.Properties;\r
+\r
     public partial class frmOptions : Form\r
     {\r
         private frmMain mainWindow;\r
@@ -105,18 +108,15 @@ namespace Handbrake
             else\r
                 radio_foreignAndSubs.Checked = true;\r
 \r
-\r
             // #############################\r
             // CLI\r
             // #############################\r
 \r
-            // Enable Start CLI minimized\r
-            if (Properties.Settings.Default.cli_minimized)\r
-                check_cli_minimized.CheckState = CheckState.Checked;\r
-\r
             // 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
@@ -157,12 +157,8 @@ namespace Handbrake
             if (Properties.Settings.Default.presetNotification)\r
                 check_disablePresetNotification.CheckState = CheckState.Checked;\r
 \r
-            // Experimental In-GUI encode status indicator.\r
-            if (Properties.Settings.Default.enocdeStatusInGui)\r
-                check_inGuiStatus.CheckState = CheckState.Checked;\r
-\r
+            // Show CLI Window\r
             check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;\r
-            check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;\r
 \r
             // Set the preview count\r
             drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();\r
@@ -322,14 +318,14 @@ namespace Handbrake
 \r
         #region CLI\r
 \r
-        private void check_cli_minimized_CheckedChanged(object sender, EventArgs e)\r
+        private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.cli_minimized = check_cli_minimized.Checked;\r
+            Properties.Settings.Default.processPriority = drp_Priority.Text;\r
         }\r
 \r
-        private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)\r
+        private void check_preventSleep_CheckedChanged(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.processPriority = drp_Priority.Text;\r
+            Properties.Settings.Default.preventSleep = check_preventSleep.Checked;\r
         }\r
 \r
         private void cb_logVerboseLvl_SelectedIndexChanged(object sender, EventArgs e)\r
@@ -418,24 +414,6 @@ namespace Handbrake
             Properties.Settings.Default.presetNotification = check_disablePresetNotification.Checked;\r
         }\r
 \r
-        private void check_inGuiStatus_CheckedChanged(object sender, EventArgs e)\r
-        {\r
-            Properties.Settings.Default.enocdeStatusInGui = check_inGuiStatus.Checked;\r
-\r
-            check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;\r
-\r
-            if (this.IsHandleCreated)\r
-                if (check_inGuiStatus.Checked)\r
-                {\r
-                    MessageBox.Show(\r
-                        "This feature is experimental!\n\n You will not be able to \91Stop\92 an encode mid-process.\n"\r
-                        + "Doing so will render the file unplayable.\n" +\r
-                        "If you enable 'Show CLI Window', you'll be ablt to hit ctrl-c in the encode window to cleanly exit the CLI. This will give you a playable file.\n\n" +\r
-                        "You are also limited to 1 instance of HandBrakeCLI on your system.", \r
-                        "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
-                }\r
-        }\r
-\r
         private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;\r
@@ -485,8 +463,21 @@ namespace Handbrake
         private void btn_close_Click(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this\r
+            UpdateApplicationServicesSettings();\r
+\r
             this.Close();\r
         }\r
 \r
+        /// <summary>\r
+        /// Initialize App Services\r
+        /// </summary>\r
+        private static void UpdateApplicationServicesSettings()\r
+        {\r
+            string versionId = String.Format("Windows GUI {1} {0}", Settings.Default.hb_build, Settings.Default.hb_version);\r
+            Init.SetupSettings(versionId, Program.InstanceId, Settings.Default.CompletionOption, Settings.Default.noDvdNav,\r
+                               Settings.Default.growlEncode, Settings.Default.growlQueue,\r
+                               Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,\r
+                               Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus, Settings.Default.preventSleep);\r
+        }\r
     }\r
 }
\ No newline at end of file