Browse Source

small change

1.Use MS YaHei as default font
2.Fix crash when delete all server and create new one
3.When no server in the list,disable server info input box
pull/305/head
Aivier 9 years ago
parent
commit
d15a432e8f
4 changed files with 90 additions and 70 deletions
  1. +1
    -1
      shadowsocks-csharp/Data/cn.txt
  2. +39
    -38
      shadowsocks-csharp/View/ConfigForm.Designer.cs
  3. +15
    -5
      shadowsocks-csharp/View/ConfigForm.cs
  4. +35
    -26
      shadowsocks-csharp/View/LogForm.Designer.cs

+ 1
- 1
shadowsocks-csharp/Data/cn.txt View File

@@ -92,4 +92,4 @@ If you want to start multiple Shadowsocks, make a copy in another directory.=如
Failed to decode QRCode=无法解析二维码 Failed to decode QRCode=无法解析二维码
Failed to update registry=无法修改注册表 Failed to update registry=无法修改注册表
System Proxy On: =系统代理已启用: System Proxy On: =系统代理已启用:
Running: Port {0}=正在运行:端口 {0}
Running: Port {0}=正在运行:端口 {0}

+ 39
- 38
shadowsocks-csharp/View/ConfigForm.Designer.cs View File

@@ -92,16 +92,16 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(238, 137);
this.tableLayoutPanel1.Size = new System.Drawing.Size(251, 148);
this.tableLayoutPanel1.TabIndex = 0; this.tableLayoutPanel1.TabIndex = 0;
// //
// RemarksTextBox // RemarksTextBox
// //
this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.RemarksTextBox.Location = new System.Drawing.Point(72, 111);
this.RemarksTextBox.Location = new System.Drawing.Point(85, 119);
this.RemarksTextBox.MaxLength = 32; this.RemarksTextBox.MaxLength = 32;
this.RemarksTextBox.Name = "RemarksTextBox"; this.RemarksTextBox.Name = "RemarksTextBox";
this.RemarksTextBox.Size = new System.Drawing.Size(160, 20);
this.RemarksTextBox.Size = new System.Drawing.Size(160, 23);
this.RemarksTextBox.TabIndex = 10; this.RemarksTextBox.TabIndex = 10;
this.RemarksTextBox.WordWrap = false; this.RemarksTextBox.WordWrap = false;
// //
@@ -109,9 +109,9 @@
// //
this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.RemarksLabel.AutoSize = true; this.RemarksLabel.AutoSize = true;
this.RemarksLabel.Location = new System.Drawing.Point(17, 114);
this.RemarksLabel.Location = new System.Drawing.Point(20, 122);
this.RemarksLabel.Name = "RemarksLabel"; this.RemarksLabel.Name = "RemarksLabel";
this.RemarksLabel.Size = new System.Drawing.Size(49, 13);
this.RemarksLabel.Size = new System.Drawing.Size(59, 17);
this.RemarksLabel.TabIndex = 9; this.RemarksLabel.TabIndex = 9;
this.RemarksLabel.Text = "Remarks"; this.RemarksLabel.Text = "Remarks";
// //
@@ -119,9 +119,9 @@
// //
this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.IPLabel.AutoSize = true; this.IPLabel.AutoSize = true;
this.IPLabel.Location = new System.Drawing.Point(15, 9);
this.IPLabel.Location = new System.Drawing.Point(19, 9);
this.IPLabel.Name = "IPLabel"; this.IPLabel.Name = "IPLabel";
this.IPLabel.Size = new System.Drawing.Size(51, 13);
this.IPLabel.Size = new System.Drawing.Size(60, 17);
this.IPLabel.TabIndex = 0; this.IPLabel.TabIndex = 0;
this.IPLabel.Text = "Server IP"; this.IPLabel.Text = "Server IP";
// //
@@ -129,9 +129,9 @@
// //
this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.ServerPortLabel.AutoSize = true; this.ServerPortLabel.AutoSize = true;
this.ServerPortLabel.Location = new System.Drawing.Point(6, 35);
this.ServerPortLabel.Location = new System.Drawing.Point(6, 38);
this.ServerPortLabel.Name = "ServerPortLabel"; this.ServerPortLabel.Name = "ServerPortLabel";
this.ServerPortLabel.Size = new System.Drawing.Size(60, 13);
this.ServerPortLabel.Size = new System.Drawing.Size(73, 17);
this.ServerPortLabel.TabIndex = 1; this.ServerPortLabel.TabIndex = 1;
this.ServerPortLabel.Text = "Server Port"; this.ServerPortLabel.Text = "Server Port";
// //
@@ -139,40 +139,40 @@
// //
this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.PasswordLabel.AutoSize = true; this.PasswordLabel.AutoSize = true;
this.PasswordLabel.Location = new System.Drawing.Point(13, 61);
this.PasswordLabel.Location = new System.Drawing.Point(15, 67);
this.PasswordLabel.Name = "PasswordLabel"; this.PasswordLabel.Name = "PasswordLabel";
this.PasswordLabel.Size = new System.Drawing.Size(53, 13);
this.PasswordLabel.Size = new System.Drawing.Size(64, 17);
this.PasswordLabel.TabIndex = 2; this.PasswordLabel.TabIndex = 2;
this.PasswordLabel.Text = "Password"; this.PasswordLabel.Text = "Password";
// //
// IPTextBox // IPTextBox
// //
this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.IPTextBox.Location = new System.Drawing.Point(72, 6);
this.IPTextBox.Location = new System.Drawing.Point(85, 6);
this.IPTextBox.MaxLength = 512; this.IPTextBox.MaxLength = 512;
this.IPTextBox.Name = "IPTextBox"; this.IPTextBox.Name = "IPTextBox";
this.IPTextBox.Size = new System.Drawing.Size(160, 20);
this.IPTextBox.Size = new System.Drawing.Size(160, 23);
this.IPTextBox.TabIndex = 0; this.IPTextBox.TabIndex = 0;
this.IPTextBox.WordWrap = false; this.IPTextBox.WordWrap = false;
// //
// ServerPortTextBox // ServerPortTextBox
// //
this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.ServerPortTextBox.Location = new System.Drawing.Point(72, 32);
this.ServerPortTextBox.Location = new System.Drawing.Point(85, 35);
this.ServerPortTextBox.MaxLength = 10; this.ServerPortTextBox.MaxLength = 10;
this.ServerPortTextBox.Name = "ServerPortTextBox"; this.ServerPortTextBox.Name = "ServerPortTextBox";
this.ServerPortTextBox.Size = new System.Drawing.Size(160, 20);
this.ServerPortTextBox.Size = new System.Drawing.Size(160, 23);
this.ServerPortTextBox.TabIndex = 1; this.ServerPortTextBox.TabIndex = 1;
this.ServerPortTextBox.WordWrap = false; this.ServerPortTextBox.WordWrap = false;
// //
// PasswordTextBox // PasswordTextBox
// //
this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.PasswordTextBox.Location = new System.Drawing.Point(72, 58);
this.PasswordTextBox.Location = new System.Drawing.Point(85, 64);
this.PasswordTextBox.MaxLength = 256; this.PasswordTextBox.MaxLength = 256;
this.PasswordTextBox.Name = "PasswordTextBox"; this.PasswordTextBox.Name = "PasswordTextBox";
this.PasswordTextBox.PasswordChar = '*'; this.PasswordTextBox.PasswordChar = '*';
this.PasswordTextBox.Size = new System.Drawing.Size(160, 20);
this.PasswordTextBox.Size = new System.Drawing.Size(160, 23);
this.PasswordTextBox.TabIndex = 2; this.PasswordTextBox.TabIndex = 2;
this.PasswordTextBox.WordWrap = false; this.PasswordTextBox.WordWrap = false;
// //
@@ -180,20 +180,20 @@
// //
this.EncryptionLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.EncryptionLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.EncryptionLabel.AutoSize = true; this.EncryptionLabel.AutoSize = true;
this.EncryptionLabel.Location = new System.Drawing.Point(9, 88);
this.EncryptionLabel.Location = new System.Drawing.Point(10, 94);
this.EncryptionLabel.Name = "EncryptionLabel"; this.EncryptionLabel.Name = "EncryptionLabel";
this.EncryptionLabel.Size = new System.Drawing.Size(57, 13);
this.EncryptionLabel.Size = new System.Drawing.Size(69, 17);
this.EncryptionLabel.TabIndex = 8; this.EncryptionLabel.TabIndex = 8;
this.EncryptionLabel.Text = "Encryption"; this.EncryptionLabel.Text = "Encryption";
// //
// EncryptionSelect // EncryptionSelect
// //
this.EncryptionSelect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.EncryptionSelect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.EncryptionSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.EncryptionSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.EncryptionSelect.FormattingEnabled = true; this.EncryptionSelect.FormattingEnabled = true;
this.EncryptionSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.EncryptionSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.EncryptionSelect.ItemHeight = 13;
this.EncryptionSelect.ItemHeight = 17;
this.EncryptionSelect.Items.AddRange(new object[] { this.EncryptionSelect.Items.AddRange(new object[] {
"table", "table",
"rc4-md5", "rc4-md5",
@@ -203,9 +203,9 @@
"aes-192-cfb", "aes-192-cfb",
"aes-128-cfb", "aes-128-cfb",
"rc4"}); "rc4"});
this.EncryptionSelect.Location = new System.Drawing.Point(72, 84);
this.EncryptionSelect.Location = new System.Drawing.Point(85, 93);
this.EncryptionSelect.Name = "EncryptionSelect"; this.EncryptionSelect.Name = "EncryptionSelect";
this.EncryptionSelect.Size = new System.Drawing.Size(160, 21);
this.EncryptionSelect.Size = new System.Drawing.Size(160, 25);
this.EncryptionSelect.TabIndex = 3; this.EncryptionSelect.TabIndex = 3;
// //
// panel2 // panel2
@@ -276,7 +276,7 @@
this.ServerGroupBox.Location = new System.Drawing.Point(178, 0); this.ServerGroupBox.Location = new System.Drawing.Point(178, 0);
this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0);
this.ServerGroupBox.Name = "ServerGroupBox"; this.ServerGroupBox.Name = "ServerGroupBox";
this.ServerGroupBox.Size = new System.Drawing.Size(249, 174);
this.ServerGroupBox.Size = new System.Drawing.Size(262, 188);
this.ServerGroupBox.TabIndex = 6; this.ServerGroupBox.TabIndex = 6;
this.ServerGroupBox.TabStop = false; this.ServerGroupBox.TabStop = false;
this.ServerGroupBox.Text = "Server"; this.ServerGroupBox.Text = "Server";
@@ -285,7 +285,7 @@
// //
this.ServersListBox.FormattingEnabled = true; this.ServersListBox.FormattingEnabled = true;
this.ServersListBox.IntegralHeight = false; this.ServersListBox.IntegralHeight = false;
this.ServersListBox.ItemHeight = 12;
this.ServersListBox.ItemHeight = 17;
this.ServersListBox.Location = new System.Drawing.Point(0, 0); this.ServersListBox.Location = new System.Drawing.Point(0, 0);
this.ServersListBox.Margin = new System.Windows.Forms.Padding(0); this.ServersListBox.Margin = new System.Windows.Forms.Padding(0);
this.ServersListBox.Name = "ServersListBox"; this.ServersListBox.Name = "ServersListBox";
@@ -313,7 +313,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.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(427, 238);
this.tableLayoutPanel2.Size = new System.Drawing.Size(440, 255);
this.tableLayoutPanel2.TabIndex = 7; this.tableLayoutPanel2.TabIndex = 7;
// //
// tableLayoutPanel6 // tableLayoutPanel6
@@ -326,7 +326,7 @@
this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0);
this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top;
this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 211);
this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 223);
this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel6.Name = "tableLayoutPanel6"; this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 1; this.tableLayoutPanel6.RowCount = 1;
@@ -369,26 +369,26 @@
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel5.Controls.Add(this.ProxyPortTextBox, 1, 0); this.tableLayoutPanel5.Controls.Add(this.ProxyPortTextBox, 1, 0);
this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0); this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0);
this.tableLayoutPanel5.Location = new System.Drawing.Point(241, 174);
this.tableLayoutPanel5.Location = new System.Drawing.Point(241, 188);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel5.Name = "tableLayoutPanel5"; this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.Padding = new System.Windows.Forms.Padding(3); this.tableLayoutPanel5.Padding = new System.Windows.Forms.Padding(3);
this.tableLayoutPanel5.RowCount = 1; this.tableLayoutPanel5.RowCount = 1;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(186, 32);
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.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 27F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(199, 35);
this.tableLayoutPanel5.TabIndex = 9; this.tableLayoutPanel5.TabIndex = 9;
// //
// ProxyPortTextBox // ProxyPortTextBox
// //
this.ProxyPortTextBox.Anchor = System.Windows.Forms.AnchorStyles.Left; this.ProxyPortTextBox.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.ProxyPortTextBox.Location = new System.Drawing.Point(67, 6);
this.ProxyPortTextBox.Location = new System.Drawing.Point(80, 6);
this.ProxyPortTextBox.MaxLength = 10; this.ProxyPortTextBox.MaxLength = 10;
this.ProxyPortTextBox.Name = "ProxyPortTextBox"; this.ProxyPortTextBox.Name = "ProxyPortTextBox";
this.ProxyPortTextBox.Size = new System.Drawing.Size(113, 20);
this.ProxyPortTextBox.Size = new System.Drawing.Size(113, 23);
this.ProxyPortTextBox.TabIndex = 4; this.ProxyPortTextBox.TabIndex = 4;
this.ProxyPortTextBox.WordWrap = false; this.ProxyPortTextBox.WordWrap = false;
// //
@@ -398,7 +398,7 @@
this.ProxyPortLabel.AutoSize = true; this.ProxyPortLabel.AutoSize = true;
this.ProxyPortLabel.Location = new System.Drawing.Point(6, 9); this.ProxyPortLabel.Location = new System.Drawing.Point(6, 9);
this.ProxyPortLabel.Name = "ProxyPortLabel"; this.ProxyPortLabel.Name = "ProxyPortLabel";
this.ProxyPortLabel.Size = new System.Drawing.Size(55, 13);
this.ProxyPortLabel.Size = new System.Drawing.Size(68, 17);
this.ProxyPortLabel.TabIndex = 3; this.ProxyPortLabel.TabIndex = 3;
this.ProxyPortLabel.Text = "Proxy Port"; this.ProxyPortLabel.Text = "Proxy Port";
// //
@@ -413,7 +413,7 @@
this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0);
this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right;
this.tableLayoutPanel3.Location = new System.Drawing.Point(268, 209);
this.tableLayoutPanel3.Location = new System.Drawing.Point(281, 226);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1; this.tableLayoutPanel3.RowCount = 1;
@@ -431,7 +431,7 @@
this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0);
this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top;
this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 174);
this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 188);
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel4.Name = "tableLayoutPanel4"; this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 1; this.tableLayoutPanel4.RowCount = 1;
@@ -450,6 +450,7 @@
this.ClientSize = new System.Drawing.Size(574, 367); this.ClientSize = new System.Drawing.Size(574, 367);
this.Controls.Add(this.tableLayoutPanel2); this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.panel2); this.Controls.Add(this.panel2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;


+ 15
- 5
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -163,7 +163,12 @@ namespace Shadowsocks.View
ServersListBox.SelectedIndex = _lastSelectedIndex; ServersListBox.SelectedIndex = _lastSelectedIndex;
return; return;
} }
ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName();
try
{
ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName();
}
catch { }
UpdateMoveUpAndDownButton(); UpdateMoveUpAndDownButton();
LoadSelectedServer(); LoadSelectedServer();
_lastSelectedIndex = ServersListBox.SelectedIndex; _lastSelectedIndex = ServersListBox.SelectedIndex;
@@ -171,6 +176,7 @@ namespace Shadowsocks.View
private void AddButton_Click(object sender, EventArgs e) private void AddButton_Click(object sender, EventArgs e)
{ {
ServerGroupBox.Enabled = true;
if (!SaveOldSelectedServer()) if (!SaveOldSelectedServer())
{ {
return; return;
@@ -194,10 +200,14 @@ namespace Shadowsocks.View
// can be -1 // can be -1
_lastSelectedIndex = _modifiedConfiguration.configs.Count - 1; _lastSelectedIndex = _modifiedConfiguration.configs.Count - 1;
} }
ServersListBox.SelectedIndex = _lastSelectedIndex;
LoadConfiguration(_modifiedConfiguration);
ServersListBox.SelectedIndex = _lastSelectedIndex;
LoadSelectedServer();
ServersListBox.SelectedIndex = _lastSelectedIndex;
LoadConfiguration(_modifiedConfiguration);
ServersListBox.SelectedIndex = _lastSelectedIndex;
LoadSelectedServer();
if (_lastSelectedIndex < 1)
{
ServerGroupBox.Enabled = false;
}
} }
private void OKButton_Click(object sender, EventArgs e) private void OKButton_Click(object sender, EventArgs e)


