diff --git a/src/webimtray/WebIMTray/options/About.cs b/src/webimtray/WebIMTray/options/About.cs index 8bf6621f..3d863546 100644 --- a/src/webimtray/WebIMTray/options/About.cs +++ b/src/webimtray/WebIMTray/options/About.cs @@ -5,6 +5,7 @@ using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; +using System.Resources; namespace webImTray { public partial class About : UserControl, OptionsPanel { @@ -24,8 +25,6 @@ namespace webImTray { return "About"; } - public event ModifiedEvent PanelModified; - #endregion private void i_services_ru_link(object sender, LinkLabelLinkClickedEventArgs e) { @@ -35,5 +34,10 @@ namespace webImTray { private void webim_ru_link(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://webim.ru/"); } + + public event ModifiedEvent PanelModified; + + public void updateUI(ResourceManager resManager) { + } } } diff --git a/src/webimtray/WebIMTray/options/OptionPanel.cs b/src/webimtray/WebIMTray/options/OptionPanel.cs index 28631ada..d52bf808 100644 --- a/src/webimtray/WebIMTray/options/OptionPanel.cs +++ b/src/webimtray/WebIMTray/options/OptionPanel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Resources; namespace webImTray { @@ -10,6 +11,7 @@ namespace webImTray { void initialize(); void apply(); string getDescription(); + void updateUI(ResourceManager resManager); event ModifiedEvent PanelModified; } diff --git a/src/webimtray/WebIMTray/options/OptionsConnectionPanel.cs b/src/webimtray/WebIMTray/options/OptionsConnectionPanel.cs index 557944e0..358f71e6 100644 --- a/src/webimtray/WebIMTray/options/OptionsConnectionPanel.cs +++ b/src/webimtray/WebIMTray/options/OptionsConnectionPanel.cs @@ -5,6 +5,7 @@ using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; +using System.Resources; namespace webImTray { public partial class OptionsConnectionPanel : UserControl, OptionsPanel { @@ -67,5 +68,8 @@ namespace webImTray { modified = true; PanelModified.Invoke(); } + + public void updateUI(ResourceManager resManager) { + } } } diff --git a/src/webimtray/WebIMTray/options/OptionsDialog.cs b/src/webimtray/WebIMTray/options/OptionsDialog.cs index a8504800..7dc58bb9 100644 --- a/src/webimtray/WebIMTray/options/OptionsDialog.cs +++ b/src/webimtray/WebIMTray/options/OptionsDialog.cs @@ -5,11 +5,13 @@ using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; +using System.Resources; +using System.Globalization; namespace webImTray { public partial class OptionsDialog : Form { - OptionsPanel[] panels = new OptionsPanel[] { + static OptionsPanel[] panels = new OptionsPanel[] { new OptionsGeneralPanel(), new OptionsConnectionPanel(), new OptionsSoundsPanel(), @@ -18,6 +20,10 @@ namespace webImTray { OptionsPanel currentPanel = null; + private static ResourceManager resourceManager = new ResourceManager("webImTray.webImTray", System.Reflection.Assembly.GetExecutingAssembly()); + private static CultureInfo englishCulture = new CultureInfo("en-US"); + private static CultureInfo russianCulture = new CultureInfo("ru-RU"); + public OptionsDialog() { InitializeComponent(); } @@ -91,5 +97,11 @@ namespace webImTray { applyChanges(); apply.Enabled = false; } + + public static void updateUI() { + for (int i = 0; i < 4; i++) { + ((OptionsPanel)panels[i]).updateUI(resourceManager); + } + } } } \ No newline at end of file diff --git a/src/webimtray/WebIMTray/options/OptionsGeneralPanel.Designer.cs b/src/webimtray/WebIMTray/options/OptionsGeneralPanel.Designer.cs index 567b243f..e6ac50ba 100644 --- a/src/webimtray/WebIMTray/options/OptionsGeneralPanel.Designer.cs +++ b/src/webimtray/WebIMTray/options/OptionsGeneralPanel.Designer.cs @@ -1,3 +1,5 @@ +using System; + namespace webImTray { partial class OptionsGeneralPanel { /// @@ -32,8 +34,12 @@ namespace webImTray { this.textBox1 = new System.Windows.Forms.TextBox(); this.showOptions = new System.Windows.Forms.CheckBox(); this.showHide = new System.Windows.Forms.CheckBox(); + this.languageBox = new System.Windows.Forms.GroupBox(); + this.radioRussian = new System.Windows.Forms.RadioButton(); + this.radioEnglish = new System.Windows.Forms.RadioButton(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.languageBox.SuspendLayout(); this.SuspendLayout(); // // groupBox1 @@ -145,10 +151,48 @@ namespace webImTray { this.showHide.UseVisualStyleBackColor = true; this.showHide.CheckedChanged += new System.EventHandler(this.checkboxChanged); // + // languageBox + // + this.languageBox.Controls.Add(this.radioRussian); + this.languageBox.Controls.Add(this.radioEnglish); + this.languageBox.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold); + this.languageBox.Location = new System.Drawing.Point(3, 210); + this.languageBox.Name = "languageBox"; + this.languageBox.Size = new System.Drawing.Size(371, 53); + this.languageBox.TabIndex = 2; + this.languageBox.TabStop = false; + this.languageBox.Text = "Language"; + // + // radioRussian + // + this.radioRussian.AutoSize = true; + this.radioRussian.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.radioRussian.Location = new System.Drawing.Point(80, 30); + this.radioRussian.Name = "radioRussian"; + this.radioRussian.Size = new System.Drawing.Size(63, 17); + this.radioRussian.TabIndex = 1; + this.radioRussian.TabStop = true; + this.radioRussian.Text = "Russian"; + this.radioRussian.UseVisualStyleBackColor = true; + // + // radioEnglish + // + this.radioEnglish.AutoSize = true; + this.radioEnglish.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.radioEnglish.Location = new System.Drawing.Point(15, 30); + this.radioEnglish.Name = "radioEnglish"; + this.radioEnglish.Size = new System.Drawing.Size(59, 17); + this.radioEnglish.TabIndex = 0; + this.radioEnglish.TabStop = true; + this.radioEnglish.Text = "English"; + this.radioEnglish.UseVisualStyleBackColor = true; + this.radioEnglish.CheckedChanged += new System.EventHandler(this.radioEnglish_CheckedChanged); + // // OptionsGeneralPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.languageBox); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "OptionsGeneralPanel"; @@ -157,6 +201,8 @@ namespace webImTray { this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + this.languageBox.ResumeLayout(false); + this.languageBox.PerformLayout(); this.ResumeLayout(false); } @@ -172,5 +218,8 @@ namespace webImTray { private System.Windows.Forms.CheckBox showHide; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.GroupBox languageBox; + private System.Windows.Forms.RadioButton radioRussian; + private System.Windows.Forms.RadioButton radioEnglish; } } diff --git a/src/webimtray/WebIMTray/options/OptionsGeneralPanel.cs b/src/webimtray/WebIMTray/options/OptionsGeneralPanel.cs index 9d857016..6e4ca9ae 100644 --- a/src/webimtray/WebIMTray/options/OptionsGeneralPanel.cs +++ b/src/webimtray/WebIMTray/options/OptionsGeneralPanel.cs @@ -5,10 +5,12 @@ using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; +using System.Resources; namespace webImTray { public partial class OptionsGeneralPanel : UserControl, OptionsPanel { bool modified = false; + public event ModifiedEvent PanelModified; public OptionsGeneralPanel() { InitializeComponent(); @@ -39,6 +41,15 @@ namespace webImTray { return "General"; } - public event ModifiedEvent PanelModified; + public void updateUI(ResourceManager resManager) { + groupBox1.Text = resManager.GetString("application"); + } + + private void radioEnglish_CheckedChanged(object sender, EventArgs e) { + // Set english locale + + // Update UI + OptionsDialog.updateUI(); + } } } diff --git a/src/webimtray/WebIMTray/options/OptionsSoundsPanel.cs b/src/webimtray/WebIMTray/options/OptionsSoundsPanel.cs index b8dbb8c1..c0b36645 100644 --- a/src/webimtray/WebIMTray/options/OptionsSoundsPanel.cs +++ b/src/webimtray/WebIMTray/options/OptionsSoundsPanel.cs @@ -5,9 +5,12 @@ using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; +using System.Resources; namespace webImTray { public partial class OptionsSoundsPanel : UserControl, OptionsPanel { + public event ModifiedEvent PanelModified; + public OptionsSoundsPanel() { InitializeComponent(); } @@ -26,6 +29,7 @@ namespace webImTray { return "Sounds"; } - public event ModifiedEvent PanelModified; + public void updateUI(ResourceManager resManager) { + } } }