aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/MainMenu
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.WinForms/MainMenu')
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs27
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.cs20
2 files changed, 45 insertions, 2 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs
index a9291d3..9ef91ad 100644
--- a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs
+++ b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs
@@ -50,6 +50,8 @@
this.lbcurrentui = new System.Windows.Forms.Label();
this.shiftos = new System.Windows.Forms.PictureBox();
this.lbbuilddetails = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.cblanguage = new System.Windows.Forms.ComboBox();
this.flmenu.SuspendLayout();
this.pnloptions.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
@@ -138,6 +140,8 @@
//
// pnloptions
//
+ this.pnloptions.Controls.Add(this.cblanguage);
+ this.pnloptions.Controls.Add(this.label3);
this.pnloptions.Controls.Add(this.txtdsport);
this.pnloptions.Controls.Add(this.label2);
this.pnloptions.Controls.Add(this.txtdsaddress);
@@ -145,7 +149,7 @@
this.pnloptions.Controls.Add(this.flowLayoutPanel1);
this.pnloptions.Location = new System.Drawing.Point(49, 26);
this.pnloptions.Name = "pnloptions";
- this.pnloptions.Size = new System.Drawing.Size(432, 167);
+ this.pnloptions.Size = new System.Drawing.Size(432, 198);
this.pnloptions.TabIndex = 2;
//
// txtdsport
@@ -188,7 +192,7 @@
this.flowLayoutPanel1.Controls.Add(this.btnsave);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
- this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 136);
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 167);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(432, 31);
this.flowLayoutPanel1.TabIndex = 0;
@@ -295,6 +299,23 @@
this.lbbuilddetails.TabIndex = 6;
this.lbbuilddetails.Text = "label4";
//
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(25, 117);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(139, 13);
+ this.label3.TabIndex = 5;
+ this.label3.Text = "{MAINMENU_LANGUAGE}";
+ //
+ // cblanguage
+ //
+ this.cblanguage.FormattingEnabled = true;
+ this.cblanguage.Location = new System.Drawing.Point(146, 117);
+ this.cblanguage.Name = "cblanguage";
+ this.cblanguage.Size = new System.Drawing.Size(225, 21);
+ this.cblanguage.TabIndex = 6;
+ //
// MainMenu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -348,5 +369,7 @@
private System.Windows.Forms.Label lbcurrentui;
private System.Windows.Forms.PictureBox shiftos;
private System.Windows.Forms.Label lbbuilddetails;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.ComboBox cblanguage;
}
} \ No newline at end of file
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)