summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls/Subtitles.cs
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/Subtitles.cs
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/Subtitles.cs')
-rw-r--r--win/C#/Controls/Subtitles.cs25
1 files changed, 23 insertions, 2 deletions
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)