summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-11-14 19:59:24 +0000
committersr55 <[email protected]>2009-11-14 19:59:24 +0000
commitab8077a17b0fe9e9969d864310b352fa79e6f630 (patch)
tree9ad6495cd27197b5b17df1ce1cff204447edb720 /win
parent4acf58d8591d8d7723fa4c392d5e800b71cef280 (diff)
WinGui:
- Fixed --srt-default and Subtitle default selection checkbox. It's now possible to select a default srt and default subtitle track. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2931 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/C#/Controls/Subtitles.cs58
-rw-r--r--win/C#/Functions/QueryGenerator.cs4
-rw-r--r--win/C#/frmPreview.Designer.cs8
3 files changed, 52 insertions, 18 deletions
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs
index f8c38cdcd..80c7edb66 100644
--- a/win/C#/Controls/Subtitles.cs
+++ b/win/C#/Controls/Subtitles.cs
@@ -43,6 +43,14 @@ namespace Handbrake.Controls
srtLangVal = srt_lang.SelectedItem.ToString();
srtCode = srt_charcode.SelectedItem.ToString();
srtOffsetMs = (int)srt_offset.Value;
+ if (defaultSub == "Yes") setNoSrtDefault();
+ } else
+ {
+ if (defaultSub == "Yes") SetNoDefault();
+ if (burnedVal == "Yes") SetNoBurned();
+
+ if (_fileContainer == 0)
+ burnedVal = "Yes"; // MP4 must have bitmap subs burned in.
}
if (_fileContainer == 0) // MP4 and M4V file extension
@@ -62,12 +70,6 @@ namespace Handbrake.Controls
}
}
- if (defaultSub == "Yes") SetNoDefault();
- if (burnedVal == "Yes") SetNoBurned();
-
- if (_fileContainer == 0 && !drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- burnedVal = "Yes"; // MP4 must have bitmap subs burned in.
-
string trackName = (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
? srtLangVal + " (" + srtFile + ")"
: drp_subtitleTracks.SelectedItem.ToString();
@@ -165,8 +167,17 @@ namespace Handbrake.Controls
// Update an item in the list if required.
if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text = drp_subtitleTracks.SelectedItem.ToString();
- lv_subList.Select();
+ if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
+ {
+ lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text = srt_lang.SelectedItem + "(" +
+ drp_subtitleTracks.SelectedItem + ")";
+ lv_subList.Select();
+ } else
+ {
+ lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text =
+ drp_subtitleTracks.SelectedItem.ToString();
+ lv_subList.Select();
+ }
SubList[lv_subList.SelectedIndices[0]].Track = drp_subtitleTracks.SelectedItem.ToString(); // Update SubList List<SubtitleInfo>
}
@@ -196,7 +207,10 @@ namespace Handbrake.Controls
if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
if (check_default.Checked) // Make sure we only have 1 default track
- SetNoDefault();
+ if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.Contains(".srt"))
+ setNoSrtDefault();
+ else
+ SetNoDefault();
lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text = check_default.Checked ? "Yes" : "No";
lv_subList.Select();
@@ -279,10 +293,30 @@ namespace Handbrake.Controls
int c = 0;
foreach (ListViewItem item in lv_subList.Items)
{
- if (item.SubItems[3].Text == "Yes")
+ if (SubList[c].SrtPath == "-")
+ {
+ if (item.SubItems[3].Text == "Yes")
+ {
+ item.SubItems[3].Text = "No";
+ SubList[c].Default = "No";
+ }
+ }
+ c++;
+ }
+ }
+
+ private void setNoSrtDefault()
+ {
+ int c = 0;
+ foreach (ListViewItem item in lv_subList.Items)
+ {
+ if (SubList[c].SrtPath != "-")
{
- item.SubItems[3].Text = "No";
- SubList[c].Default = "No";
+ if (item.SubItems[3].Text == "Yes")
+ {
+ item.SubItems[3].Text = "No";
+ SubList[c].Default = "No";
+ }
}
c++;
}
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index cd558f6b7..749103618 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -376,7 +376,7 @@ namespace Handbrake.Functions
string subtitleForced = String.Empty;
string subtitleBurn = String.Empty;
string subtitleDefault = String.Empty;
-
+
// SRT
string srtFile = String.Empty;
string srtCodeset = String.Empty;
@@ -471,7 +471,7 @@ namespace Handbrake.Functions
if (srtLang != "")
query += " --srt-lang " + srtLang;
if (srtDefault != "")
- query += " --subtitle-default " + srtDefault;
+ query += " --srt-default=" + srtDefault;
}
}
diff --git a/win/C#/frmPreview.Designer.cs b/win/C#/frmPreview.Designer.cs
index 14a90a937..086819348 100644
--- a/win/C#/frmPreview.Designer.cs
+++ b/win/C#/frmPreview.Designer.cs
@@ -68,7 +68,7 @@
//
this.lbl_preview.BackColor = System.Drawing.Color.Transparent;
this.lbl_preview.Name = "lbl_preview";
- this.lbl_preview.Size = new System.Drawing.Size(89, 22);
+ this.lbl_preview.Size = new System.Drawing.Size(91, 22);
this.lbl_preview.Text = "Start at Preview:";
//
// cb_preview
@@ -95,7 +95,7 @@
//
this.toolStripLabel2.BackColor = System.Drawing.Color.Transparent;
this.toolStripLabel2.Name = "toolStripLabel2";
- this.toolStripLabel2.Size = new System.Drawing.Size(98, 22);
+ this.toolStripLabel2.Size = new System.Drawing.Size(107, 22);
this.toolStripLabel2.Text = "Duration (seconds)";
//
// cb_duration
@@ -127,7 +127,7 @@
this.btn_playQT.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_playQT.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_playQT.Name = "btn_playQT";
- this.btn_playQT.Size = new System.Drawing.Size(89, 22);
+ this.btn_playQT.Size = new System.Drawing.Size(96, 22);
this.btn_playQT.Text = "Play with QT";
this.btn_playQT.Click += new System.EventHandler(this.btn_playQT_Click);
//
@@ -137,7 +137,7 @@
this.btn_playVLC.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.btn_playVLC.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btn_playVLC.Name = "btn_playVLC";
- this.btn_playVLC.Size = new System.Drawing.Size(93, 22);
+ this.btn_playVLC.Size = new System.Drawing.Size(101, 22);
this.btn_playVLC.Text = "Play with VLC";
this.btn_playVLC.Click += new System.EventHandler(this.btn_playVLC_Click);
//