diff options
| author | Michael <[email protected]> | 2017-06-19 10:18:55 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-19 10:19:03 -0400 |
| commit | af9e3401e6b2c111da172da1671090f6cb33137f (patch) | |
| tree | 9c6c297455de94764fd6b074311a43564a0c1860 /ShiftOS.WinForms/MainMenu/MainMenu.cs | |
| parent | 49b31c7e847cc7aa9365880f9f92e0498f1450bd (diff) | |
| download | shiftos_thereturn-af9e3401e6b2c111da172da1671090f6cb33137f.tar.gz shiftos_thereturn-af9e3401e6b2c111da172da1671090f6cb33137f.tar.bz2 shiftos_thereturn-af9e3401e6b2c111da172da1671090f6cb33137f.zip | |
store languages in appdata
Diffstat (limited to 'ShiftOS.WinForms/MainMenu/MainMenu.cs')
| -rw-r--r-- | ShiftOS.WinForms/MainMenu/MainMenu.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs index f6bc833..b957c28 100644 --- a/ShiftOS.WinForms/MainMenu/MainMenu.cs +++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs @@ -156,6 +156,15 @@ namespace ShiftOS.WinForms.MainMenu txtdsaddress.Text = conf.DigitalSocietyAddress; txtdsport.Text = conf.DigitalSocietyPort.ToString(); + cblanguage.Items.Clear(); + foreach(var lang in Localization.GetAllLanguages()) + { + var finf = new System.IO.FileInfo(lang); + int nameindex = finf.Name.Length - 5; + cblanguage.Items.Add(finf.Name.Remove(nameindex, 5)); + } + + cblanguage.Text = conf.Language; pnloptions.Show(); pnloptions.BringToFront(); @@ -186,9 +195,20 @@ namespace ShiftOS.WinForms.MainMenu conf.DigitalSocietyPort = p; + bool requiresRestart = (conf.Language != cblanguage.Text); + conf.Language = cblanguage.Text; + + System.IO.File.WriteAllText("servers.json", Newtonsoft.Json.JsonConvert.SerializeObject(conf, Newtonsoft.Json.Formatting.Indented)); HideOptions(); + if(requiresRestart == true) + { + Infobox.Show("{TITLE_RESTARTREQUIRED}", "{PROMPT_RESTARTREQUIRED}", () => + { + Application.Restart(); + }); + } } private void button10_Click(object sender, EventArgs e) |
