From 38a608169dbfcc20dff6ea1381de15cc22d88a25 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 16 Oct 2007 18:29:18 +0000 Subject: [PATCH] WinGui: - Some main window tweaks. Some of the window colours were not appearing correctly. (thanks Lant for pointing this out) - Added an exception handler into the queue. See if we can't track down why windows seems to lose track of the process/threads. - Turbo First pass now deselects / disables should a non h264 codec be selected. it also re-enables nicer now. git-svn-id: svn://localhost/HandBrake/trunk@1028 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/frmDvdInfo.Designer.cs | 27 ++++++++-------- win/C#/frmMain.Designer.cs | 73 +++++++++++++++++++++++++++++-------------- win/C#/frmMain.cs | 22 +++++++++---- win/C#/frmQueue.cs | 27 ++++++++-------- 4 files changed, 93 insertions(+), 56 deletions(-) diff --git a/win/C#/frmDvdInfo.Designer.cs b/win/C#/frmDvdInfo.Designer.cs index 696ac989..f07cb6fb 100644 --- a/win/C#/frmDvdInfo.Designer.cs +++ b/win/C#/frmDvdInfo.Designer.cs @@ -43,19 +43,19 @@ namespace Handbrake // this.Label2.AutoSize = true; this.Label2.BackColor = System.Drawing.SystemColors.ControlLight; - this.Label2.Location = new System.Drawing.Point(51, 41); + this.Label2.Location = new System.Drawing.Point(59, 41); this.Label2.Name = "Label2"; - this.Label2.Size = new System.Drawing.Size(279, 13); + this.Label2.Size = new System.Drawing.Size(341, 13); this.Label2.TabIndex = 30; this.Label2.Text = "Handbrake\'s DVD information output in an unparsed form."; // // rtf_dvdInfo // this.rtf_dvdInfo.DetectUrls = false; - this.rtf_dvdInfo.Location = new System.Drawing.Point(16, 70); + this.rtf_dvdInfo.Location = new System.Drawing.Point(19, 70); this.rtf_dvdInfo.Name = "rtf_dvdInfo"; this.rtf_dvdInfo.ReadOnly = true; - this.rtf_dvdInfo.Size = new System.Drawing.Size(515, 365); + this.rtf_dvdInfo.Size = new System.Drawing.Size(600, 365); this.rtf_dvdInfo.TabIndex = 29; this.rtf_dvdInfo.Text = ""; this.ToolTip.SetToolTip(this.rtf_dvdInfo, "Note: If you have not scanned a DVD then this window\r\nwill display the previously" + @@ -68,9 +68,9 @@ namespace Handbrake this.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btn_close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_close.Location = new System.Drawing.Point(421, 452); + this.btn_close.Location = new System.Drawing.Point(491, 452); this.btn_close.Name = "btn_close"; - this.btn_close.Size = new System.Drawing.Size(110, 22); + this.btn_close.Size = new System.Drawing.Size(128, 22); this.btn_close.TabIndex = 28; this.btn_close.TabStop = false; this.btn_close.Text = "Close Window"; @@ -80,9 +80,9 @@ namespace Handbrake // pictureBox1 // this.pictureBox1.Image = global::Handbrake.Properties.Resources.Movies; - this.pictureBox1.Location = new System.Drawing.Point(13, 13); + this.pictureBox1.Location = new System.Drawing.Point(15, 13); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.Size = new System.Drawing.Size(37, 32); this.pictureBox1.TabIndex = 39; this.pictureBox1.TabStop = false; // @@ -90,7 +90,7 @@ namespace Handbrake // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(51, 25); + this.label1.Location = new System.Drawing.Point(59, 25); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(127, 13); this.label1.TabIndex = 40; @@ -103,20 +103,21 @@ namespace Handbrake // frmDvdInfo // this.AcceptButton = this.btn_close; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLight; - this.ClientSize = new System.Drawing.Size(545, 493); + this.ClientSize = new System.Drawing.Size(636, 493); this.Controls.Add(this.label1); this.Controls.Add(this.pictureBox1); this.Controls.Add(this.Label2); this.Controls.Add(this.rtf_dvdInfo); this.Controls.Add(this.btn_close); + this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(553, 520); + this.MaximumSize = new System.Drawing.Size(644, 520); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(553, 506); + this.MinimumSize = new System.Drawing.Size(644, 506); this.Name = "frmDvdInfo"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Media Information"; diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 8cdaf1b3..dba694bc 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -177,10 +177,12 @@ namespace Handbrake this.text_right = new System.Windows.Forms.TextBox(); this.text_left = new System.Windows.Forms.TextBox(); this.advancedOptions = new System.Windows.Forms.TabControl(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.label26 = new System.Windows.Forms.Label(); + this.label25 = new System.Windows.Forms.Label(); this.groupBox_dest = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.tabPage4 = new System.Windows.Forms.TabPage(); Label38 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit(); this.frmMainMenu.SuspendLayout(); @@ -192,10 +194,10 @@ namespace Handbrake this.TabPage3.SuspendLayout(); this.TabPage1.SuspendLayout(); this.advancedOptions.SuspendLayout(); + this.tabPage4.SuspendLayout(); this.groupBox_dest.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.tabPage4.SuspendLayout(); this.SuspendLayout(); // // Label38 @@ -211,7 +213,7 @@ namespace Handbrake // DVD_Save // this.DVD_Save.DefaultExt = "mp4"; - this.DVD_Save.Filter = "mp4|.mp4|m4v|.m4v|avi|.avi|ogm|.ogm|mkv|.mkv"; + this.DVD_Save.Filter = "mp4|*.mp4|m4v|*.m4v|avi|*.avi|ogm|*.ogm|mkv|*.mkv"; // // File_Save // @@ -659,7 +661,7 @@ namespace Handbrake this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.button1.Location = new System.Drawing.Point(8, 13); + this.button1.Location = new System.Drawing.Point(16, 78); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(114, 22); this.button1.TabIndex = 109; @@ -696,7 +698,7 @@ namespace Handbrake // mnu_exit // this.mnu_exit.Name = "mnu_exit"; - this.mnu_exit.Size = new System.Drawing.Size(103, 22); + this.mnu_exit.Size = new System.Drawing.Size(152, 22); this.mnu_exit.Text = "E&xit"; this.mnu_exit.Click += new System.EventHandler(this.mnu_exit_Click); // @@ -1141,7 +1143,7 @@ namespace Handbrake // // btn_eCancel // - this.btn_eCancel.BackColor = System.Drawing.SystemColors.Control; + this.btn_eCancel.BackColor = System.Drawing.SystemColors.ControlLight; this.btn_eCancel.Enabled = false; this.btn_eCancel.FlatAppearance.BorderColor = System.Drawing.Color.Black; this.btn_eCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -1173,7 +1175,6 @@ namespace Handbrake this.TabPage6.Size = new System.Drawing.Size(639, 211); this.TabPage6.TabIndex = 6; this.TabPage6.Text = "Query Editor"; - this.TabPage6.UseVisualStyleBackColor = true; // // btn_copy // @@ -1261,7 +1262,6 @@ namespace Handbrake this.h264Tab.Size = new System.Drawing.Size(639, 211); this.h264Tab.TabIndex = 5; this.h264Tab.Text = "H.264"; - this.h264Tab.UseVisualStyleBackColor = true; // // Label43 // @@ -1350,7 +1350,6 @@ namespace Handbrake this.TabPage2.Size = new System.Drawing.Size(639, 211); this.TabPage2.TabIndex = 3; this.TabPage2.Text = "Audio && Subtitles"; - this.TabPage2.UseVisualStyleBackColor = true; // // Label19 // @@ -1506,7 +1505,6 @@ namespace Handbrake this.TabPage3.Size = new System.Drawing.Size(639, 211); this.TabPage3.TabIndex = 2; this.TabPage3.Text = "Video Settings"; - this.TabPage3.UseVisualStyleBackColor = true; // // check_grayscale // @@ -1634,7 +1632,6 @@ namespace Handbrake this.TabPage1.Size = new System.Drawing.Size(639, 211); this.TabPage1.TabIndex = 0; this.TabPage1.Text = "Picture Settings"; - this.TabPage1.UseVisualStyleBackColor = true; // // lbl_anamorphicError // @@ -1748,13 +1745,14 @@ namespace Handbrake // CheckPixelRatio // this.CheckPixelRatio.AutoSize = true; + this.CheckPixelRatio.BackColor = System.Drawing.SystemColors.ControlLight; this.CheckPixelRatio.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.CheckPixelRatio.Location = new System.Drawing.Point(317, 150); this.CheckPixelRatio.Name = "CheckPixelRatio"; this.CheckPixelRatio.Size = new System.Drawing.Size(121, 17); this.CheckPixelRatio.TabIndex = 50; this.CheckPixelRatio.Text = "Anamorphic PAR"; - this.CheckPixelRatio.UseVisualStyleBackColor = true; + this.CheckPixelRatio.UseVisualStyleBackColor = false; this.CheckPixelRatio.CheckedChanged += new System.EventHandler(this.CheckPixelRatio_CheckedChanged); // // label6 @@ -1918,12 +1916,46 @@ namespace Handbrake this.advancedOptions.TabIndex = 27; this.advancedOptions.TabStop = false; // + // tabPage4 + // + this.tabPage4.BackColor = System.Drawing.SystemColors.ControlLight; + this.tabPage4.Controls.Add(this.label26); + this.tabPage4.Controls.Add(this.label25); + this.tabPage4.Controls.Add(this.button1); + this.tabPage4.Location = new System.Drawing.Point(4, 22); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Size = new System.Drawing.Size(639, 211); + this.tabPage4.TabIndex = 7; + this.tabPage4.Text = "Development"; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label26.Location = new System.Drawing.Point(13, 35); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(372, 26); + this.label26.TabIndex = 130; + this.label26.Text = "This tab is used for testing of new features. You can ignore this.\r\nIt will not b" + + "e a user visible tab on release."; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label25.Location = new System.Drawing.Point(13, 13); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(93, 13); + this.label25.TabIndex = 110; + this.label25.Text = "Development"; + // // groupBox_dest // this.groupBox_dest.Controls.Add(this.Label3); this.groupBox_dest.Controls.Add(this.text_destination); this.groupBox_dest.Controls.Add(this.btn_destBrowse); this.groupBox_dest.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox_dest.ForeColor = System.Drawing.Color.Black; this.groupBox_dest.Location = new System.Drawing.Point(14, 128); this.groupBox_dest.Name = "groupBox_dest"; this.groupBox_dest.Size = new System.Drawing.Size(646, 50); @@ -1935,6 +1967,7 @@ namespace Handbrake // this.groupBox2.Controls.Add(this.ListBox_Presets); this.groupBox2.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox2.ForeColor = System.Drawing.Color.Black; this.groupBox2.Location = new System.Drawing.Point(674, 35); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(193, 404); @@ -1948,6 +1981,7 @@ namespace Handbrake this.groupBox3.Controls.Add(this.btn_setDefault); this.groupBox3.Controls.Add(this.btn_addPreset); this.groupBox3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox3.ForeColor = System.Drawing.Color.Black; this.groupBox3.Location = new System.Drawing.Point(674, 448); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(193, 61); @@ -1955,16 +1989,6 @@ namespace Handbrake this.groupBox3.TabStop = false; this.groupBox3.Text = "Preset Functions"; // - // tabPage4 - // - this.tabPage4.Controls.Add(this.button1); - this.tabPage4.Location = new System.Drawing.Point(4, 22); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(639, 211); - this.tabPage4.TabIndex = 7; - this.tabPage4.Text = "Development"; - this.tabPage4.UseVisualStyleBackColor = true; - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2008,11 +2032,12 @@ namespace Handbrake this.TabPage1.ResumeLayout(false); this.TabPage1.PerformLayout(); this.advancedOptions.ResumeLayout(false); + this.tabPage4.ResumeLayout(false); + this.tabPage4.PerformLayout(); this.groupBox_dest.ResumeLayout(false); this.groupBox_dest.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); - this.tabPage4.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -2170,6 +2195,8 @@ namespace Handbrake internal System.Windows.Forms.Button button1; private System.Windows.Forms.Label lbl_anamorphicError; private System.Windows.Forms.TabPage tabPage4; + internal System.Windows.Forms.Label label26; + internal System.Windows.Forms.Label label25; } } \ No newline at end of file diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index bc8b4864..ecfc2680 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -420,9 +420,16 @@ namespace Handbrake private void btn_destBrowse_Click(object sender, EventArgs e) { + // This removes the file extension from the filename box on the save file dialog. + // It's daft but some users don't realise that typing an extension overrides the dropdown extension selected. + // Should be a nicer way to do this. + DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", "").Replace(".m4v", "").Replace(".mkv", "").Replace(".ogm", "").Replace(".avi", ""); + + // Show the dialog and set the main form file path DVD_Save.ShowDialog(); 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) { string destination = text_destination.Text; @@ -1191,7 +1198,7 @@ namespace Handbrake text_height.Text = ""; text_width.BackColor = Color.White; text_height.BackColor = Color.White; - CheckPixelRatio.BackColor = frmMain.DefaultBackColor; + CheckPixelRatio.BackColor = TabPage1.BackColor; lbl_anamorphicError.Visible = false; } @@ -1199,7 +1206,10 @@ namespace Handbrake { if (check_2PassEncode.CheckState.ToString() == "Checked") { - check_turbo.Enabled = true; + if (drp_videoEncoder.Text.Contains("H.264")) + { + check_turbo.Enabled = true; + } } else { @@ -1345,7 +1355,10 @@ namespace Handbrake else { CheckCRF.Enabled = true; - check_turbo.Enabled = true; + if (check_2PassEncode.CheckState.ToString() == "Checked") + { + check_turbo.Enabled = true; + } h264Tab.Enabled = true; } @@ -1802,9 +1815,6 @@ namespace Handbrake MessageBox.Show(thisQuery.DeTelecine.ToString()); } - - - // This is the END of the road ------------------------------------------------------------------------------ } } diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 4690b51d..117bb147 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -24,13 +24,20 @@ namespace Handbrake private void btn_q_encoder_Click(object sender, EventArgs e) { - if (list_queue.Items.Count != 0) + try + { + if (list_queue.Items.Count != 0) + { + progressBar.Value = 0; + lbl_progressValue.Text = "0 %"; + progressBar.Step = 100 / list_queue.Items.Count; + progressBar.Update(); + ThreadPool.QueueUserWorkItem(startProc); + } + } + catch (Exception exc) { - progressBar.Value = 0; - lbl_progressValue.Text = "0 %"; - progressBar.Step = 100 / list_queue.Items.Count; - progressBar.Update(); - ThreadPool.QueueUserWorkItem(startProc); + MessageBox.Show(exc.ToString()); } } @@ -161,20 +168,12 @@ namespace Handbrake } #endregion - #region Window Management private void btn_Close_Click(object sender, EventArgs e) { this.Hide(); } - private void btn_minimise_Click(object sender, EventArgs e) - { - this.WindowState = FormWindowState.Minimized; - } - - #endregion - protected override void OnClosing(CancelEventArgs e) { e.Cancel = true; -- 2.11.0