Skip to content

Commit

Permalink
Fixed mantis #0002158: Cleanup of duplicated languages in Audio / Sub…
Browse files Browse the repository at this point in the history
…title section of TV plugin in MP Config
  • Loading branch information
chemelli committed May 5, 2009
1 parent 3daf8bb commit 656aa76
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions MediaPortal/Configuration/Sections/TVClient.cs
Expand Up @@ -139,7 +139,7 @@ public override void LoadSettings()
BindingFlags.Public | BindingFlags.Instance);
_languagesAvail = methodInfo.Invoke(languageObject, null) as List<String>;
methodInfo = exportedType.GetMethod("GetLanguageCodes", BindingFlags.Public | BindingFlags.Instance);
_languageCodes = (List<String>) methodInfo.Invoke(languageObject, null);
_languageCodes = (List<String>)methodInfo.Invoke(languageObject, null);

if (_languagesAvail == null || _languageCodes == null)
{
Expand All @@ -152,9 +152,9 @@ public override void LoadSettings()
mpListViewPreferredAudioLang.Items.Clear();
for (int i = 0; i < _languagesAvail.Count; i++)
{
if (!_preferredAudioLanguages.Contains(_languagesAvail[i]))
if (!_preferredAudioLanguages.Contains(_languagesAvail[i]) && _languageCodes[i] != _languageCodes[i - 1])
{
ListViewItem item = new ListViewItem(new string[] {_languagesAvail[i], _languageCodes[i]});
ListViewItem item = new ListViewItem(new string[] { _languagesAvail[i], _languageCodes[i] });
item.Tag = _languageCodes[i];
mpListViewAvailAudioLang.Items.Add(item);
}
Expand All @@ -177,7 +177,7 @@ public override void LoadSettings()
{
if (_languageCodes[j].Contains(langStr))
{
ListViewItem item = new ListViewItem(new string[] {_languagesAvail[j], _languageCodes[j]});
ListViewItem item = new ListViewItem(new string[] { _languagesAvail[j], _languageCodes[j] });
item.Tag = _languageCodes[j];
mpListViewPreferredAudioLang.Items.Add(item);
break;
Expand All @@ -191,9 +191,9 @@ public override void LoadSettings()
mpListViewPreferredSubLang.Items.Clear();
for (int i = 0; i < _languagesAvail.Count; i++)
{
if (!_preferredSubLanguages.Contains(_languagesAvail[i]))
if (!_preferredSubLanguages.Contains(_languagesAvail[i]) && _languageCodes[i] != _languageCodes[i - 1])
{
ListViewItem item = new ListViewItem(new string[] {_languagesAvail[i], _languageCodes[i]});
ListViewItem item = new ListViewItem(new string[] { _languagesAvail[i], _languageCodes[i] });
item.Tag = _languageCodes[i];
mpListViewAvailSubLang.Items.Add(item);
}
Expand All @@ -216,7 +216,7 @@ public override void LoadSettings()
{
if (_languageCodes[j].Contains(langStr))
{
ListViewItem item = new ListViewItem(new string[] {_languagesAvail[j], _languageCodes[j]});
ListViewItem item = new ListViewItem(new string[] { _languagesAvail[j], _languageCodes[j] });
item.Tag = _languageCodes[j];
mpListViewPreferredSubLang.Items.Add(item);
break;
Expand Down Expand Up @@ -276,14 +276,14 @@ public override void SaveSettings()

foreach (ListViewItem item in mpListViewPreferredAudioLang.Items)
{
prefLangs += (string) item.Tag + ";";
prefLangs += (string)item.Tag + ";";
}
xmlwriter.SetValue("tvservice", "preferredaudiolanguages", prefLangs);

prefLangs = "";
foreach (ListViewItem item in mpListViewPreferredSubLang.Items)
{
prefLangs += (string) item.Tag + ";";
prefLangs += (string)item.Tag + ";";
}
xmlwriter.SetValue("tvservice", "preferredsublanguages", prefLangs);
}
Expand Down Expand Up @@ -395,7 +395,7 @@ private void InitializeComponent()
//
// mpGroupBox1
//
this.mpGroupBox1.Anchor = ((AnchorStyles) (((AnchorStyles.Bottom | AnchorStyles.Left)
this.mpGroupBox1.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left)
| AnchorStyles.Right)));
this.mpGroupBox1.Controls.Add(this.enableAudioDualMonoModes);
this.mpGroupBox1.Controls.Add(this.mpCheckBoxPrefAudioOverLang);
Expand Down Expand Up @@ -424,7 +424,7 @@ private void InitializeComponent()
//
// mpCheckBoxPrefAudioOverLang
//
this.mpCheckBoxPrefAudioOverLang.Anchor = ((AnchorStyles) ((AnchorStyles.Bottom | AnchorStyles.Left)));
this.mpCheckBoxPrefAudioOverLang.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left)));
this.mpCheckBoxPrefAudioOverLang.AutoSize = true;
this.mpCheckBoxPrefAudioOverLang.FlatStyle = FlatStyle.Popup;
this.mpCheckBoxPrefAudioOverLang.Location = new Point(239, 18);
Expand All @@ -436,7 +436,7 @@ private void InitializeComponent()
//
// mpCheckBoxPrefAC3
//
this.mpCheckBoxPrefAC3.Anchor = ((AnchorStyles) ((AnchorStyles.Bottom | AnchorStyles.Left)));
this.mpCheckBoxPrefAC3.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left)));
this.mpCheckBoxPrefAC3.AutoSize = true;
this.mpCheckBoxPrefAC3.FlatStyle = FlatStyle.Popup;
this.mpCheckBoxPrefAC3.Location = new Point(9, 18);
Expand Down Expand Up @@ -532,7 +532,7 @@ private void InitializeComponent()
//
// groupBox2
//
this.groupBox2.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.groupBox2.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.mpLabel5);
this.groupBox2.Controls.Add(this.mpLabel1);
Expand Down Expand Up @@ -570,7 +570,7 @@ private void InitializeComponent()
//
// mpButtonDownAudioLang
//
this.mpButtonDownAudioLang.Anchor = ((AnchorStyles) ((AnchorStyles.Bottom | AnchorStyles.Right)));
this.mpButtonDownAudioLang.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
this.mpButtonDownAudioLang.Location = new Point(289, 255);
this.mpButtonDownAudioLang.Name = "mpButtonDownAudioLang";
this.mpButtonDownAudioLang.Size = new Size(46, 20);
Expand All @@ -581,7 +581,7 @@ private void InitializeComponent()
//
// mpButtonUpAudioLang
//
this.mpButtonUpAudioLang.Anchor = ((AnchorStyles) ((AnchorStyles.Bottom | AnchorStyles.Right)));
this.mpButtonUpAudioLang.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
this.mpButtonUpAudioLang.Location = new Point(237, 255);
this.mpButtonUpAudioLang.Name = "mpButtonUpAudioLang";
this.mpButtonUpAudioLang.Size = new Size(46, 20);
Expand All @@ -592,7 +592,7 @@ private void InitializeComponent()
//
// mpButtonAddAudioLang
//
this.mpButtonAddAudioLang.Anchor = ((AnchorStyles) ((AnchorStyles.Top | AnchorStyles.Right)));
this.mpButtonAddAudioLang.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
this.mpButtonAddAudioLang.Location = new Point(202, 40);
this.mpButtonAddAudioLang.Name = "mpButtonAddAudioLang";
this.mpButtonAddAudioLang.Size = new Size(28, 20);
Expand All @@ -603,7 +603,7 @@ private void InitializeComponent()
//
// mpButtonRemoveAudioLang
//
this.mpButtonRemoveAudioLang.Anchor = ((AnchorStyles) ((AnchorStyles.Top | AnchorStyles.Right)));
this.mpButtonRemoveAudioLang.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right)));
this.mpButtonRemoveAudioLang.Location = new Point(202, 66);
this.mpButtonRemoveAudioLang.Name = "mpButtonRemoveAudioLang";
this.mpButtonRemoveAudioLang.Size = new Size(28, 20);
Expand All @@ -616,7 +616,7 @@ private void InitializeComponent()
//
this.mpListViewPreferredAudioLang.AllowDrop = true;
this.mpListViewPreferredAudioLang.AllowRowReorder = true;
this.mpListViewPreferredAudioLang.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Bottom)
this.mpListViewPreferredAudioLang.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Right)));
this.mpListViewPreferredAudioLang.Columns.AddRange(new ColumnHeader[]
{
Expand Down Expand Up @@ -648,7 +648,7 @@ private void InitializeComponent()
//
this.mpListViewAvailAudioLang.AllowDrop = true;
this.mpListViewAvailAudioLang.AllowRowReorder = true;
this.mpListViewAvailAudioLang.Anchor = ((AnchorStyles) ((((AnchorStyles.Top | AnchorStyles.Bottom)
this.mpListViewAvailAudioLang.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Left)
| AnchorStyles.Right)));
this.mpListViewAvailAudioLang.Columns.AddRange(new ColumnHeader[]
Expand Down Expand Up @@ -725,7 +725,7 @@ private void InitializeComponent()
//
// mpGroupBox3
//
this.mpGroupBox3.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.mpGroupBox3.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.mpGroupBox3.Controls.Add(this.mpLabel6);
this.mpGroupBox3.Controls.Add(this.mpLabel7);
Expand Down Expand Up @@ -873,7 +873,7 @@ private void InitializeComponent()
//
// mpGroupBox8
//
this.mpGroupBox8.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.mpGroupBox8.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.mpGroupBox8.Controls.Add(this.chkRecnotifications);
this.mpGroupBox8.FlatStyle = FlatStyle.Popup;
Expand All @@ -897,7 +897,7 @@ private void InitializeComponent()
//
// mpGroupBox7
//
this.mpGroupBox7.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.mpGroupBox7.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.mpGroupBox7.Controls.Add(this.txtNotifyAfter);
this.mpGroupBox7.Controls.Add(this.labelNotifyTimeout);
Expand All @@ -915,7 +915,7 @@ private void InitializeComponent()
//
// txtNotifyAfter
//
this.txtNotifyAfter.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.txtNotifyAfter.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.txtNotifyAfter.BorderColor = Color.Empty;
this.txtNotifyAfter.Location = new Point(164, 73);
Expand All @@ -935,7 +935,7 @@ private void InitializeComponent()
//
// checkBoxNotifyPlaySound
//
this.checkBoxNotifyPlaySound.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.checkBoxNotifyPlaySound.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.checkBoxNotifyPlaySound.AutoSize = true;
this.checkBoxNotifyPlaySound.Checked = true;
Expand All @@ -959,7 +959,7 @@ private void InitializeComponent()
//
// txtNotifyBefore
//
this.txtNotifyBefore.Anchor = ((AnchorStyles) (((AnchorStyles.Top | AnchorStyles.Left)
this.txtNotifyBefore.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
| AnchorStyles.Right)));
this.txtNotifyBefore.BorderColor = Color.Empty;
this.txtNotifyBefore.Location = new Point(164, 47);
Expand Down

0 comments on commit 656aa76

Please sign in to comment.