mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 01:39:17 +01:00
Revert "Postpone language packs list population until control Load event"
This reverts commit 45ca80a494
.
This commit is contained in:
parent
45ca80a494
commit
256711f696
@ -55,7 +55,6 @@
|
|||||||
this.Controls.Add(this.cbCulture);
|
this.Controls.Add(this.cbCulture);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Name = "LanguagePackComboBox";
|
this.Name = "LanguagePackComboBox";
|
||||||
this.Load += new System.EventHandler(this.LanguagePackComboBox_Load);
|
|
||||||
this.SizeChanged += new System.EventHandler(this.LanguagePackComboBox_SizeChanged);
|
this.SizeChanged += new System.EventHandler(this.LanguagePackComboBox_SizeChanged);
|
||||||
this.Resize += new System.EventHandler(this.LanguagePackComboBox_SizeChanged);
|
this.Resize += new System.EventHandler(this.LanguagePackComboBox_SizeChanged);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
@ -78,6 +78,19 @@ namespace DS4Windows.DS4Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
cbCulture.Enabled = false;
|
cbCulture.Enabled = false;
|
||||||
|
|
||||||
|
Task.Run(() => {
|
||||||
|
// Find available language assemblies and bind the list to the combo box.
|
||||||
|
cbCulture.DataSource = CreateLanguageAssembliesBindingSource();
|
||||||
|
cbCulture.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name;
|
||||||
|
|
||||||
|
// This must be set here instead of Designer or event would fire at initial selected value setting above.
|
||||||
|
cbCulture.SelectedIndexChanged += new EventHandler(CbCulture_SelectedIndexChanged);
|
||||||
|
cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged);
|
||||||
|
|
||||||
|
cbCulture.Enabled = true;
|
||||||
|
LanguageListInitialized.SetResult(true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private BindingSource CreateLanguageAssembliesBindingSource()
|
private BindingSource CreateLanguageAssembliesBindingSource()
|
||||||
@ -130,21 +143,5 @@ namespace DS4Windows.DS4Forms
|
|||||||
{
|
{
|
||||||
SelectedValueChanged?.Invoke(this, e);
|
SelectedValueChanged?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LanguagePackComboBox_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Invoke(new Action(() => {
|
|
||||||
// Find available language assemblies and bind the list to the combo box.
|
|
||||||
cbCulture.DataSource = CreateLanguageAssembliesBindingSource();
|
|
||||||
cbCulture.SelectedValue = Thread.CurrentThread.CurrentUICulture.Name;
|
|
||||||
|
|
||||||
// This must be set here instead of Designer or event would fire at initial selected value setting above.
|
|
||||||
cbCulture.SelectedIndexChanged += new EventHandler(CbCulture_SelectedIndexChanged);
|
|
||||||
cbCulture.SelectedValueChanged += new EventHandler(CbCulture_SelectedValueChanged);
|
|
||||||
|
|
||||||
cbCulture.Enabled = true;
|
|
||||||
LanguageListInitialized.SetResult(true);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user