diff options
author | sr55 <[email protected]> | 2011-07-31 18:57:31 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-07-31 18:57:31 +0000 |
commit | 7f0a86bd7811b82cb5b086ea960ef7ccc054d3bd (patch) | |
tree | a3c87cb0a2054d7b1362e13d70c26af305f51cf2 | |
parent | 0ec1780ee70bb9e1270aaaa7cf1fcc40e78a0aa8 (diff) |
WinGui: Usability Improvements on the Audio and Subtitle tabs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4145 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/Controls/AudioPanel.Designer.cs | 56 | ||||
-rw-r--r-- | win/CS/Controls/AudioPanel.cs | 28 | ||||
-rw-r--r-- | win/CS/Controls/AudioPanel.resx | 6 | ||||
-rw-r--r-- | win/CS/Controls/Subtitles.Designer.cs | 123 | ||||
-rw-r--r-- | win/CS/Controls/Subtitles.cs | 126 | ||||
-rw-r--r-- | win/CS/Controls/Subtitles.resx | 12 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/ScanService.cs | 4 | ||||
-rw-r--r-- | win/CS/Settings.StyleCop | 28 |
8 files changed, 269 insertions, 114 deletions
diff --git a/win/CS/Controls/AudioPanel.Designer.cs b/win/CS/Controls/AudioPanel.Designer.cs index 9c7e37c5e..6b2a0ad5f 100644 --- a/win/CS/Controls/AudioPanel.Designer.cs +++ b/win/CS/Controls/AudioPanel.Designer.cs @@ -42,7 +42,6 @@ namespace Handbrake.Controls this.audioList_MoveToBottom = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.audioList_remove = new System.Windows.Forms.ToolStripMenuItem();
- this.btn_RemoveAudioTrack = new System.Windows.Forms.Button();
this.label68 = new System.Windows.Forms.Label();
this.drp_audioEncoder = new System.Windows.Forms.ComboBox();
this.drp_audioMix = new System.Windows.Forms.ComboBox();
@@ -63,9 +62,13 @@ namespace Handbrake.Controls this.btn_addAudioTrack = new wyDay.Controls.SplitButton();
this.AddTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnu_AddAll = new System.Windows.Forms.ToolStripMenuItem();
+ this.btn_RemoveTrack = new wyDay.Controls.SplitButton();
+ this.RemoveTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
this.audioMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.audioList)).BeginInit();
this.AddTrackMenu.SuspendLayout();
+ this.RemoveTrackMenu.SuspendLayout();
this.SuspendLayout();
//
// audioMenu
@@ -121,19 +124,6 @@ namespace Handbrake.Controls this.audioList_remove.Text = "Remove";
this.audioList_remove.Click += new System.EventHandler(this.AudioList_remove_Click);
//
- // btn_RemoveAudioTrack
- //
- this.btn_RemoveAudioTrack.BackColor = System.Drawing.Color.Transparent;
- this.btn_RemoveAudioTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_RemoveAudioTrack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_RemoveAudioTrack.Location = new System.Drawing.Point(114, 37);
- this.btn_RemoveAudioTrack.Name = "btn_RemoveAudioTrack";
- this.btn_RemoveAudioTrack.Size = new System.Drawing.Size(71, 23);
- this.btn_RemoveAudioTrack.TabIndex = 64;
- this.btn_RemoveAudioTrack.Text = "Remove";
- this.btn_RemoveAudioTrack.UseVisualStyleBackColor = false;
- this.btn_RemoveAudioTrack.Click += new System.EventHandler(this.RemoveAudioTrack_Click);
- //
// label68
//
this.label68.AutoSize = true;
@@ -380,10 +370,39 @@ namespace Handbrake.Controls // mnu_AddAll
//
this.mnu_AddAll.Name = "mnu_AddAll";
- this.mnu_AddAll.Size = new System.Drawing.Size(152, 22);
+ this.mnu_AddAll.Size = new System.Drawing.Size(113, 22);
this.mnu_AddAll.Text = "Add All";
this.mnu_AddAll.Click += new System.EventHandler(this.mnu_AddAll_Click);
//
+ // btn_RemoveTrack
+ //
+ this.btn_RemoveTrack.AutoSize = true;
+ this.btn_RemoveTrack.ContextMenuStrip = this.RemoveTrackMenu;
+ this.btn_RemoveTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_RemoveTrack.ForeColor = System.Drawing.Color.DarkOrange;
+ this.btn_RemoveTrack.Location = new System.Drawing.Point(114, 37);
+ this.btn_RemoveTrack.Name = "btn_RemoveTrack";
+ this.btn_RemoveTrack.Size = new System.Drawing.Size(82, 23);
+ this.btn_RemoveTrack.SplitMenuStrip = this.RemoveTrackMenu;
+ this.btn_RemoveTrack.TabIndex = 73;
+ this.btn_RemoveTrack.Text = "Remove";
+ this.btn_RemoveTrack.UseVisualStyleBackColor = true;
+ this.btn_RemoveTrack.Click += new System.EventHandler(this.Btn_remove_track_click);
+ //
+ // RemoveTrackMenu
+ //
+ this.RemoveTrackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnu_ClearAll});
+ this.RemoveTrackMenu.Name = "audioMenu";
+ this.RemoveTrackMenu.Size = new System.Drawing.Size(119, 26);
+ //
+ // mnu_ClearAll
+ //
+ this.mnu_ClearAll.Name = "mnu_ClearAll";
+ this.mnu_ClearAll.Size = new System.Drawing.Size(152, 22);
+ this.mnu_ClearAll.Text = "Clear All";
+ this.mnu_ClearAll.Click += new System.EventHandler(this.Mnu_clear_all_click);
+ //
// AudioPanel
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
@@ -391,19 +410,20 @@ namespace Handbrake.Controls this.Controls.Add(this.drp_audioTrack);
this.Controls.Add(this.btn_AdvancedAudio);
this.Controls.Add(this.drp_audioSample);
+ this.Controls.Add(this.btn_RemoveTrack);
this.Controls.Add(this.audioList);
this.Controls.Add(this.label68);
this.Controls.Add(this.btn_addAudioTrack);
this.Controls.Add(this.drp_audioBitrate);
this.Controls.Add(this.drp_audioMix);
this.Controls.Add(this.drp_audioEncoder);
- this.Controls.Add(this.btn_RemoveAudioTrack);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "AudioPanel";
this.Size = new System.Drawing.Size(720, 310);
this.audioMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.audioList)).EndInit();
this.AddTrackMenu.ResumeLayout(false);
+ this.RemoveTrackMenu.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -411,7 +431,6 @@ namespace Handbrake.Controls #endregion
- private System.Windows.Forms.Button btn_RemoveAudioTrack;
internal System.Windows.Forms.Label label68;
internal System.Windows.Forms.ComboBox drp_audioEncoder;
internal System.Windows.Forms.ComboBox drp_audioMix;
@@ -439,5 +458,8 @@ namespace Handbrake.Controls private wyDay.Controls.SplitButton btn_addAudioTrack;
private System.Windows.Forms.ContextMenuStrip AddTrackMenu;
private System.Windows.Forms.ToolStripMenuItem mnu_AddAll;
+ private wyDay.Controls.SplitButton btn_RemoveTrack;
+ private System.Windows.Forms.ContextMenuStrip RemoveTrackMenu;
+ private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll;
}
}
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index fe56bfbdd..338cbb550 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -460,15 +460,15 @@ namespace Handbrake.Controls }
/// <summary>
- /// The Remove Track button event handler
+ /// Remove an Audio Track
/// </summary>
/// <param name="sender">
- /// The sender.
+ /// The Sender
/// </param>
/// <param name="e">
- /// The e.
+ /// The Event Args
/// </param>
- private void RemoveAudioTrack_Click(object sender, EventArgs e)
+ private void Btn_remove_track_click(object sender, EventArgs e)
{
RemoveTrack();
@@ -479,6 +479,20 @@ namespace Handbrake.Controls }
}
+ /// <summary>
+ /// Clear all audio tracks
+ /// </summary>
+ /// <param name="sender">
+ /// The Sender
+ /// </param>
+ /// <param name="e">
+ /// The Event Args
+ /// </param>
+ private void Mnu_clear_all_click(object sender, EventArgs e)
+ {
+ this.ClearAudioList();
+ }
+
#endregion
#region Audio List Menu
@@ -617,7 +631,7 @@ namespace Handbrake.Controls if (!elementFound)
mode = 2;
}
-
+
switch (mode)
{
case 1: // Adding all audio tracks
@@ -672,6 +686,8 @@ namespace Handbrake.Controls {
this.AudioTracks.Clear();
+ drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;
+
if (this.AudioListChanged != null)
this.AudioListChanged(this, new EventArgs());
}
@@ -782,7 +798,7 @@ namespace Handbrake.Controls case "AAC (ffmpeg)":
max = drp_audioMix.Text.Contains("6 Channel") ? 768 : 320;
defaultRate = "160";
- break;
+ break;
case "MP3 (lame)":
max = 320;
defaultRate = "160";
diff --git a/win/CS/Controls/AudioPanel.resx b/win/CS/Controls/AudioPanel.resx index f6e59c9fa..79c291869 100644 --- a/win/CS/Controls/AudioPanel.resx +++ b/win/CS/Controls/AudioPanel.resx @@ -147,7 +147,13 @@ <metadata name="Gain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+ <metadata name="ToolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>330, 16</value>
+ </metadata>
<metadata name="AddTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>427, 16</value>
</metadata>
+ <metadata name="RemoveTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>561, 16</value>
+ </metadata>
</root>
\ No newline at end of file diff --git a/win/CS/Controls/Subtitles.Designer.cs b/win/CS/Controls/Subtitles.Designer.cs index 606c7c877..e8e70cf51 100644 --- a/win/CS/Controls/Subtitles.Designer.cs +++ b/win/CS/Controls/Subtitles.Designer.cs @@ -29,8 +29,6 @@ private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- this.btn_addTrack = new System.Windows.Forms.Button();
- this.btn_RemoveSubTrack = new System.Windows.Forms.Button();
this.lv_subList = new System.Windows.Forms.ListView();
this.col_Source = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.col_forced = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@@ -55,37 +53,19 @@ this.btn_srtAdd = new System.Windows.Forms.Button();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ this.btn_addSubtitleTrack = new wyDay.Controls.SplitButton();
+ this.SubtitleTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.mnu_AddAll = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_AddAllCC = new System.Windows.Forms.ToolStripMenuItem();
+ this.SubtitleRemoveButtonMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
+ this.btn_RemoveTrack = new wyDay.Controls.SplitButton();
this.subMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.srt_offset)).BeginInit();
+ this.SubtitleTrackMenu.SuspendLayout();
+ this.SubtitleRemoveButtonMenu.SuspendLayout();
this.SuspendLayout();
//
- // btn_addTrack
- //
- this.btn_addTrack.BackColor = System.Drawing.Color.Transparent;
- this.btn_addTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_addTrack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_addTrack.Location = new System.Drawing.Point(16, 38);
- this.btn_addTrack.Name = "btn_addTrack";
- this.btn_addTrack.Size = new System.Drawing.Size(57, 23);
- this.btn_addTrack.TabIndex = 68;
- this.btn_addTrack.Text = "Add";
- this.toolTip.SetToolTip(this.btn_addTrack, "Add a new subtitle track to the list below");
- this.btn_addTrack.UseVisualStyleBackColor = false;
- this.btn_addTrack.Click += new System.EventHandler(this.BtnAddSubTrackClick);
- //
- // btn_RemoveSubTrack
- //
- this.btn_RemoveSubTrack.BackColor = System.Drawing.Color.Transparent;
- this.btn_RemoveSubTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_RemoveSubTrack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_RemoveSubTrack.Location = new System.Drawing.Point(79, 38);
- this.btn_RemoveSubTrack.Name = "btn_RemoveSubTrack";
- this.btn_RemoveSubTrack.Size = new System.Drawing.Size(73, 23);
- this.btn_RemoveSubTrack.TabIndex = 69;
- this.btn_RemoveSubTrack.Text = "Remove";
- this.btn_RemoveSubTrack.UseVisualStyleBackColor = false;
- this.btn_RemoveSubTrack.Click += new System.EventHandler(this.BtnRemoveSubTrackClick);
- //
// lv_subList
//
this.lv_subList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
@@ -316,7 +296,7 @@ this.btn_srtAdd.BackColor = System.Drawing.Color.Transparent;
this.btn_srtAdd.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_srtAdd.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_srtAdd.Location = new System.Drawing.Point(158, 38);
+ this.btn_srtAdd.Location = new System.Drawing.Point(179, 38);
this.btn_srtAdd.Name = "btn_srtAdd";
this.btn_srtAdd.Size = new System.Drawing.Size(88, 23);
this.btn_srtAdd.TabIndex = 73;
@@ -330,27 +310,95 @@ this.openFileDialog.DefaultExt = "srt";
this.openFileDialog.Filter = "SRT Files |*.srt";
//
+ // btn_addSubtitleTrack
+ //
+ this.btn_addSubtitleTrack.AutoSize = true;
+ this.btn_addSubtitleTrack.ContextMenuStrip = this.SubtitleTrackMenu;
+ this.btn_addSubtitleTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_addSubtitleTrack.ForeColor = System.Drawing.Color.DarkOrange;
+ this.btn_addSubtitleTrack.Location = new System.Drawing.Point(16, 38);
+ this.btn_addSubtitleTrack.Name = "btn_addSubtitleTrack";
+ this.btn_addSubtitleTrack.Size = new System.Drawing.Size(69, 23);
+ this.btn_addSubtitleTrack.SplitMenuStrip = this.SubtitleTrackMenu;
+ this.btn_addSubtitleTrack.TabIndex = 80;
+ this.btn_addSubtitleTrack.Text = "Add";
+ this.btn_addSubtitleTrack.UseVisualStyleBackColor = true;
+ this.btn_addSubtitleTrack.Click += new System.EventHandler(this.btn_addSubtitleTrack_Click);
+ //
+ // SubtitleTrackMenu
+ //
+ this.SubtitleTrackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnu_AddAll,
+ this.mnu_AddAllCC});
+ this.SubtitleTrackMenu.Name = "audioMenu";
+ this.SubtitleTrackMenu.Size = new System.Drawing.Size(196, 48);
+ //
+ // mnu_AddAll
+ //
+ this.mnu_AddAll.Name = "mnu_AddAll";
+ this.mnu_AddAll.Size = new System.Drawing.Size(195, 22);
+ this.mnu_AddAll.Text = "Add All";
+ this.mnu_AddAll.Click += new System.EventHandler(this.mnu_AddAll_Click);
+ //
+ // mnu_AddAllCC
+ //
+ this.mnu_AddAllCC.Name = "mnu_AddAllCC";
+ this.mnu_AddAllCC.Size = new System.Drawing.Size(195, 22);
+ this.mnu_AddAllCC.Text = "Add all Closed Caption";
+ this.mnu_AddAllCC.Click += new System.EventHandler(this.mnu_AddAllCC_Click);
+ //
+ // SubtitleRemoveButtonMenu
+ //
+ this.SubtitleRemoveButtonMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnu_ClearAll});
+ this.SubtitleRemoveButtonMenu.Name = "audioMenu";
+ this.SubtitleRemoveButtonMenu.Size = new System.Drawing.Size(153, 48);
+ //
+ // mnu_ClearAll
+ //
+ this.mnu_ClearAll.Name = "mnu_ClearAll";
+ this.mnu_ClearAll.Size = new System.Drawing.Size(152, 22);
+ this.mnu_ClearAll.Text = "Clear All";
+ this.mnu_ClearAll.Click += new System.EventHandler(this.mnu_ClearAll_Click);
+ //
+ // btn_RemoveTrack
+ //
+ this.btn_RemoveTrack.AutoSize = true;
+ this.btn_RemoveTrack.ContextMenuStrip = this.SubtitleRemoveButtonMenu;
+ this.btn_RemoveTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_RemoveTrack.ForeColor = System.Drawing.Color.DarkOrange;
+ this.btn_RemoveTrack.Location = new System.Drawing.Point(91, 38);
+ this.btn_RemoveTrack.Name = "btn_RemoveTrack";
+ this.btn_RemoveTrack.Size = new System.Drawing.Size(82, 23);
+ this.btn_RemoveTrack.SplitMenuStrip = this.SubtitleRemoveButtonMenu;
+ this.btn_RemoveTrack.TabIndex = 82;
+ this.btn_RemoveTrack.Text = "Remove";
+ this.btn_RemoveTrack.UseVisualStyleBackColor = true;
+ this.btn_RemoveTrack.Click += new System.EventHandler(this.btn_RemoveTrack_Click);
+ //
// Subtitles
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.drp_subtitleTracks);
this.Controls.Add(this.srt_offset);
- this.Controls.Add(this.btn_addTrack);
this.Controls.Add(this.srt_lang);
+ this.Controls.Add(this.btn_RemoveTrack);
this.Controls.Add(this.srt_charcode);
+ this.Controls.Add(this.btn_addSubtitleTrack);
this.Controls.Add(this.label68);
- this.Controls.Add(this.btn_RemoveSubTrack);
this.Controls.Add(this.lv_subList);
- this.Controls.Add(this.btn_srtAdd);
this.Controls.Add(this.check_forced);
this.Controls.Add(this.check_burned);
this.Controls.Add(this.check_default);
+ this.Controls.Add(this.btn_srtAdd);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "Subtitles";
this.Size = new System.Drawing.Size(719, 300);
this.subMenu.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.srt_offset)).EndInit();
+ this.SubtitleTrackMenu.ResumeLayout(false);
+ this.SubtitleRemoveButtonMenu.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -358,8 +406,6 @@ #endregion
- private System.Windows.Forms.Button btn_RemoveSubTrack;
- private System.Windows.Forms.Button btn_addTrack;
internal System.Windows.Forms.ListView lv_subList;
private System.Windows.Forms.ColumnHeader col_Source;
private System.Windows.Forms.ColumnHeader col_forced;
@@ -384,5 +430,12 @@ internal System.Windows.Forms.ComboBox drp_subtitleTracks;
private System.Windows.Forms.ColumnHeader col_srtLang;
private System.Windows.Forms.ToolTip toolTip;
+ private wyDay.Controls.SplitButton btn_addSubtitleTrack;
+ private System.Windows.Forms.ContextMenuStrip SubtitleTrackMenu;
+ private System.Windows.Forms.ToolStripMenuItem mnu_AddAll;
+ private System.Windows.Forms.ToolStripMenuItem mnu_AddAllCC;
+ private System.Windows.Forms.ContextMenuStrip SubtitleRemoveButtonMenu;
+ private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll;
+ private wyDay.Controls.SplitButton btn_RemoveTrack;
}
}
diff --git a/win/CS/Controls/Subtitles.cs b/win/CS/Controls/Subtitles.cs index 1c8bef8cc..578eda4dc 100644 --- a/win/CS/Controls/Subtitles.cs +++ b/win/CS/Controls/Subtitles.cs @@ -254,13 +254,13 @@ namespace Handbrake.Controls for (int i = 1; i < drp_subtitleTracks.Items.Count; i++)
{
drp_subtitleTracks.SelectedIndex = i;
- this.BtnAddSubTrackClick(this, new EventArgs());
+ this.btn_addSubtitleTrack_Click(this, new EventArgs());
}
break;
case 2: // Adding only the first Audio Track
drp_subtitleTracks.SelectedIndex = 1;
if (drp_subtitleTracks.SelectedItem != null)
- this.BtnAddSubTrackClick(this, new EventArgs());
+ this.btn_addSubtitleTrack_Click(this, new EventArgs());
break;
case 3:
foreach (string item in languageOrder)
@@ -272,7 +272,7 @@ namespace Handbrake.Controls drp_subtitleTracks.SelectedIndex = i;
if (drp_subtitleTracks.SelectedItem != null)
{
- this.BtnAddSubTrackClick(this, new EventArgs());
+ this.btn_addSubtitleTrack_Click(this, new EventArgs());
//subList.ClearSelection();
}
}
@@ -287,7 +287,7 @@ namespace Handbrake.Controls drp_subtitleTracks.SelectedIndex = i;
if (drp_subtitleTracks.SelectedItem != null)
{
- this.BtnAddSubTrackClick(this, new EventArgs());
+ this.btn_addSubtitleTrack_Click(this, new EventArgs());
//subList.ClearSelection();
}
}
@@ -306,7 +306,7 @@ namespace Handbrake.Controls if (item.ToString().Contains("Closed"))
{
drp_subtitleTracks.SelectedItem = item;
- BtnAddSubTrackClick(this, EventArgs.Empty);
+ btn_addSubtitleTrack_Click(this, EventArgs.Empty);
}
}
}
@@ -326,15 +326,15 @@ namespace Handbrake.Controls #region Primary Controls
/// <summary>
- /// Add a Subtitle track.
+ /// Add a subtitle Track
/// </summary>
/// <param name="sender">
- /// The sender.
+ /// The Sender
/// </param>
/// <param name="e">
- /// The e.
+ /// The Event Args
/// </param>
- private void BtnAddSubTrackClick(object sender, EventArgs e)
+ private void btn_addSubtitleTrack_Click(object sender, EventArgs e)
{
if (drp_subtitleTracks.SelectedItem == null)
{
@@ -372,23 +372,95 @@ namespace Handbrake.Controls : drp_subtitleTracks.SelectedItem.ToString();
SubtitleTrack track = new SubtitleTrack
- {
- Track = trackName,
- Forced = check_forced.Checked,
- Burned = check_burned.Checked,
- Default = check_default.Checked,
- SrtLang = srtLangVal,
- SrtCharCode = srtCode,
- SrtOffset = srtOffsetMs,
- SrtPath = srtPath,
- SrtFileName = srtFile
- };
+ {
+ Track = trackName,
+ Forced = check_forced.Checked,
+ Burned = check_burned.Checked,
+ Default = check_default.Checked,
+ SrtLang = srtLangVal,
+ SrtCharCode = srtCode,
+ SrtOffset = srtOffsetMs,
+ SrtPath = srtPath,
+ SrtFileName = srtFile
+ };
lv_subList.Items.Add(track.ListView);
subList.Add(track);
}
/// <summary>
+ /// Add all audio tracks.
+ /// </summary>
+ /// <param name="sender">
+ /// The Sender
+ /// </param>
+ /// <param name="e">
+ /// The Event Args
+ /// </param>
+ private void mnu_AddAll_Click(object sender, EventArgs e)
+ {
+ // TODO - Might need to be a bit more clever with this. Will wait and see if this causes any problems.
+ foreach (object item in drp_subtitleTracks.Items)
+ {
+ if (!item.ToString().Contains("Foreign Audio Search"))
+ {
+ drp_subtitleTracks.SelectedItem = item;
+ btn_addSubtitleTrack_Click(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Add all closed caption tracks
+ /// </summary>
+ /// <param name="sender">
+ /// The Sender
+ /// </param>
+ /// <param name="e">
+ /// The Event Args
+ /// </param>
+ private void mnu_AddAllCC_Click(object sender, EventArgs e)
+ {
+ foreach (object item in drp_subtitleTracks.Items)
+ {
+ if (item.ToString().Contains("Closed"))
+ {
+ drp_subtitleTracks.SelectedItem = item;
+ btn_addSubtitleTrack_Click(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Clear all tracks.
+ /// </summary>
+ /// <param name="sender">
+ /// The Sender
+ /// </param>
+ /// <param name="e">
+ /// The Event Args
+ /// </param>
+ private void mnu_ClearAll_Click(object sender, EventArgs e)
+ {
+ lv_subList.Items.Clear();
+ subList.Clear();
+ }
+
+ /// <summary>
+ /// Remvoe a track
+ /// </summary>
+ /// <param name="sender">
+ /// The Sender
+ /// </param>
+ /// <param name="e">
+ /// The Event Args
+ /// </param>
+ private void btn_RemoveTrack_Click(object sender, EventArgs e)
+ {
+ this.RemoveSelectedTrack();
+ }
+
+ /// <summary>
/// Import an SRT Subtitle Track
/// </summary>
/// <param name="sender">
@@ -418,20 +490,6 @@ namespace Handbrake.Controls }
/// <summary>
- /// Remove a subtitle track
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void BtnRemoveSubTrackClick(object sender, EventArgs e)
- {
- this.RemoveSelectedTrack();
- }
-
- /// <summary>
/// The Subtitle List selected index has changed
/// </summary>
/// <param name="sender">
diff --git a/win/CS/Controls/Subtitles.resx b/win/CS/Controls/Subtitles.resx index dee1e5718..e492eea54 100644 --- a/win/CS/Controls/Subtitles.resx +++ b/win/CS/Controls/Subtitles.resx @@ -117,16 +117,22 @@ <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>237, 17</value>
- </metadata>
<metadata name="subMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
+ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>237, 17</value>
+ </metadata>
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>113, 17</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 17</value>
</metadata>
+ <metadata name="SubtitleTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>317, 20</value>
+ </metadata>
+ <metadata name="SubtitleRemoveButtonMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>471, 20</value>
+ </metadata>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index ace330c42..3c2a736e8 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -206,6 +206,7 @@ namespace HandBrake.ApplicationServices.Services // Quick fix for "F:\\" style paths. Just get rid of the \\ so the CLI doesn't fall over.
// Sould probably clean up the escaping of the strings later.
string source = sourcePath.ToString().EndsWith("\\") ? sourcePath.ToString() : "\"" + sourcePath + "\"";
+ string query = string.Format(@" -i {0} -t{1} {2} -v ", source, title, extraArguments);
this.hbProc = new Process
{
@@ -234,7 +235,10 @@ namespace HandBrake.ApplicationServices.Services if (this.readData.Buffer.Length < 100000000)
{
scanLog.WriteLine(GeneralUtilities.CreateCliLogHeader());
+ scanLog.WriteLine(query);
scanLog.Write(this.readData.Buffer);
+
+ this.logBuffer.AppendLine(query);
this.logBuffer.AppendLine(this.readData.Buffer.ToString());
}
else
diff --git a/win/CS/Settings.StyleCop b/win/CS/Settings.StyleCop index a9622d880..60e05fd02 100644 --- a/win/CS/Settings.StyleCop +++ b/win/CS/Settings.StyleCop @@ -1,24 +1,19 @@ -<StyleCopSettings Version="4.3">
+<StyleCopSettings Version="105">
<Parsers>
- <Parser ParserId="Microsoft.StyleCop.CSharp.CsParser">
+ <Parser ParserId="StyleCop.CSharp.CsParser">
<ParserSettings>
<BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty>
</ParserSettings>
</Parser>
</Parsers>
<Analyzers>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.DocumentationRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="PropertyDocumentationMustHaveValueText">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="DocumentationTextMustMeetMinimumCharacterLength">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
<Rule Name="DocumentationTextMustContainWhitespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
@@ -59,18 +54,13 @@ <BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
- <Rule Name="ElementsMustBeDocumented">
- <RuleSettings>
- <BooleanProperty Name="Enabled">False</BooleanProperty>
- </RuleSettings>
- </Rule>
</Rules>
<AnalyzerSettings>
<StringProperty Name="CompanyName">HandBrake Project (http://handbrake.fr)</StringProperty>
<StringProperty Name="Copyright">This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.</StringProperty>
</AnalyzerSettings>
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.MaintainabilityRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="StatementMustNotUseUnnecessaryParenthesis">
<RuleSettings>
@@ -95,7 +85,7 @@ </Rules>
<AnalyzerSettings />
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.SpacingRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="OpeningCurlyBracketsMustBeSpacedCorrectly">
<RuleSettings>
@@ -115,7 +105,7 @@ </Rules>
<AnalyzerSettings />
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.LayoutRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="SingleLineCommentsMustNotBeFollowedByBlankLine">
<RuleSettings>
@@ -145,7 +135,7 @@ </Rules>
<AnalyzerSettings />
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.ReadabilityRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="BlockStatementsMustNotContainEmbeddedComments">
<RuleSettings>
@@ -190,7 +180,7 @@ </Rules>
<AnalyzerSettings />
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.NamingRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
<Rule Name="FieldNamesMustNotUseHungarianNotation">
<RuleSettings>
@@ -215,7 +205,7 @@ </Rules>
<AnalyzerSettings />
</Analyzer>
- <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.OrderingRules">
+ <Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
|