Refine PR #730
Squashed commit of the following: commit 48eb4d88391b85986190ace825ec0a167df16f8a Author: Syrone Wong <wong.syrone@gmail.com> Date: Sun Sep 18 15:46:09 2016 +0800 Drop useless interface impl Signed-off-by: Syrone Wong <wong.syrone@gmail.com> commitc0a4f3421aAuthor: Logan Zhou <xorcererzc@gmail.com> Date: Sun Sep 18 00:58:02 2016 +0800 Revert "Updated to meet the hint from Wongsyrone." This reverts commit84c8053577. commit84c8053577Author: Logan Zhou <xorcererzc@gmail.com> Date: Sun Sep 18 00:52:21 2016 +0800 Updated to meet the hint from Wongsyrone. commit333ccb6d1fAuthor: Logan Zhou <xorcererzc@gmail.com> Date: Sun Sep 18 00:34:52 2016 +0800 Added duplicate button to config form. Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
@@ -39,6 +39,7 @@ Choose by statistics=根据统计
|
||||
|
||||
&Add=添加(&A)
|
||||
&Delete=删除(&D)
|
||||
Dupli&cate=复制(&C)
|
||||
Server=服务器
|
||||
Server Addr=服务器地址
|
||||
Server Port=服务器端口
|
||||
|
||||
@@ -39,6 +39,7 @@ Choose by statistics=根據統計
|
||||
|
||||
&Add=新增(&A)
|
||||
&Delete=移除(&D)
|
||||
Dupli&cate=複製(&C)
|
||||
Server=伺服器
|
||||
Server Addr=伺服器位址
|
||||
Server Port=伺服器連接埠
|
||||
|
||||
+24
-8
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user