summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-07-17 15:22:07 +0000
committersr55 <[email protected]>2009-07-17 15:22:07 +0000
commita8acbe50c4fef4efd39d83e8052f1012fae7232a (patch)
tree0d87d8041fb84248c45325ee47f9616f6f16becb /win/C#/Controls
parent69faa2de07f1d0e488830ebec3fcc9b52fad6b99 (diff)
WinGui:
- Option to set an External SRT as default. - Import preset now adds the preset to the preset list. Includes a few UI/QueryGenerator.cs fixes for this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2703 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/Subtitles.Designer.cs20
-rw-r--r--win/C#/Controls/Subtitles.cs25
2 files changed, 40 insertions, 5 deletions
diff --git a/win/C#/Controls/Subtitles.Designer.cs b/win/C#/Controls/Subtitles.Designer.cs
index bbef36333..26584ec99 100644
--- a/win/C#/Controls/Subtitles.Designer.cs
+++ b/win/C#/Controls/Subtitles.Designer.cs
@@ -65,6 +65,7 @@
this.srt_lang = new System.Windows.Forms.ComboBox();
this.btn_srtAdd = new System.Windows.Forms.Button();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
+ this.check_default_srt = new System.Windows.Forms.CheckBox();
this.SubTitlesGroup.SuspendLayout();
this.subMenu.SuspendLayout();
this.tabControl1.SuspendLayout();
@@ -311,6 +312,7 @@
// SRTGroup
//
this.SRTGroup.BackColor = System.Drawing.Color.Transparent;
+ this.SRTGroup.Controls.Add(this.check_default_srt);
this.SRTGroup.Controls.Add(this.srt_offset);
this.SRTGroup.Controls.Add(this.label5);
this.SRTGroup.Controls.Add(this.srt_browse);
@@ -338,7 +340,7 @@
// label5
//
this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(486, 23);
+ this.label5.Location = new System.Drawing.Point(555, 23);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(27, 13);
this.label5.TabIndex = 78;
@@ -349,9 +351,9 @@
this.srt_browse.BackColor = System.Drawing.Color.Transparent;
this.srt_browse.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.srt_browse.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.srt_browse.Location = new System.Drawing.Point(519, 18);
+ this.srt_browse.Location = new System.Drawing.Point(588, 18);
this.srt_browse.Name = "srt_browse";
- this.srt_browse.Size = new System.Drawing.Size(111, 23);
+ this.srt_browse.Size = new System.Drawing.Size(67, 23);
this.srt_browse.TabIndex = 77;
this.srt_browse.Text = "Browse";
this.srt_browse.UseVisualStyleBackColor = false;
@@ -454,6 +456,17 @@
this.openFileDialog.DefaultExt = "srt";
this.openFileDialog.Filter = "SRT Files |*.srt";
//
+ // check_default_srt
+ //
+ this.check_default_srt.AutoSize = true;
+ this.check_default_srt.Location = new System.Drawing.Point(470, 22);
+ this.check_default_srt.Name = "check_default_srt";
+ this.check_default_srt.Size = new System.Drawing.Size(61, 17);
+ this.check_default_srt.TabIndex = 80;
+ this.check_default_srt.Text = "Default";
+ this.check_default_srt.UseVisualStyleBackColor = true;
+ this.check_default_srt.CheckedChanged += new System.EventHandler(this.check_default_srt_CheckedChanged);
+ //
// Subtitles
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -519,5 +532,6 @@
internal System.Windows.Forms.ComboBox srt_lang;
private System.Windows.Forms.NumericUpDown srt_offset;
private System.Windows.Forms.OpenFileDialog openFileDialog;
+ private System.Windows.Forms.CheckBox check_default_srt;
}
}
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index 48a6f3c7a..c785cdeb6 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -103,12 +103,19 @@ namespace Handbrake.Controls
}
private void btn_srtAdd_Click(object sender, EventArgs e)
{
+ string defaultSub = "No";
+ if (check_default_srt.Checked)
+ {
+ defaultSub = "Yes";
+ setNoDefault();
+ }
+
ListViewItem newTrack = new ListViewItem(getNewID().ToString());
newTrack.SubItems.Add(srt_lang.SelectedItem + ", (" + srt_charcode.SelectedItem + ")");
newTrack.SubItems.Add("No");
newTrack.SubItems.Add("No");
- newTrack.SubItems.Add("No");
+ newTrack.SubItems.Add(defaultSub);
if (openFileDialog.FileName != null)
newTrack.SubItems.Add(openFileDialog.FileName);
else
@@ -138,6 +145,8 @@ namespace Handbrake.Controls
int.TryParse(lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[6].Text, out offsetVal);
srt_offset.Value = offsetVal;
+ check_default_srt.CheckState = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[4].Text == "Yes" ? CheckState.Checked : CheckState.Unchecked;
+
SRTGroup.Text = "Selected Track: " + lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text;
SubTitlesGroup.Text = "Selected Track: None";
}
@@ -154,7 +163,7 @@ namespace Handbrake.Controls
drp_subtitleTracks.SelectedItem = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[1];
check_forced.CheckState = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[2].Text == "Yes" ? CheckState.Checked : CheckState.Unchecked;
- check_burned.CheckState = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text == "Yes" ? CheckState.Checked : CheckState.Unchecked;
+ check_burned.CheckState = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text == "Yes" ? CheckState.Checked : CheckState.Unchecked;
check_default.CheckState = lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[4].Text == "Yes" ? CheckState.Checked : CheckState.Unchecked;
SubTitlesGroup.Text = "Selected Track: " + lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text;
@@ -211,6 +220,18 @@ namespace Handbrake.Controls
lv_subList.Select();
}
}
+ private void check_default_srt_CheckedChanged(object sender, EventArgs e)
+ {
+ // Update an item in the list if required.
+ if (lv_subList.Items.Count != 0 && lv_subList.SelectedIndices.Count != 0)
+ {
+ if (check_default_srt.Checked) // Make sure we only have 1 default track
+ setNoDefault();
+
+ lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[4].Text = check_default_srt.Checked ? "Yes" : "No";
+ lv_subList.Select();
+ }
+ }
// SRT Controls
private void srt_offset_ValueChanged(object sender, EventArgs e)