diff options
author | sr55 <[email protected]> | 2009-10-16 21:00:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-10-16 21:00:48 +0000 |
commit | 476577f3d16c046d63a58a92908519a571682b01 (patch) | |
tree | 45e9364ce44c543455fcd5ccfcfa4641d02b0b44 /win/C#/Functions/QueryGenerator.cs | |
parent | b5bcace7027df5b269d3dfba32df9fa7c05e1d85 (diff) |
WinGui:
- Improved / Simplified the Subtitle UI design. Hopefully should make it a bit easier to use and understand.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2888 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/QueryGenerator.cs')
-rw-r--r-- | win/C#/Functions/QueryGenerator.cs | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs index ed80bdaf6..0ba49171c 100644 --- a/win/C#/Functions/QueryGenerator.cs +++ b/win/C#/Functions/QueryGenerator.cs @@ -384,29 +384,26 @@ namespace Handbrake.Functions string srtDefault = String.Empty;
int srtCount = 0;
- foreach (ListViewItem item in mainWindow.Subtitles.lv_subList.Items)
+ List<Controls.SubtitleInfo> SubList = mainWindow.Subtitles.GetSubtitleInfoList();
+
+ foreach (var item in SubList)
{
string itemToAdd, trackID;
- if (item.SubItems.Count != 5) // We have an SRT file
+ if (item.SrtPath != "-") // We have an SRT file
{
srtCount++; // SRT track id.
- string[] trackData = item.SubItems[1].Text.Split(',');
- if (trackData != null)
- {
- string charCode = trackData[1].Replace("(", "").Replace(")", "").Trim();
- string realLangCode = langMap[trackData[0].Trim()];
- srtLang += srtLang == "" ? realLangCode : "," + realLangCode;
- srtCodeset += srtCodeset == "" ? charCode : "," + charCode;
- }
- if (item.SubItems[4].Text == "Yes") // default
+ srtLang += srtLang == "" ? langMap[item.SrtLang] : "," + langMap[item.SrtLang];
+ srtCodeset += srtCodeset == "" ? item.SrtCharCode : "," + item.SrtCharCode;
+
+ if (item.Default == "Yes") // default
srtDefault = srtCount.ToString();
- itemToAdd = item.SubItems[5].Text;
+ itemToAdd = item.SrtPath;
srtFile += srtFile == "" ? itemToAdd : "," + itemToAdd;
- itemToAdd = item.SubItems[6].Text;
+ itemToAdd = item.SrtOffset.ToString();
srtOffset += srtOffset == "" ? itemToAdd : "," + itemToAdd;
}
else // We have Bitmap or CC
@@ -414,11 +411,11 @@ namespace Handbrake.Functions string[] tempSub;
// Find --subtitle <string>
- if (item.SubItems[1].Text.Contains("Foreign Audio Search"))
+ if (item.Track.Contains("Foreign Audio Search"))
itemToAdd = "scan";
else
{
- tempSub = item.SubItems[1].Text.Split(' ');
+ tempSub = item.Track.Split(' ');
itemToAdd = tempSub[0];
}
@@ -426,26 +423,25 @@ namespace Handbrake.Functions // Find --subtitle-forced
itemToAdd = "";
- tempSub = item.SubItems[1].Text.Split(' ');
+ tempSub = item.Track.Split(' ');
trackID = tempSub[0];
- if (item.SubItems[2].Text == "Yes")
+ if (item.Forced == "Yes")
itemToAdd = trackID;
if (itemToAdd != "")
subtitleForced += subtitleForced == "" ? itemToAdd : "," + itemToAdd;
// Find --subtitle-burn and --subtitle-default
- tempSub = item.SubItems[1].Text.Split(' ');
trackID = tempSub[0];
if (trackID.Trim() == "Foreign")
trackID = "scan";
- if (item.SubItems[3].Text == "Yes") // burn
+ if (item.Burned == "Yes") // burn
subtitleBurn = trackID;
- if (item.SubItems[4].Text == "Yes") // default
+ if (item.Default == "Yes") // default
subtitleDefault = trackID;
}
}
|