Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RELEASE PREVIEW HUB + TRANSLATOR

- More changes on code
- Added translator integration on Chat
- Added translation configuration in Settings tab
  • Loading branch information...
commit 1c7fa3c686f9c7a34cd7a2363b9adc80f0ad5cc7 1 parent 1be987b
@netonjm netonjm authored
View
1  .gitignore
@@ -1,7 +1,6 @@
/XBSlink.suo
/XBSlink.userprefs
XBSlink/obj
-XBSlink.Android/
XBSlink/bin
/*.suo
/*.userprefs
View
30 XBSlink.sln
@@ -1,6 +1,6 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XBSlink", "XBSlink\XBSlink.csproj", "{60AED2EE-9511-4FC0-BE50-DC440E4EF254}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpPcap", "SharpPcap\SharpPcap.csproj", "{24262E52-1304-4A25-8F73-A3B06E40592E}"
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PacketDotNet", "PacketDotNe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Nat", "Mono.Nat\Mono.Nat.csproj", "{F5D74163-145F-47BF-83DC-D0E07249C6CA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XBSlink.Android", "XBSlink.Android\XBSlink.Android.csproj", "{F10FF62B-280C-4202-AD28-B874BFA35AB7}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -19,14 +17,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|x86.ActiveCfg = Debug|x86
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|x86.Build.0 = Debug|x86
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|Any CPU.Build.0 = Release|Any CPU
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|x86.ActiveCfg = Release|x86
- {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|x86.Build.0 = Release|x86
{24262E52-1304-4A25-8F73-A3B06E40592E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24262E52-1304-4A25-8F73-A3B06E40592E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24262E52-1304-4A25-8F73-A3B06E40592E}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -39,20 +29,20 @@ Global
{55ABBA4C-AAF9-4726-A592-0C92436CEC92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55ABBA4C-AAF9-4726-A592-0C92436CEC92}.Release|Any CPU.Build.0 = Release|Any CPU
{55ABBA4C-AAF9-4726-A592-0C92436CEC92}.Release|x86.ActiveCfg = Release|Any CPU
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|x86.ActiveCfg = Debug|x86
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Debug|x86.Build.0 = Debug|x86
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|Any CPU.Build.0 = Release|Any CPU
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|x86.ActiveCfg = Release|x86
+ {60AED2EE-9511-4FC0-BE50-DC440E4EF254}.Release|x86.Build.0 = Release|x86
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Release|Any CPU.Build.0 = Release|Any CPU
{F5D74163-145F-47BF-83DC-D0E07249C6CA}.Release|x86.ActiveCfg = Release|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Release|Any CPU.Build.0 = Release|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {F10FF62B-280C-4202-AD28-B874BFA35AB7}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
226 XBSlink/Form1.Designer.cs
@@ -136,6 +136,8 @@ private void InitializeComponent()
this.checkBox_chat_notify = new System.Windows.Forms.CheckBox();
this.checkBox_newNodeSound = new System.Windows.Forms.CheckBox();
this.groupBox_chatsettings = new System.Windows.Forms.GroupBox();
+ this.label10 = new System.Windows.Forms.Label();
+ this.comboBox_DefaultTranslationLang = new System.Windows.Forms.ComboBox();
this.checkBox_chat_nodeInfoMessagesInChat = new System.Windows.Forms.CheckBox();
this.checkBox_chatAutoSwitch = new System.Windows.Forms.CheckBox();
this.tabPageSettings_network = new System.Windows.Forms.TabPage();
@@ -230,9 +232,9 @@ private void InitializeComponent()
this.toolStripStatusLabel_udp_in,
this.toolStripStatusLabel_udp_out,
this.toolStripStatusLabel_icon});
- this.statusStrip.Location = new System.Drawing.Point(0, 588);
+ this.statusStrip.Location = new System.Drawing.Point(0, 454);
this.statusStrip.Name = "statusStrip";
- this.statusStrip.Size = new System.Drawing.Size(654, 22);
+ this.statusStrip.Size = new System.Drawing.Size(687, 22);
this.statusStrip.TabIndex = 2;
this.statusStrip.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.statusStrip1_MouseDoubleClick);
//
@@ -281,7 +283,7 @@ private void InitializeComponent()
this.toolStripStatusLabel_icon.Image = global::XBSlink.Properties.Resources.ok_16;
this.toolStripStatusLabel_icon.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.toolStripStatusLabel_icon.Name = "toolStripStatusLabel_icon";
- this.toolStripStatusLabel_icon.Size = new System.Drawing.Size(322, 17);
+ this.toolStripStatusLabel_icon.Size = new System.Drawing.Size(355, 17);
this.toolStripStatusLabel_icon.Spring = true;
this.toolStripStatusLabel_icon.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
@@ -293,7 +295,7 @@ private void InitializeComponent()
this.comboBox_captureDevice.FormattingEnabled = true;
this.comboBox_captureDevice.Location = new System.Drawing.Point(6, 32);
this.comboBox_captureDevice.Name = "comboBox_captureDevice";
- this.comboBox_captureDevice.Size = new System.Drawing.Size(588, 21);
+ this.comboBox_captureDevice.Size = new System.Drawing.Size(587, 21);
this.comboBox_captureDevice.TabIndex = 3;
this.comboBox_captureDevice.SelectedIndexChanged += new System.EventHandler(this.comboBox_captureDevice_SelectedIndexChanged);
//
@@ -336,7 +338,7 @@ private void InitializeComponent()
// textBox_remote_port
//
this.textBox_remote_port.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.textBox_remote_port.Location = new System.Drawing.Point(605, 39);
+ this.textBox_remote_port.Location = new System.Drawing.Point(638, 39);
this.textBox_remote_port.MaxLength = 5;
this.textBox_remote_port.Name = "textBox_remote_port";
this.textBox_remote_port.Size = new System.Drawing.Size(36, 20);
@@ -434,7 +436,7 @@ private void InitializeComponent()
this.tabControl1.Margin = new System.Windows.Forms.Padding(1);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(636, 519);
+ this.tabControl1.Size = new System.Drawing.Size(669, 385);
this.tabControl1.TabIndex = 17;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
@@ -443,7 +445,7 @@ private void InitializeComponent()
this.tabPage_newsFeed.Controls.Add(this.richTextBox_newsFeed);
this.tabPage_newsFeed.Location = new System.Drawing.Point(4, 22);
this.tabPage_newsFeed.Name = "tabPage_newsFeed";
- this.tabPage_newsFeed.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_newsFeed.Size = new System.Drawing.Size(661, 359);
this.tabPage_newsFeed.TabIndex = 7;
this.tabPage_newsFeed.Text = "News";
this.tabPage_newsFeed.UseVisualStyleBackColor = true;
@@ -455,7 +457,7 @@ private void InitializeComponent()
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox_newsFeed.Location = new System.Drawing.Point(0, 0);
this.richTextBox_newsFeed.Name = "richTextBox_newsFeed";
- this.richTextBox_newsFeed.Size = new System.Drawing.Size(626, 493);
+ this.richTextBox_newsFeed.Size = new System.Drawing.Size(659, 356);
this.richTextBox_newsFeed.TabIndex = 0;
this.richTextBox_newsFeed.Text = "";
this.richTextBox_newsFeed.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBox_newsFeed_LinkClicked);
@@ -471,7 +473,7 @@ private void InitializeComponent()
this.tabPage_info.Location = new System.Drawing.Point(4, 22);
this.tabPage_info.Name = "tabPage_info";
this.tabPage_info.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage_info.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_info.Size = new System.Drawing.Size(661, 359);
this.tabPage_info.TabIndex = 0;
this.tabPage_info.Text = "Info";
//
@@ -479,7 +481,7 @@ private void InitializeComponent()
//
this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.splitContainer2.Location = new System.Drawing.Point(0, 364);
+ this.splitContainer2.Location = new System.Drawing.Point(0, 237);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
@@ -489,8 +491,8 @@ private void InitializeComponent()
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.treeView_nodeinfo);
- this.splitContainer2.Size = new System.Drawing.Size(623, 129);
- this.splitContainer2.SplitterDistance = 373;
+ this.splitContainer2.Size = new System.Drawing.Size(656, 116);
+ this.splitContainer2.SplitterDistance = 392;
this.splitContainer2.TabIndex = 7;
//
// textBox_maininfo
@@ -503,7 +505,7 @@ private void InitializeComponent()
this.textBox_maininfo.Name = "textBox_maininfo";
this.textBox_maininfo.ReadOnly = true;
this.textBox_maininfo.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.textBox_maininfo.Size = new System.Drawing.Size(370, 129);
+ this.textBox_maininfo.Size = new System.Drawing.Size(389, 116);
this.textBox_maininfo.TabIndex = 1;
this.textBox_maininfo.Text = "Engine not started.";
//
@@ -514,14 +516,14 @@ private void InitializeComponent()
| System.Windows.Forms.AnchorStyles.Right)));
this.treeView_nodeinfo.Location = new System.Drawing.Point(3, 0);
this.treeView_nodeinfo.Name = "treeView_nodeinfo";
- this.treeView_nodeinfo.Size = new System.Drawing.Size(243, 129);
+ this.treeView_nodeinfo.Size = new System.Drawing.Size(257, 116);
this.treeView_nodeinfo.TabIndex = 5;
//
// label9
//
this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(3, 348);
+ this.label9.Location = new System.Drawing.Point(3, 221);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(84, 13);
this.label9.TabIndex = 6;
@@ -531,7 +533,7 @@ private void InitializeComponent()
//
this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(529, 348);
+ this.label8.Location = new System.Drawing.Point(562, 221);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(94, 13);
this.label8.TabIndex = 5;
@@ -564,7 +566,7 @@ private void InitializeComponent()
this.listView_nodes.MultiSelect = false;
this.listView_nodes.Name = "listView_nodes";
this.listView_nodes.ShowGroups = false;
- this.listView_nodes.Size = new System.Drawing.Size(623, 323);
+ this.listView_nodes.Size = new System.Drawing.Size(656, 193);
this.listView_nodes.TabIndex = 2;
this.listView_nodes.UseCompatibleStateImageBehavior = false;
this.listView_nodes.View = System.Windows.Forms.View.Details;
@@ -614,7 +616,7 @@ private void InitializeComponent()
this.tabPage_clouds.Location = new System.Drawing.Point(4, 22);
this.tabPage_clouds.Margin = new System.Windows.Forms.Padding(1);
this.tabPage_clouds.Name = "tabPage_clouds";
- this.tabPage_clouds.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_clouds.Size = new System.Drawing.Size(661, 359);
this.tabPage_clouds.TabIndex = 5;
this.tabPage_clouds.Text = "Clouds";
//
@@ -622,7 +624,7 @@ private void InitializeComponent()
//
this.button_CloudLeave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_CloudLeave.Enabled = false;
- this.button_CloudLeave.Location = new System.Drawing.Point(551, 447);
+ this.button_CloudLeave.Location = new System.Drawing.Point(584, 311);
this.button_CloudLeave.Name = "button_CloudLeave";
this.button_CloudLeave.Size = new System.Drawing.Size(75, 21);
this.button_CloudLeave.TabIndex = 11;
@@ -634,7 +636,7 @@ private void InitializeComponent()
//
this.button_CloudJoin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_CloudJoin.Enabled = false;
- this.button_CloudJoin.Location = new System.Drawing.Point(551, 469);
+ this.button_CloudJoin.Location = new System.Drawing.Point(584, 333);
this.button_CloudJoin.Name = "button_CloudJoin";
this.button_CloudJoin.Size = new System.Drawing.Size(75, 21);
this.button_CloudJoin.TabIndex = 10;
@@ -646,7 +648,7 @@ private void InitializeComponent()
//
this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(455, 452);
+ this.label14.Location = new System.Drawing.Point(488, 316);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(53, 13);
this.label14.TabIndex = 9;
@@ -656,7 +658,7 @@ private void InitializeComponent()
//
this.textBox_CloudPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.textBox_CloudPassword.Enabled = false;
- this.textBox_CloudPassword.Location = new System.Drawing.Point(458, 468);
+ this.textBox_CloudPassword.Location = new System.Drawing.Point(491, 332);
this.textBox_CloudPassword.Name = "textBox_CloudPassword";
this.textBox_CloudPassword.PasswordChar = '*';
this.textBox_CloudPassword.Size = new System.Drawing.Size(90, 20);
@@ -666,7 +668,7 @@ private void InitializeComponent()
//
this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(416, 452);
+ this.label13.Location = new System.Drawing.Point(449, 316);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(27, 13);
this.label13.TabIndex = 7;
@@ -676,7 +678,7 @@ private void InitializeComponent()
//
this.textBox_CloudMaxNodes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.textBox_CloudMaxNodes.Enabled = false;
- this.textBox_CloudMaxNodes.Location = new System.Drawing.Point(419, 468);
+ this.textBox_CloudMaxNodes.Location = new System.Drawing.Point(452, 332);
this.textBox_CloudMaxNodes.Name = "textBox_CloudMaxNodes";
this.textBox_CloudMaxNodes.Size = new System.Drawing.Size(33, 20);
this.textBox_CloudMaxNodes.TabIndex = 6;
@@ -687,7 +689,7 @@ private void InitializeComponent()
//
this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(3, 451);
+ this.label12.Location = new System.Drawing.Point(3, 315);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(63, 13);
this.label12.TabIndex = 5;
@@ -698,15 +700,15 @@ private void InitializeComponent()
this.textBox_CloudName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox_CloudName.Enabled = false;
- this.textBox_CloudName.Location = new System.Drawing.Point(6, 467);
+ this.textBox_CloudName.Location = new System.Drawing.Point(6, 331);
this.textBox_CloudName.Name = "textBox_CloudName";
- this.textBox_CloudName.Size = new System.Drawing.Size(407, 20);
+ this.textBox_CloudName.Size = new System.Drawing.Size(440, 20);
this.textBox_CloudName.TabIndex = 4;
//
// buttonLoadCloudlist
//
this.buttonLoadCloudlist.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonLoadCloudlist.Location = new System.Drawing.Point(551, 2);
+ this.buttonLoadCloudlist.Location = new System.Drawing.Point(584, 2);
this.buttonLoadCloudlist.Name = "buttonLoadCloudlist";
this.buttonLoadCloudlist.Size = new System.Drawing.Size(75, 23);
this.buttonLoadCloudlist.TabIndex = 3;
@@ -720,7 +722,7 @@ private void InitializeComponent()
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox_cloudlist.Location = new System.Drawing.Point(61, 2);
this.textBox_cloudlist.Name = "textBox_cloudlist";
- this.textBox_cloudlist.Size = new System.Drawing.Size(484, 20);
+ this.textBox_cloudlist.Size = new System.Drawing.Size(517, 20);
this.textBox_cloudlist.TabIndex = 2;
this.textBox_cloudlist.Leave += new System.EventHandler(this.textBox_cloudlist_Leave);
//
@@ -747,7 +749,7 @@ private void InitializeComponent()
this.listView_clouds.GridLines = true;
this.listView_clouds.Location = new System.Drawing.Point(0, 28);
this.listView_clouds.Name = "listView_clouds";
- this.listView_clouds.Size = new System.Drawing.Size(626, 415);
+ this.listView_clouds.Size = new System.Drawing.Size(659, 277);
this.listView_clouds.TabIndex = 0;
this.listView_clouds.UseCompatibleStateImageBehavior = false;
this.listView_clouds.View = System.Windows.Forms.View.Details;
@@ -776,7 +778,7 @@ private void InitializeComponent()
this.tabPage_chat.Controls.Add(this.textBox_chatEntry);
this.tabPage_chat.Location = new System.Drawing.Point(4, 22);
this.tabPage_chat.Name = "tabPage_chat";
- this.tabPage_chat.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_chat.Size = new System.Drawing.Size(661, 359);
this.tabPage_chat.TabIndex = 4;
this.tabPage_chat.Text = "Chat";
//
@@ -789,7 +791,7 @@ private void InitializeComponent()
this.tab_chats.Location = new System.Drawing.Point(3, 5);
this.tab_chats.Name = "tab_chats";
this.tab_chats.SelectedIndex = 0;
- this.tab_chats.Size = new System.Drawing.Size(623, 458);
+ this.tab_chats.Size = new System.Drawing.Size(656, 324);
this.tab_chats.TabIndex = 8;
this.tab_chats.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tab_chats_MouseUp);
//
@@ -799,7 +801,7 @@ private void InitializeComponent()
this.tab_general.Location = new System.Drawing.Point(4, 22);
this.tab_general.Name = "tab_general";
this.tab_general.Padding = new System.Windows.Forms.Padding(3);
- this.tab_general.Size = new System.Drawing.Size(615, 432);
+ this.tab_general.Size = new System.Drawing.Size(648, 298);
this.tab_general.TabIndex = 0;
this.tab_general.Text = "General";
this.tab_general.UseVisualStyleBackColor = true;
@@ -821,8 +823,8 @@ private void InitializeComponent()
this.splitContainer1.Panel2.Controls.Add(this.listBox_chatUserList);
this.splitContainer1.Panel2.Controls.Add(this.label16);
this.splitContainer1.Panel2.Controls.Add(this.label_num_persons_in_chat);
- this.splitContainer1.Size = new System.Drawing.Size(609, 754);
- this.splitContainer1.SplitterDistance = 435;
+ this.splitContainer1.Size = new System.Drawing.Size(642, 292);
+ this.splitContainer1.SplitterDistance = 458;
this.splitContainer1.SplitterWidth = 2;
this.splitContainer1.TabIndex = 7;
//
@@ -838,8 +840,10 @@ private void InitializeComponent()
this.textBox_chatMessages.Name = "textBox_chatMessages";
this.textBox_chatMessages.ReadOnly = true;
this.textBox_chatMessages.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.textBox_chatMessages.Size = new System.Drawing.Size(425, 423);
+ this.textBox_chatMessages.Size = new System.Drawing.Size(448, 286);
this.textBox_chatMessages.TabIndex = 3;
+ this.textBox_chatMessages.MouseDown += new System.Windows.Forms.MouseEventHandler(this.textBox_chatMessages_MouseDown);
+ this.textBox_chatMessages.MouseUp += new System.Windows.Forms.MouseEventHandler(this.textBox_chatMessages_MouseUp);
//
// listBox_chatUserList
//
@@ -850,7 +854,7 @@ private void InitializeComponent()
this.listBox_chatUserList.IntegralHeight = false;
this.listBox_chatUserList.Location = new System.Drawing.Point(0, 17);
this.listBox_chatUserList.Name = "listBox_chatUserList";
- this.listBox_chatUserList.Size = new System.Drawing.Size(169, 409);
+ this.listBox_chatUserList.Size = new System.Drawing.Size(179, 272);
this.listBox_chatUserList.TabIndex = 6;
this.listBox_chatUserList.DoubleClick += new System.EventHandler(this.listBox_chatUserList_DoubleClick);
//
@@ -877,7 +881,7 @@ private void InitializeComponent()
// button_clearChat
//
this.button_clearChat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.button_clearChat.Location = new System.Drawing.Point(589, 469);
+ this.button_clearChat.Location = new System.Drawing.Point(620, 335);
this.button_clearChat.Name = "button_clearChat";
this.button_clearChat.Size = new System.Drawing.Size(39, 21);
this.button_clearChat.TabIndex = 2;
@@ -889,11 +893,11 @@ private void InitializeComponent()
//
this.textBox_chatEntry.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.textBox_chatEntry.Location = new System.Drawing.Point(0, 470);
+ this.textBox_chatEntry.Location = new System.Drawing.Point(3, 335);
this.textBox_chatEntry.MaxLength = 1400;
this.textBox_chatEntry.Name = "textBox_chatEntry";
this.textBox_chatEntry.ReadOnly = true;
- this.textBox_chatEntry.Size = new System.Drawing.Size(586, 20);
+ this.textBox_chatEntry.Size = new System.Drawing.Size(615, 20);
this.textBox_chatEntry.TabIndex = 1;
this.textBox_chatEntry.Text = "The chat is enabled after the engine is started.";
this.textBox_chatEntry.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox_chatEntry_KeyPress);
@@ -906,7 +910,7 @@ private void InitializeComponent()
this.tabPage_messages.Controls.Add(this.button_clearMessages);
this.tabPage_messages.Location = new System.Drawing.Point(4, 22);
this.tabPage_messages.Name = "tabPage_messages";
- this.tabPage_messages.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_messages.Size = new System.Drawing.Size(661, 359);
this.tabPage_messages.TabIndex = 2;
this.tabPage_messages.Text = "Messages";
//
@@ -932,7 +936,7 @@ private void InitializeComponent()
this.listBox_messages.Location = new System.Drawing.Point(0, 36);
this.listBox_messages.Name = "listBox_messages";
this.listBox_messages.ScrollAlwaysVisible = true;
- this.listBox_messages.Size = new System.Drawing.Size(626, 457);
+ this.listBox_messages.Size = new System.Drawing.Size(659, 320);
this.listBox_messages.TabIndex = 1;
//
// button_clearMessages
@@ -955,7 +959,7 @@ private void InitializeComponent()
this.tabPage_settings.Location = new System.Drawing.Point(4, 22);
this.tabPage_settings.Name = "tabPage_settings";
this.tabPage_settings.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage_settings.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_settings.Size = new System.Drawing.Size(661, 359);
this.tabPage_settings.TabIndex = 1;
this.tabPage_settings.Text = "Settings";
//
@@ -970,7 +974,7 @@ private void InitializeComponent()
this.tabControl_settings.Location = new System.Drawing.Point(0, 6);
this.tabControl_settings.Name = "tabControl_settings";
this.tabControl_settings.SelectedIndex = 0;
- this.tabControl_settings.Size = new System.Drawing.Size(622, 452);
+ this.tabControl_settings.Size = new System.Drawing.Size(655, 318);
this.tabControl_settings.TabIndex = 38;
//
// tabPageSettings_general
@@ -985,7 +989,7 @@ private void InitializeComponent()
this.tabPageSettings_general.Location = new System.Drawing.Point(4, 25);
this.tabPageSettings_general.Name = "tabPageSettings_general";
this.tabPageSettings_general.Padding = new System.Windows.Forms.Padding(3);
- this.tabPageSettings_general.Size = new System.Drawing.Size(614, 423);
+ this.tabPageSettings_general.Size = new System.Drawing.Size(647, 289);
this.tabPageSettings_general.TabIndex = 1;
this.tabPageSettings_general.Text = "General";
this.tabPageSettings_general.UseVisualStyleBackColor = true;
@@ -996,7 +1000,7 @@ private void InitializeComponent()
this.groupBox_newsFeed.Controls.Add(this.label7);
this.groupBox_newsFeed.Controls.Add(this.checkBox_showNewsFeed);
this.groupBox_newsFeed.Controls.Add(this.textBox_newsFeedUri);
- this.groupBox_newsFeed.Location = new System.Drawing.Point(6, 311);
+ this.groupBox_newsFeed.Location = new System.Drawing.Point(6, 357);
this.groupBox_newsFeed.Name = "groupBox_newsFeed";
this.groupBox_newsFeed.Size = new System.Drawing.Size(363, 106);
this.groupBox_newsFeed.TabIndex = 37;
@@ -1056,7 +1060,7 @@ private void InitializeComponent()
this.groupBox_usersettings.Controls.Add(this.textBox_chatNickname);
this.groupBox_usersettings.Location = new System.Drawing.Point(6, 6);
this.groupBox_usersettings.Name = "groupBox_usersettings";
- this.groupBox_usersettings.Size = new System.Drawing.Size(600, 60);
+ this.groupBox_usersettings.Size = new System.Drawing.Size(599, 60);
this.groupBox_usersettings.TabIndex = 36;
this.groupBox_usersettings.TabStop = false;
this.groupBox_usersettings.Text = "user";
@@ -1076,7 +1080,7 @@ private void InitializeComponent()
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox_chatNickname.Location = new System.Drawing.Point(6, 32);
this.textBox_chatNickname.Name = "textBox_chatNickname";
- this.textBox_chatNickname.Size = new System.Drawing.Size(588, 20);
+ this.textBox_chatNickname.Size = new System.Drawing.Size(587, 20);
this.textBox_chatNickname.TabIndex = 0;
this.toolTip1.SetToolTip(this.textBox_chatNickname, "the nickname will appear in the chat as well as in the node list");
this.textBox_chatNickname.Leave += new System.EventHandler(this.textBox_chatNickname_Leave);
@@ -1088,9 +1092,9 @@ private void InitializeComponent()
this.groupBox_updates.Controls.Add(this.checkBox_preventSystemStandby);
this.groupBox_updates.Controls.Add(this.checkBox_minimize2systray);
this.groupBox_updates.Controls.Add(this.checkBox_checkForUpdates);
- this.groupBox_updates.Location = new System.Drawing.Point(6, 216);
+ this.groupBox_updates.Location = new System.Drawing.Point(6, 262);
this.groupBox_updates.Name = "groupBox_updates";
- this.groupBox_updates.Size = new System.Drawing.Size(600, 89);
+ this.groupBox_updates.Size = new System.Drawing.Size(599, 89);
this.groupBox_updates.TabIndex = 35;
this.groupBox_updates.TabStop = false;
this.groupBox_updates.Text = "system";
@@ -1139,9 +1143,9 @@ private void InitializeComponent()
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox5.Controls.Add(this.checkBox_chat_notify);
this.groupBox5.Controls.Add(this.checkBox_newNodeSound);
- this.groupBox5.Location = new System.Drawing.Point(6, 143);
+ this.groupBox5.Location = new System.Drawing.Point(6, 189);
this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(600, 67);
+ this.groupBox5.Size = new System.Drawing.Size(599, 67);
this.groupBox5.TabIndex = 34;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "sound";
@@ -1176,15 +1180,87 @@ private void InitializeComponent()
//
this.groupBox_chatsettings.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox_chatsettings.Controls.Add(this.label10);
+ this.groupBox_chatsettings.Controls.Add(this.comboBox_DefaultTranslationLang);
this.groupBox_chatsettings.Controls.Add(this.checkBox_chat_nodeInfoMessagesInChat);
this.groupBox_chatsettings.Controls.Add(this.checkBox_chatAutoSwitch);
this.groupBox_chatsettings.Location = new System.Drawing.Point(6, 72);
this.groupBox_chatsettings.Name = "groupBox_chatsettings";
- this.groupBox_chatsettings.Size = new System.Drawing.Size(600, 65);
+ this.groupBox_chatsettings.Size = new System.Drawing.Size(599, 111);
this.groupBox_chatsettings.TabIndex = 30;
this.groupBox_chatsettings.TabStop = false;
this.groupBox_chatsettings.Text = "chat settings";
//
+ // label10
+ //
+ this.label10.AutoSize = true;
+ this.label10.Location = new System.Drawing.Point(9, 66);
+ this.label10.Name = "label10";
+ this.label10.Size = new System.Drawing.Size(139, 13);
+ this.label10.TabIndex = 34;
+ this.label10.Text = "Default translation language";
+ //
+ // comboBox_DefaultTranslationLang
+ //
+ this.comboBox_DefaultTranslationLang.FormattingEnabled = true;
+ this.comboBox_DefaultTranslationLang.Items.AddRange(new object[] {
+ "Afrikaans",
+ "Albanian",
+ "Arabic",
+ "Belarusian",
+ "Bulgarian",
+ "Catalan",
+ "Chinese",
+ "Croatian",
+ "Czech",
+ "Danish",
+ "Dutch",
+ "English",
+ "Estonian",
+ "Filipino",
+ "Finnish",
+ "French",
+ "Galician",
+ "German",
+ "Greek",
+ "Haitian Creole",
+ "Hebrew",
+ "Hindi",
+ "Hungarian",
+ "Icelandic",
+ "Indonesian",
+ "Irish",
+ "Italian",
+ "Japanese",
+ "Korean",
+ "Latvian",
+ "Lithuanian",
+ "Macedonian",
+ "Malay",
+ "Maltese",
+ "Norwegian",
+ "Persian",
+ "Polish",
+ "Portuguese",
+ "Romanian",
+ "Russian",
+ "Serbian",
+ "Slovak",
+ "Slovenian",
+ "Spanish",
+ "Swahili",
+ "Swedish",
+ "Thai",
+ "Turkish",
+ "Ukrainian",
+ "Vietnamese",
+ "Welsh",
+ "Yiddish"});
+ this.comboBox_DefaultTranslationLang.Location = new System.Drawing.Point(9, 82);
+ this.comboBox_DefaultTranslationLang.Name = "comboBox_DefaultTranslationLang";
+ this.comboBox_DefaultTranslationLang.Size = new System.Drawing.Size(157, 21);
+ this.comboBox_DefaultTranslationLang.TabIndex = 33;
+ //
// checkBox_chat_nodeInfoMessagesInChat
//
this.checkBox_chat_nodeInfoMessagesInChat.AutoSize = true;
@@ -1224,7 +1300,7 @@ private void InitializeComponent()
this.tabPageSettings_network.Location = new System.Drawing.Point(4, 25);
this.tabPageSettings_network.Name = "tabPageSettings_network";
this.tabPageSettings_network.Padding = new System.Windows.Forms.Padding(3);
- this.tabPageSettings_network.Size = new System.Drawing.Size(614, 423);
+ this.tabPageSettings_network.Size = new System.Drawing.Size(647, 289);
this.tabPageSettings_network.TabIndex = 0;
this.tabPageSettings_network.Text = "Network";
this.tabPageSettings_network.UseVisualStyleBackColor = true;
@@ -1237,7 +1313,7 @@ private void InitializeComponent()
this.groupBox1.Controls.Add(this.comboBox_captureDevice);
this.groupBox1.Location = new System.Drawing.Point(6, 6);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(600, 61);
+ this.groupBox1.Size = new System.Drawing.Size(599, 61);
this.groupBox1.TabIndex = 40;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "packet sniffer";
@@ -1255,7 +1331,7 @@ private void InitializeComponent()
this.groupBox_portoptions.Controls.Add(this.textBox_local_Port);
this.groupBox_portoptions.Location = new System.Drawing.Point(6, 73);
this.groupBox_portoptions.Name = "groupBox_portoptions";
- this.groupBox_portoptions.Size = new System.Drawing.Size(600, 107);
+ this.groupBox_portoptions.Size = new System.Drawing.Size(599, 107);
this.groupBox_portoptions.TabIndex = 39;
this.groupBox_portoptions.TabStop = false;
this.groupBox_portoptions.Text = "internet connection";
@@ -1291,7 +1367,7 @@ private void InitializeComponent()
this.groupBox_packetfilter.Controls.Add(this.checkBox_excludeGatewayIPs);
this.groupBox_packetfilter.Location = new System.Drawing.Point(6, 186);
this.groupBox_packetfilter.Name = "groupBox_packetfilter";
- this.groupBox_packetfilter.Size = new System.Drawing.Size(600, 91);
+ this.groupBox_packetfilter.Size = new System.Drawing.Size(599, 91);
this.groupBox_packetfilter.TabIndex = 38;
this.groupBox_packetfilter.TabStop = false;
this.groupBox_packetfilter.Text = "packet filter";
@@ -1351,7 +1427,7 @@ private void InitializeComponent()
this.groupBox_MAClist.Controls.Add(this.listBox_MAC_list);
this.groupBox_MAClist.Location = new System.Drawing.Point(6, 283);
this.groupBox_MAClist.Name = "groupBox_MAClist";
- this.groupBox_MAClist.Size = new System.Drawing.Size(600, 130);
+ this.groupBox_MAClist.Size = new System.Drawing.Size(599, 130);
this.groupBox_MAClist.TabIndex = 21;
this.groupBox_MAClist.TabStop = false;
this.groupBox_MAClist.Text = "\"always forward\" MAC list";
@@ -1430,7 +1506,7 @@ private void InitializeComponent()
// button_reset_settings
//
this.button_reset_settings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.button_reset_settings.Location = new System.Drawing.Point(117, 464);
+ this.button_reset_settings.Location = new System.Drawing.Point(117, 330);
this.button_reset_settings.Name = "button_reset_settings";
this.button_reset_settings.Size = new System.Drawing.Size(55, 23);
this.button_reset_settings.TabIndex = 34;
@@ -1441,7 +1517,7 @@ private void InitializeComponent()
// button_save_settings
//
this.button_save_settings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.button_save_settings.Location = new System.Drawing.Point(6, 464);
+ this.button_save_settings.Location = new System.Drawing.Point(6, 330);
this.button_save_settings.Name = "button_save_settings";
this.button_save_settings.Size = new System.Drawing.Size(105, 23);
this.button_save_settings.TabIndex = 23;
@@ -1465,7 +1541,7 @@ private void InitializeComponent()
this.tabPage_nat.Controls.Add(this.label17);
this.tabPage_nat.Location = new System.Drawing.Point(4, 22);
this.tabPage_nat.Name = "tabPage_nat";
- this.tabPage_nat.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_nat.Size = new System.Drawing.Size(661, 359);
this.tabPage_nat.TabIndex = 6;
this.tabPage_nat.Text = "NAT";
//
@@ -1473,7 +1549,7 @@ private void InitializeComponent()
//
this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(27, 469);
+ this.label18.Location = new System.Drawing.Point(27, 335);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(68, 13);
this.label18.TabIndex = 14;
@@ -1487,7 +1563,7 @@ private void InitializeComponent()
"255.255.255.0",
"255.255.0.0",
"255.0.0.0"});
- this.comboBox_nat_netmask.Location = new System.Drawing.Point(101, 466);
+ this.comboBox_nat_netmask.Location = new System.Drawing.Point(101, 332);
this.comboBox_nat_netmask.Name = "comboBox_nat_netmask";
this.comboBox_nat_netmask.Size = new System.Drawing.Size(94, 21);
this.comboBox_nat_netmask.TabIndex = 13;
@@ -1496,7 +1572,7 @@ private void InitializeComponent()
// button_nat_ippool_del
//
this.button_nat_ippool_del.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.button_nat_ippool_del.Location = new System.Drawing.Point(246, 440);
+ this.button_nat_ippool_del.Location = new System.Drawing.Point(246, 306);
this.button_nat_ippool_del.Name = "button_nat_ippool_del";
this.button_nat_ippool_del.Size = new System.Drawing.Size(99, 20);
this.button_nat_ippool_del.TabIndex = 12;
@@ -1507,7 +1583,7 @@ private void InitializeComponent()
// button_nat_add_iprange
//
this.button_nat_add_iprange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.button_nat_add_iprange.Location = new System.Drawing.Point(201, 440);
+ this.button_nat_add_iprange.Location = new System.Drawing.Point(201, 306);
this.button_nat_add_iprange.Name = "button_nat_add_iprange";
this.button_nat_add_iprange.Size = new System.Drawing.Size(39, 20);
this.button_nat_add_iprange.TabIndex = 11;
@@ -1519,7 +1595,7 @@ private void InitializeComponent()
//
this.textBox_nat_iprange_to.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox_nat_iprange_to.ForeColor = System.Drawing.Color.LightGray;
- this.textBox_nat_iprange_to.Location = new System.Drawing.Point(101, 440);
+ this.textBox_nat_iprange_to.Location = new System.Drawing.Point(101, 306);
this.textBox_nat_iprange_to.Name = "textBox_nat_iprange_to";
this.textBox_nat_iprange_to.Size = new System.Drawing.Size(94, 20);
this.textBox_nat_iprange_to.TabIndex = 10;
@@ -1532,7 +1608,7 @@ private void InitializeComponent()
//
this.textBox_nat_iprange_from.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox_nat_iprange_from.ForeColor = System.Drawing.Color.LightGray;
- this.textBox_nat_iprange_from.Location = new System.Drawing.Point(6, 440);
+ this.textBox_nat_iprange_from.Location = new System.Drawing.Point(6, 306);
this.textBox_nat_iprange_from.Name = "textBox_nat_iprange_from";
this.textBox_nat_iprange_from.Size = new System.Drawing.Size(94, 20);
this.textBox_nat_iprange_from.TabIndex = 9;
@@ -1545,7 +1621,7 @@ private void InitializeComponent()
//
this.label20.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(3, 424);
+ this.label20.Location = new System.Drawing.Point(3, 290);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(107, 13);
this.label20.TabIndex = 8;
@@ -1573,7 +1649,7 @@ private void InitializeComponent()
this.listView_nat_IPpool.GridLines = true;
this.listView_nat_IPpool.Location = new System.Drawing.Point(0, 134);
this.listView_nat_IPpool.Name = "listView_nat_IPpool";
- this.listView_nat_IPpool.Size = new System.Drawing.Size(626, 287);
+ this.listView_nat_IPpool.Size = new System.Drawing.Size(659, 153);
this.listView_nat_IPpool.TabIndex = 3;
this.listView_nat_IPpool.UseCompatibleStateImageBehavior = false;
this.listView_nat_IPpool.View = System.Windows.Forms.View.Details;
@@ -1608,7 +1684,7 @@ private void InitializeComponent()
this.groupBox3.Controls.Add(this.checkBox_nat_enable);
this.groupBox3.Location = new System.Drawing.Point(6, 27);
this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(339, 88);
+ this.groupBox3.Size = new System.Drawing.Size(372, 88);
this.groupBox3.TabIndex = 2;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "NAT settings";
@@ -1664,7 +1740,7 @@ private void InitializeComponent()
this.tabPage_about.Controls.Add(this.richTextBox_about);
this.tabPage_about.Location = new System.Drawing.Point(4, 22);
this.tabPage_about.Name = "tabPage_about";
- this.tabPage_about.Size = new System.Drawing.Size(628, 493);
+ this.tabPage_about.Size = new System.Drawing.Size(661, 359);
this.tabPage_about.TabIndex = 3;
this.tabPage_about.Text = "About";
//
@@ -1677,7 +1753,7 @@ private void InitializeComponent()
this.richTextBox_about.Location = new System.Drawing.Point(0, 3);
this.richTextBox_about.Name = "richTextBox_about";
this.richTextBox_about.ReadOnly = true;
- this.richTextBox_about.Size = new System.Drawing.Size(625, 490);
+ this.richTextBox_about.Size = new System.Drawing.Size(658, 458);
this.richTextBox_about.TabIndex = 0;
this.richTextBox_about.Text = "";
this.richTextBox_about.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBox_about_LinkClicked);
@@ -1693,7 +1769,7 @@ private void InitializeComponent()
this.comboBox_RemoteHost.FormattingEnabled = true;
this.comboBox_RemoteHost.Location = new System.Drawing.Point(86, 39);
this.comboBox_RemoteHost.Name = "comboBox_RemoteHost";
- this.comboBox_RemoteHost.Size = new System.Drawing.Size(513, 21);
+ this.comboBox_RemoteHost.Size = new System.Drawing.Size(546, 21);
this.comboBox_RemoteHost.TabIndex = 18;
this.comboBox_RemoteHost.Text = "otherhost.dyndns.org";
//
@@ -1742,7 +1818,7 @@ private void InitializeComponent()
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(654, 610);
+ this.ClientSize = new System.Drawing.Size(687, 476);
this.Controls.Add(this.comboBox_RemoteHost);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.button_announce);
@@ -1952,6 +2028,8 @@ private void InitializeComponent()
private System.Windows.Forms.TabPage tab_general;
private System.Windows.Forms.ContextMenuStrip MenuStrip_tabs;
private System.Windows.Forms.ToolStripMenuItem itm_close;
+ private System.Windows.Forms.Label label10;
+ private System.Windows.Forms.ComboBox comboBox_DefaultTranslationLang;
}
}
View
94 XBSlink/Form1.cs
@@ -196,23 +196,18 @@ public void initializateXlinkKaiUdpServer()
void XlinkServer_XlinkConsoleJoinCloud(xlink_msg udp_msg, string CloudName, string CloudPassword)
{
- //WriteHeader(udp_msg, "[XLINK/JOINCLOUD] :" + udp_msg.data_msg);
-
- Invoke((MethodInvoker)delegate
- {
- textBox_CloudName.Text = CloudName;
- textBox_CloudPassword.Text = CloudPassword;
- JoinChannel(CloudName, CloudPassword);
- });
-
+ JoinChannel(CloudName, CloudPassword);
}
void JoinChannel(string CloudName, string CloudPassword)
{
- LeaveChannel();
- var encontrado = cloudlist.findCloud(CloudName);
- if (encontrado != null)
- join_cloud(CloudName, encontrado.max_nodes.ToString(), CloudPassword);
+ Invoke((MethodInvoker)delegate
+ {
+ LeaveChannel();
+ var encontrado = cloudlist.findCloud(CloudName);
+ if (encontrado != null)
+ join_cloud(CloudName, encontrado.max_nodes.ToString(), CloudPassword);
+ });
}
void XlinkServer_XlinkConsoleLogin(xlink_msg udp_msg)
@@ -249,13 +244,6 @@ void udp_listener_PmMessage(xbs_node_message_msgpm udp_msg)
GetSendMessagePM(udp_msg.sender.nickname, udp_msg.message_string, false);
}
-
- void udp_listener_DeleteNode(string NickName)
- {
- Console.WriteLine("[ENGINE/LEAVEUSER]" + NickName);
- udp_xlink_server.XBS_LeaveUser(null, NickName);
- }
-
void udp_listener_AddNode(string NickName, string client_version, string last_ping_delay_ms)
{
Console.WriteLine("[ENGINE/ADDUSER] : " + NickName + " VERSION: " + client_version + " PING: " + last_ping_delay_ms);
@@ -433,6 +421,8 @@ private void initWithRegistryValues()
updateNATIPPoolListView();
}
+ comboBox_DefaultTranslationLang.Text = s.REG_DEFAULT_TRANSLATION_LANG;
+
comboBox_captureDevice.Text = s.REG_CAPTURE_DEVICE_NAME;
comboBox_localIP.Text = s.REG_LOCAL_IP;
textBox_local_Port.Text = s.REG_LOCAL_PORT.ToString();
@@ -503,6 +493,9 @@ private void saveRegistryValues()
s.REG_SHOW_NEWS_FEED = checkBox_showNewsFeed.Checked;
s.REG_NEWS_FEED_URI = textBox_newsFeedUri.Text;
s.REG_NEWS_FEED_SWITCH_TO_TAB = checkBox_switchToNewsTab.Checked;
+ s.REG_DEFAULT_TRANSLATION_LANG = comboBox_DefaultTranslationLang.Text;
+
+
s.Save();
}
@@ -591,7 +584,6 @@ private void resume_start_engine()
if (udp_listener != null)
{
udp_listener.AddNode -= udp_listener_AddNode;
- udp_listener.DeleteNode -= udp_listener_DeleteNode;
udp_listener.ChatMessage -= udp_listener_ChatMessage;
udp_listener.PmMessage -= udp_listener_PmMessage;
}
@@ -599,9 +591,8 @@ private void resume_start_engine()
udp_listener = new xbs_udp_listener(internal_ip, UInt16.Parse(textBox_local_Port.Text), node_list);
udp_listener.AddNode += udp_listener_AddNode;
- udp_listener.DeleteNode += udp_listener_DeleteNode;
udp_listener.ChatMessage += udp_listener_ChatMessage;
- udp_listener.PmMessage +=udp_listener_PmMessage;
+ udp_listener.PmMessage +=udp_listener_PmMessage;
}
catch (Exception e)
{
@@ -1446,9 +1437,10 @@ public void loadCloudList()
initCloudListView();
foreach (xbs_cloud cloud in clouds)
{
- //Sending Clouds to consoles
-
+
+ if (udp_xlink_server.IsConsoleLogged)
udp_xlink_server.XBS_ChannelCreate(null,cloud.name, cloud.node_count, cloud.isPrivate, cloud.max_nodes);
+
ListViewItem lv_item = new ListViewItem(cloud.name);
lv_item.SubItems.Add(cloud.node_count.ToString());
lv_item.SubItems.Add(cloud.max_nodes.ToString());
@@ -1505,18 +1497,22 @@ public bool join_cloud(string CloudName, string MaxNodes, string Password)
public bool join_cloud(string CloudList, string CloudName, string MaxNodes, string Password)
{
- var ret = cloudlist.JoinOrCreateCloud(CloudList, CloudName, MaxNodes, Password, node_list.local_node.ip_public, node_list.local_node.port_public, node_list.local_node.nickname, xbs_upnp.isPortReachable, xbs_settings.xbslink_version);
- if (ret)
- {
- toolTip2.Show("joined " + textBox_CloudName.Text, button_CloudJoin, 0, -20, 2000);
- button_CloudLeave.Enabled = true;
- button_CloudJoin.Enabled = false;
- textBox_CloudName.Enabled = false;
- textBox_CloudMaxNodes.Enabled = false;
- textBox_CloudPassword.Enabled = false;
- switch_tab = tabPage_info;
- }
- return ret;
+
+
+ var ret = cloudlist.JoinOrCreateCloud(CloudList, CloudName, MaxNodes, Password, node_list.local_node.ip_public, node_list.local_node.port_public, node_list.local_node.nickname, xbs_upnp.isPortReachable, xbs_settings.xbslink_version);
+ if (ret)
+ {
+ toolTip2.Show("joined " + textBox_CloudName.Text, button_CloudJoin, 0, -20, 2000);
+ button_CloudLeave.Enabled = true;
+ button_CloudJoin.Enabled = false;
+ textBox_CloudName.Enabled = false;
+ textBox_CloudMaxNodes.Enabled = false;
+ textBox_CloudPassword.Enabled = false;
+ switch_tab = tabPage_info;
+ }
+ return ret;
+
+
}
private bool join_cloud()
@@ -2198,6 +2194,30 @@ private void listBox_chatUserList_DoubleClick(object sender, EventArgs e)
AddPrivateChat(listBox_chatUserList.SelectedItem.ToString(), true);
}
+
+
+ private void textBox_chatMessages_MouseUp(object sender, MouseEventArgs e)
+ {
+ if (e.Button == System.Windows.Forms.MouseButtons.Left)
+ {
+ if (textBox_chatMessages.SelectedText != "")
+ {
+ toolTip1.Show(
+ Translator.TranslatorEngine.TranslateText(textBox_chatMessages.SelectedText, comboBox_DefaultTranslationLang.Text),
+ textBox_chatMessages);
+ }
+
+ }
+ }
+
+ private void textBox_chatMessages_MouseDown(object sender, MouseEventArgs e)
+ {
+ if (e.Button == System.Windows.Forms.MouseButtons.Left)
+ {
+ textBox_chatMessages.SelectedText = "";
+ }
+ }
+
}
View
2  XBSlink/Form1.resx
@@ -142,7 +142,7 @@
<value>153, 36</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>58</value>
+ <value>101</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
View
22 XBSlink/Properties/Settings.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
-// Dieser Code wurde von einem Tool generiert.
-// Laufzeitversion:4.0.30319.239
+// Este código fue generado por una herramienta.
+// Versión de runtime:4.0.30319.17626
//
-// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
-// der Code erneut generiert wird.
+// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
+// se vuelve a generar el código.
// </auto-generated>
//------------------------------------------------------------------------------
@@ -12,7 +12,7 @@ namespace XBSlink.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -394,5 +394,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
this["REG_NEWS_FEED_SWITCH_TO_TAB"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("English")]
+ public string REG_DEFAULT_TRANSLATION_LANG {
+ get {
+ return ((string)(this["REG_DEFAULT_TRANSLATION_LANG"]));
+ }
+ set {
+ this["REG_DEFAULT_TRANSLATION_LANG"] = value;
+ }
+ }
}
}
View
3  XBSlink/Properties/Settings.settings
@@ -95,5 +95,8 @@
<Setting Name="REG_NEWS_FEED_SWITCH_TO_TAB" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
+ <Setting Name="REG_DEFAULT_TRANSLATION_LANG" Type="System.String" Scope="User">
+ <Value Profile="(Default)">English</Value>
+ </Setting>
</Settings>
</SettingsFile>
View
4 XBSlink/XBSlink.csproj
@@ -112,6 +112,9 @@
<DependentUpon>ExceptionMessage.cs</DependentUpon>
</Compile>
<Compile Include="Options.cs" />
+ <Compile Include="translator\parsers\StringParser.cs" />
+ <Compile Include="translator\TranslatorEngine.cs" />
+ <Compile Include="translator\web\WebResourceProvider.cs" />
<Compile Include="xbs_cloud.cs" />
<Compile Include="xlink\xlink_delegates.cs" />
<Compile Include="Settings.cs" />
@@ -239,6 +242,7 @@
<Content Include="warning_16.png" />
<Content Include="XBSlink.ico" />
</ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
3  XBSlink/app.config
@@ -102,6 +102,9 @@
<setting name="REG_NEWS_FEED_SWITCH_TO_TAB" serializeAs="String">
<value>True</value>
</setting>
+ <setting name="REG_DEFAULT_TRANSLATION_LANG" serializeAs="String">
+ <value>English</value>
+ </setting>
</XBSlink.Properties.Settings>
</userSettings>
</configuration>
View
362 XBSlink/translator/TranslatorEngine.cs
@@ -0,0 +1,362 @@
+
+using System;
+using System.Collections.Generic;
+using XBSlink.Translator.Strings;
+using XBSlink.Translator.Web;
+
+
+
+
+namespace XBSlink.Translator
+{
+
+
+
+ /// <summary>
+ /// Translates text using Google's online language tools.
+ /// </summary>
+ public class TranslatorEngine : WebResourceProvider
+ {
+
+
+
+ #region Constructor
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Translator"/> class.
+ /// </summary>
+ public TranslatorEngine()
+ {
+ this.SourceLanguage = "English";
+ this.TargetLanguage = "French";
+ this.Referer = "http://www.google.com";
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the source "
+ /// </summary>
+ /// <value>The source "</value>
+ public string SourceLanguage {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the target "
+ /// </summary>
+ /// <value>The target "</value>
+ public string TargetLanguage {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the source text.
+ /// </summary>
+ /// <value>The source text.</value>
+ public string SourceText {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets the translation.
+ /// </summary>
+ /// <value>The translated text.</value>
+ public string Translation {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// Gets the reverse translation.
+ /// </summary>
+ /// <value>The reverse translated text.</value>
+ public string ReverseTranslation {
+ get;
+ private set;
+ }
+
+ #endregion
+
+ #region Public methods
+
+ /// <summary>
+ /// Attempts to translate the text.
+ /// </summary>
+ public void Translate()
+ {
+ // Validate source and target languages
+ if (string.IsNullOrEmpty (this.SourceLanguage) ||
+ string.IsNullOrEmpty (this.TargetLanguage) ||
+ this.SourceLanguage.Trim().Equals (this.TargetLanguage.Trim())) {
+ throw new Exception ("An invalid source or target language was specified.");
+ }
+
+ // Delegate to base class
+ this.fetchResource();
+ }
+
+ #endregion
+
+ #region WebResourceProvider implementation
+
+ /// <summary>
+ /// Returns the url to be fetched.
+ /// </summary>
+ /// <returns>The url to be fetched.</returns>
+ protected override string getFetchUrl()
+ {
+ return "http://translate.google.com/translate_t";
+ }
+
+ /// <summary>
+ /// Retrieves the POST data (if any) to be sent to the url to be fetched.
+ /// The data is returned as a string of the form "arg=val[&arg=val]...".
+ /// </summary>
+ /// <returns>A string containing the POST data or null if none.</returns>
+ protected override string getPostData()
+ {
+ // Set translation mode
+ string strPostData = string.Format ("hl=en&ie=UTF8&oe=UTF8submit=Translate&langpair={0}|{1}",
+ LanguageEnumToIdentifier (this.SourceLanguage),
+ LanguageEnumToIdentifier (this.TargetLanguage));
+
+ // Set text to be translated
+ strPostData += "&text=\"" + this.SourceText + "\"";
+ return strPostData;
+ }
+
+ /// <summary>
+ /// Parses the fetched content.
+ /// </summary>
+ protected override void parseContent()
+ {
+ // Initialize the scraper
+ this.Translation = string.Empty;
+ string strContent = this.Content;
+ StringParser parser = new StringParser (strContent);
+
+ // Scrape the translation
+ string strTranslation = string.Empty;
+ if (parser.skipToEndOf ("<span id=result_box")) {
+ if (parser.skipToEndOf ("onmouseout=\"this.style.backgroundColor='#fff'\">")) {
+ if (parser.extractTo("</span>", ref strTranslation)) {
+ strTranslation = StringParser.removeHtml (strTranslation);
+ }
+ }
+ }
+
+ #region Fix up the translation
+ int startClean = 0;
+ int endClean = 0;
+ int i=0;
+ while (i < strTranslation.Length) {
+ if (Char.IsLetterOrDigit (strTranslation[i])) {
+ startClean = i;
+ break;
+ }
+ i++;
+ }
+ i = strTranslation.Length - 1;
+ while (i > 0) {
+ char ch = strTranslation[i];
+ if (Char.IsLetterOrDigit (ch) ||
+ (Char.IsPunctuation (ch) && (ch != '\"'))) {
+ endClean = i;
+ break;
+ }
+ i--;
+ }
+ this.Translation = strTranslation.Substring (startClean, endClean - startClean + 1).Replace ("\"", "");
+ #endregion
+ }
+
+ #endregion
+
+ public class Languages
+ {
+
+ public static string _AUTODETECT = "Autodetect";
+ public static string _ENGLISH = "English";
+ public static string _SPANISH = "Spanish";
+
+ public string description { get; set; }
+ public string code { get; set; }
+ }
+
+ public static List<Languages> GetLanguages()
+ {
+ List<Languages> lang = new List<Languages>();
+ lang.Add(new Languages() { description ="Afrikaans", code = "af" });
+ lang.Add(new Languages() { description ="Albanian", code = "sq" });
+ lang.Add(new Languages() { description ="Arabic", code = "ar" });
+ lang.Add(new Languages() { description ="Belarusian", code = "be" });
+ lang.Add(new Languages() { description ="Bulgarian", code = "bg" });
+ lang.Add(new Languages() { description ="Catalan", code = "ca" });
+ lang.Add(new Languages() { description ="Chinese", code = "zh-CN" });
+ lang.Add(new Languages() { description ="Croatian", code = "hr" });
+ lang.Add(new Languages() { description ="Czech", code = "cs" });
+ lang.Add(new Languages() { description ="Danish", code = "da" });
+ lang.Add(new Languages() { description ="Dutch", code = "nl" });
+ lang.Add(new Languages() { description ="English", code = "en" });
+ lang.Add(new Languages() { description ="Estonian", code = "et" });
+ lang.Add(new Languages() { description ="Filipino", code = "tl" });
+ lang.Add(new Languages() { description ="Finnish", code = "fi" });
+ lang.Add(new Languages() { description ="French", code = "fr" });
+ lang.Add(new Languages() { description ="Galician", code = "gl" });
+ lang.Add(new Languages() { description ="German", code = "de" });
+ lang.Add(new Languages() { description ="Greek", code = "el" });
+ lang.Add(new Languages() { description ="Haitian Creole ALPHA", code = "ht" });
+ lang.Add(new Languages() { description ="Hebrew", code = "iw" });
+ lang.Add(new Languages() { description ="Hindi", code = "hi" });
+ lang.Add(new Languages() { description ="Hungarian", code = "hu" });
+ lang.Add(new Languages() { description ="Icelandic", code = "is" });
+ lang.Add(new Languages() { description ="Indonesian", code = "id" });
+ lang.Add(new Languages() { description ="Irish", code = "ga" });
+ lang.Add(new Languages() { description ="Italian", code = "it" });
+ lang.Add(new Languages() { description ="Japanese", code = "ja" });
+ lang.Add(new Languages() { description ="Korean", code = "ko" });
+ lang.Add(new Languages() { description ="Latvian", code = "lv" });
+ lang.Add(new Languages() { description ="Lithuanian", code = "lt" });
+ lang.Add(new Languages() { description ="Macedonian", code = "mk" });
+ lang.Add(new Languages() { description ="Malay", code = "ms" });
+ lang.Add(new Languages() { description ="Maltese", code = "mt" });
+ lang.Add(new Languages() { description ="Norwegian", code = "no" });
+ lang.Add(new Languages() { description ="Persian", code = "fa" });
+ lang.Add(new Languages() { description ="Polish", code = "pl" });
+ lang.Add(new Languages() { description ="Portuguese", code = "pt" });
+ lang.Add(new Languages() { description ="Romanian", code = "ro" });
+ lang.Add(new Languages() { description ="Russian", code = "ru" });
+ lang.Add(new Languages() { description ="Serbian", code = "sr" });
+ lang.Add(new Languages() { description ="Slovak", code = "sk" });
+ lang.Add(new Languages() { description ="Slovenian", code = "sl" });
+ lang.Add(new Languages() { description ="Spanish", code = "es" });
+ lang.Add(new Languages() { description ="Swahili", code = "sw" });
+ lang.Add(new Languages() { description ="Swedish", code = "sv" });
+ lang.Add(new Languages() { description ="Thai", code = "th" });
+ lang.Add(new Languages() { description ="Turkish", code = "tr" });
+ lang.Add(new Languages() { description ="Ukrainian", code = "uk" });
+ lang.Add(new Languages() { description ="Vietnamese", code = "vi" });
+ lang.Add(new Languages() { description ="Welsh", code = "cy" });
+ lang.Add(new Languages() { description ="Yiddish", code = "yi" });
+ lang.Add(new Languages() { description ="Autodetect", code = "auto" });
+ return lang;
+ }
+
+ public static string TranslateText(string SourceText, string TargetLanguage)
+ {
+ return TranslateText(SourceText, Languages._AUTODETECT, TargetLanguage);
+ }
+
+ public static string TranslateText(string SourceText, string SourceLanguage, string TargetLanguage)
+ {
+ TranslatorEngine t = new TranslatorEngine();
+ t.SourceLanguage = SourceLanguage;
+ t.TargetLanguage = TargetLanguage;
+ t.SourceText = SourceText;
+
+ try
+ {
+ t.Translate();
+ return t.Translation;
+ }
+ catch (Exception ex)
+ {
+ xbs_messages.addDebugMessage("ERROR in Translator Engine: " + ex.Message, xbs_message_sender.TRANSLATOR, xbs_message_type.ERROR);
+ }
+ finally
+ {
+
+ }
+ return "";
+ }
+
+ #region Private methods
+
+ /// <summary>
+ /// Converts a language to its identifier.
+ /// </summary>
+ /// <param name="language">The language."</param>
+ /// <returns>The identifier or <see cref="string.Empty"/> if none.</returns>
+ private static string LanguageEnumToIdentifier
+ (string language)
+ {
+ if (_languageModeMap == null)
+ {
+ _languageModeMap = new Dictionary<string, string>();
+ _languageModeMap.Add("Afrikaans", "af");
+ _languageModeMap.Add("Albanian", "sq");
+ _languageModeMap.Add("Arabic", "ar");
+ _languageModeMap.Add("Belarusian", "be");
+ _languageModeMap.Add("Bulgarian", "bg");
+ _languageModeMap.Add("Catalan", "ca");
+ _languageModeMap.Add("Chinese", "zh-CN");
+ _languageModeMap.Add("Croatian", "hr");
+ _languageModeMap.Add("Czech", "cs");
+ _languageModeMap.Add("Danish", "da");
+ _languageModeMap.Add("Dutch", "nl");
+ _languageModeMap.Add ("English", "en");
+ _languageModeMap.Add ("Estonian", "et");
+ _languageModeMap.Add ("Filipino", "tl");
+ _languageModeMap.Add ("Finnish", "fi");
+ _languageModeMap.Add ("French", "fr");
+ _languageModeMap.Add ("Galician", "gl");
+ _languageModeMap.Add ("German", "de");
+ _languageModeMap.Add ("Greek", "el");
+ _languageModeMap.Add ("Haitian Creole ALPHA", "ht");
+ _languageModeMap.Add ("Hebrew", "iw");
+ _languageModeMap.Add ("Hindi", "hi");
+ _languageModeMap.Add ("Hungarian", "hu");
+ _languageModeMap.Add ("Icelandic", "is");
+ _languageModeMap.Add ("Indonesian", "id");
+ _languageModeMap.Add ("Irish", "ga");
+ _languageModeMap.Add ("Italian", "it");
+ _languageModeMap.Add ("Japanese", "ja");
+ _languageModeMap.Add ("Korean", "ko");
+ _languageModeMap.Add ("Latvian", "lv");
+ _languageModeMap.Add ("Lithuanian", "lt");
+ _languageModeMap.Add ("Macedonian", "mk");
+ _languageModeMap.Add ("Malay", "ms");
+ _languageModeMap.Add ("Maltese", "mt");
+ _languageModeMap.Add ("Norwegian", "no");
+ _languageModeMap.Add ("Persian", "fa");
+ _languageModeMap.Add ("Polish", "pl");
+ _languageModeMap.Add ("Portuguese", "pt");
+ _languageModeMap.Add ("Romanian", "ro");
+ _languageModeMap.Add ("Russian", "ru");
+ _languageModeMap.Add ("Serbian", "sr");
+ _languageModeMap.Add ("Slovak", "sk");
+ _languageModeMap.Add ("Slovenian", "sl");
+ _languageModeMap.Add ("Spanish", "es");
+ _languageModeMap.Add ("Swahili", "sw");
+ _languageModeMap.Add ("Swedish", "sv");
+ _languageModeMap.Add ("Thai", "th");
+ _languageModeMap.Add ("Turkish", "tr");
+ _languageModeMap.Add ("Ukrainian", "uk");
+ _languageModeMap.Add ("Vietnamese", "vi");
+ _languageModeMap.Add ("Welsh", "cy");
+ _languageModeMap.Add ("Yiddish", "yi");
+ _languageModeMap.Add("Autodetect", "auto");
+ }
+ string mode = string.Empty;
+ _languageModeMap.TryGetValue (language, out mode);
+ return mode;
+ }
+
+ #endregion
+
+ #region Fields
+
+ /// <summary>
+ /// The language to translation mode map.
+ /// </summary>
+ private static Dictionary<string, string> _languageModeMap;
+
+ #endregion
+ }
+}
View
416 XBSlink/translator/parsers/StringParser.cs
@@ -0,0 +1,416 @@
+namespace XBSlink.Translator.Strings
+{
+ using System;
+ using System.Collections;
+
+ public class StringParser
+ {
+ private int m_nIndex;
+ private string m_strContent;
+ private string m_strContentLC;
+
+ public StringParser()
+ {
+ this.m_strContent = "";
+ this.m_strContentLC = "";
+ this.m_nIndex = 0;
+ }
+
+ public StringParser(string strContent)
+ {
+ this.m_strContent = "";
+ this.m_strContentLC = "";
+ this.m_nIndex = 0;
+ this.Content = strContent;
+ }
+
+ public bool at(string strString)
+ {
+ return (this.m_strContent.IndexOf(strString, this.Position) == this.Position);
+ }
+
+ public bool atNoCase(string strString)
+ {
+ strString = strString.ToLower();
+ return (this.m_strContentLC.IndexOf(strString, this.Position) == this.Position);
+ }
+
+ public bool extractTo(string strString, ref string strExtract)
+ {
+ int index = this.m_strContent.IndexOf(strString, this.Position);
+ if (index != -1)
+ {
+ strExtract = this.m_strContent.Substring(this.m_nIndex, index - this.m_nIndex);
+ this.m_nIndex = index + strString.Length;
+ return true;
+ }
+ return false;
+ }
+
+ public void extractToEnd(ref string strExtract)
+ {
+ strExtract = "";
+ if (this.Position < this.m_strContent.Length)
+ {
+ int length = this.m_strContent.Length - this.Position;
+ strExtract = this.m_strContent.Substring(this.Position, length);
+ }
+ }
+
+ public bool extractToNoCase(string strString, ref string strExtract)
+ {
+ strString = strString.ToLower();
+ int index = this.m_strContentLC.IndexOf(strString, this.Position);
+ if (index != -1)
+ {
+ strExtract = this.m_strContent.Substring(this.m_nIndex, index - this.m_nIndex);
+ this.m_nIndex = index + strString.Length;
+ return true;
+ }
+ return false;
+ }
+
+ public bool extractUntil(string strString, ref string strExtract)
+ {
+ int index = this.m_strContent.IndexOf(strString, this.Position);
+ if (index != -1)
+ {
+ strExtract = this.m_strContent.Substring(this.m_nIndex, index - this.m_nIndex);
+ this.m_nIndex = index;
+ return true;
+ }
+ return false;
+ }
+
+ public bool extractUntilNoCase(string strString, ref string strExtract)
+ {
+ strString = strString.ToLower();
+ int index = this.m_strContentLC.IndexOf(strString, this.Position);
+ if (index != -1)
+ {
+ strExtract = this.m_strContent.Substring(this.m_nIndex, index - this.m_nIndex);
+ this.m_nIndex = index;
+ return true;
+ }
+ return false;
+ }
+
+ public static void getLinks(string strString, string strRootUrl, ref ArrayList documents, ref ArrayList images)
+ {
+ strString = removeComments(strString);
+ strString = removeScripts(strString);
+ StringParser parser = new StringParser(strString);
+ parser.replaceEvery("'", "\"");
+ string uri = "";
+ if (strRootUrl != null)
+ {
+ uri = strRootUrl.Trim();
+ }
+ if ((uri.Length > 0) && !uri.EndsWith("/"))
+ {
+ uri = uri + "/";
+ }
+ string strExtract = "";
+ parser.resetPosition();
+ while (parser.skipToEndOfNoCase("href=\""))
+ {
+ if (parser.extractTo("\"", ref strExtract))
+ {
+ strExtract = strExtract.Trim();
+ if ((strExtract.Length > 0) && (strExtract.IndexOf("mailto:") == -1))
+ {
+ if (!strExtract.StartsWith("http://") && !strExtract.StartsWith("ftp://"))
+ {
+ try
+ {
+ UriBuilder builder = new UriBuilder(uri);
+ builder.Path = strExtract;
+ strExtract = builder.Uri.ToString();
+ }
+ catch (Exception)
+ {
+ strExtract = "http://" + strExtract;
+ }
+ }
+ if (!documents.Contains(strExtract))
+ {
+ documents.Add(strExtract);
+ }
+ }
+ }
+ }
+ parser.resetPosition();
+ while (parser.skipToEndOfNoCase("src=\""))
+ {
+ if (parser.extractTo("\"", ref strExtract))
+ {
+ strExtract = strExtract.Trim();
+ if (strExtract.Length > 0)
+ {
+ if (!strExtract.StartsWith("http://") && !strExtract.StartsWith("ftp://"))
+ {
+ try
+ {
+ UriBuilder builder2 = new UriBuilder(uri);
+ builder2.Path = strExtract;
+ strExtract = builder2.Uri.ToString();
+ }
+ catch (Exception)
+ {
+ strExtract = "http://" + strExtract;
+ }
+ }
+ if (!images.Contains(strExtract))
+ {
+ images.Add(strExtract);
+ }
+ }
+ }
+ }
+ }
+
+ public static string removeComments(string strString)
+ {
+ string str = "";
+ string strExtract = "";
+ StringParser parser = new StringParser(strString);
+ while (parser.extractTo("<!--", ref strExtract))
+ {
+ str = str + strExtract;
+ if (!parser.skipToEndOf("-->"))
+ {
+ return strString;
+ }
+ }
+ parser.extractToEnd(ref strExtract);
+ return (str + strExtract);
+ }
+
+ public static string removeEnclosingAnchorTag(string strString)
+ {
+ string str = strString.ToLower();
+ int index = str.IndexOf("<a");
+ if (index != -1)
+ {
+ index++;
+ index = str.IndexOf(">", index);
+ if (index != -1)
+ {
+ index++;
+ int num2 = str.LastIndexOf("</a>");
+ if (num2 != -1)
+ {
+ return strString.Substring(index, num2 - index);
+ }
+ }
+ }
+ return strString;
+ }
+
+ public static string removeEnclosingQuotes(string strString)
+ {
+ int index = strString.IndexOf("\"");
+ if (index != -1)
+ {
+ int num2 = strString.LastIndexOf("\"");
+ if (num2 > index)
+ {
+ return strString.Substring(index, (num2 - index) - 1);
+ }
+ }
+ return strString;
+ }
+
+ public static string removeHtml(string strString)
+ {
+ Hashtable hashtable = new Hashtable();
+ hashtable.Add("&nbsp;", " ");
+ hashtable.Add("&amp;", "&");
+ hashtable.Add("&aring;", "");
+ hashtable.Add("&auml;", "");
+ hashtable.Add("&eacute;", "");
+ hashtable.Add("&iacute;", "");
+ hashtable.Add("&igrave;", "");
+ hashtable.Add("&ograve;", "");
+ hashtable.Add("&ouml;", "");
+ hashtable.Add("&quot;", "\"");
+ hashtable.Add("&szlig;", "");
+ StringParser parser = new StringParser(strString);
+ foreach (string str in hashtable.Keys)
+ {
+ string strReplacement = hashtable[str] as string;
+ if (strString.IndexOf(str) != -1)
+ {
+ parser.replaceEveryExact(str, strReplacement);
+ }
+ }
+ parser.replaceEveryExact("&#0", "&#");
+ parser.replaceEveryExact("&#39;", "'");
+ parser.replaceEveryExact("</", " <~/");
+ parser.replaceEveryExact("<~/", "</");
+ hashtable.Clear();
+ hashtable.Add("<br>", " ");
+ hashtable.Add("<p>", " ");
+ foreach (string str3 in hashtable.Keys)
+ {
+ string str4 = hashtable[str3] as string;
+ if (strString.IndexOf(str3) != -1)
+ {
+ parser.replaceEvery(str3, str4);
+ }
+ }
+ strString = parser.Content;
+ string str5 = "";
+ int startIndex = 0;
+ int num2 = 0;
+ while ((num2 = strString.IndexOf("<", startIndex)) != -1)
+ {
+ string str6 = strString.Substring(startIndex, num2 - startIndex);
+ str5 = str5 + str6;
+ startIndex = num2 + 1;
+ int index = strString.IndexOf(">", startIndex);
+ if (index == -1)
+ {
+ break;
+ }
+ startIndex = index + 1;
+ }
+ if (startIndex < strString.Length)
+ {
+ str5 = str5 + strString.Substring(startIndex, strString.Length - startIndex);
+ }
+ strString = str5;
+ str5 = "";
+ parser.Content = strString;
+ parser.replaceEveryExact(" ", " ");
+ strString = parser.Content.Trim();
+ return strString;
+ }
+
+ public static string removeScripts(string strString)
+ {
+ string str = "";
+ string strExtract = "";
+ StringParser parser = new StringParser(strString);
+ while (parser.extractToNoCase("<script", ref strExtract))
+ {
+ str = str + strExtract;
+ if (!parser.skipToEndOfNoCase("</script>"))
+ {
+ parser.Content = str;
+ return strString;
+ }
+ }
+ parser.extractToEnd(ref strExtract);
+ return (str + strExtract);
+ }
+
+ public int replaceEvery(string strOccurrence, string strReplacement)
+ {
+ int num = 0;
+ strOccurrence = strOccurrence.ToLower();
+ for (int i = this.m_strContentLC.IndexOf(strOccurrence); i != -1; i = this.m_strContentLC.IndexOf(strOccurrence))
+ {
+ string str = this.m_strContent.Substring(0, i) + strReplacement;
+ int startIndex = i + strOccurrence.Length;
+ if (startIndex < this.m_strContent.Length)
+ {
+ string str2 = this.m_strContent.Substring(startIndex, this.m_strContent.Length - startIndex);
+ str = str + str2;
+ }
+ this.m_strContent = str;
+ this.m_strContentLC = this.m_strContent.ToLower();
+ num++;
+ }
+ return num;
+ }
+
+ public int replaceEveryExact(string strOccurrence, string strReplacement)
+ {
+ int num = 0;
+ while (this.m_strContent.IndexOf(strOccurrence) != -1)
+ {
+ this.m_strContent = this.m_strContent.Replace(strOccurrence, strReplacement);
+ num++;
+ }
+ this.m_strContentLC = this.m_strContent.ToLower();
+ return num;
+ }
+
+ public void resetPosition()
+ {
+ this.m_nIndex = 0;
+ }
+
+ private bool seekTo(string strString, bool bNoCase, bool bPositionAfter)
+ {
+ if (this.Position >= this.m_strContent.Length)
+ {
+ return false;
+ }
+ int index = 0;
+ if (bNoCase)
+ {
+ strString = strString.ToLower();
+ index = this.m_strContentLC.IndexOf(strString, this.Position);
+ }
+ else
+ {
+ index = this.m_strContent.IndexOf(strString, this.Position);
+ }
+ if (index == -1)
+ {
+ return false;
+ }
+ this.m_nIndex = index;
+ if (bPositionAfter)
+ {
+ this.m_nIndex += strString.Length;
+ }
+ return true;
+ }
+
+ public bool skipToEndOf(string strString)
+ {
+ return this.seekTo(strString, false, true);
+ }
+
+ public bool skipToEndOfNoCase(string strText)
+ {
+ return this.seekTo(strText, true, true);
+ }
+
+ public bool skipToStartOf(string strString)
+ {
+ return this.seekTo(strString, false, false);
+ }
+
+ public bool skipToStartOfNoCase(string strText)
+ {
+ return this.seekTo(strText, true, false);
+ }
+
+ public string Content
+ {
+ get
+ {
+ return this.m_strContent;
+ }
+ set
+ {
+ this.m_strContent = value;
+ this.m_strContentLC = this.m_strContent.ToLower();
+ this.resetPosition();
+ }
+ }
+
+ public int Position
+ {
+ get
+ {
+ return this.m_nIndex;
+ }
+ }
+ }
+}
+
View
230 XBSlink/translator/web/WebResourceProvider.cs
@@ -0,0 +1,230 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace XBSlink.Translator.Web
+{
+ using System;
+ using System.IO;
+ using System.Net;
+ using System.Text;
+ using System.Threading;
+
+ public abstract class WebResourceProvider
+ {
+ private HttpStatusCode m_httpStatusCode;
+ private int m_nPause;
+ private int m_nTimeout;
+ private string m_strAgent;
+ private string m_strContent;
+ private string m_strError;
+ private string m_strReferer;
+ private DateTime m_tmFetchTime;
+
+ public WebResourceProvider()
+ {
+ this.reset();
+ }
+
+ protected virtual bool continueFetching()
+ {
+ return false;
+ }
+
+ public void fetchResource()
+ {
+ if (this.init())
+ {
+ bool flag = false;
+ do
+ {
+ string url = this.getFetchUrl();
+ this.getContent(url);
+ if (this.m_httpStatusCode == HttpStatusCode.OK)
+ {
+ this.parseContent();
+ }
+ }
+ while (flag && this.continueFetching());
+ }
+ }
+
+ private void getContent(string url)
+ {
+ if (this.m_nPause > 0)
+ {
+ int totalMilliseconds = 0;
+ do
+ {
+ if ((totalMilliseconds == 0) && (this.m_tmFetchTime != DateTime.MinValue))
+ {
+ TimeSpan span = (TimeSpan)(this.m_tmFetchTime - DateTime.Now);
+ totalMilliseconds = (int)span.TotalMilliseconds;
+ }
+ int millisecondsTimeout = 100;
+ if (totalMilliseconds < this.m_nPause)
+ {
+ Thread.Sleep(millisecondsTimeout);
+ totalMilliseconds += millisecondsTimeout;
+ }
+ }
+ while (totalMilliseconds < this.m_nPause);
+ }
+ string requestUriString = url;
+ if (!requestUriString.StartsWith("http://"))
+ {
+ requestUriString = "http://" + requestUriString;
+ }
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString);
+ request.AllowAutoRedirect = true;
+ request.UserAgent = this.m_strAgent;
+ request.Referer = this.m_strReferer;
+ if (this.m_nTimeout != 0)
+ {
+ request.Timeout = this.m_nTimeout;
+ }
+ string s = this.getPostData();
+ if (s != null)
+ {
+ byte[] bytes = new ASCIIEncoding().GetBytes(s);
+ request.Method = "POST";
+ request.ContentType = "application/x-www-form-urlencoded";
+ request.ContentLength = bytes.Length;
+ Stream requestStream = request.GetRequestStream();
+ requestStream.Write(bytes, 0, bytes.Length);
+ requestStream.Close();
+ }
+ this.m_strError = "";
+ this.m_strContent = "";
+ HttpWebResponse response = null;
+ try
+ {
+ this.m_tmFetchTime = DateTime.Now;
+ response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (Exception exception)
+ {
+ if (exception is WebException)
+ {
+ WebException exception2 = exception as WebException;
+ this.m_strError = exception2.Message;
+ }
+ return;
+ }
+ finally
+ {
+ if (response != null)
+ {
+ this.m_httpStatusCode = response.StatusCode;
+ }
+ }
+ try
+ {
+ this.m_strContent = new StreamReader(response.GetResponseStream()).ReadToEnd();
+ }
+ catch (Exception)
+ {
+ }
+ }
+
+ protected abstract string getFetchUrl();
+ protected virtual string getPostData()
+ {
+ return null;
+ }
+
+ protected virtual bool init()
+ {
+ return true;
+ }
+
+ protected virtual void parseContent()
+ {
+ }
+
+ public void reset()
+ {
+ this.m_strAgent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)";
+ this.m_strReferer = "";
+ this.m_strError = "";
+ this.m_strContent = "";
+ this.m_httpStatusCode = HttpStatusCode.OK;
+ this.m_nPause = 0;
+ this.m_nTimeout = 0;
+ this.m_tmFetchTime = DateTime.MinValue;
+ }
+
+ public string Agent
+ {
+ get
+ {
+ return this.m_strAgent;
+ }
+ set
+ {
+ this.m_strAgent = (value == null) ? "" : value;
+ }
+ }
+
+ public string Content
+ {
+ get
+ {
+ return this.m_strContent;
+ }
+ }
+
+ public string ErrorMsg
+ {
+ get
+ {
+ return this.m_strError;
+ }
+ }
+
+ public DateTime FetchTime
+ {
+ get
+ {
+ return this.m_tmFetchTime;
+ }
+ }
+
+ public int Pause
+ {
+ get
+ {
+ return this.m_nPause;
+ }
+ set
+ {
+ this.m_nPause = value;
+ }
+ }
+
+ public string Referer
+ {
+ get
+ {
+ return this.m_strReferer;
+ }
+ set
+ {
+ this.m_strReferer = (value == null) ? "" : value;
+ }
+ }
+
+ public int Timeout
+ {
+ get
+ {
+ return this.m_nTimeout;
+ }
+ set
+ {
+ this.m_nTimeout = value;
+ }
+ }
+ }
+}
+
View
3  XBSlink/xbs_messages.cs
@@ -17,7 +17,8 @@ public enum xbs_message_sender : byte
NAT = 0x06,
NODE = 0x07,
NODELIST = 0x08,
- X360 = 0x09
+ X360 = 0x09,
+ TRANSLATOR = 0x10
}
enum xbs_message_type : byte
View
7 XBSlink/xbs_node_list.cs
@@ -130,13 +130,14 @@ public void delNode(xbs_node node)
foreach (xbs_node n in node_list)
if (n.Equals(node))
{
- xbs_messages.addInfoMessage(" + removed node " + n, xbs_message_sender.NODELIST);
- deleted_node = n;
- node_list.Remove(n);
if (DeleteNode != null)
DeleteNode(n.nickname);
+ xbs_messages.addInfoMessage(" + removed node " + n, xbs_message_sender.NODELIST);
+ deleted_node = n;
+ node_list.Remove(n);
+
if (notify_on_new_node)
{
System.Media.SoundPlayer sound_player = new System.Media.SoundPlayer();