From: sr55 Date: Sat, 4 Jul 2009 15:32:41 +0000 (+0000) Subject: WinGui: X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c6b9258bc1412ec3c41e7c9dba938def394525c1;p=handbrake-jp%2Fhandbrake-jp-git.git WinGui: - Remove M4v from format dropdown and add new option "Use iPod/iTunes friendly (.m4v) file extension for MP4 git-svn-id: svn://localhost/HandBrake/trunk@2662 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs index 47864f2e..9358a794 100644 --- a/win/C#/Controls/Subtitles.cs +++ b/win/C#/Controls/Subtitles.cs @@ -17,7 +17,7 @@ namespace Handbrake.Controls { fileContainer = value; Boolean trigger = false; - if (fileContainer != 2) + if (fileContainer != 1) foreach (ListViewItem item in lv_subList.Items) { if (item.SubItems[1].Text.Contains("Bitmap")) diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 1b223bab..d2e136a9 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -162,10 +162,13 @@ namespace Handbrake.Functions // Add the appropriate file extension if (format == 0) - destination_filename += ".mp4"; + { + if (Properties.Settings.Default.useM4v) + destination_filename += ".m4v"; + else + destination_filename += ".mp4"; + } else if (format == 1) - destination_filename += ".m4v"; - else if (format == 2) destination_filename += ".mkv"; // Now work out the path where the file will be stored. diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index 043436c0..28cec680 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -45,14 +45,9 @@ namespace Handbrake.Functions if (presetQuery.Format != null) { - if (presetQuery.Format == "mp4") + if (presetQuery.Format == "mp4" || presetQuery.Format == "m4v") mainWindow.drop_format.SelectedIndex = 0; - else if (presetQuery.Format == "m4v") - mainWindow.drop_format.SelectedIndex = 1; else if (presetQuery.Format == "mkv") - mainWindow.drop_format.SelectedIndex = 2; - - if (presetQuery.ChapterMarkers && presetQuery.Format == "mp4") mainWindow.drop_format.SelectedIndex = 1; } diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index f6112620..026d297f 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -393,5 +393,17 @@ namespace Handbrake.Properties { this["daysBetweenUpdateCheck"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool useM4v { + get { + return ((bool)(this["useM4v"])); + } + set { + this["useM4v"] = value; + } + } } } diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index 76bf6ca5..834ae32e 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -95,5 +95,8 @@ 5 + + False + \ No newline at end of file diff --git a/win/C#/app.config b/win/C#/app.config index 9a95c030..21a7c3b1 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -100,6 +100,9 @@ 5 + + False + diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index d7b522eb..b93072ab 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -153,12 +153,12 @@ namespace Handbrake this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel(); + this.lbl_updateCheck = new System.Windows.Forms.ToolStripStatusLabel(); this.hbproc = new System.Diagnostics.Process(); this.label1 = new System.Windows.Forms.Label(); this.lbl_source = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.groupBox_output = new System.Windows.Forms.Label(); - this.lbl_updateCheck = new System.Windows.Forms.ToolStripStatusLabel(); this.PictureSettings = new Handbrake.Controls.PictureSettings(); this.Filters = new Handbrake.Controls.Filters(); this.AudioSettings = new Handbrake.Controls.AudioPanel(); @@ -204,7 +204,7 @@ namespace Handbrake // // DVD_Save // - this.DVD_Save.Filter = "mp4|*.mp4|m4v|*.m4v|mkv|*.mkv"; + this.DVD_Save.Filter = "mp4|*.mp4|mkv|*.mkv"; this.DVD_Save.SupportMultiDottedExtensions = true; // // File_Save @@ -484,7 +484,6 @@ namespace Handbrake this.drop_format.FormattingEnabled = true; this.drop_format.Items.AddRange(new object[] { "MP4 File", - "M4V File", "MKV File"}); this.drop_format.Location = new System.Drawing.Point(78, 215); this.drop_format.Name = "drop_format"; @@ -1391,6 +1390,16 @@ namespace Handbrake this.lbl_encode.Size = new System.Drawing.Size(31, 17); this.lbl_encode.Text = "{0}"; // + // lbl_updateCheck + // + this.lbl_updateCheck.BackColor = System.Drawing.Color.Transparent; + this.lbl_updateCheck.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.lbl_updateCheck.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_updateCheck.Name = "lbl_updateCheck"; + this.lbl_updateCheck.Size = new System.Drawing.Size(139, 17); + this.lbl_updateCheck.Text = "Checking for Updates ..."; + this.lbl_updateCheck.Visible = false; + // // hbproc // this.hbproc.StartInfo.Domain = ""; @@ -1441,16 +1450,6 @@ namespace Handbrake this.groupBox_output.TabIndex = 47; this.groupBox_output.Text = "Output Settings: (Preset: None)"; // - // lbl_updateCheck - // - this.lbl_updateCheck.BackColor = System.Drawing.Color.Transparent; - this.lbl_updateCheck.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.lbl_updateCheck.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_updateCheck.Name = "lbl_updateCheck"; - this.lbl_updateCheck.Size = new System.Drawing.Size(139, 17); - this.lbl_updateCheck.Text = "Checking for Updates ..."; - this.lbl_updateCheck.Visible = false; - // // PictureSettings // this.PictureSettings.BackColor = System.Drawing.Color.Transparent; diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 5da52c61..d51f9aa4 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1024,8 +1024,6 @@ namespace Handbrake DVD_Save.FilterIndex = 1; else if (drop_format.SelectedIndex.Equals(1)) DVD_Save.FilterIndex = 2; - else if (drop_format.SelectedIndex.Equals(2)) - DVD_Save.FilterIndex = 3; if (DVD_Save.ShowDialog() == DialogResult.OK) { @@ -1038,13 +1036,12 @@ namespace Handbrake { case 1: if (!Path.GetExtension(DVD_Save.FileName).Equals(".mp4", StringComparison.InvariantCultureIgnoreCase)) - DVD_Save.FileName += ".mp4"; + if (Properties.Settings.Default.useM4v) + DVD_Save.FileName += ".m4v"; + else + DVD_Save.FileName += ".mp4"; break; case 2: - if (!Path.GetExtension(DVD_Save.FileName).Equals(".m4v", StringComparison.InvariantCultureIgnoreCase)) - DVD_Save.FileName += ".m4v"; - break; - case 3: if (!Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase)) DVD_Save.FileName += ".mkv"; break; @@ -1055,20 +1052,18 @@ namespace Handbrake text_destination.Text = DVD_Save.FileName; // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing) - if (Check_ChapterMarkers.Checked) - drop_format.SelectedIndex = 1; + if (Check_ChapterMarkers.Checked && DVD_Save.FilterIndex != 2) + setExtension(".m4v"); } } } private void text_destination_TextChanged(object sender, EventArgs e) { string path = text_destination.Text; - if (path.EndsWith(".mp4")) + if (path.EndsWith(".mp4") || path.EndsWith(".m4v")) drop_format.SelectedIndex = 0; - else if (path.EndsWith(".m4v")) - drop_format.SelectedIndex = 1; else if (path.EndsWith(".mkv")) - drop_format.SelectedIndex = 2; + drop_format.SelectedIndex = 1; } // Output Settings @@ -1077,12 +1072,12 @@ namespace Handbrake switch (drop_format.SelectedIndex) { case 0: - setExtension(".mp4"); + if (Properties.Settings.Default.useM4v) + setExtension(".m4v"); + else + setExtension(".mp4"); break; case 1: - setExtension(".m4v"); - break; - case 2: setExtension(".mkv"); break; } @@ -1273,8 +1268,8 @@ namespace Handbrake { if (Check_ChapterMarkers.Checked) { - if (drop_format.SelectedIndex != 2) - drop_format.SelectedIndex = 1; + if (drop_format.SelectedIndex != 1) + setExtension(".m4v"); data_chpt.Rows.Clear(); data_chpt.Enabled = true; DataGridView chapterGridView = Main.chapterNaming(data_chpt, drop_chapterFinish.Text); @@ -1283,8 +1278,8 @@ namespace Handbrake } else { - if (drop_format.SelectedIndex != 2) - drop_format.SelectedIndex = 0; + if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v) + setExtension(".mp4"); data_chpt.Rows.Clear(); data_chpt.Enabled = false; } diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs index edb2fe5e..5817af67 100644 --- a/win/C#/frmOptions.Designer.cs +++ b/win/C#/frmOptions.Designer.cs @@ -123,6 +123,7 @@ namespace Handbrake this.label26 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label(); this.openFile_vlc = new System.Windows.Forms.OpenFileDialog(); + this.check_m4v = new System.Windows.Forms.CheckBox(); this.tab_options.SuspendLayout(); this.tab_general.SuspendLayout(); this.tab_picture.SuspendLayout(); @@ -180,6 +181,7 @@ namespace Handbrake // // tab_general // + this.tab_general.Controls.Add(this.check_m4v); this.tab_general.Controls.Add(this.label7); this.tab_general.Controls.Add(this.label5); this.tab_general.Controls.Add(this.txt_autoNameFormat); @@ -1210,6 +1212,19 @@ namespace Handbrake this.openFile_vlc.DefaultExt = "exe"; this.openFile_vlc.Filter = "exe|*.exe"; // + // check_m4v + // + this.check_m4v.AutoSize = true; + this.check_m4v.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.check_m4v.Location = new System.Drawing.Point(114, 247); + this.check_m4v.Name = "check_m4v"; + this.check_m4v.Size = new System.Drawing.Size(334, 17); + this.check_m4v.TabIndex = 82; + this.check_m4v.Text = "Use iPod/iTunes friendly (.m4v) file extension for MP4"; + this.ToolTip.SetToolTip(this.check_m4v, "Use .m4v instead of .mp4 for MP4 files"); + this.check_m4v.UseVisualStyleBackColor = true; + this.check_m4v.CheckedChanged += new System.EventHandler(this.check_m4v_CheckedChanged); + // // frmOptions // this.ClientSize = new System.Drawing.Size(521, 413); @@ -1330,5 +1345,6 @@ namespace Handbrake private System.Windows.Forms.Label label31; private System.Windows.Forms.Button btn_viewLogs; private System.Windows.Forms.Button btn_clearLogs; + internal System.Windows.Forms.CheckBox check_m4v; } } \ No newline at end of file diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs index 9aeeb000..d6c9489c 100644 --- a/win/C#/frmOptions.cs +++ b/win/C#/frmOptions.cs @@ -38,7 +38,7 @@ namespace Handbrake // On Encode Completeion Action drp_completeOption.Text = Properties.Settings.Default.CompletionOption; - + // Enable auto naming feature. if (Properties.Settings.Default.autoNaming) check_autoNaming.CheckState = CheckState.Checked; @@ -51,6 +51,10 @@ namespace Handbrake // Store auto name format txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat; + // Use iPod/iTunes friendly .m4v extension for MP4 files. + if (Properties.Settings.Default.useM4v) + check_m4v.CheckState = CheckState.Checked; + // ############################# // Picture Tab // ############################# @@ -174,6 +178,11 @@ namespace Handbrake else Properties.Settings.Default.autoNamePath = text_an_path.Text; } + + private void check_m4v_CheckedChanged(object sender, EventArgs e) + { + Properties.Settings.Default.useM4v = check_m4v.Checked; + } #endregion #region Picture @@ -313,7 +322,7 @@ namespace Handbrake private void check_dvdnav_CheckedChanged(object sender, EventArgs e) { Properties.Settings.Default.dvdnav = check_dvdnav.Checked; - } + } #endregion private void btn_close_Click(object sender, EventArgs e) @@ -321,5 +330,6 @@ namespace Handbrake Properties.Settings.Default.Save(); // Small hack for Vista. Seems to work fine on XP without this this.Close(); } + } } \ No newline at end of file