+ 35
- 26
shadowsocks-csharp/View/LogForm.Designer.cs View File

@@ -36,11 +36,11 @@
this.OpenLocationMenuItem = new System.Windows.Forms.MenuItem(); this.OpenLocationMenuItem = new System.Windows.Forms.MenuItem();
this.ExitMenuItem = new System.Windows.Forms.MenuItem(); this.ExitMenuItem = new System.Windows.Forms.MenuItem();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.TopMostCheckBox = new System.Windows.Forms.CheckBox();
this.ChangeFontButton = new System.Windows.Forms.Button(); this.ChangeFontButton = new System.Windows.Forms.Button();
this.CleanLogsButton = new System.Windows.Forms.Button(); this.CleanLogsButton = new System.Windows.Forms.Button();
this.WrapTextCheckBox = new System.Windows.Forms.CheckBox(); this.WrapTextCheckBox = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.TopMostCheckBox = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -51,13 +51,14 @@
this.LogMessageTextBox.Dock = System.Windows.Forms.DockStyle.Fill; this.LogMessageTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.LogMessageTextBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.LogMessageTextBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.LogMessageTextBox.ForeColor = System.Drawing.Color.White; this.LogMessageTextBox.ForeColor = System.Drawing.Color.White;
this.LogMessageTextBox.Location = new System.Drawing.Point(3, 43);
this.LogMessageTextBox.Location = new System.Drawing.Point(3, 61);
this.LogMessageTextBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.LogMessageTextBox.MaxLength = 2147483647; this.LogMessageTextBox.MaxLength = 2147483647;
this.LogMessageTextBox.Multiline = true; this.LogMessageTextBox.Multiline = true;
this.LogMessageTextBox.Name = "LogMessageTextBox"; this.LogMessageTextBox.Name = "LogMessageTextBox";
this.LogMessageTextBox.ReadOnly = true; this.LogMessageTextBox.ReadOnly = true;
this.LogMessageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.LogMessageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.LogMessageTextBox.Size = new System.Drawing.Size(541, 307);
this.LogMessageTextBox.Size = new System.Drawing.Size(632, 444);
this.LogMessageTextBox.TabIndex = 0; this.LogMessageTextBox.TabIndex = 0;
this.LogMessageTextBox.WordWrap = false; this.LogMessageTextBox.WordWrap = false;
// //
@@ -98,16 +99,30 @@
this.panel1.Controls.Add(this.CleanLogsButton); this.panel1.Controls.Add(this.CleanLogsButton);
this.panel1.Controls.Add(this.WrapTextCheckBox); this.panel1.Controls.Add(this.WrapTextCheckBox);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Location = new System.Drawing.Point(3, 4);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(541, 34);
this.panel1.Size = new System.Drawing.Size(632, 49);
this.panel1.TabIndex = 1; this.panel1.TabIndex = 1;
// //
// TopMostCheckBox
//
this.TopMostCheckBox.AutoSize = true;
this.TopMostCheckBox.Location = new System.Drawing.Point(363, 13);
this.TopMostCheckBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.TopMostCheckBox.Name = "TopMostCheckBox";
this.TopMostCheckBox.Size = new System.Drawing.Size(83, 21);
this.TopMostCheckBox.TabIndex = 3;
this.TopMostCheckBox.Text = "&Top most";
this.TopMostCheckBox.UseVisualStyleBackColor = true;
this.TopMostCheckBox.CheckedChanged += new System.EventHandler(this.TopMostCheckBox_CheckedChanged);
//
// ChangeFontButton // ChangeFontButton
// //
this.ChangeFontButton.Location = new System.Drawing.Point(107, 4);
this.ChangeFontButton.Location = new System.Drawing.Point(125, 6);
this.ChangeFontButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ChangeFontButton.Name = "ChangeFontButton"; this.ChangeFontButton.Name = "ChangeFontButton";
this.ChangeFontButton.Size = new System.Drawing.Size(75, 23);
this.ChangeFontButton.Size = new System.Drawing.Size(87, 33);
this.ChangeFontButton.TabIndex = 2; this.ChangeFontButton.TabIndex = 2;
this.ChangeFontButton.Text = "&Font"; this.ChangeFontButton.Text = "&Font";
this.ChangeFontButton.UseVisualStyleBackColor = true; this.ChangeFontButton.UseVisualStyleBackColor = true;
@@ -115,9 +130,10 @@
// //
// CleanLogsButton // CleanLogsButton
// //
this.CleanLogsButton.Location = new System.Drawing.Point(9, 4);
this.CleanLogsButton.Location = new System.Drawing.Point(10, 6);
this.CleanLogsButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.CleanLogsButton.Name = "CleanLogsButton"; this.CleanLogsButton.Name = "CleanLogsButton";
this.CleanLogsButton.Size = new System.Drawing.Size(75, 23);
this.CleanLogsButton.Size = new System.Drawing.Size(87, 33);
this.CleanLogsButton.TabIndex = 1; this.CleanLogsButton.TabIndex = 1;
this.CleanLogsButton.Text = "&Clean logs"; this.CleanLogsButton.Text = "&Clean logs";
this.CleanLogsButton.UseVisualStyleBackColor = true; this.CleanLogsButton.UseVisualStyleBackColor = true;
@@ -126,9 +142,10 @@
// WrapTextCheckBox // WrapTextCheckBox
// //
this.WrapTextCheckBox.AutoSize = true; this.WrapTextCheckBox.AutoSize = true;
this.WrapTextCheckBox.Location = new System.Drawing.Point(209, 9);
this.WrapTextCheckBox.Location = new System.Drawing.Point(244, 13);
this.WrapTextCheckBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.WrapTextCheckBox.Name = "WrapTextCheckBox"; this.WrapTextCheckBox.Name = "WrapTextCheckBox";
this.WrapTextCheckBox.Size = new System.Drawing.Size(78, 16);
this.WrapTextCheckBox.Size = new System.Drawing.Size(84, 21);
this.WrapTextCheckBox.TabIndex = 0; this.WrapTextCheckBox.TabIndex = 0;
this.WrapTextCheckBox.Text = "&Wrap text"; this.WrapTextCheckBox.Text = "&Wrap text";
this.WrapTextCheckBox.UseVisualStyleBackColor = true; this.WrapTextCheckBox.UseVisualStyleBackColor = true;
@@ -142,30 +159,22 @@
this.tableLayoutPanel1.Controls.Add(this.LogMessageTextBox, 0, 1); this.tableLayoutPanel1.Controls.Add(this.LogMessageTextBox, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 57F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(547, 353);
this.tableLayoutPanel1.Size = new System.Drawing.Size(638, 509);
this.tableLayoutPanel1.TabIndex = 2; this.tableLayoutPanel1.TabIndex = 2;
// //
// TopMostCheckBox
//
this.TopMostCheckBox.AutoSize = true;
this.TopMostCheckBox.Location = new System.Drawing.Point(311, 9);
this.TopMostCheckBox.Name = "TopMostCheckBox";
this.TopMostCheckBox.Size = new System.Drawing.Size(72, 16);
this.TopMostCheckBox.TabIndex = 3;
this.TopMostCheckBox.Text = "&Top most";
this.TopMostCheckBox.UseVisualStyleBackColor = true;
this.TopMostCheckBox.CheckedChanged += new System.EventHandler(this.TopMostCheckBox_CheckedChanged);
//
// LogForm // LogForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(547, 353);
this.ClientSize = new System.Drawing.Size(638, 509);
this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Menu = this.mainMenu1; this.Menu = this.mainMenu1;
this.Name = "LogForm"; this.Name = "LogForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;


Loading…
Cancel
Save