OSDN Git Service

CLI: add iso639-2 language code to audio track information display
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmOptions.cs
index 2f4496a..174b860 100644 (file)
@@ -5,7 +5,9 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
+using System.Globalization;\r
 using System.Windows.Forms;\r
+using Handbrake.Functions;\r
 \r
 namespace Handbrake\r
 {\r
@@ -36,7 +38,7 @@ namespace Handbrake
 \r
             // On Encode Completeion Action\r
             drp_completeOption.Text = Properties.Settings.Default.CompletionOption;\r
-            \r
+\r
             // Enable auto naming feature.\r
             if (Properties.Settings.Default.autoNaming)\r
                 check_autoNaming.CheckState = CheckState.Checked;\r
@@ -49,6 +51,10 @@ namespace Handbrake
             // Store auto name format\r
             txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;\r
 \r
+            // Use iPod/iTunes friendly .m4v extension for MP4 files.\r
+            if (Properties.Settings.Default.useM4v)\r
+                check_m4v.CheckState = CheckState.Checked;\r
+\r
             // #############################\r
             // Picture Tab\r
             // #############################\r
@@ -106,6 +112,9 @@ namespace Handbrake
             if (Properties.Settings.Default.QueryEditorTab)\r
                 check_queryEditorTab.CheckState = CheckState.Checked;\r
 \r
+            // Prompt on inconsistant queries\r
+            check_promptOnUnmatchingQueries.Checked = Properties.Settings.Default.PromptOnUnmatchingQueries;\r
+\r
             // Preset update notification\r
             if (Properties.Settings.Default.presetNotification)\r
                 check_disablePresetNotification.CheckState = CheckState.Checked;\r
@@ -115,10 +124,22 @@ namespace Handbrake
                 check_inGuiStatus.CheckState = CheckState.Checked;\r
 \r
             // Days between update checks\r
-            numeric_updateCheckDays.Value = Properties.Settings.Default.daysBetweenUpdateCheck;\r
+            switch (Properties.Settings.Default.daysBetweenUpdateCheck)\r
+            {\r
+                case 1:\r
+                    drop_updateCheckDays.SelectedIndex = 0;\r
+                    break;\r
+                case 7:\r
+                    drop_updateCheckDays.SelectedIndex = 1;\r
+                    break;\r
+                case 30:\r
+                    drop_updateCheckDays.SelectedIndex = 2;\r
+                    break;\r
+            }\r
 \r
             // x264 step\r
-            drop_x264step.SelectedItem = Properties.Settings.Default.x264cqstep;\r
+            CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");\r
+            drop_x264step.SelectedItem = Properties.Settings.Default.x264cqstep.ToString(culture);\r
 \r
             // Use Experimental dvdnav\r
             if (Properties.Settings.Default.dvdnav)\r
@@ -171,6 +192,11 @@ namespace Handbrake
             else\r
                 Properties.Settings.Default.autoNamePath = text_an_path.Text;\r
         }\r
+\r
+        private void check_m4v_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            Properties.Settings.Default.useM4v = check_m4v.Checked;\r
+        }\r
         #endregion\r
 \r
         #region Picture\r
@@ -211,6 +237,7 @@ namespace Handbrake
         {\r
             Properties.Settings.Default.saveLogWithVideo = check_saveLogWithVideo.Checked;\r
         }\r
+\r
         private void check_logsInSpecifiedLocation_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.saveLogToSpecifiedPath = check_logsInSpecifiedLocation.Checked;\r
@@ -229,6 +256,26 @@ namespace Handbrake
             Properties.Settings.Default.saveLogPath = text_logPath.Text;\r
         }\r
 \r
+        private void btn_viewLogs_Click(object sender, EventArgs e)\r
+        {\r
+            string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
+            string windir = Environment.GetEnvironmentVariable("WINDIR");\r
+            System.Diagnostics.Process prc = new System.Diagnostics.Process();\r
+            prc.StartInfo.FileName = windir + @"\explorer.exe";\r
+            prc.StartInfo.Arguments = logDir;\r
+            prc.Start();\r
+        }\r
+\r
+        private void btn_clearLogs_Click(object sender, EventArgs e)\r
+        {\r
+            DialogResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);\r
+            if (result == DialogResult.Yes)\r
+            {\r
+                Main.clearLogs();\r
+                MessageBox.Show(this, "HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButtons.OK,\r
+                                MessageBoxIcon.Information);\r
+            }\r
+        }\r
         #endregion\r
 \r
         #region Advanced\r
@@ -240,6 +287,7 @@ namespace Handbrake
         private void check_mainMinimize_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.MainWindowMinimize = check_mainMinimize.Checked;\r
+            check_trayStatusAlerts.Enabled = check_mainMinimize.Checked;\r
         }\r
 \r
         private void check_trayStatusAlerts_CheckedChanged(object sender, EventArgs e)\r
@@ -250,6 +298,12 @@ namespace Handbrake
         private void check_queryEditorTab_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.QueryEditorTab = check_queryEditorTab.Checked;\r
+            check_promptOnUnmatchingQueries.Enabled = check_queryEditorTab.Checked;\r
+        }\r
+\r
+        private void check_promptOnUnmatchingQueries_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            Properties.Settings.Default.PromptOnUnmatchingQueries = check_promptOnUnmatchingQueries.Checked;\r
         }\r
 \r
         private void check_disablePresetNotification_CheckedChanged(object sender, EventArgs e)\r
@@ -262,20 +316,45 @@ namespace Handbrake
             Properties.Settings.Default.enocdeStatusInGui = check_inGuiStatus.Checked;\r
         }\r
 \r
-        private void numeric_updateCheckDays_ValueChanged(object sender, EventArgs e)\r
+        private void drop_updateCheckDays_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.daysBetweenUpdateCheck = (int)numeric_updateCheckDays.Value;\r
+            switch (drop_updateCheckDays.SelectedIndex)\r
+            {\r
+                case 0:\r
+                    Properties.Settings.Default.daysBetweenUpdateCheck = 1;\r
+                    break;\r
+                case 1:\r
+                    Properties.Settings.Default.daysBetweenUpdateCheck = 7;\r
+                    break;\r
+                case 2:\r
+                    Properties.Settings.Default.daysBetweenUpdateCheck = 30;\r
+                    break;\r
+            }\r
         }\r
 \r
         private void x264step_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.x264cqstep = drop_x264step.Text;\r
+            switch (drop_x264step.SelectedIndex)\r
+            {\r
+                case 0:\r
+                    Properties.Settings.Default.x264cqstep = 1.0;\r
+                    break;\r
+                case 1:\r
+                    Properties.Settings.Default.x264cqstep = 0.50;\r
+                    break;\r
+                case 2:\r
+                    Properties.Settings.Default.x264cqstep = 0.25;\r
+                    break;\r
+                case 3:\r
+                    Properties.Settings.Default.x264cqstep = 0.20;\r
+                    break;\r
+            }\r
         }\r
 \r
         private void check_dvdnav_CheckedChanged(object sender, EventArgs e)\r
         {\r
             Properties.Settings.Default.dvdnav = check_dvdnav.Checked;\r
-        } \r
+        }\r
         #endregion\r
 \r
         private void btn_close_Click(object sender, EventArgs e)\r