diff --git a/shadowsocks-csharp/Data/cn.txt b/shadowsocks-csharp/Data/cn.txt index 3823429e..b8bc01d3 100644 --- a/shadowsocks-csharp/Data/cn.txt +++ b/shadowsocks-csharp/Data/cn.txt @@ -39,6 +39,7 @@ Choose by statistics=根据统计 &Add=添加(&A) &Delete=删除(&D) +Dupli&cate=复制(&C) Server=服务器 Server Addr=服务器地址 Server Port=服务器端口 diff --git a/shadowsocks-csharp/Data/zh_tw.txt b/shadowsocks-csharp/Data/zh_tw.txt index 337ce4f3..6468c79d 100644 --- a/shadowsocks-csharp/Data/zh_tw.txt +++ b/shadowsocks-csharp/Data/zh_tw.txt @@ -39,6 +39,7 @@ Choose by statistics=根據統計 &Add=新增(&A) &Delete=移除(&D) +Dupli&cate=複製(&C) Server=伺服器 Server Addr=伺服器位址 Server Port=伺服器連接埠 diff --git a/shadowsocks-csharp/View/ConfigForm.Designer.cs b/shadowsocks-csharp/View/ConfigForm.Designer.cs index fcfd2fc0..b2829704 100755 --- a/shadowsocks-csharp/View/ConfigForm.Designer.cs +++ b/shadowsocks-csharp/View/ConfigForm.Designer.cs @@ -56,6 +56,7 @@ this.ProxyPortLabel = new System.Windows.Forms.Label(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.DuplicateButton = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.ServerGroupBox.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); @@ -332,7 +333,7 @@ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.Size = new System.Drawing.Size(438, 265); + this.tableLayoutPanel2.Size = new System.Drawing.Size(438, 296); this.tableLayoutPanel2.TabIndex = 7; // // tableLayoutPanel6 @@ -345,7 +346,7 @@ this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; - this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 233); + this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 264); this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel6.Name = "tableLayoutPanel6"; this.tableLayoutPanel6.RowCount = 1; @@ -398,13 +399,13 @@ this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(196, 33); + this.tableLayoutPanel5.Size = new System.Drawing.Size(196, 64); this.tableLayoutPanel5.TabIndex = 9; // // ProxyPortTextBox // this.ProxyPortTextBox.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.ProxyPortTextBox.Location = new System.Drawing.Point(77, 6); + this.ProxyPortTextBox.Location = new System.Drawing.Point(77, 21); this.ProxyPortTextBox.MaxLength = 10; this.ProxyPortTextBox.Name = "ProxyPortTextBox"; this.ProxyPortTextBox.Size = new System.Drawing.Size(113, 21); @@ -415,7 +416,7 @@ // this.ProxyPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.ProxyPortLabel.AutoSize = true; - this.ProxyPortLabel.Location = new System.Drawing.Point(6, 10); + this.ProxyPortLabel.Location = new System.Drawing.Point(6, 26); this.ProxyPortLabel.Name = "ProxyPortLabel"; this.ProxyPortLabel.Size = new System.Drawing.Size(65, 12); this.ProxyPortLabel.TabIndex = 3; @@ -432,7 +433,7 @@ this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; - this.tableLayoutPanel3.Location = new System.Drawing.Point(279, 236); + this.tableLayoutPanel3.Location = new System.Drawing.Point(279, 267); this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.RowCount = 1; @@ -447,17 +448,31 @@ this.tableLayoutPanel4.ColumnCount = 2; this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel4.Controls.Add(this.DuplicateButton, 0, 1); this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 200); this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; + this.tableLayoutPanel4.RowCount = 2; this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.Size = new System.Drawing.Size(166, 32); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.Size = new System.Drawing.Size(166, 64); this.tableLayoutPanel4.TabIndex = 8; // + // DuplicateButton + // + this.DuplicateButton.Dock = System.Windows.Forms.DockStyle.Left; + this.DuplicateButton.Location = new System.Drawing.Point(0, 38); + this.DuplicateButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); + this.DuplicateButton.Name = "DuplicateButton"; + this.DuplicateButton.Size = new System.Drawing.Size(80, 23); + this.DuplicateButton.TabIndex = 10; + this.DuplicateButton.Text = "Dupli&cate"; + this.DuplicateButton.UseVisualStyleBackColor = true; + this.DuplicateButton.Click += new System.EventHandler(this.DuplicateButton_Click); + // // ConfigForm // this.AcceptButton = this.OKButton; @@ -526,6 +541,7 @@ private System.Windows.Forms.Button MoveDownButton; private System.Windows.Forms.Button MoveUpButton; private System.Windows.Forms.CheckBox OneTimeAuth; + private System.Windows.Forms.Button DuplicateButton; } } diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index f2a190da..91c4e0d2 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -42,6 +42,7 @@ namespace Shadowsocks.View { AddButton.Text = I18N.GetString("&Add"); DeleteButton.Text = I18N.GetString("&Delete"); + DuplicateButton.Text = I18N.GetString("Dupli&cate"); IPLabel.Text = I18N.GetString("Server Addr"); ServerPortLabel.Text = I18N.GetString("Server Port"); PasswordLabel.Text = I18N.GetString("Password"); @@ -210,6 +211,19 @@ namespace Shadowsocks.View _lastSelectedIndex = ServersListBox.SelectedIndex; } + private void DuplicateButton_Click( object sender, EventArgs e ) + { + if (!SaveOldSelectedServer()) + { + return; + } + Server currServer = _modifiedConfiguration.configs[_lastSelectedIndex]; + _modifiedConfiguration.configs.Add(currServer); + LoadConfiguration(_modifiedConfiguration); + ServersListBox.SelectedIndex = _modifiedConfiguration.configs.Count - 1; + _lastSelectedIndex = ServersListBox.SelectedIndex; + } + private void DeleteButton_Click(object sender, EventArgs e) { _lastSelectedIndex = ServersListBox.SelectedIndex;