diff --git a/shadowsocks-csharp/Controller/UpdateChecker.cs b/shadowsocks-csharp/Controller/UpdateChecker.cs index 69263c8f..ed308f74 100755 --- a/shadowsocks-csharp/Controller/UpdateChecker.cs +++ b/shadowsocks-csharp/Controller/UpdateChecker.cs @@ -20,8 +20,8 @@ public class UpdateChecker public event EventHandler NewVersionFound; public const string Name = "ShadowsocksR"; - public const string Copyright = "Copyright © BreakWa11 2017. Fork from Shadowsocks by clowwindy"; - public const string Version = "4.9.0"; + public const string Copyright = "Copyright © Akkariiin 2019 & BreakWa11 2017. Fork from Shadowsocks by clowwindy"; + public const string Version = "4.9.2"; #if !_DOTNET_4_0 public const string NetVer = "2.0"; #elif !_CONSOLE diff --git a/shadowsocks-csharp/Controller/UpdateFreeNode.cs b/shadowsocks-csharp/Controller/UpdateFreeNode.cs index 206d1de0..2f28f3fc 100644 --- a/shadowsocks-csharp/Controller/UpdateFreeNode.cs +++ b/shadowsocks-csharp/Controller/UpdateFreeNode.cs @@ -1,148 +1,155 @@ -using Shadowsocks.Model; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Windows.Forms; - -namespace Shadowsocks.Controller -{ - public class UpdateFreeNode - { - private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt"; - - public event EventHandler NewFreeNodeFound; - public string FreeNodeResult; - public ServerSubscribe subscribeTask; +using Shadowsocks.Model; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Xml; +using System.Windows.Forms; + +namespace Shadowsocks.Controller +{ + public class UpdateFreeNode + { + private const string UpdateURL = "https://raw.githubusercontent.com/shadowsocksrr/breakwa11.github.io/master/free/freenodeplain.txt"; + + public event EventHandler NewFreeNodeFound; + public string FreeNodeResult; + public ServerSubscribe subscribeTask; public bool noitify; - - public const string Name = "ShadowsocksR"; - - public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify) - { - FreeNodeResult = null; - this.noitify = noitify; - try - { - WebClient http = new WebClient(); + + public const string Name = "ShadowsocksR"; + + public void CheckUpdate(Configuration config, ServerSubscribe subscribeTask, bool use_proxy, bool noitify) + { + FreeNodeResult = null; + this.noitify = noitify; + try + { + WebClient http = new WebClient(); http.Headers.Add("User-Agent", String.IsNullOrEmpty(config.proxyUserAgent) ? "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36" - : config.proxyUserAgent); - http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString(); - if (use_proxy) - { - WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort); - if (!string.IsNullOrEmpty(config.authPass)) - { - proxy.Credentials = new NetworkCredential(config.authUser, config.authPass); - } - http.Proxy = proxy; - } - else - { - http.Proxy = null; - } - //UseProxy = !UseProxy; - this.subscribeTask = subscribeTask; - string URL = subscribeTask.URL; - http.DownloadStringCompleted += http_DownloadStringCompleted; - http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL)); - } - catch (Exception e) - { - Logging.LogUsefulException(e); - } - } - - private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) - { - try - { - string response = e.Result; - FreeNodeResult = response; - - if (NewFreeNodeFound != null) - { - NewFreeNodeFound(this, new EventArgs()); - } - } - catch (Exception ex) - { - if (e.Error != null) - { - Logging.Debug(e.Error.ToString()); - } - Logging.Debug(ex.ToString()); - if (NewFreeNodeFound != null) - { - NewFreeNodeFound(this, new EventArgs()); - } - return; - } - } - } - - public class UpdateSubscribeManager - { - private Configuration _config; - private List _serverSubscribes; - private UpdateFreeNode _updater; - private string _URL; - private bool _use_proxy; + : config.proxyUserAgent); + http.QueryString["rnd"] = Util.Utils.RandUInt32().ToString(); + if (use_proxy) + { + WebProxy proxy = new WebProxy(IPAddress.Loopback.ToString(), config.localPort); + if (!string.IsNullOrEmpty(config.authPass)) + { + proxy.Credentials = new NetworkCredential(config.authUser, config.authPass); + } + http.Proxy = proxy; + } + else + { + http.Proxy = null; + } + //UseProxy = !UseProxy; + this.subscribeTask = subscribeTask; + string URL = subscribeTask.URL; + + //add support for tls1.2+ + if (URL.StartsWith("https", StringComparison.OrdinalIgnoreCase)) + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | (SecurityProtocolType)3072 | SecurityProtocolType.Tls; + } + + http.DownloadStringCompleted += http_DownloadStringCompleted; + http.DownloadStringAsync(new Uri(URL != null ? URL : UpdateURL)); + } + catch (Exception e) + { + Logging.LogUsefulException(e); + } + } + + private void http_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) + { + try + { + string response = e.Result; + FreeNodeResult = response; + + if (NewFreeNodeFound != null) + { + NewFreeNodeFound(this, new EventArgs()); + } + } + catch (Exception ex) + { + if (e.Error != null) + { + Logging.Debug(e.Error.ToString()); + } + Logging.Debug(ex.ToString()); + if (NewFreeNodeFound != null) + { + NewFreeNodeFound(this, new EventArgs()); + } + return; + } + } + } + + public class UpdateSubscribeManager + { + private Configuration _config; + private List _serverSubscribes; + private UpdateFreeNode _updater; + private string _URL; + private bool _use_proxy; public bool _noitify; - - public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify) - { - if (_config == null) - { - _config = config; - _updater = updater; - _use_proxy = use_proxy; - _noitify = noitify; - if (index < 0) - { - _serverSubscribes = new List(); - for (int i = 0; i < config.serverSubscribes.Count; ++i) - { - _serverSubscribes.Add(config.serverSubscribes[i]); - } - } - else if (index < _config.serverSubscribes.Count) - { - _serverSubscribes = new List(); - _serverSubscribes.Add(config.serverSubscribes[index]); - } - Next(); - } - } - - public bool Next() - { - if (_serverSubscribes.Count == 0) - { - _config = null; - return false; - } - else - { - _URL = _serverSubscribes[0].URL; - _updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify); - _serverSubscribes.RemoveAt(0); - return true; - } - } - - public string URL - { - get - { - return _URL; - } - } - } -} + + public void CreateTask(Configuration config, UpdateFreeNode updater, int index, bool use_proxy, bool noitify) + { + if (_config == null) + { + _config = config; + _updater = updater; + _use_proxy = use_proxy; + _noitify = noitify; + if (index < 0) + { + _serverSubscribes = new List(); + for (int i = 0; i < config.serverSubscribes.Count; ++i) + { + _serverSubscribes.Add(config.serverSubscribes[i]); + } + } + else if (index < _config.serverSubscribes.Count) + { + _serverSubscribes = new List(); + _serverSubscribes.Add(config.serverSubscribes[index]); + } + Next(); + } + } + + public bool Next() + { + if (_serverSubscribes.Count == 0) + { + _config = null; + return false; + } + else + { + _URL = _serverSubscribes[0].URL; + _updater.CheckUpdate(_config, _serverSubscribes[0], _use_proxy, _noitify); + _serverSubscribes.RemoveAt(0); + return true; + } + } + + public string URL + { + get + { + return _URL; + } + } + } +} diff --git a/shadowsocks-csharp/Data/cn.txt b/shadowsocks-csharp/Data/cn.txt index 05b2d560..16ede5eb 100644 --- a/shadowsocks-csharp/Data/cn.txt +++ b/shadowsocks-csharp/Data/cn.txt @@ -64,7 +64,8 @@ Global Settings=选项设置 Up=上移 Down=下移 Verion=版本 -local=本地端口 +Any=任意地址 +Local=本机地址 New server=未配置的服务器 Server=服务器(截图打码) @@ -74,6 +75,7 @@ UDP Port=UDP端口 Password=密码 Encryption=加密 Remarks=备注 +Group=群组名 Adv. Setting=高级选项 Obfs UDP=混淆UDP协议 @@ -88,6 +90,7 @@ Obfs param=混淆参数 SSR Link=SSR链接 Original=原版 Verify all=校验所有数据 +Click the 'Link' text box=点击“SSR链接”文本框 Balance=负载均衡 OneByOne=按次序 @@ -99,6 +102,8 @@ SelectedFirst=选中优先 Timer=定时切换 Balance in group=所选组切换 AutoBan=自动禁用出错服务器 +Logging=日志记录 +Enable Log=开启日志 Remote proxy=二级(前置)代理 Proxy On=开启代理 @@ -107,11 +112,13 @@ Socks5(support UDP)=Socks5(支持UDP) Http tunnel=Http隧道 TCP Port tunnel=TCP端口转发(需要相关混淆插件) Username=用户名 +User Agent=用户代理 Local proxy=本地代理 Build-in http proxy=内置http代理(目前有bug) Proxy Port=本地端口 Set Default=重置默认值 +Local Dns=递归DNS Reconnect Times=重连次数 ConnectTimeout=连接超时 TTL=空闲断开秒数 @@ -244,4 +251,4 @@ Running: Port {0}=正在运行:端口 {0} Password NOT match=密码不匹配 Update subscribe {0} success=服务器订阅 {0} 更新成功 Update subscribe {0} failure=服务器订阅 {0} 更新失败 -Success=成功 +Success=成功 \ No newline at end of file diff --git a/shadowsocks-csharp/Data/zh-tw.txt b/shadowsocks-csharp/Data/zh-tw.txt index 6bbd6c4e..323ae3d6 100644 --- a/shadowsocks-csharp/Data/zh-tw.txt +++ b/shadowsocks-csharp/Data/zh-tw.txt @@ -63,7 +63,9 @@ Global Settings=選項設置 &Delete=刪除(&D) Up=上移 Down=下移 - +Version=版本 +Any=任意地址 +Local=本機地址 New server=未配置的伺服器 Server=伺服器(截圖打碼) @@ -73,6 +75,7 @@ UDP Port=UDP連接埠 Password=密碼 Encryption=加密 Remarks=備註 +Group=群組名 Adv. Setting=高級選項 Obfs UDP=混淆UDP協議 @@ -87,6 +90,7 @@ Obfs param=混淆參數 SSR Link=SSR連結 Original=原版 Verify all=校驗所有數據 +Click the 'Link' text box=點擊“SSR鏈接”文本框 Balance=負載均衡 OneByOne=按次序 @@ -98,6 +102,8 @@ SelectedFirst=選中優先 Timer=定時切換 Balance in group=所選組切換 AutoBan=自動禁用出錯伺服器 +Logging=日誌記錄 +Enable Log=開啟日誌 Remote proxy=二級(前置)代理 Proxy On=開啟代理 @@ -106,11 +112,13 @@ Socks5(support UDP)=Socks5(支持UDP) Http tunnel=Http隧道 TCP Port tunnel=TCP連接埠轉發(需要相關混淆插件) Username=用戶名 +User Agent=用戶代理 Local proxy=本地代理 Build-in http proxy=內置http代理(目前有bug) Proxy Port=本地連接埠 Set Default=重置缺省值 +Local Dns=遞歸DNS Reconnect Times=重連次數 ConnectTimeout=連接超時 TTL=空閒斷開秒數 @@ -154,9 +162,21 @@ Error Percent=出錯比例 Continuous=連錯 Version=版本 +# Global Log Form + +&File=文件(&F) +Clear &log=清空日誌(&L) +Show in &Explorer=在資源管理器中顯示(&E) +&Close=關閉(&C) +&View=視圖(&V) +&Font...=字體設置(&F)... +&Wrap Text=自動換行(&W) +&Always on top=置於頂層(&A) +Log Viewer=日誌查看器 + # QRCode Form -QRCode=QR 碼 +QRCode=二維碼 # PAC Url Form @@ -231,4 +251,4 @@ Running: Port {0}=正在運行:連接埠 {0} Password NOT match=密碼不匹配 Update subscribe {0} success=伺服器訂閱 {0} 更新成功 Update subscribe {0} failure=伺服器訂閱 {0} 更新失敗 -Success=成功 +Success=成功 \ No newline at end of file diff --git a/shadowsocks-csharp/Properties/AssemblyInfo.cs b/shadowsocks-csharp/Properties/AssemblyInfo.cs index 451e2293..d68de629 100755 --- a/shadowsocks-csharp/Properties/AssemblyInfo.cs +++ b/shadowsocks-csharp/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(UpdateChecker.Version)] +[assembly: AssemblyVersion(UpdateChecker.Version + ".*")] // [assembly: AssemblyFileVersion("2.0.0")] diff --git a/shadowsocks-csharp/View/ConfigForm.Designer.cs b/shadowsocks-csharp/View/ConfigForm.Designer.cs index c21ee437..a6d69eeb 100755 --- a/shadowsocks-csharp/View/ConfigForm.Designer.cs +++ b/shadowsocks-csharp/View/ConfigForm.Designer.cs @@ -29,60 +29,60 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.panel2 = new System.Windows.Forms.Panel(); - this.DeleteButton = new System.Windows.Forms.Button(); - this.AddButton = new System.Windows.Forms.Button(); - this.PictureQRcode = new System.Windows.Forms.PictureBox(); - this.ServersListBox = new System.Windows.Forms.ListBox(); + this.btnDelete = new System.Windows.Forms.Button(); + this.btnAdd = new System.Windows.Forms.Button(); + this.picQRcode = new System.Windows.Forms.PictureBox(); + this.lstServers = new System.Windows.Forms.ListBox(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.ServerGroupBox = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.ObfsCombo = new System.Windows.Forms.ComboBox(); - this.labelObfs = new System.Windows.Forms.Label(); - this.ServerPortLabel = new System.Windows.Forms.Label(); - this.IPTextBox = new System.Windows.Forms.TextBox(); - this.NumServerPort = new System.Windows.Forms.NumericUpDown(); - this.PasswordTextBox = new System.Windows.Forms.TextBox(); - this.EncryptionLabel = new System.Windows.Forms.Label(); - this.EncryptionSelect = new System.Windows.Forms.ComboBox(); - this.TextLink = new System.Windows.Forms.TextBox(); - this.RemarksTextBox = new System.Windows.Forms.TextBox(); - this.ObfsUDPLabel = new System.Windows.Forms.Label(); - this.CheckObfsUDP = new System.Windows.Forms.CheckBox(); - this.TCPProtocolLabel = new System.Windows.Forms.Label(); - this.UDPoverTCPLabel = new System.Windows.Forms.Label(); - this.CheckUDPoverUDP = new System.Windows.Forms.CheckBox(); + this.cmbObfs = new System.Windows.Forms.ComboBox(); + this.lblObfs = new System.Windows.Forms.Label(); + this.lblServerPort = new System.Windows.Forms.Label(); + this.txtIP = new System.Windows.Forms.TextBox(); + this.nudServerPort = new System.Windows.Forms.NumericUpDown(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.lblEncryption = new System.Windows.Forms.Label(); + this.cmbEncryption = new System.Windows.Forms.ComboBox(); + this.txtLink = new System.Windows.Forms.TextBox(); + this.txtRemarks = new System.Windows.Forms.TextBox(); + this.lblObfsUdp = new System.Windows.Forms.Label(); + this.chkObfsUDP = new System.Windows.Forms.CheckBox(); + this.lblTCPProtocol = new System.Windows.Forms.Label(); + this.lblUdpOverTcp = new System.Windows.Forms.Label(); + this.chkUdpOverTcp = new System.Windows.Forms.CheckBox(); this.LabelNote = new System.Windows.Forms.Label(); - this.PasswordLabel = new System.Windows.Forms.CheckBox(); - this.TCPoverUDPLabel = new System.Windows.Forms.Label(); - this.CheckTCPoverUDP = new System.Windows.Forms.CheckBox(); - this.TCPProtocolComboBox = new System.Windows.Forms.ComboBox(); - this.labelObfsParam = new System.Windows.Forms.Label(); - this.TextObfsParam = new System.Windows.Forms.TextBox(); - this.labelGroup = new System.Windows.Forms.Label(); - this.TextGroup = new System.Windows.Forms.TextBox(); - this.checkAdvSetting = new System.Windows.Forms.CheckBox(); - this.labelUDPPort = new System.Windows.Forms.Label(); - this.NumUDPPort = new System.Windows.Forms.NumericUpDown(); - this.checkSSRLink = new System.Windows.Forms.CheckBox(); - this.labelRemarks = new System.Windows.Forms.Label(); - this.labelProtocolParam = new System.Windows.Forms.Label(); - this.TextProtocolParam = new System.Windows.Forms.TextBox(); - this.IPLabel = new System.Windows.Forms.CheckBox(); + this.chkPassword = new System.Windows.Forms.CheckBox(); + this.lblTcpOverUdp = new System.Windows.Forms.Label(); + this.chkTcpOverUdp = new System.Windows.Forms.CheckBox(); + this.cmbTcpProtocol = new System.Windows.Forms.ComboBox(); + this.lblObfsParam = new System.Windows.Forms.Label(); + this.txtObfsParam = new System.Windows.Forms.TextBox(); + this.lblGroup = new System.Windows.Forms.Label(); + this.txtGroup = new System.Windows.Forms.TextBox(); + this.chkAdvSetting = new System.Windows.Forms.CheckBox(); + this.lblUDPPort = new System.Windows.Forms.Label(); + this.nudUdpPort = new System.Windows.Forms.NumericUpDown(); + this.chkSSRLink = new System.Windows.Forms.CheckBox(); + this.lblRemarks = new System.Windows.Forms.Label(); + this.lblProtocolParam = new System.Windows.Forms.Label(); + this.txtProtocolParam = new System.Windows.Forms.TextBox(); + this.chkIP = new System.Windows.Forms.CheckBox(); this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); - this.LinkUpdate = new System.Windows.Forms.LinkLabel(); + this.llbUpdate = new System.Windows.Forms.LinkLabel(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.DownButton = new System.Windows.Forms.Button(); - this.UpButton = new System.Windows.Forms.Button(); + this.btnDown = new System.Windows.Forms.Button(); + this.btnUp = new System.Windows.Forms.Button(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.MyCancelButton = new System.Windows.Forms.Button(); - this.OKButton = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.PictureQRcode)).BeginInit(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.picQRcode)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); this.ServerGroupBox.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumServerPort)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumUDPPort)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudServerPort)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudUdpPort)).BeginInit(); this.tableLayoutPanel7.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); @@ -99,52 +99,52 @@ private void InitializeComponent() this.panel2.Size = new System.Drawing.Size(0, 0); this.panel2.TabIndex = 1; // - // DeleteButton - // - this.DeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.DeleteButton.Location = new System.Drawing.Point(130, 0); - this.DeleteButton.Margin = new System.Windows.Forms.Padding(0); - this.DeleteButton.Name = "DeleteButton"; - this.DeleteButton.Size = new System.Drawing.Size(120, 34); - this.DeleteButton.TabIndex = 2; - this.DeleteButton.Text = "&Delete"; - this.DeleteButton.UseVisualStyleBackColor = true; - this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); - // - // AddButton - // - this.AddButton.Location = new System.Drawing.Point(0, 0); - this.AddButton.Margin = new System.Windows.Forms.Padding(0); - this.AddButton.Name = "AddButton"; - this.AddButton.Size = new System.Drawing.Size(120, 34); - this.AddButton.TabIndex = 1; - this.AddButton.Text = "&Add"; - this.AddButton.UseVisualStyleBackColor = true; - this.AddButton.Click += new System.EventHandler(this.AddButton_Click); - // - // PictureQRcode - // - this.PictureQRcode.Anchor = System.Windows.Forms.AnchorStyles.None; - this.PictureQRcode.BackColor = System.Drawing.SystemColors.Control; - this.PictureQRcode.Location = new System.Drawing.Point(4, 135); - this.PictureQRcode.Margin = new System.Windows.Forms.Padding(4); - this.PictureQRcode.Name = "PictureQRcode"; - this.PictureQRcode.Size = new System.Drawing.Size(260, 200); - this.PictureQRcode.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.PictureQRcode.TabIndex = 13; - this.PictureQRcode.TabStop = false; - // - // ServersListBox - // - this.ServersListBox.HorizontalScrollbar = true; - this.ServersListBox.ItemHeight = 12; - this.ServersListBox.Location = new System.Drawing.Point(0, 0); - this.ServersListBox.Margin = new System.Windows.Forms.Padding(0); - this.ServersListBox.Name = "ServersListBox"; - this.ServersListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.ServersListBox.Size = new System.Drawing.Size(250, 292); - this.ServersListBox.TabIndex = 0; - this.ServersListBox.SelectedIndexChanged += new System.EventHandler(this.ServersListBox_SelectedIndexChanged); + // btnDelete + // + this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDelete.Location = new System.Drawing.Point(130, 0); + this.btnDelete.Margin = new System.Windows.Forms.Padding(0); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.Size = new System.Drawing.Size(120, 34); + this.btnDelete.TabIndex = 2; + this.btnDelete.Text = "&Delete"; + this.btnDelete.UseVisualStyleBackColor = true; + this.btnDelete.Click += new System.EventHandler(this.DeleteButton_Click); + // + // btnAdd + // + this.btnAdd.Location = new System.Drawing.Point(0, 0); + this.btnAdd.Margin = new System.Windows.Forms.Padding(0); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size(120, 34); + this.btnAdd.TabIndex = 1; + this.btnAdd.Text = "&Add"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.AddButton_Click); + // + // picQRcode + // + this.picQRcode.Anchor = System.Windows.Forms.AnchorStyles.None; + this.picQRcode.BackColor = System.Drawing.SystemColors.Control; + this.picQRcode.Location = new System.Drawing.Point(4, 134); + this.picQRcode.Margin = new System.Windows.Forms.Padding(4); + this.picQRcode.Name = "picQRcode"; + this.picQRcode.Size = new System.Drawing.Size(260, 200); + this.picQRcode.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.picQRcode.TabIndex = 13; + this.picQRcode.TabStop = false; + // + // lstServers + // + this.lstServers.HorizontalScrollbar = true; + this.lstServers.ItemHeight = 12; + this.lstServers.Location = new System.Drawing.Point(0, 0); + this.lstServers.Margin = new System.Windows.Forms.Padding(0); + this.lstServers.Name = "lstServers"; + this.lstServers.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.lstServers.Size = new System.Drawing.Size(250, 292); + this.lstServers.TabIndex = 0; + this.lstServers.SelectedIndexChanged += new System.EventHandler(this.ServersListBox_SelectedIndexChanged); // // tableLayoutPanel2 // @@ -164,7 +164,7 @@ private void InitializeComponent() this.tableLayoutPanel2.RowCount = 2; 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(909, 518); + this.tableLayoutPanel2.Size = new System.Drawing.Size(903, 517); this.tableLayoutPanel2.TabIndex = 7; // // ServerGroupBox @@ -176,7 +176,7 @@ private void InitializeComponent() this.ServerGroupBox.Location = new System.Drawing.Point(268, 0); this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); this.ServerGroupBox.Name = "ServerGroupBox"; - this.ServerGroupBox.Size = new System.Drawing.Size(358, 476); + this.ServerGroupBox.Size = new System.Drawing.Size(352, 475); this.ServerGroupBox.TabIndex = 20; this.ServerGroupBox.TabStop = false; this.ServerGroupBox.Text = "Server"; @@ -188,38 +188,38 @@ private void InitializeComponent() this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.Controls.Add(this.ObfsCombo, 1, 7); - this.tableLayoutPanel1.Controls.Add(this.labelObfs, 0, 7); - this.tableLayoutPanel1.Controls.Add(this.ServerPortLabel, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.IPTextBox, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.NumServerPort, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.EncryptionLabel, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 4); - this.tableLayoutPanel1.Controls.Add(this.TextLink, 1, 11); - this.tableLayoutPanel1.Controls.Add(this.RemarksTextBox, 1, 9); - this.tableLayoutPanel1.Controls.Add(this.ObfsUDPLabel, 0, 16); - this.tableLayoutPanel1.Controls.Add(this.CheckObfsUDP, 1, 16); - this.tableLayoutPanel1.Controls.Add(this.TCPProtocolLabel, 0, 5); - this.tableLayoutPanel1.Controls.Add(this.UDPoverTCPLabel, 0, 15); - this.tableLayoutPanel1.Controls.Add(this.CheckUDPoverUDP, 1, 15); + this.tableLayoutPanel1.Controls.Add(this.cmbObfs, 1, 7); + this.tableLayoutPanel1.Controls.Add(this.lblObfs, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.lblServerPort, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.txtIP, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.nudServerPort, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.txtPassword, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.lblEncryption, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.cmbEncryption, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.txtLink, 1, 11); + this.tableLayoutPanel1.Controls.Add(this.txtRemarks, 1, 9); + this.tableLayoutPanel1.Controls.Add(this.lblObfsUdp, 0, 16); + this.tableLayoutPanel1.Controls.Add(this.chkObfsUDP, 1, 16); + this.tableLayoutPanel1.Controls.Add(this.lblTCPProtocol, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.lblUdpOverTcp, 0, 15); + this.tableLayoutPanel1.Controls.Add(this.chkUdpOverTcp, 1, 15); this.tableLayoutPanel1.Controls.Add(this.LabelNote, 1, 12); - this.tableLayoutPanel1.Controls.Add(this.PasswordLabel, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.TCPoverUDPLabel, 0, 14); - this.tableLayoutPanel1.Controls.Add(this.CheckTCPoverUDP, 1, 14); - this.tableLayoutPanel1.Controls.Add(this.TCPProtocolComboBox, 1, 5); - this.tableLayoutPanel1.Controls.Add(this.labelObfsParam, 0, 8); - this.tableLayoutPanel1.Controls.Add(this.TextObfsParam, 1, 8); - this.tableLayoutPanel1.Controls.Add(this.labelGroup, 0, 10); - this.tableLayoutPanel1.Controls.Add(this.TextGroup, 1, 10); - this.tableLayoutPanel1.Controls.Add(this.checkAdvSetting, 0, 12); - this.tableLayoutPanel1.Controls.Add(this.labelUDPPort, 0, 13); - this.tableLayoutPanel1.Controls.Add(this.NumUDPPort, 1, 13); - this.tableLayoutPanel1.Controls.Add(this.checkSSRLink, 0, 11); - this.tableLayoutPanel1.Controls.Add(this.labelRemarks, 0, 9); - this.tableLayoutPanel1.Controls.Add(this.labelProtocolParam, 0, 6); - this.tableLayoutPanel1.Controls.Add(this.TextProtocolParam, 1, 6); - this.tableLayoutPanel1.Controls.Add(this.IPLabel, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.chkPassword, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.lblTcpOverUdp, 0, 14); + this.tableLayoutPanel1.Controls.Add(this.chkTcpOverUdp, 1, 14); + this.tableLayoutPanel1.Controls.Add(this.cmbTcpProtocol, 1, 5); + this.tableLayoutPanel1.Controls.Add(this.lblObfsParam, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.txtObfsParam, 1, 8); + this.tableLayoutPanel1.Controls.Add(this.lblGroup, 0, 10); + this.tableLayoutPanel1.Controls.Add(this.txtGroup, 1, 10); + this.tableLayoutPanel1.Controls.Add(this.chkAdvSetting, 0, 12); + this.tableLayoutPanel1.Controls.Add(this.lblUDPPort, 0, 13); + this.tableLayoutPanel1.Controls.Add(this.nudUdpPort, 1, 13); + this.tableLayoutPanel1.Controls.Add(this.chkSSRLink, 0, 11); + this.tableLayoutPanel1.Controls.Add(this.lblRemarks, 0, 9); + this.tableLayoutPanel1.Controls.Add(this.lblProtocolParam, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.txtProtocolParam, 1, 6); + this.tableLayoutPanel1.Controls.Add(this.chkIP, 0, 1); this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 32); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; @@ -243,234 +243,240 @@ private void InitializeComponent() 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(347, 427); + this.tableLayoutPanel1.Size = new System.Drawing.Size(341, 426); this.tableLayoutPanel1.TabIndex = 0; // - // ObfsCombo + // cmbObfs // - this.ObfsCombo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.ObfsCombo.FormattingEnabled = true; - this.ObfsCombo.Items.AddRange(new object[] { + this.cmbObfs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbObfs.FormattingEnabled = true; + this.cmbObfs.Items.AddRange(new object[] { "plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth", "tls1.2_ticket_fastauth"}); - this.ObfsCombo.Location = new System.Drawing.Point(108, 174); - this.ObfsCombo.Margin = new System.Windows.Forms.Padding(3, 3, 3, 7); - this.ObfsCombo.Name = "ObfsCombo"; - this.ObfsCombo.Size = new System.Drawing.Size(233, 20); - this.ObfsCombo.TabIndex = 19; - this.ObfsCombo.TextChanged += new System.EventHandler(this.ObfsCombo_TextChanged); - // - // labelObfs - // - this.labelObfs.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelObfs.AutoSize = true; - this.labelObfs.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.labelObfs.Location = new System.Drawing.Point(73, 180); - this.labelObfs.Name = "labelObfs"; - this.labelObfs.Size = new System.Drawing.Size(29, 12); - this.labelObfs.TabIndex = 18; - this.labelObfs.Text = "Obfs"; - // - // ServerPortLabel - // - this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ServerPortLabel.AutoSize = true; - this.ServerPortLabel.Location = new System.Drawing.Point(31, 37); - this.ServerPortLabel.Name = "ServerPortLabel"; - this.ServerPortLabel.Size = new System.Drawing.Size(71, 12); - this.ServerPortLabel.TabIndex = 8; - this.ServerPortLabel.Text = "Server Port"; - // - // IPTextBox - // - this.IPTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.IPTextBox.Location = new System.Drawing.Point(108, 6); - this.IPTextBox.MaxLength = 512; - this.IPTextBox.Name = "IPTextBox"; - this.IPTextBox.Size = new System.Drawing.Size(233, 21); - this.IPTextBox.TabIndex = 7; - this.IPTextBox.UseSystemPasswordChar = true; - this.IPTextBox.WordWrap = false; - // - // NumServerPort - // - this.NumServerPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.NumServerPort.Location = new System.Drawing.Point(108, 33); - this.NumServerPort.Maximum = new decimal(new int[] { + this.cmbObfs.Location = new System.Drawing.Point(102, 176); + this.cmbObfs.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); + this.cmbObfs.Name = "cmbObfs"; + this.cmbObfs.Size = new System.Drawing.Size(233, 20); + this.cmbObfs.TabIndex = 19; + this.cmbObfs.TextChanged += new System.EventHandler(this.ObfsCombo_TextChanged); + // + // lblObfs + // + this.lblObfs.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblObfs.AutoSize = true; + this.lblObfs.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); + this.lblObfs.Location = new System.Drawing.Point(67, 182); + this.lblObfs.Margin = new System.Windows.Forms.Padding(3); + this.lblObfs.Name = "lblObfs"; + this.lblObfs.Size = new System.Drawing.Size(29, 12); + this.lblObfs.TabIndex = 18; + this.lblObfs.Text = "Obfs"; + // + // lblServerPort + // + this.lblServerPort.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblServerPort.AutoSize = true; + this.lblServerPort.Location = new System.Drawing.Point(25, 37); + this.lblServerPort.Margin = new System.Windows.Forms.Padding(3); + this.lblServerPort.Name = "lblServerPort"; + this.lblServerPort.Size = new System.Drawing.Size(71, 12); + this.lblServerPort.TabIndex = 8; + this.lblServerPort.Text = "Server Port"; + this.lblServerPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtIP + // + this.txtIP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtIP.Location = new System.Drawing.Point(102, 6); + this.txtIP.MaxLength = 512; + this.txtIP.Name = "txtIP"; + this.txtIP.Size = new System.Drawing.Size(233, 21); + this.txtIP.TabIndex = 7; + this.txtIP.UseSystemPasswordChar = true; + this.txtIP.WordWrap = false; + // + // nudServerPort + // + this.nudServerPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudServerPort.Location = new System.Drawing.Point(102, 33); + this.nudServerPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); - this.NumServerPort.Name = "NumServerPort"; - this.NumServerPort.Size = new System.Drawing.Size(233, 21); - this.NumServerPort.TabIndex = 9; - // - // PasswordTextBox - // - this.PasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.PasswordTextBox.Location = new System.Drawing.Point(108, 60); - this.PasswordTextBox.MaxLength = 256; - this.PasswordTextBox.Name = "PasswordTextBox"; - this.PasswordTextBox.Size = new System.Drawing.Size(233, 21); - this.PasswordTextBox.TabIndex = 11; - this.PasswordTextBox.UseSystemPasswordChar = true; - this.PasswordTextBox.WordWrap = false; - // - // EncryptionLabel - // - this.EncryptionLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.EncryptionLabel.AutoSize = true; - this.EncryptionLabel.Location = new System.Drawing.Point(37, 93); - this.EncryptionLabel.Name = "EncryptionLabel"; - this.EncryptionLabel.Size = new System.Drawing.Size(65, 12); - this.EncryptionLabel.TabIndex = 12; - this.EncryptionLabel.Text = "Encryption"; - // - // EncryptionSelect - // - this.EncryptionSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.EncryptionSelect.FormattingEnabled = true; - this.EncryptionSelect.Location = new System.Drawing.Point(108, 87); - this.EncryptionSelect.Margin = new System.Windows.Forms.Padding(3, 3, 3, 7); - this.EncryptionSelect.Name = "EncryptionSelect"; - this.EncryptionSelect.Size = new System.Drawing.Size(233, 20); - this.EncryptionSelect.TabIndex = 13; - // - // TextLink - // - this.TextLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TextLink.Location = new System.Drawing.Point(108, 285); - this.TextLink.Name = "TextLink"; - this.TextLink.ReadOnly = true; - this.TextLink.Size = new System.Drawing.Size(233, 21); - this.TextLink.TabIndex = 27; - this.TextLink.WordWrap = false; - this.TextLink.Enter += new System.EventHandler(this.TextBox_Enter); - this.TextLink.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TextBox_MouseUp); - // - // RemarksTextBox - // - this.RemarksTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.RemarksTextBox.Location = new System.Drawing.Point(108, 231); - this.RemarksTextBox.MaxLength = 256; - this.RemarksTextBox.Name = "RemarksTextBox"; - this.RemarksTextBox.Size = new System.Drawing.Size(233, 21); - this.RemarksTextBox.TabIndex = 23; - this.RemarksTextBox.WordWrap = false; - // - // ObfsUDPLabel - // - this.ObfsUDPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ObfsUDPLabel.AutoSize = true; - this.ObfsUDPLabel.Location = new System.Drawing.Point(49, 407); - this.ObfsUDPLabel.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); - this.ObfsUDPLabel.Name = "ObfsUDPLabel"; - this.ObfsUDPLabel.Size = new System.Drawing.Size(53, 12); - this.ObfsUDPLabel.TabIndex = 36; - this.ObfsUDPLabel.Text = "Obfs UDP"; - this.ObfsUDPLabel.Visible = false; - // - // CheckObfsUDP - // - this.CheckObfsUDP.AutoSize = true; - this.CheckObfsUDP.Location = new System.Drawing.Point(108, 405); - this.CheckObfsUDP.Name = "CheckObfsUDP"; - this.CheckObfsUDP.Size = new System.Drawing.Size(126, 16); - this.CheckObfsUDP.TabIndex = 37; - this.CheckObfsUDP.Text = "Recommend checked"; - this.CheckObfsUDP.UseVisualStyleBackColor = true; - this.CheckObfsUDP.Visible = false; - // - // TCPProtocolLabel - // - this.TCPProtocolLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.TCPProtocolLabel.AutoSize = true; - this.TCPProtocolLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.TCPProtocolLabel.Location = new System.Drawing.Point(49, 123); - this.TCPProtocolLabel.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); - this.TCPProtocolLabel.Name = "TCPProtocolLabel"; - this.TCPProtocolLabel.Size = new System.Drawing.Size(53, 12); - this.TCPProtocolLabel.TabIndex = 14; - this.TCPProtocolLabel.Text = "Protocol"; - // - // UDPoverTCPLabel - // - this.UDPoverTCPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.UDPoverTCPLabel.AutoSize = true; - this.UDPoverTCPLabel.Location = new System.Drawing.Point(25, 385); - this.UDPoverTCPLabel.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); - this.UDPoverTCPLabel.Name = "UDPoverTCPLabel"; - this.UDPoverTCPLabel.Size = new System.Drawing.Size(77, 12); - this.UDPoverTCPLabel.TabIndex = 34; - this.UDPoverTCPLabel.Text = "UDP over TCP"; - this.UDPoverTCPLabel.Visible = false; - // - // CheckUDPoverUDP - // - this.CheckUDPoverUDP.AutoSize = true; - this.CheckUDPoverUDP.Location = new System.Drawing.Point(108, 383); - this.CheckUDPoverUDP.Name = "CheckUDPoverUDP"; - this.CheckUDPoverUDP.Size = new System.Drawing.Size(186, 16); - this.CheckUDPoverUDP.TabIndex = 35; - this.CheckUDPoverUDP.Text = "UDP over UDP if not checked"; - this.CheckUDPoverUDP.UseVisualStyleBackColor = true; - this.CheckUDPoverUDP.Visible = false; + this.nudServerPort.Name = "nudServerPort"; + this.nudServerPort.Size = new System.Drawing.Size(233, 21); + this.nudServerPort.TabIndex = 9; + // + // txtPassword + // + this.txtPassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtPassword.Location = new System.Drawing.Point(102, 60); + this.txtPassword.MaxLength = 256; + this.txtPassword.Name = "txtPassword"; + this.txtPassword.Size = new System.Drawing.Size(233, 21); + this.txtPassword.TabIndex = 11; + this.txtPassword.UseSystemPasswordChar = true; + this.txtPassword.WordWrap = false; + // + // lblEncryption + // + this.lblEncryption.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblEncryption.AutoSize = true; + this.lblEncryption.Location = new System.Drawing.Point(31, 93); + this.lblEncryption.Margin = new System.Windows.Forms.Padding(3); + this.lblEncryption.Name = "lblEncryption"; + this.lblEncryption.Size = new System.Drawing.Size(65, 12); + this.lblEncryption.TabIndex = 12; + this.lblEncryption.Text = "Encryption"; + this.lblEncryption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // cmbEncryption + // + this.cmbEncryption.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbEncryption.FormattingEnabled = true; + this.cmbEncryption.Location = new System.Drawing.Point(102, 87); + this.cmbEncryption.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); + this.cmbEncryption.Name = "cmbEncryption"; + this.cmbEncryption.Size = new System.Drawing.Size(233, 20); + this.cmbEncryption.TabIndex = 13; + // + // txtLink + // + this.txtLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtLink.Location = new System.Drawing.Point(102, 288); + this.txtLink.Name = "txtLink"; + this.txtLink.ReadOnly = true; + this.txtLink.Size = new System.Drawing.Size(233, 21); + this.txtLink.TabIndex = 27; + this.txtLink.WordWrap = false; + this.txtLink.Enter += new System.EventHandler(this.TextBox_Enter); + this.txtLink.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TextBox_MouseUp); + // + // txtRemarks + // + this.txtRemarks.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtRemarks.Location = new System.Drawing.Point(102, 234); + this.txtRemarks.MaxLength = 256; + this.txtRemarks.Name = "txtRemarks"; + this.txtRemarks.Size = new System.Drawing.Size(233, 21); + this.txtRemarks.TabIndex = 23; + this.txtRemarks.WordWrap = false; + // + // lblObfsUdp + // + this.lblObfsUdp.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblObfsUdp.AutoSize = true; + this.lblObfsUdp.Location = new System.Drawing.Point(43, 406); + this.lblObfsUdp.Margin = new System.Windows.Forms.Padding(3); + this.lblObfsUdp.Name = "lblObfsUdp"; + this.lblObfsUdp.Size = new System.Drawing.Size(53, 12); + this.lblObfsUdp.TabIndex = 36; + this.lblObfsUdp.Text = "Obfs UDP"; + this.lblObfsUdp.Visible = false; + // + // chkObfsUDP + // + this.chkObfsUDP.AutoSize = true; + this.chkObfsUDP.Location = new System.Drawing.Point(102, 404); + this.chkObfsUDP.Name = "chkObfsUDP"; + this.chkObfsUDP.Size = new System.Drawing.Size(126, 16); + this.chkObfsUDP.TabIndex = 37; + this.chkObfsUDP.Text = "Recommend checked"; + this.chkObfsUDP.UseVisualStyleBackColor = true; + this.chkObfsUDP.Visible = false; + // + // lblTCPProtocol + // + this.lblTCPProtocol.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblTCPProtocol.AutoSize = true; + this.lblTCPProtocol.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); + this.lblTCPProtocol.Location = new System.Drawing.Point(43, 124); + this.lblTCPProtocol.Margin = new System.Windows.Forms.Padding(3); + this.lblTCPProtocol.Name = "lblTCPProtocol"; + this.lblTCPProtocol.Size = new System.Drawing.Size(53, 12); + this.lblTCPProtocol.TabIndex = 14; + this.lblTCPProtocol.Text = "Protocol"; + // + // lblUdpOverTcp + // + this.lblUdpOverTcp.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblUdpOverTcp.AutoSize = true; + this.lblUdpOverTcp.Location = new System.Drawing.Point(19, 384); + this.lblUdpOverTcp.Margin = new System.Windows.Forms.Padding(3); + this.lblUdpOverTcp.Name = "lblUdpOverTcp"; + this.lblUdpOverTcp.Size = new System.Drawing.Size(77, 12); + this.lblUdpOverTcp.TabIndex = 34; + this.lblUdpOverTcp.Text = "UDP over TCP"; + this.lblUdpOverTcp.Visible = false; + // + // chkUdpOverTcp + // + this.chkUdpOverTcp.AutoSize = true; + this.chkUdpOverTcp.Location = new System.Drawing.Point(102, 382); + this.chkUdpOverTcp.Name = "chkUdpOverTcp"; + this.chkUdpOverTcp.Size = new System.Drawing.Size(186, 16); + this.chkUdpOverTcp.TabIndex = 35; + this.chkUdpOverTcp.Text = "UDP over TCP if not checked"; + this.chkUdpOverTcp.UseVisualStyleBackColor = true; + this.chkUdpOverTcp.Visible = false; // // LabelNote // this.LabelNote.Anchor = System.Windows.Forms.AnchorStyles.Left; this.LabelNote.AutoSize = true; - this.LabelNote.Location = new System.Drawing.Point(110, 314); - this.LabelNote.Margin = new System.Windows.Forms.Padding(5); + this.LabelNote.Location = new System.Drawing.Point(99, 315); + this.LabelNote.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.LabelNote.Name = "LabelNote"; this.LabelNote.Size = new System.Drawing.Size(179, 12); this.LabelNote.TabIndex = 29; this.LabelNote.Text = "NOT all server support belows"; // - // PasswordLabel - // - this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.PasswordLabel.AutoSize = true; - this.PasswordLabel.Location = new System.Drawing.Point(30, 62); - this.PasswordLabel.Name = "PasswordLabel"; - this.PasswordLabel.Size = new System.Drawing.Size(72, 16); - this.PasswordLabel.TabIndex = 10; - this.PasswordLabel.Text = "Password"; - this.PasswordLabel.UseVisualStyleBackColor = true; - this.PasswordLabel.CheckedChanged += new System.EventHandler(this.PasswordLabel_CheckedChanged); - // - // TCPoverUDPLabel - // - this.TCPoverUDPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.TCPoverUDPLabel.AutoSize = true; - this.TCPoverUDPLabel.Location = new System.Drawing.Point(25, 363); - this.TCPoverUDPLabel.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); - this.TCPoverUDPLabel.Name = "TCPoverUDPLabel"; - this.TCPoverUDPLabel.Size = new System.Drawing.Size(77, 12); - this.TCPoverUDPLabel.TabIndex = 32; - this.TCPoverUDPLabel.Text = "TCP over UDP"; - this.TCPoverUDPLabel.Visible = false; - // - // CheckTCPoverUDP - // - this.CheckTCPoverUDP.AutoSize = true; - this.CheckTCPoverUDP.Location = new System.Drawing.Point(108, 361); - this.CheckTCPoverUDP.Name = "CheckTCPoverUDP"; - this.CheckTCPoverUDP.Size = new System.Drawing.Size(186, 16); - this.CheckTCPoverUDP.TabIndex = 33; - this.CheckTCPoverUDP.Text = "TCP over TCP if not checked"; - this.CheckTCPoverUDP.UseVisualStyleBackColor = true; - this.CheckTCPoverUDP.Visible = false; - // - // TCPProtocolComboBox - // - this.TCPProtocolComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TCPProtocolComboBox.FormattingEnabled = true; - this.TCPProtocolComboBox.Items.AddRange(new object[] { + // chkPassword + // + this.chkPassword.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkPassword.AutoSize = true; + this.chkPassword.Location = new System.Drawing.Point(27, 62); + this.chkPassword.Margin = new System.Windows.Forms.Padding(0); + this.chkPassword.Name = "chkPassword"; + this.chkPassword.Size = new System.Drawing.Size(72, 16); + this.chkPassword.TabIndex = 10; + this.chkPassword.Text = "Password"; + this.chkPassword.UseVisualStyleBackColor = true; + this.chkPassword.CheckedChanged += new System.EventHandler(this.PasswordLabel_CheckedChanged); + // + // lblTcpOverUdp + // + this.lblTcpOverUdp.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblTcpOverUdp.AutoSize = true; + this.lblTcpOverUdp.Location = new System.Drawing.Point(19, 362); + this.lblTcpOverUdp.Margin = new System.Windows.Forms.Padding(3); + this.lblTcpOverUdp.Name = "lblTcpOverUdp"; + this.lblTcpOverUdp.Size = new System.Drawing.Size(77, 12); + this.lblTcpOverUdp.TabIndex = 32; + this.lblTcpOverUdp.Text = "TCP over UDP"; + this.lblTcpOverUdp.Visible = false; + // + // chkTcpOverUdp + // + this.chkTcpOverUdp.AutoSize = true; + this.chkTcpOverUdp.Location = new System.Drawing.Point(102, 360); + this.chkTcpOverUdp.Name = "chkTcpOverUdp"; + this.chkTcpOverUdp.Size = new System.Drawing.Size(186, 16); + this.chkTcpOverUdp.TabIndex = 33; + this.chkTcpOverUdp.Text = "TCP over UDP if not checked"; + this.chkTcpOverUdp.UseVisualStyleBackColor = true; + this.chkTcpOverUdp.Visible = false; + // + // cmbTcpProtocol + // + this.cmbTcpProtocol.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbTcpProtocol.FormattingEnabled = true; + this.cmbTcpProtocol.Items.AddRange(new object[] { "origin", "verify_deflate", "auth_sha1_v4", @@ -483,152 +489,159 @@ private void InitializeComponent() "auth_chain_e", "auth_chain_f", "auth_akarin_rand", - "auth_akarin_spec_a" - }); - this.TCPProtocolComboBox.Location = new System.Drawing.Point(108, 117); - this.TCPProtocolComboBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 7); - this.TCPProtocolComboBox.Name = "TCPProtocolComboBox"; - this.TCPProtocolComboBox.Size = new System.Drawing.Size(233, 20); - this.TCPProtocolComboBox.TabIndex = 15; - // - // labelObfsParam - // - this.labelObfsParam.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelObfsParam.AutoSize = true; - this.labelObfsParam.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.labelObfsParam.Location = new System.Drawing.Point(37, 208); - this.labelObfsParam.Name = "labelObfsParam"; - this.labelObfsParam.Size = new System.Drawing.Size(65, 12); - this.labelObfsParam.TabIndex = 20; - this.labelObfsParam.Text = "Obfs param"; - // - // TextObfsParam - // - this.TextObfsParam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TextObfsParam.Location = new System.Drawing.Point(108, 204); - this.TextObfsParam.Name = "TextObfsParam"; - this.TextObfsParam.Size = new System.Drawing.Size(233, 21); - this.TextObfsParam.TabIndex = 21; - // - // labelGroup - // - this.labelGroup.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelGroup.AutoSize = true; - this.labelGroup.Location = new System.Drawing.Point(67, 262); - this.labelGroup.Name = "labelGroup"; - this.labelGroup.Size = new System.Drawing.Size(35, 12); - this.labelGroup.TabIndex = 24; - this.labelGroup.Text = "Group"; - // - // TextGroup - // - this.TextGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TextGroup.Location = new System.Drawing.Point(108, 258); - this.TextGroup.MaxLength = 64; - this.TextGroup.Name = "TextGroup"; - this.TextGroup.Size = new System.Drawing.Size(233, 21); - this.TextGroup.TabIndex = 25; - this.TextGroup.WordWrap = false; - // - // checkAdvSetting - // - this.checkAdvSetting.AutoSize = true; - this.checkAdvSetting.Location = new System.Drawing.Point(6, 312); - this.checkAdvSetting.Name = "checkAdvSetting"; - this.checkAdvSetting.Size = new System.Drawing.Size(96, 16); - this.checkAdvSetting.TabIndex = 28; - this.checkAdvSetting.Text = "Adv. Setting"; - this.checkAdvSetting.UseVisualStyleBackColor = true; - this.checkAdvSetting.CheckedChanged += new System.EventHandler(this.checkAdvSetting_CheckedChanged); - // - // labelUDPPort - // - this.labelUDPPort.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelUDPPort.AutoSize = true; - this.labelUDPPort.Location = new System.Drawing.Point(49, 338); - this.labelUDPPort.Margin = new System.Windows.Forms.Padding(3, 5, 3, 5); - this.labelUDPPort.Name = "labelUDPPort"; - this.labelUDPPort.Size = new System.Drawing.Size(53, 12); - this.labelUDPPort.TabIndex = 30; - this.labelUDPPort.Text = "UDP Port"; - this.labelUDPPort.Visible = false; - // - // NumUDPPort - // - this.NumUDPPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.NumUDPPort.Location = new System.Drawing.Point(108, 334); - this.NumUDPPort.Maximum = new decimal(new int[] { + "auth_akarin_spec_a"}); + this.cmbTcpProtocol.Location = new System.Drawing.Point(102, 118); + this.cmbTcpProtocol.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); + this.cmbTcpProtocol.Name = "cmbTcpProtocol"; + this.cmbTcpProtocol.Size = new System.Drawing.Size(233, 20); + this.cmbTcpProtocol.TabIndex = 15; + // + // lblObfsParam + // + this.lblObfsParam.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblObfsParam.AutoSize = true; + this.lblObfsParam.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); + this.lblObfsParam.Location = new System.Drawing.Point(31, 211); + this.lblObfsParam.Margin = new System.Windows.Forms.Padding(3); + this.lblObfsParam.Name = "lblObfsParam"; + this.lblObfsParam.Size = new System.Drawing.Size(65, 12); + this.lblObfsParam.TabIndex = 20; + this.lblObfsParam.Text = "Obfs param"; + // + // txtObfsParam + // + this.txtObfsParam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtObfsParam.Location = new System.Drawing.Point(102, 207); + this.txtObfsParam.Name = "txtObfsParam"; + this.txtObfsParam.Size = new System.Drawing.Size(233, 21); + this.txtObfsParam.TabIndex = 21; + // + // lblGroup + // + this.lblGroup.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblGroup.AutoSize = true; + this.lblGroup.Location = new System.Drawing.Point(61, 265); + this.lblGroup.Margin = new System.Windows.Forms.Padding(3); + this.lblGroup.Name = "lblGroup"; + this.lblGroup.Size = new System.Drawing.Size(35, 12); + this.lblGroup.TabIndex = 24; + this.lblGroup.Text = "Group"; + // + // txtGroup + // + this.txtGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtGroup.Location = new System.Drawing.Point(102, 261); + this.txtGroup.MaxLength = 64; + this.txtGroup.Name = "txtGroup"; + this.txtGroup.Size = new System.Drawing.Size(233, 21); + this.txtGroup.TabIndex = 25; + this.txtGroup.WordWrap = false; + // + // chkAdvSetting + // + this.chkAdvSetting.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkAdvSetting.AutoSize = true; + this.chkAdvSetting.Location = new System.Drawing.Point(3, 313); + this.chkAdvSetting.Margin = new System.Windows.Forms.Padding(0); + this.chkAdvSetting.Name = "chkAdvSetting"; + this.chkAdvSetting.Size = new System.Drawing.Size(96, 16); + this.chkAdvSetting.TabIndex = 28; + this.chkAdvSetting.Text = "Adv. Setting"; + this.chkAdvSetting.UseVisualStyleBackColor = true; + this.chkAdvSetting.CheckedChanged += new System.EventHandler(this.checkAdvSetting_CheckedChanged); + // + // lblUDPPort + // + this.lblUDPPort.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblUDPPort.AutoSize = true; + this.lblUDPPort.Location = new System.Drawing.Point(43, 337); + this.lblUDPPort.Margin = new System.Windows.Forms.Padding(3); + this.lblUDPPort.Name = "lblUDPPort"; + this.lblUDPPort.Size = new System.Drawing.Size(53, 12); + this.lblUDPPort.TabIndex = 30; + this.lblUDPPort.Text = "UDP Port"; + this.lblUDPPort.Visible = false; + // + // nudUdpPort + // + this.nudUdpPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudUdpPort.Location = new System.Drawing.Point(102, 333); + this.nudUdpPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); - this.NumUDPPort.Name = "NumUDPPort"; - this.NumUDPPort.Size = new System.Drawing.Size(233, 21); - this.NumUDPPort.TabIndex = 31; - this.NumUDPPort.Visible = false; - // - // checkSSRLink - // - this.checkSSRLink.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.checkSSRLink.AutoSize = true; - this.checkSSRLink.Checked = true; - this.checkSSRLink.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkSSRLink.Location = new System.Drawing.Point(30, 287); - this.checkSSRLink.Name = "checkSSRLink"; - this.checkSSRLink.Size = new System.Drawing.Size(72, 16); - this.checkSSRLink.TabIndex = 26; - this.checkSSRLink.Text = "SSR Link"; - this.checkSSRLink.UseVisualStyleBackColor = true; - this.checkSSRLink.CheckedChanged += new System.EventHandler(this.checkSSRLink_CheckedChanged); - // - // labelRemarks - // - this.labelRemarks.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelRemarks.AutoSize = true; - this.labelRemarks.Location = new System.Drawing.Point(55, 235); - this.labelRemarks.Name = "labelRemarks"; - this.labelRemarks.Size = new System.Drawing.Size(47, 12); - this.labelRemarks.TabIndex = 22; - this.labelRemarks.Text = "Remarks"; - // - // labelProtocolParam - // - this.labelProtocolParam.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelProtocolParam.AutoSize = true; - this.labelProtocolParam.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.labelProtocolParam.Location = new System.Drawing.Point(13, 151); - this.labelProtocolParam.Name = "labelProtocolParam"; - this.labelProtocolParam.Size = new System.Drawing.Size(89, 12); - this.labelProtocolParam.TabIndex = 16; - this.labelProtocolParam.Text = "Protocol param"; - // - // TextProtocolParam - // - this.TextProtocolParam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TextProtocolParam.Location = new System.Drawing.Point(108, 147); - this.TextProtocolParam.Name = "TextProtocolParam"; - this.TextProtocolParam.Size = new System.Drawing.Size(233, 21); - this.TextProtocolParam.TabIndex = 17; - // - // IPLabel - // - this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.IPLabel.AutoSize = true; - this.IPLabel.Location = new System.Drawing.Point(24, 8); - this.IPLabel.Name = "IPLabel"; - this.IPLabel.Size = new System.Drawing.Size(78, 16); - this.IPLabel.TabIndex = 38; - this.IPLabel.Text = "Server IP"; - this.IPLabel.UseVisualStyleBackColor = true; - this.IPLabel.CheckedChanged += new System.EventHandler(this.IPLabel_CheckedChanged); + this.nudUdpPort.Name = "nudUdpPort"; + this.nudUdpPort.Size = new System.Drawing.Size(233, 21); + this.nudUdpPort.TabIndex = 31; + this.nudUdpPort.Visible = false; + // + // chkSSRLink + // + this.chkSSRLink.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkSSRLink.AutoSize = true; + this.chkSSRLink.Checked = true; + this.chkSSRLink.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkSSRLink.Location = new System.Drawing.Point(27, 290); + this.chkSSRLink.Margin = new System.Windows.Forms.Padding(0); + this.chkSSRLink.Name = "chkSSRLink"; + this.chkSSRLink.Size = new System.Drawing.Size(72, 16); + this.chkSSRLink.TabIndex = 26; + this.chkSSRLink.Text = "SSR Link"; + this.chkSSRLink.UseVisualStyleBackColor = true; + this.chkSSRLink.CheckedChanged += new System.EventHandler(this.checkSSRLink_CheckedChanged); + // + // lblRemarks + // + this.lblRemarks.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblRemarks.AutoSize = true; + this.lblRemarks.Location = new System.Drawing.Point(49, 238); + this.lblRemarks.Margin = new System.Windows.Forms.Padding(3); + this.lblRemarks.Name = "lblRemarks"; + this.lblRemarks.Size = new System.Drawing.Size(47, 12); + this.lblRemarks.TabIndex = 22; + this.lblRemarks.Text = "Remarks"; + // + // lblProtocolParam + // + this.lblProtocolParam.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblProtocolParam.AutoSize = true; + this.lblProtocolParam.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); + this.lblProtocolParam.Location = new System.Drawing.Point(7, 153); + this.lblProtocolParam.Margin = new System.Windows.Forms.Padding(3); + this.lblProtocolParam.Name = "lblProtocolParam"; + this.lblProtocolParam.Size = new System.Drawing.Size(89, 12); + this.lblProtocolParam.TabIndex = 16; + this.lblProtocolParam.Text = "Protocol param"; + // + // txtProtocolParam + // + this.txtProtocolParam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtProtocolParam.Location = new System.Drawing.Point(102, 149); + this.txtProtocolParam.Name = "txtProtocolParam"; + this.txtProtocolParam.Size = new System.Drawing.Size(233, 21); + this.txtProtocolParam.TabIndex = 17; + // + // chkIP + // + this.chkIP.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkIP.AutoSize = true; + this.chkIP.Location = new System.Drawing.Point(21, 8); + this.chkIP.Margin = new System.Windows.Forms.Padding(0); + this.chkIP.Name = "chkIP"; + this.chkIP.Size = new System.Drawing.Size(78, 16); + this.chkIP.TabIndex = 38; + this.chkIP.Text = "Server IP"; + this.chkIP.UseVisualStyleBackColor = true; + this.chkIP.CheckedChanged += new System.EventHandler(this.IPLabel_CheckedChanged); // // tableLayoutPanel7 // this.tableLayoutPanel7.AutoSize = true; this.tableLayoutPanel7.ColumnCount = 1; this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel7.Controls.Add(this.ServersListBox, 0, 0); - this.tableLayoutPanel7.Controls.Add(this.LinkUpdate, 0, 2); + this.tableLayoutPanel7.Controls.Add(this.lstServers, 0, 0); + this.tableLayoutPanel7.Controls.Add(this.llbUpdate, 0, 2); this.tableLayoutPanel7.Controls.Add(this.tableLayoutPanel4, 0, 1); this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 3); @@ -638,21 +651,21 @@ private void InitializeComponent() this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel7.Size = new System.Drawing.Size(250, 512); + this.tableLayoutPanel7.Size = new System.Drawing.Size(250, 511); this.tableLayoutPanel7.TabIndex = 16; // - // LinkUpdate + // llbUpdate // - this.LinkUpdate.Anchor = System.Windows.Forms.AnchorStyles.None; - this.LinkUpdate.AutoSize = true; - this.LinkUpdate.Location = new System.Drawing.Point(59, 432); - this.LinkUpdate.Margin = new System.Windows.Forms.Padding(5); - this.LinkUpdate.Name = "LinkUpdate"; - this.LinkUpdate.Size = new System.Drawing.Size(131, 12); - this.LinkUpdate.TabIndex = 5; - this.LinkUpdate.TabStop = true; - this.LinkUpdate.Text = "New version available"; - this.LinkUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkUpdate_LinkClicked); + this.llbUpdate.Anchor = System.Windows.Forms.AnchorStyles.None; + this.llbUpdate.AutoSize = true; + this.llbUpdate.Location = new System.Drawing.Point(59, 436); + this.llbUpdate.Margin = new System.Windows.Forms.Padding(5); + this.llbUpdate.Name = "llbUpdate"; + this.llbUpdate.Size = new System.Drawing.Size(131, 12); + this.llbUpdate.TabIndex = 5; + this.llbUpdate.TabStop = true; + this.llbUpdate.Text = "New version available"; + this.llbUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkUpdate_LinkClicked); // // tableLayoutPanel4 // @@ -661,57 +674,57 @@ private void InitializeComponent() 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.DownButton, 1, 1); - this.tableLayoutPanel4.Controls.Add(this.UpButton, 0, 1); - this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); - this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); + this.tableLayoutPanel4.Controls.Add(this.btnDown, 1, 1); + this.tableLayoutPanel4.Controls.Add(this.btnUp, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.btnDelete, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.btnAdd, 0, 0); this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Bottom; this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 297); - this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0, 5, 0, 0); + this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0, 5, 0, 5); this.tableLayoutPanel4.Name = "tableLayoutPanel4"; this.tableLayoutPanel4.RowCount = 2; this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.Size = new System.Drawing.Size(250, 68); + this.tableLayoutPanel4.Size = new System.Drawing.Size(250, 71); this.tableLayoutPanel4.TabIndex = 8; // - // DownButton - // - this.DownButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.DownButton.Location = new System.Drawing.Point(130, 34); - this.DownButton.Margin = new System.Windows.Forms.Padding(0); - this.DownButton.Name = "DownButton"; - this.DownButton.Size = new System.Drawing.Size(120, 34); - this.DownButton.TabIndex = 4; - this.DownButton.Text = "Down"; - this.DownButton.UseVisualStyleBackColor = true; - this.DownButton.Click += new System.EventHandler(this.DownButton_Click); - // - // UpButton - // - this.UpButton.Location = new System.Drawing.Point(0, 34); - this.UpButton.Margin = new System.Windows.Forms.Padding(0); - this.UpButton.Name = "UpButton"; - this.UpButton.Size = new System.Drawing.Size(120, 34); - this.UpButton.TabIndex = 3; - this.UpButton.Text = "Up"; - this.UpButton.UseVisualStyleBackColor = true; - this.UpButton.Click += new System.EventHandler(this.UpButton_Click); + // btnDown + // + this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDown.Location = new System.Drawing.Point(130, 37); + this.btnDown.Margin = new System.Windows.Forms.Padding(0, 3, 0, 0); + this.btnDown.Name = "btnDown"; + this.btnDown.Size = new System.Drawing.Size(120, 34); + this.btnDown.TabIndex = 4; + this.btnDown.Text = "Down"; + this.btnDown.UseVisualStyleBackColor = true; + this.btnDown.Click += new System.EventHandler(this.DownButton_Click); + // + // btnUp + // + this.btnUp.Location = new System.Drawing.Point(0, 37); + this.btnUp.Margin = new System.Windows.Forms.Padding(0, 3, 0, 0); + this.btnUp.Name = "btnUp"; + this.btnUp.Size = new System.Drawing.Size(120, 34); + this.btnUp.TabIndex = 3; + this.btnUp.Text = "Up"; + this.btnUp.UseVisualStyleBackColor = true; + this.btnUp.Click += new System.EventHandler(this.UpButton_Click); // // tableLayoutPanel5 // this.tableLayoutPanel5.AutoSize = true; this.tableLayoutPanel5.ColumnCount = 1; this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel5.Controls.Add(this.PictureQRcode, 0, 0); + this.tableLayoutPanel5.Controls.Add(this.picQRcode, 0, 0); this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(638, 3); + this.tableLayoutPanel5.Location = new System.Drawing.Point(632, 3); this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(12, 3, 3, 3); this.tableLayoutPanel5.Name = "tableLayoutPanel5"; this.tableLayoutPanel5.RowCount = 2; this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.Size = new System.Drawing.Size(268, 470); + this.tableLayoutPanel5.Size = new System.Drawing.Size(268, 469); this.tableLayoutPanel5.TabIndex = 17; // // tableLayoutPanel3 @@ -722,43 +735,43 @@ private void InitializeComponent() this.tableLayoutPanel3.ColumnCount = 2; this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); - this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); - this.tableLayoutPanel3.Location = new System.Drawing.Point(259, 479); - this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); + this.tableLayoutPanel3.Controls.Add(this.btnCancel, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.btnOK, 0, 0); + this.tableLayoutPanel3.Location = new System.Drawing.Point(268, 478); + this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(12, 3, 0, 3); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.RowCount = 1; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel3.Size = new System.Drawing.Size(367, 36); + this.tableLayoutPanel3.Size = new System.Drawing.Size(352, 36); this.tableLayoutPanel3.TabIndex = 14; // - // MyCancelButton - // - this.MyCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.MyCancelButton.AutoSize = true; - this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.MyCancelButton.Location = new System.Drawing.Point(212, 3); - this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); - this.MyCancelButton.Name = "MyCancelButton"; - this.MyCancelButton.Size = new System.Drawing.Size(155, 33); - this.MyCancelButton.TabIndex = 39; - this.MyCancelButton.Text = "Cancel"; - this.MyCancelButton.UseVisualStyleBackColor = true; - this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); - // - // OKButton - // - this.OKButton.AutoSize = true; - this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OKButton.Dock = System.Windows.Forms.DockStyle.Left; - this.OKButton.Location = new System.Drawing.Point(3, 3); - this.OKButton.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); - this.OKButton.Name = "OKButton"; - this.OKButton.Size = new System.Drawing.Size(155, 33); - this.OKButton.TabIndex = 38; - this.OKButton.Text = "OK"; - this.OKButton.UseVisualStyleBackColor = true; - this.OKButton.Click += new System.EventHandler(this.OKButton_Click); + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.AutoSize = true; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(197, 3); + this.btnCancel.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(155, 33); + this.btnCancel.TabIndex = 39; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.CancelButton_Click); + // + // btnOK + // + this.btnOK.AutoSize = true; + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Dock = System.Windows.Forms.DockStyle.Left; + this.btnOK.Location = new System.Drawing.Point(0, 3); + this.btnOK.Margin = new System.Windows.Forms.Padding(0, 3, 0, 0); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(155, 33); + this.btnOK.TabIndex = 38; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.OKButton_Click); // // ConfigForm // @@ -778,15 +791,15 @@ private void InitializeComponent() this.Text = "Edit Servers"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ConfigForm_FormClosed); this.Shown += new System.EventHandler(this.ConfigForm_Shown); - ((System.ComponentModel.ISupportInitialize)(this.PictureQRcode)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picQRcode)).EndInit(); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); this.ServerGroupBox.ResumeLayout(false); this.ServerGroupBox.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumServerPort)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumUDPPort)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudServerPort)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudUdpPort)).EndInit(); this.tableLayoutPanel7.ResumeLayout(false); this.tableLayoutPanel7.PerformLayout(); this.tableLayoutPanel4.ResumeLayout(false); @@ -801,54 +814,54 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button DeleteButton; - private System.Windows.Forms.Button AddButton; - private System.Windows.Forms.ListBox ServersListBox; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.ListBox lstServers; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.Button DownButton; - private System.Windows.Forms.Button UpButton; - private System.Windows.Forms.PictureBox PictureQRcode; - private System.Windows.Forms.LinkLabel LinkUpdate; + private System.Windows.Forms.Button btnDown; + private System.Windows.Forms.Button btnUp; + private System.Windows.Forms.PictureBox picQRcode; + private System.Windows.Forms.LinkLabel llbUpdate; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; private System.Windows.Forms.GroupBox ServerGroupBox; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.ComboBox ObfsCombo; - private System.Windows.Forms.Label labelObfs; - private System.Windows.Forms.Label ServerPortLabel; - private System.Windows.Forms.TextBox IPTextBox; - private System.Windows.Forms.NumericUpDown NumServerPort; - private System.Windows.Forms.TextBox PasswordTextBox; - private System.Windows.Forms.Label EncryptionLabel; - private System.Windows.Forms.ComboBox EncryptionSelect; - private System.Windows.Forms.TextBox TextLink; - private System.Windows.Forms.TextBox RemarksTextBox; - private System.Windows.Forms.Label ObfsUDPLabel; - private System.Windows.Forms.CheckBox CheckObfsUDP; - private System.Windows.Forms.Label TCPProtocolLabel; - private System.Windows.Forms.Label UDPoverTCPLabel; - private System.Windows.Forms.CheckBox CheckUDPoverUDP; + private System.Windows.Forms.ComboBox cmbObfs; + private System.Windows.Forms.Label lblObfs; + private System.Windows.Forms.Label lblServerPort; + private System.Windows.Forms.TextBox txtIP; + private System.Windows.Forms.NumericUpDown nudServerPort; + private System.Windows.Forms.TextBox txtPassword; + private System.Windows.Forms.Label lblEncryption; + private System.Windows.Forms.ComboBox cmbEncryption; + private System.Windows.Forms.TextBox txtLink; + private System.Windows.Forms.TextBox txtRemarks; + private System.Windows.Forms.Label lblObfsUdp; + private System.Windows.Forms.CheckBox chkObfsUDP; + private System.Windows.Forms.Label lblTCPProtocol; + private System.Windows.Forms.Label lblUdpOverTcp; + private System.Windows.Forms.CheckBox chkUdpOverTcp; private System.Windows.Forms.Label LabelNote; - private System.Windows.Forms.CheckBox PasswordLabel; - private System.Windows.Forms.Label TCPoverUDPLabel; - private System.Windows.Forms.CheckBox CheckTCPoverUDP; - private System.Windows.Forms.ComboBox TCPProtocolComboBox; - private System.Windows.Forms.Label labelObfsParam; - private System.Windows.Forms.TextBox TextObfsParam; - private System.Windows.Forms.Label labelGroup; - private System.Windows.Forms.TextBox TextGroup; - private System.Windows.Forms.CheckBox checkAdvSetting; - private System.Windows.Forms.Label labelUDPPort; - private System.Windows.Forms.NumericUpDown NumUDPPort; - private System.Windows.Forms.CheckBox checkSSRLink; - private System.Windows.Forms.Label labelRemarks; + private System.Windows.Forms.CheckBox chkPassword; + private System.Windows.Forms.Label lblTcpOverUdp; + private System.Windows.Forms.CheckBox chkTcpOverUdp; + private System.Windows.Forms.ComboBox cmbTcpProtocol; + private System.Windows.Forms.Label lblObfsParam; + private System.Windows.Forms.TextBox txtObfsParam; + private System.Windows.Forms.Label lblGroup; + private System.Windows.Forms.TextBox txtGroup; + private System.Windows.Forms.CheckBox chkAdvSetting; + private System.Windows.Forms.Label lblUDPPort; + private System.Windows.Forms.NumericUpDown nudUdpPort; + private System.Windows.Forms.CheckBox chkSSRLink; + private System.Windows.Forms.Label lblRemarks; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.Button MyCancelButton; - private System.Windows.Forms.Button OKButton; - private System.Windows.Forms.Label labelProtocolParam; - private System.Windows.Forms.TextBox TextProtocolParam; - private System.Windows.Forms.CheckBox IPLabel; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Label lblProtocolParam; + private System.Windows.Forms.TextBox txtProtocolParam; + private System.Windows.Forms.CheckBox chkIP; } } diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index 8f0f891c..d0d266df 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -33,24 +33,24 @@ public ConfigForm(ShadowsocksController controller, UpdateChecker updateChecker, { this.Font = System.Drawing.SystemFonts.MessageBoxFont; InitializeComponent(); - ServersListBox.Font = CreateFont(); + lstServers.Font = CreateFont(); - NumServerPort.Minimum = IPEndPoint.MinPort; - NumServerPort.Maximum = IPEndPoint.MaxPort; - NumUDPPort.Minimum = IPEndPoint.MinPort; - NumUDPPort.Maximum = IPEndPoint.MaxPort; + nudServerPort.Minimum = IPEndPoint.MinPort; + nudServerPort.Maximum = IPEndPoint.MaxPort; + nudUdpPort.Minimum = IPEndPoint.MinPort; + nudUdpPort.Maximum = IPEndPoint.MaxPort; this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon()); this.controller = controller; this.updateChecker = updateChecker; if (updateChecker.LatestVersionURL == null) - LinkUpdate.Visible = false; + llbUpdate.Visible = false; foreach (string name in EncryptorFactory.GetEncryptor()) { EncryptorInfo info = EncryptorFactory.GetEncryptorInfo(name); if (info.display) - EncryptionSelect.Items.Add(name); + cmbEncryption.Items.Add(name); } UpdateTexts(); controller.ConfigChanged += controller_ConfigChanged; @@ -68,43 +68,44 @@ public ConfigForm(ShadowsocksController controller, UpdateChecker updateChecker, } if (_modifiedConfiguration.isHideTips) - PictureQRcode.Visible = false; + picQRcode.Visible = false; int dpi_mul = Util.Utils.GetDpiMul(); - //ServersListBox.Height = ServersListBox.Height * 4 / dpi_mul; - ServersListBox.Width = ServersListBox.Width * dpi_mul / 4; - //ServersListBox.Height = ServersListBox.Height * dpi_mul / 4; - ServersListBox.Height = checkAdvSetting.Top + checkAdvSetting.Height; - AddButton.Width = AddButton.Width * dpi_mul / 4; - AddButton.Height = AddButton.Height * dpi_mul / 4; - DeleteButton.Width = DeleteButton.Width * dpi_mul / 4; - DeleteButton.Height = DeleteButton.Height * dpi_mul / 4; - UpButton.Width = UpButton.Width * dpi_mul / 4; - UpButton.Height = UpButton.Height * dpi_mul / 4; - DownButton.Width = DownButton.Width * dpi_mul / 4; - DownButton.Height = DownButton.Height * dpi_mul / 4; - - //IPTextBox.Width = IPTextBox.Width * dpi_mul / 4; - //ServerPortNumericUpDown.Width = ServerPortNumericUpDown.Width * dpi_mul / 4; - //PasswordTextBox.Width = PasswordTextBox.Width * dpi_mul / 4; - //EncryptionSelect.Width = EncryptionSelect.Width * dpi_mul / 4; - //TCPProtocolComboBox.Width = TCPProtocolComboBox.Width * dpi_mul / 4; - //ObfsCombo.Width = ObfsCombo.Width * dpi_mul / 4; - //TextObfsParam.Width = TextObfsParam.Width * dpi_mul / 4; - //RemarksTextBox.Width = RemarksTextBox.Width * dpi_mul / 4; - //TextGroup.Width = TextGroup.Width * dpi_mul / 4; - //TextLink.Width = TextLink.Width * dpi_mul / 4; - //TextUDPPort.Width = TextUDPPort.Width * dpi_mul / 4; - - //int font_height = 9; - //EncryptionSelect.Height = EncryptionSelect.Height - font_height + font_height * dpi_mul / 4; - //TCPProtocolComboBox.Height = TCPProtocolComboBox.Height - font_height + font_height * dpi_mul / 4; - //ObfsCombo.Height = ObfsCombo.Height - font_height + font_height * dpi_mul / 4; - - //OKButton.Width = OKButton.Width * dpi_mul / 4; - OKButton.Height = OKButton.Height * dpi_mul / 4; - //MyCancelButton.Width = MyCancelButton.Width * dpi_mul / 4; - MyCancelButton.Height = MyCancelButton.Height * dpi_mul / 4; + //comment + ////ServersListBox.Height = ServersListBox.Height * 4 / dpi_mul; + //lstServers.Width = lstServers.Width * dpi_mul / 4; + ////ServersListBox.Height = ServersListBox.Height * dpi_mul / 4; + //lstServers.Height = chkAdvSetting.Top + chkAdvSetting.Height; + //btnAdd.Width = btnAdd.Width * dpi_mul / 4; + //btnAdd.Height = btnAdd.Height * dpi_mul / 4; + //btnDelete.Width = btnDelete.Width * dpi_mul / 4; + //btnDelete.Height = btnDelete.Height * dpi_mul / 4; + //btnUp.Width = btnUp.Width * dpi_mul / 4; + //btnUp.Height = btnUp.Height * dpi_mul / 4; + //btnDown.Width = btnDown.Width * dpi_mul / 4; + //btnDown.Height = btnDown.Height * dpi_mul / 4; + + ////IPTextBox.Width = IPTextBox.Width * dpi_mul / 4; + ////ServerPortNumericUpDown.Width = ServerPortNumericUpDown.Width * dpi_mul / 4; + ////PasswordTextBox.Width = PasswordTextBox.Width * dpi_mul / 4; + ////EncryptionSelect.Width = EncryptionSelect.Width * dpi_mul / 4; + ////TCPProtocolComboBox.Width = TCPProtocolComboBox.Width * dpi_mul / 4; + ////ObfsCombo.Width = ObfsCombo.Width * dpi_mul / 4; + ////TextObfsParam.Width = TextObfsParam.Width * dpi_mul / 4; + ////RemarksTextBox.Width = RemarksTextBox.Width * dpi_mul / 4; + ////TextGroup.Width = TextGroup.Width * dpi_mul / 4; + ////TextLink.Width = TextLink.Width * dpi_mul / 4; + ////TextUDPPort.Width = TextUDPPort.Width * dpi_mul / 4; + + ////int font_height = 9; + ////EncryptionSelect.Height = EncryptionSelect.Height - font_height + font_height * dpi_mul / 4; + ////TCPProtocolComboBox.Height = TCPProtocolComboBox.Height - font_height + font_height * dpi_mul / 4; + ////ObfsCombo.Height = ObfsCombo.Height - font_height + font_height * dpi_mul / 4; + + ////OKButton.Width = OKButton.Width * dpi_mul / 4; + //btnOK.Height = btnOK.Height * dpi_mul / 4; + ////MyCancelButton.Width = MyCancelButton.Width * dpi_mul / 4; + //btnCancel.Height = btnCancel.Height * dpi_mul / 4; DrawLogo(350 * dpi_mul / 4); //DrawLogo(350); @@ -142,47 +143,48 @@ private Font CreateFont() private void UpdateTexts() { this.Text = I18N.GetString("Edit Servers") + "(" - + (controller.GetCurrentConfiguration().shareOverLan ? "any" : I18N.GetString("local")) + ": " + controller.GetCurrentConfiguration().localPort.ToString() - +" " +I18N.GetString("Version")+": " + UpdateChecker.FullVersion + + (controller.GetCurrentConfiguration().shareOverLan ? I18N.GetString("Any") : I18N.GetString("Local")) + ":" + controller.GetCurrentConfiguration().localPort.ToString() + +" " +I18N.GetString("Version")+":" + UpdateChecker.FullVersion + ")"; - AddButton.Text = I18N.GetString("&Add"); - DeleteButton.Text = I18N.GetString("&Delete"); - UpButton.Text = I18N.GetString("Up"); - DownButton.Text = I18N.GetString("Down"); - - const string mark_str = "* "; - IPLabel.Text = mark_str + I18N.GetString("Server IP"); - ServerPortLabel.Text = mark_str + I18N.GetString("Server Port"); - labelUDPPort.Text = I18N.GetString("UDP Port"); - PasswordLabel.Text = mark_str + I18N.GetString("Password"); - EncryptionLabel.Text = mark_str + I18N.GetString("Encryption"); - TCPProtocolLabel.Text = mark_str + I18N.GetString(TCPProtocolLabel.Text); - labelObfs.Text = mark_str + I18N.GetString(labelObfs.Text); - labelRemarks.Text = I18N.GetString("Remarks"); - - checkAdvSetting.Text = I18N.GetString(checkAdvSetting.Text); - TCPoverUDPLabel.Text = I18N.GetString(TCPoverUDPLabel.Text); - UDPoverTCPLabel.Text = I18N.GetString(UDPoverTCPLabel.Text); - labelProtocolParam.Text = I18N.GetString(labelProtocolParam.Text); - labelObfsParam.Text = I18N.GetString(labelObfsParam.Text); - ObfsUDPLabel.Text = I18N.GetString(ObfsUDPLabel.Text); + btnAdd.Text = I18N.GetString("&Add"); + btnDelete.Text = I18N.GetString("&Delete"); + btnUp.Text = I18N.GetString("Up"); + btnDown.Text = I18N.GetString("Down"); + + const string mark_str = "*"; + chkIP.Text = mark_str + I18N.GetString("Server IP"); + lblServerPort.Text = mark_str + I18N.GetString("Server Port"); + lblUDPPort.Text = I18N.GetString("UDP Port"); + chkPassword.Text = mark_str + I18N.GetString("Password"); + lblEncryption.Text = mark_str + I18N.GetString("Encryption"); + lblTCPProtocol.Text = mark_str + I18N.GetString(lblTCPProtocol.Text); + lblObfs.Text = mark_str + I18N.GetString(lblObfs.Text); + lblRemarks.Text = I18N.GetString("Remarks"); + lblGroup.Text = I18N.GetString("Group"); + + chkAdvSetting.Text = I18N.GetString(chkAdvSetting.Text); + lblTcpOverUdp.Text = I18N.GetString(lblTcpOverUdp.Text); + lblUdpOverTcp.Text = I18N.GetString(lblUdpOverTcp.Text); + lblProtocolParam.Text = I18N.GetString(lblProtocolParam.Text); + lblObfsParam.Text = I18N.GetString(lblObfsParam.Text); + lblObfsUdp.Text = I18N.GetString(lblObfsUdp.Text); LabelNote.Text = I18N.GetString(LabelNote.Text); - CheckTCPoverUDP.Text = I18N.GetString(CheckTCPoverUDP.Text); - CheckUDPoverUDP.Text = I18N.GetString(CheckUDPoverUDP.Text); - CheckObfsUDP.Text = I18N.GetString(CheckObfsUDP.Text); - checkSSRLink.Text = I18N.GetString(checkSSRLink.Text); - for (int i = 0; i < TCPProtocolComboBox.Items.Count; ++i) + chkTcpOverUdp.Text = I18N.GetString(chkTcpOverUdp.Text); + chkUdpOverTcp.Text = I18N.GetString(chkUdpOverTcp.Text); + chkObfsUDP.Text = I18N.GetString(chkObfsUDP.Text); + chkSSRLink.Text = I18N.GetString(chkSSRLink.Text); + for (int i = 0; i < cmbTcpProtocol.Items.Count; ++i) { - TCPProtocolComboBox.Items[i] = I18N.GetString(TCPProtocolComboBox.Items[i].ToString()); + cmbTcpProtocol.Items[i] = I18N.GetString(cmbTcpProtocol.Items[i].ToString()); } ServerGroupBox.Text = I18N.GetString("Server"); - OKButton.Text = I18N.GetString("OK"); - MyCancelButton.Text = I18N.GetString("Cancel"); - LinkUpdate.MaximumSize = new Size(ServersListBox.Width, ServersListBox.Height); - LinkUpdate.Text = String.Format(I18N.GetString("New version {0} {1} available"), UpdateChecker.Name, updateChecker.LatestVersionNumber); + btnOK.Text = I18N.GetString("OK"); + btnCancel.Text = I18N.GetString("Cancel"); + llbUpdate.MaximumSize = new Size(lstServers.Width, lstServers.Height); + llbUpdate.Text = String.Format(I18N.GetString("New version {0} {1} available"), UpdateChecker.Name, updateChecker.LatestVersionNumber); } private void controller_ConfigChanged(object sender, EventArgs e) @@ -194,7 +196,7 @@ private void ShowWindow() { this.Opacity = 1; this.Show(); - IPTextBox.Focus(); + txtIP.Focus(); } private int SaveOldSelectedServer() @@ -207,18 +209,18 @@ private int SaveOldSelectedServer() } Server server = new Server { - server = IPTextBox.Text.Trim(), - server_port = Convert.ToUInt16(NumServerPort.Value), - server_udp_port = Convert.ToUInt16(NumUDPPort.Value), - password = PasswordTextBox.Text, - method = EncryptionSelect.Text, - protocol = TCPProtocolComboBox.Text, - protocolparam = TextProtocolParam.Text, - obfs = ObfsCombo.Text, - obfsparam = TextObfsParam.Text, - remarks = RemarksTextBox.Text, - group = TextGroup.Text.Trim(), - udp_over_tcp = CheckUDPoverUDP.Checked, + server = txtIP.Text.Trim(), + server_port = Convert.ToUInt16(nudServerPort.Value), + server_udp_port = Convert.ToUInt16(nudUdpPort.Value), + password = txtPassword.Text, + method = cmbEncryption.Text, + protocol = cmbTcpProtocol.Text, + protocolparam = txtProtocolParam.Text, + obfs = cmbObfs.Text, + obfsparam = txtObfsParam.Text, + remarks = txtRemarks.Text, + group = txtGroup.Text.Trim(), + udp_over_tcp = chkUdpOverTcp.Checked, //obfs_udp = CheckObfsUDP.Checked, id = _SelectedID }; @@ -263,16 +265,16 @@ private void DrawLogo(int width) Bitmap ngnl = Resources.ngnl; g.DrawImage(ngnl, new Rectangle(0, 0, width, width)); if (!_modifiedConfiguration.isHideTips) - g.DrawString("Click the 'Link' text box", new Font("Arial", 14), new SolidBrush(Color.Black), new RectangleF(0, 0, 300, 300)); + g.DrawString(I18N.GetString("Click the 'Link' text box"), new Font("宋体", 12), new SolidBrush(Color.Black), new RectangleF(0, 0, 300, 300)); } - PictureQRcode.Image = drawArea; + picQRcode.Image = drawArea; } private void GenQR(string ssconfig) { int dpi_mul = Util.Utils.GetDpiMul(); int width = 350 * dpi_mul / 4; - if (TextLink.Focused) + if (txtLink.Focused) { string qrText = ssconfig; QRCode code = ZXing.QrCode.Internal.Encoder.encode(qrText, ErrorCorrectionLevel.M); @@ -301,76 +303,76 @@ private void GenQR(string ssconfig) int l = (m.Width * div_l + div - 1) / div * blockSize, r = (m.Width * div_r + div - 1) / div * blockSize; g.DrawImage(ngnl, new Rectangle(l + blockSize, l + blockSize, r - l, r - l)); } - PictureQRcode.Image = drawArea; - PictureQRcode.Visible = true; + picQRcode.Image = drawArea; + picQRcode.Visible = true; _modifiedConfiguration.isHideTips = true; } else { //PictureQRcode.Visible = false; - DrawLogo(PictureQRcode.Width); + DrawLogo(picQRcode.Width); } } private void LoadSelectedServer() { - if (ServersListBox.SelectedIndex >= 0 && ServersListBox.SelectedIndex < _modifiedConfiguration.configs.Count) + if (lstServers.SelectedIndex >= 0 && lstServers.SelectedIndex < _modifiedConfiguration.configs.Count) { - Server server = _modifiedConfiguration.configs[ServersListBox.SelectedIndex]; + Server server = _modifiedConfiguration.configs[lstServers.SelectedIndex]; - IPTextBox.Text = server.server; - NumServerPort.Value = server.server_port; - NumUDPPort.Value = server.server_udp_port; - PasswordTextBox.Text = server.password; - EncryptionSelect.Text = server.method ?? "aes-256-cfb"; + txtIP.Text = server.server; + nudServerPort.Value = server.server_port; + nudUdpPort.Value = server.server_udp_port; + txtPassword.Text = server.password; + cmbEncryption.Text = server.method ?? "aes-256-cfb"; if (string.IsNullOrEmpty(server.protocol)) { - TCPProtocolComboBox.Text = "origin"; + cmbTcpProtocol.Text = "origin"; } else { - TCPProtocolComboBox.Text = server.protocol ?? "origin"; + cmbTcpProtocol.Text = server.protocol ?? "origin"; } string obfs_text = server.obfs ?? "plain"; - ObfsCombo.Text = obfs_text; - TextProtocolParam.Text = server.protocolparam; - TextObfsParam.Text = server.obfsparam; - RemarksTextBox.Text = server.remarks; - TextGroup.Text = server.group; - CheckUDPoverUDP.Checked = server.udp_over_tcp; + cmbObfs.Text = obfs_text; + txtProtocolParam.Text = server.protocolparam; + txtObfsParam.Text = server.obfsparam; + txtRemarks.Text = server.remarks; + txtGroup.Text = server.group; + chkUdpOverTcp.Checked = server.udp_over_tcp; //CheckObfsUDP.Checked = server.obfs_udp; _SelectedID = server.id; ServerGroupBox.Visible = true; - if (TCPProtocolComboBox.Text == "origin" + if (cmbTcpProtocol.Text == "origin" && obfs_text == "plain" - && !CheckUDPoverUDP.Checked + && !chkUdpOverTcp.Checked ) { - checkAdvSetting.Checked = false; + chkAdvSetting.Checked = false; } - if (checkSSRLink.Checked) + if (chkSSRLink.Checked) { - TextLink.Text = server.GetSSRLinkForServer(); + txtLink.Text = server.GetSSRLinkForServer(); } else { - TextLink.Text = server.GetSSLinkForServer(); + txtLink.Text = server.GetSSLinkForServer(); } - if (CheckTCPoverUDP.Checked || CheckUDPoverUDP.Checked || server.server_udp_port != 0) + if (chkTcpOverUdp.Checked || chkUdpOverTcp.Checked || server.server_udp_port != 0) { - checkAdvSetting.Checked = true; + chkAdvSetting.Checked = true; } //PasswordLabel.Checked = false; //IPLabel.Checked = false; Update_SSR_controls_Visable(); UpdateObfsTextbox(); - TextLink.SelectAll(); - GenQR(TextLink.Text); + txtLink.SelectAll(); + GenQR(txtLink.Text); } else { @@ -380,18 +382,18 @@ private void LoadSelectedServer() private void LoadConfiguration(Configuration configuration) { - if (ServersListBox.Items.Count != _modifiedConfiguration.configs.Count) + if (lstServers.Items.Count != _modifiedConfiguration.configs.Count) { - ServersListBox.Items.Clear(); + lstServers.Items.Clear(); foreach (Server server in _modifiedConfiguration.configs) { if (!string.IsNullOrEmpty(server.group)) { - ServersListBox.Items.Add(server.group + " - " + server.HiddenName()); + lstServers.Items.Add(server.group + " - " + server.HiddenName()); } else { - ServersListBox.Items.Add(" " + server.HiddenName()); + lstServers.Items.Add(" " + server.HiddenName()); } } } @@ -401,11 +403,11 @@ private void LoadConfiguration(Configuration configuration) { if (!string.IsNullOrEmpty(_modifiedConfiguration.configs[i].group)) { - ServersListBox.Items[i] = _modifiedConfiguration.configs[i].group + " - " + _modifiedConfiguration.configs[i].HiddenName(); + lstServers.Items[i] = _modifiedConfiguration.configs[i].group + " - " + _modifiedConfiguration.configs[i].HiddenName(); } else { - ServersListBox.Items[i] = " " + _modifiedConfiguration.configs[i].HiddenName(); + lstServers.Items[i] = " " + _modifiedConfiguration.configs[i].HiddenName(); } } } @@ -413,11 +415,11 @@ private void LoadConfiguration(Configuration configuration) public void SetServerListSelectedIndex(int index) { - ServersListBox.ClearSelected(); - if (index < ServersListBox.Items.Count) - ServersListBox.SelectedIndex = index; + lstServers.ClearSelected(); + if (index < lstServers.Items.Count) + lstServers.SelectedIndex = index; else - _oldSelectedIndex = ServersListBox.SelectedIndex; + _oldSelectedIndex = lstServers.SelectedIndex; } private void LoadCurrentConfiguration() @@ -432,7 +434,7 @@ private void LoadCurrentConfiguration() private void ServersListBox_SelectedIndexChanged(object sender, EventArgs e) { - if (_oldSelectedIndex == ServersListBox.SelectedIndex || ServersListBox.SelectedIndex == -1) + if (_oldSelectedIndex == lstServers.SelectedIndex || lstServers.SelectedIndex == -1) { // we are moving back to oldSelectedIndex or doing a force move return; @@ -442,7 +444,7 @@ private void ServersListBox_SelectedIndexChanged(object sender, EventArgs e) int change = SaveOldSelectedServer(); if (change == -1) { - ServersListBox.SelectedIndex = _oldSelectedIndex; // go back + lstServers.SelectedIndex = _oldSelectedIndex; // go back return; } if (change == 1) @@ -451,27 +453,27 @@ private void ServersListBox_SelectedIndexChanged(object sender, EventArgs e) } } if (!_ignoreLoad) LoadSelectedServer(); - _oldSelectedIndex = ServersListBox.SelectedIndex; + _oldSelectedIndex = lstServers.SelectedIndex; } private void UpdateServersListBoxTopIndex(int style = 0) { - int visibleItems = ServersListBox.ClientSize.Height / ServersListBox.ItemHeight; + int visibleItems = lstServers.ClientSize.Height / lstServers.ItemHeight; int index; if (style == 0) { - index = ServersListBox.SelectedIndex; + index = lstServers.SelectedIndex; } else { - var items = ServersListBox.SelectedIndices; + var items = lstServers.SelectedIndices; if (0 == items.Count) index = 0; else index = (style == 1 ? items[0] : items[items.Count - 1]); } int topIndex = Math.Max(index - visibleItems / 2, 0); - ServersListBox.TopIndex = topIndex; + lstServers.TopIndex = topIndex; } private void AddButton_Click(object sender, EventArgs e) @@ -486,14 +488,14 @@ private void AddButton_Click(object sender, EventArgs e) _modifiedConfiguration.configs.Insert(_oldSelectedIndex < 0 ? 0 : _oldSelectedIndex + 1, server); LoadConfiguration(_modifiedConfiguration); _SelectedID = server.id; - ServersListBox.SelectedIndex = _oldSelectedIndex + 1; - _oldSelectedIndex = ServersListBox.SelectedIndex; + lstServers.SelectedIndex = _oldSelectedIndex + 1; + _oldSelectedIndex = lstServers.SelectedIndex; } private void DeleteButton_Click(object sender, EventArgs e) { - _oldSelectedIndex = ServersListBox.SelectedIndex; - var items = ServersListBox.SelectedIndices; + _oldSelectedIndex = lstServers.SelectedIndex; + var items = lstServers.SelectedIndices; if (items.Count > 0) { int[] array = new int[items.Count]; @@ -521,7 +523,7 @@ private void DeleteButton_Click(object sender, EventArgs e) _oldSelectedIndex = 0; } if (_oldSelectedIndex < _modifiedConfiguration.configs.Count) - ServersListBox.SelectedIndex = _oldSelectedIndex; + lstServers.SelectedIndex = _oldSelectedIndex; LoadConfiguration(_modifiedConfiguration); SetServerListSelectedIndex(_oldSelectedIndex); LoadSelectedServer(); @@ -561,7 +563,7 @@ private void CancelButton_Click(object sender, EventArgs e) private void ConfigForm_Shown(object sender, EventArgs e) { - IPTextBox.Focus(); + txtIP.Focus(); } private void ConfigForm_FormClosed(object sender, FormClosedEventArgs e) @@ -571,20 +573,20 @@ private void ConfigForm_FormClosed(object sender, FormClosedEventArgs e) private void UpButton_Click(object sender, EventArgs e) { - _oldSelectedIndex = ServersListBox.SelectedIndex; + _oldSelectedIndex = lstServers.SelectedIndex; int index = _oldSelectedIndex; SaveOldSelectedServer(); - var items = ServersListBox.SelectedIndices; + var items = lstServers.SelectedIndices; if (items.Count == 1) { if (index > 0 && index < _modifiedConfiguration.configs.Count) { _modifiedConfiguration.configs.Reverse(index - 1, 2); - ServersListBox.ClearSelected(); - ServersListBox.SelectedIndex = _oldSelectedIndex = index - 1; + lstServers.ClearSelected(); + lstServers.SelectedIndex = _oldSelectedIndex = index - 1; LoadConfiguration(_modifiedConfiguration); - ServersListBox.ClearSelected(); - ServersListBox.SelectedIndex = _oldSelectedIndex = index - 1; + lstServers.ClearSelected(); + lstServers.SelectedIndex = _oldSelectedIndex = index - 1; LoadSelectedServer(); } } @@ -592,7 +594,7 @@ private void UpButton_Click(object sender, EventArgs e) { // Handle when server list is empty. _oldSelectedIndex = -1; - ServersListBox.ClearSelected(); + lstServers.ClearSelected(); LoadSelectedServer(); } else @@ -611,17 +613,17 @@ private void UpButton_Click(object sender, EventArgs e) _allowSave = false; _ignoreLoad = true; - ServersListBox.SelectedIndex = _oldSelectedIndex = index - 1; + lstServers.SelectedIndex = _oldSelectedIndex = index - 1; LoadConfiguration(_modifiedConfiguration); - ServersListBox.ClearSelected(); + lstServers.ClearSelected(); foreach (int item in all_items) { if (item != index) - ServersListBox.SelectedIndex = _oldSelectedIndex = item - 1; + lstServers.SelectedIndex = _oldSelectedIndex = item - 1; } - ServersListBox.SelectedIndex = _oldSelectedIndex = index - 1; + lstServers.SelectedIndex = _oldSelectedIndex = index - 1; _ignoreLoad = false; _allowSave = true; @@ -632,20 +634,20 @@ private void UpButton_Click(object sender, EventArgs e) private void DownButton_Click(object sender, EventArgs e) { - _oldSelectedIndex = ServersListBox.SelectedIndex; + _oldSelectedIndex = lstServers.SelectedIndex; int index = _oldSelectedIndex; SaveOldSelectedServer(); - var items = ServersListBox.SelectedIndices; + var items = lstServers.SelectedIndices; if (items.Count == 1) { if (_oldSelectedIndex >= 0 && _oldSelectedIndex < _modifiedConfiguration.configs.Count - 1) { _modifiedConfiguration.configs.Reverse(index, 2); - ServersListBox.ClearSelected(); - ServersListBox.SelectedIndex = _oldSelectedIndex = index + 1; + lstServers.ClearSelected(); + lstServers.SelectedIndex = _oldSelectedIndex = index + 1; LoadConfiguration(_modifiedConfiguration); - ServersListBox.ClearSelected(); - ServersListBox.SelectedIndex = _oldSelectedIndex = index + 1; + lstServers.ClearSelected(); + lstServers.SelectedIndex = _oldSelectedIndex = index + 1; LoadSelectedServer(); } } @@ -653,13 +655,13 @@ private void DownButton_Click(object sender, EventArgs e) { // Handle when server list is empty. _oldSelectedIndex = -1; - ServersListBox.ClearSelected(); + lstServers.ClearSelected(); LoadSelectedServer(); } else { List rev_items = new List(); - int max_index = ServersListBox.Items.Count - 1; + int max_index = lstServers.Items.Count - 1; foreach (int item in items) { if (item == max_index) @@ -673,17 +675,17 @@ private void DownButton_Click(object sender, EventArgs e) _allowSave = false; _ignoreLoad = true; - ServersListBox.SelectedIndex = _oldSelectedIndex = index + 1; + lstServers.SelectedIndex = _oldSelectedIndex = index + 1; LoadConfiguration(_modifiedConfiguration); - ServersListBox.ClearSelected(); + lstServers.ClearSelected(); foreach (int item in rev_items) { if (item != index) - ServersListBox.SelectedIndex = _oldSelectedIndex = item + 1; + lstServers.SelectedIndex = _oldSelectedIndex = item + 1; } - ServersListBox.SelectedIndex = _oldSelectedIndex = index + 1; + lstServers.SelectedIndex = _oldSelectedIndex = index + 1; _ignoreLoad = false; _allowSave = true; @@ -718,13 +720,13 @@ private void LinkUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs private void PasswordLabel_CheckedChanged(object sender, EventArgs e) { - if (PasswordLabel.Checked) + if (chkPassword.Checked) { - PasswordTextBox.UseSystemPasswordChar = false; + txtPassword.UseSystemPasswordChar = false; } else { - PasswordTextBox.UseSystemPasswordChar = true; + txtPassword.UseSystemPasswordChar = true; } } @@ -732,20 +734,20 @@ private void UpdateObfsTextbox() { try { - Obfs.ObfsBase obfs = (Obfs.ObfsBase)Obfs.ObfsFactory.GetObfs(ObfsCombo.Text); - int[] properties = obfs.GetObfs()[ObfsCombo.Text]; + Obfs.ObfsBase obfs = (Obfs.ObfsBase)Obfs.ObfsFactory.GetObfs(cmbObfs.Text); + int[] properties = obfs.GetObfs()[cmbObfs.Text]; if (properties[2] > 0) { - TextObfsParam.Enabled = true; + txtObfsParam.Enabled = true; } else { - TextObfsParam.Enabled = false; + txtObfsParam.Enabled = false; } } catch { - TextObfsParam.Enabled = true; + txtObfsParam.Enabled = true; } } @@ -772,42 +774,42 @@ private void checkAdvSetting_CheckedChanged(object sender, EventArgs e) private void Update_SSR_controls_Visable() { SuspendLayout(); - if (checkAdvSetting.Checked) + if (chkAdvSetting.Checked) { - labelUDPPort.Visible = true; - NumUDPPort.Visible = true; + lblUDPPort.Visible = true; + nudUdpPort.Visible = true; //TCPoverUDPLabel.Visible = true; //CheckTCPoverUDP.Visible = true; } else { - labelUDPPort.Visible = false; - NumUDPPort.Visible = false; + lblUDPPort.Visible = false; + nudUdpPort.Visible = false; //TCPoverUDPLabel.Visible = false; //CheckTCPoverUDP.Visible = false; } - if (checkAdvSetting.Checked) + if (chkAdvSetting.Checked) { - UDPoverTCPLabel.Visible = true; - CheckUDPoverUDP.Visible = true; + lblUdpOverTcp.Visible = true; + chkUdpOverTcp.Visible = true; } else { - UDPoverTCPLabel.Visible = false; - CheckUDPoverUDP.Visible = false; + lblUdpOverTcp.Visible = false; + chkUdpOverTcp.Visible = false; } ResumeLayout(); } private void IPLabel_CheckedChanged(object sender, EventArgs e) { - if (IPLabel.Checked) + if (chkIP.Checked) { - IPTextBox.UseSystemPasswordChar = false; + txtIP.UseSystemPasswordChar = false; } else { - IPTextBox.UseSystemPasswordChar = true; + txtIP.UseSystemPasswordChar = true; } } } diff --git a/shadowsocks-csharp/View/ConfigForm.resx b/shadowsocks-csharp/View/ConfigForm.resx index ff31a6db..c7e0d4bd 100755 --- a/shadowsocks-csharp/View/ConfigForm.resx +++ b/shadowsocks-csharp/View/ConfigForm.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/shadowsocks-csharp/View/MenuViewController.cs b/shadowsocks-csharp/View/MenuViewController.cs index 22bbaa91..e4bfcf2f 100755 --- a/shadowsocks-csharp/View/MenuViewController.cs +++ b/shadowsocks-csharp/View/MenuViewController.cs @@ -150,64 +150,65 @@ private void UpdateTrayIcon() bool global = config.sysProxyMode == (int)ProxyMode.Global; bool random = config.random; - //try - //{ - // Bitmap icon = new Bitmap("icon.png"); - // Icon newIcon = Icon.FromHandle(icon.GetHicon()); - // _notifyIcon.Icon = newIcon; - // DestroyIcon(newIcon.Handle); - //} - //catch - //{ - Bitmap icon = null; - if (dpi < 97) - { - // dpi = 96; - icon = Resources.ss16; - } - else if (dpi < 121) - { - // dpi = 120; - icon = Resources.ss20; - } - else - { - icon = Resources.ss24; - } - double mul_a = 1.0, mul_r = 1.0, mul_g = 1.0, mul_b = 1.0; - if (!enabled) - { - mul_g = 0.4; - } - else if (!global) + try { - mul_b = 0.4; - mul_g = 0.8; + Bitmap icon = new Bitmap("icon.png"); + Icon newIcon = Icon.FromHandle(icon.GetHicon()); + icon.Dispose(); + _notifyIcon.Icon = newIcon; } - if (!random) + catch { - mul_r = 0.4; - } + Bitmap icon = null; + if (dpi < 97) + { + // dpi = 96; + icon = Resources.ss16; + } + else if (dpi < 121) + { + // dpi = 120; + icon = Resources.ss20; + } + else + { + icon = Resources.ss24; + } + double mul_a = 1.0, mul_r = 1.0, mul_g = 1.0, mul_b = 1.0; + if (!enabled) + { + mul_g = 0.4; + } + else if (!global) + { + mul_b = 0.4; + mul_g = 0.8; + } + if (!random) + { + mul_r = 0.4; + } - Bitmap iconCopy = new Bitmap(icon); - { + Bitmap iconCopy = new Bitmap(icon); for (int x = 0; x < iconCopy.Width; x++) { for (int y = 0; y < iconCopy.Height; y++) { Color color = icon.GetPixel(x, y); iconCopy.SetPixel(x, y, + Color.FromArgb((byte)(color.A * mul_a), - (byte)(color.R * mul_r), - (byte)(color.G * mul_g), - (byte)(color.B * mul_b))); + ((byte)(color.R * mul_r)), + ((byte)(color.G * mul_g)), + ((byte)(color.B * mul_b)))); } } Icon newIcon = Icon.FromHandle(iconCopy.GetHicon()); + icon.Dispose(); + iconCopy.Dispose(); + _notifyIcon.Icon = newIcon; - DestroyIcon(newIcon.Handle); } - //} // we want to show more details but notify icon title is limited to 63 characters string text = (enabled ? @@ -311,14 +312,12 @@ private void controller_ToggleModeChanged(object sender, EventArgs e) { Configuration config = controller.GetCurrentConfiguration(); UpdateSysProxyMode(config); - UpdateTrayIcon(); } private void controller_ToggleRuleModeChanged(object sender, EventArgs e) { Configuration config = controller.GetCurrentConfiguration(); UpdateProxyRule(config); - UpdateTrayIcon(); } void controller_FileReadyToOpen(object sender, ShadowsocksController.PathEventArgs e) diff --git a/shadowsocks-csharp/View/SettingsForm.Designer.cs b/shadowsocks-csharp/View/SettingsForm.Designer.cs index d62807a4..ffa55dec 100644 --- a/shadowsocks-csharp/View/SettingsForm.Designer.cs +++ b/shadowsocks-csharp/View/SettingsForm.Designer.cs @@ -30,71 +30,69 @@ private void InitializeComponent() { this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.LabelRandom = new System.Windows.Forms.Label(); - this.RandomComboBox = new System.Windows.Forms.ComboBox(); - this.CheckAutoBan = new System.Windows.Forms.CheckBox(); - this.checkRandom = new System.Windows.Forms.CheckBox(); - this.checkAutoStartup = new System.Windows.Forms.CheckBox(); - this.checkBalanceInGroup = new System.Windows.Forms.CheckBox(); - this.checkSwitchAutoCloseAll = new System.Windows.Forms.CheckBox(); - this.Socks5ProxyGroup = new System.Windows.Forms.GroupBox(); + this.chkLogEnable = new System.Windows.Forms.CheckBox(); + this.lblLogging = new System.Windows.Forms.Label(); + this.lblBalance = new System.Windows.Forms.Label(); + this.cmbBalance = new System.Windows.Forms.ComboBox(); + this.chkAutoBan = new System.Windows.Forms.CheckBox(); + this.chkBalance = new System.Windows.Forms.CheckBox(); + this.chkAutoStartup = new System.Windows.Forms.CheckBox(); + this.chkBalanceInGroup = new System.Windows.Forms.CheckBox(); + this.chkSwitchAutoCloseAll = new System.Windows.Forms.CheckBox(); + this.gbxSocks5Proxy = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); - this.LabelS5Password = new System.Windows.Forms.Label(); - this.LabelS5Username = new System.Windows.Forms.Label(); - this.TextS5Pass = new System.Windows.Forms.TextBox(); - this.LabelS5Port = new System.Windows.Forms.Label(); - this.TextS5User = new System.Windows.Forms.TextBox(); - this.LabelS5Server = new System.Windows.Forms.Label(); - this.NumS5Port = new System.Windows.Forms.NumericUpDown(); - this.TextS5Server = new System.Windows.Forms.TextBox(); - this.comboProxyType = new System.Windows.Forms.ComboBox(); - this.CheckSockProxy = new System.Windows.Forms.CheckBox(); - this.checkBoxPacProxy = new System.Windows.Forms.CheckBox(); - this.label1 = new System.Windows.Forms.Label(); - this.TextUserAgent = new System.Windows.Forms.TextBox(); - this.ListenGroup = new System.Windows.Forms.GroupBox(); + this.lblS5Password = new System.Windows.Forms.Label(); + this.lblS5Username = new System.Windows.Forms.Label(); + this.txtS5Pass = new System.Windows.Forms.TextBox(); + this.lblS5Port = new System.Windows.Forms.Label(); + this.txtS5User = new System.Windows.Forms.TextBox(); + this.lblS5Server = new System.Windows.Forms.Label(); + this.nudS5Port = new System.Windows.Forms.NumericUpDown(); + this.txtS5Server = new System.Windows.Forms.TextBox(); + this.cmbProxyType = new System.Windows.Forms.ComboBox(); + this.chkSockProxy = new System.Windows.Forms.CheckBox(); + this.chkPacProxy = new System.Windows.Forms.CheckBox(); + this.lblUserAgent = new System.Windows.Forms.Label(); + this.txtUserAgent = new System.Windows.Forms.TextBox(); + this.gbxListen = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.TextAuthPass = new System.Windows.Forms.TextBox(); - this.LabelAuthPass = new System.Windows.Forms.Label(); - this.TextAuthUser = new System.Windows.Forms.TextBox(); - this.LabelAuthUser = new System.Windows.Forms.Label(); + this.txtAuthPass = new System.Windows.Forms.TextBox(); + this.lblAuthPass = new System.Windows.Forms.Label(); + this.txtAuthUser = new System.Windows.Forms.TextBox(); + this.lblAuthUser = new System.Windows.Forms.Label(); this.checkShareOverLan = new System.Windows.Forms.CheckBox(); - this.NumProxyPort = new System.Windows.Forms.NumericUpDown(); - this.ProxyPortLabel = new System.Windows.Forms.Label(); + this.nudProxyPort = new System.Windows.Forms.NumericUpDown(); + this.lblProxyPort = new System.Windows.Forms.Label(); this.tableLayoutPanel10 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.MyCancelButton = new System.Windows.Forms.Button(); - this.OKButton = new System.Windows.Forms.Button(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.ReconnectLabel = new System.Windows.Forms.Label(); - this.NumReconnect = new System.Windows.Forms.NumericUpDown(); - this.TTLLabel = new System.Windows.Forms.Label(); - this.NumTTL = new System.Windows.Forms.NumericUpDown(); - this.labelTimeout = new System.Windows.Forms.Label(); - this.NumTimeout = new System.Windows.Forms.NumericUpDown(); - this.DNSText = new System.Windows.Forms.TextBox(); - this.buttonDefault = new System.Windows.Forms.Button(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.LocalDNSText = new System.Windows.Forms.TextBox(); - this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); - this.LabelLogging = new System.Windows.Forms.Label(); - this.CheckLogEnable = new System.Windows.Forms.CheckBox(); + this.lblReconnect = new System.Windows.Forms.Label(); + this.nudReconnect = new System.Windows.Forms.NumericUpDown(); + this.lblTtl = new System.Windows.Forms.Label(); + this.nudTTL = new System.Windows.Forms.NumericUpDown(); + this.lblTimeout = new System.Windows.Forms.Label(); + this.nudTimeout = new System.Windows.Forms.NumericUpDown(); + this.txtDNS = new System.Windows.Forms.TextBox(); + this.btnDefault = new System.Windows.Forms.Button(); + this.lblDns = new System.Windows.Forms.Label(); + this.lblLocalDns = new System.Windows.Forms.Label(); + this.txtLocalDNS = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); - this.Socks5ProxyGroup.SuspendLayout(); + this.gbxSocks5Proxy.SuspendLayout(); this.tableLayoutPanel9.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumS5Port)).BeginInit(); - this.ListenGroup.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudS5Port)).BeginInit(); + this.gbxListen.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumProxyPort)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudProxyPort)).BeginInit(); this.tableLayoutPanel10.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumReconnect)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumTTL)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumTimeout)).BeginInit(); - this.tableLayoutPanel6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudReconnect)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudTTL)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudTimeout)).BeginInit(); + this.tableLayoutPanel3.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -105,61 +103,91 @@ private void InitializeComponent() this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.Socks5ProxyGroup, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.ListenGroup, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel10, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel6, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.gbxSocks5Proxy, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.gbxListen, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel10, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 1, 2); this.tableLayoutPanel1.Location = new System.Drawing.Point(15, 16); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; 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(731, 478); + this.tableLayoutPanel1.Size = new System.Drawing.Size(599, 451); this.tableLayoutPanel1.TabIndex = 0; // // tableLayoutPanel2 // this.tableLayoutPanel2.AutoSize = true; + this.tableLayoutPanel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.LabelRandom, 0, 3); - this.tableLayoutPanel2.Controls.Add(this.RandomComboBox, 1, 3); - this.tableLayoutPanel2.Controls.Add(this.CheckAutoBan, 1, 5); - this.tableLayoutPanel2.Controls.Add(this.checkRandom, 1, 2); - this.tableLayoutPanel2.Controls.Add(this.checkAutoStartup, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.checkBalanceInGroup, 1, 4); - this.tableLayoutPanel2.Controls.Add(this.checkSwitchAutoCloseAll, 1, 1); - this.tableLayoutPanel2.Location = new System.Drawing.Point(408, 3); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 150F)); + this.tableLayoutPanel2.Controls.Add(this.chkLogEnable, 1, 6); + this.tableLayoutPanel2.Controls.Add(this.lblLogging, 0, 6); + this.tableLayoutPanel2.Controls.Add(this.lblBalance, 0, 3); + this.tableLayoutPanel2.Controls.Add(this.cmbBalance, 1, 3); + this.tableLayoutPanel2.Controls.Add(this.chkAutoBan, 1, 5); + this.tableLayoutPanel2.Controls.Add(this.chkBalance, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.chkAutoStartup, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.chkBalanceInGroup, 1, 4); + this.tableLayoutPanel2.Controls.Add(this.chkSwitchAutoCloseAll, 1, 1); + this.tableLayoutPanel2.Location = new System.Drawing.Point(346, 3); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 6; + this.tableLayoutPanel2.RowCount = 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(320, 158); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.Size = new System.Drawing.Size(250, 127); this.tableLayoutPanel2.TabIndex = 2; // - // LabelRandom - // - this.LabelRandom.AutoSize = true; - this.LabelRandom.Dock = System.Windows.Forms.DockStyle.Fill; - this.LabelRandom.Location = new System.Drawing.Point(3, 75); - this.LabelRandom.Name = "LabelRandom"; - this.LabelRandom.Size = new System.Drawing.Size(63, 33); - this.LabelRandom.TabIndex = 12; - this.LabelRandom.Text = "Balance"; - this.LabelRandom.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // RandomComboBox - // - this.RandomComboBox.Anchor = System.Windows.Forms.AnchorStyles.None; - this.RandomComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.RandomComboBox.FormattingEnabled = true; - this.RandomComboBox.Items.AddRange(new object[] { + // chkLogEnable + // + this.chkLogEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkLogEnable.AutoSize = true; + this.chkLogEnable.Location = new System.Drawing.Point(103, 111); + this.chkLogEnable.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkLogEnable.Name = "chkLogEnable"; + this.chkLogEnable.Size = new System.Drawing.Size(144, 16); + this.chkLogEnable.TabIndex = 18; + this.chkLogEnable.Text = "Enable Log"; + this.chkLogEnable.UseVisualStyleBackColor = true; + // + // lblLogging + // + this.lblLogging.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblLogging.AutoSize = true; + this.lblLogging.Location = new System.Drawing.Point(50, 112); + this.lblLogging.Margin = new System.Windows.Forms.Padding(3, 0, 3, 1); + this.lblLogging.Name = "lblLogging"; + this.lblLogging.Size = new System.Drawing.Size(47, 12); + this.lblLogging.TabIndex = 17; + this.lblLogging.Text = "Logging"; + this.lblLogging.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblBalance + // + this.lblBalance.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblBalance.AutoSize = true; + this.lblBalance.Location = new System.Drawing.Point(50, 56); + this.lblBalance.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6); + this.lblBalance.Name = "lblBalance"; + this.lblBalance.Size = new System.Drawing.Size(47, 12); + this.lblBalance.TabIndex = 12; + this.lblBalance.Text = "Balance"; + this.lblBalance.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // cmbBalance + // + this.cmbBalance.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbBalance.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbBalance.FormattingEnabled = true; + this.cmbBalance.Items.AddRange(new object[] { "OneByOne", "Random", "FastDownloadSpeed", @@ -167,95 +195,106 @@ private void InitializeComponent() "LowException", "SelectedFirst", "Timer"}); - this.RandomComboBox.Location = new System.Drawing.Point(121, 78); - this.RandomComboBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 7); - this.RandomComboBox.Name = "RandomComboBox"; - this.RandomComboBox.Size = new System.Drawing.Size(147, 23); - this.RandomComboBox.TabIndex = 14; - // - // CheckAutoBan - // - this.CheckAutoBan.AutoSize = true; - this.CheckAutoBan.Location = new System.Drawing.Point(72, 136); - this.CheckAutoBan.Name = "CheckAutoBan"; - this.CheckAutoBan.Size = new System.Drawing.Size(85, 19); - this.CheckAutoBan.TabIndex = 15; - this.CheckAutoBan.Text = "AutoBan"; - this.CheckAutoBan.UseVisualStyleBackColor = true; - // - // checkRandom - // - this.checkRandom.AutoSize = true; - this.checkRandom.Location = new System.Drawing.Point(72, 53); - this.checkRandom.Name = "checkRandom"; - this.checkRandom.Size = new System.Drawing.Size(125, 19); - this.checkRandom.TabIndex = 13; - this.checkRandom.Text = "Load balance"; - this.checkRandom.UseVisualStyleBackColor = true; - // - // checkAutoStartup - // - this.checkAutoStartup.AutoSize = true; - this.checkAutoStartup.Location = new System.Drawing.Point(72, 3); - this.checkAutoStartup.Name = "checkAutoStartup"; - this.checkAutoStartup.Size = new System.Drawing.Size(133, 19); - this.checkAutoStartup.TabIndex = 12; - this.checkAutoStartup.Text = "Start on Boot"; - this.checkAutoStartup.UseVisualStyleBackColor = true; - // - // checkBalanceInGroup - // - this.checkBalanceInGroup.AutoSize = true; - this.checkBalanceInGroup.Location = new System.Drawing.Point(72, 111); - this.checkBalanceInGroup.Name = "checkBalanceInGroup"; - this.checkBalanceInGroup.Size = new System.Drawing.Size(157, 19); - this.checkBalanceInGroup.TabIndex = 15; - this.checkBalanceInGroup.Text = "Balance in group"; - this.checkBalanceInGroup.UseVisualStyleBackColor = true; - // - // checkSwitchAutoCloseAll - // - this.checkSwitchAutoCloseAll.AutoSize = true; - this.checkSwitchAutoCloseAll.Location = new System.Drawing.Point(72, 28); - this.checkSwitchAutoCloseAll.Name = "checkSwitchAutoCloseAll"; - this.checkSwitchAutoCloseAll.Size = new System.Drawing.Size(245, 19); - this.checkSwitchAutoCloseAll.TabIndex = 16; - this.checkSwitchAutoCloseAll.Text = "Switch auto close TCP links"; - this.checkSwitchAutoCloseAll.UseVisualStyleBackColor = true; - // - // Socks5ProxyGroup - // - this.Socks5ProxyGroup.AutoSize = true; - this.Socks5ProxyGroup.Controls.Add(this.tableLayoutPanel9); - this.Socks5ProxyGroup.Location = new System.Drawing.Point(14, 0); - this.Socks5ProxyGroup.Margin = new System.Windows.Forms.Padding(14, 0, 0, 0); - this.Socks5ProxyGroup.Name = "Socks5ProxyGroup"; - this.tableLayoutPanel1.SetRowSpan(this.Socks5ProxyGroup, 2); - this.Socks5ProxyGroup.Size = new System.Drawing.Size(391, 265); - this.Socks5ProxyGroup.TabIndex = 0; - this.Socks5ProxyGroup.TabStop = false; - this.Socks5ProxyGroup.Text = "Remote proxy"; + this.cmbBalance.Location = new System.Drawing.Point(103, 51); + this.cmbBalance.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); + this.cmbBalance.Name = "cmbBalance"; + this.cmbBalance.Size = new System.Drawing.Size(144, 20); + this.cmbBalance.TabIndex = 14; + // + // chkAutoBan + // + this.chkAutoBan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkAutoBan.AutoSize = true; + this.chkAutoBan.Location = new System.Drawing.Point(103, 95); + this.chkAutoBan.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkAutoBan.Name = "chkAutoBan"; + this.chkAutoBan.Size = new System.Drawing.Size(144, 16); + this.chkAutoBan.TabIndex = 15; + this.chkAutoBan.Text = "AutoBan"; + this.chkAutoBan.UseVisualStyleBackColor = true; + // + // chkBalance + // + this.chkBalance.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkBalance.AutoSize = true; + this.chkBalance.Location = new System.Drawing.Point(103, 32); + this.chkBalance.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkBalance.Name = "chkBalance"; + this.chkBalance.Size = new System.Drawing.Size(144, 16); + this.chkBalance.TabIndex = 13; + this.chkBalance.Text = "Load balance"; + this.chkBalance.UseVisualStyleBackColor = true; + // + // chkAutoStartup + // + this.chkAutoStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkAutoStartup.AutoSize = true; + this.chkAutoStartup.Location = new System.Drawing.Point(103, 0); + this.chkAutoStartup.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkAutoStartup.Name = "chkAutoStartup"; + this.chkAutoStartup.Size = new System.Drawing.Size(144, 16); + this.chkAutoStartup.TabIndex = 12; + this.chkAutoStartup.Text = "Start on Boot"; + this.chkAutoStartup.UseVisualStyleBackColor = true; + // + // chkBalanceInGroup + // + this.chkBalanceInGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkBalanceInGroup.AutoSize = true; + this.chkBalanceInGroup.Location = new System.Drawing.Point(103, 79); + this.chkBalanceInGroup.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkBalanceInGroup.Name = "chkBalanceInGroup"; + this.chkBalanceInGroup.Size = new System.Drawing.Size(144, 16); + this.chkBalanceInGroup.TabIndex = 15; + this.chkBalanceInGroup.Text = "Balance in group"; + this.chkBalanceInGroup.UseVisualStyleBackColor = true; + // + // chkSwitchAutoCloseAll + // + this.chkSwitchAutoCloseAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkSwitchAutoCloseAll.AutoSize = true; + this.chkSwitchAutoCloseAll.Location = new System.Drawing.Point(103, 16); + this.chkSwitchAutoCloseAll.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkSwitchAutoCloseAll.Name = "chkSwitchAutoCloseAll"; + this.chkSwitchAutoCloseAll.Size = new System.Drawing.Size(144, 16); + this.chkSwitchAutoCloseAll.TabIndex = 16; + this.chkSwitchAutoCloseAll.Text = "Switch auto close TCP links"; + this.chkSwitchAutoCloseAll.UseVisualStyleBackColor = true; + // + // gbxSocks5Proxy + // + this.gbxSocks5Proxy.AutoSize = true; + this.gbxSocks5Proxy.Controls.Add(this.tableLayoutPanel9); + this.gbxSocks5Proxy.Location = new System.Drawing.Point(0, 0); + this.gbxSocks5Proxy.Margin = new System.Windows.Forms.Padding(0); + this.gbxSocks5Proxy.Name = "gbxSocks5Proxy"; + this.gbxSocks5Proxy.Size = new System.Drawing.Size(343, 229); + this.gbxSocks5Proxy.TabIndex = 0; + this.gbxSocks5Proxy.TabStop = false; + this.gbxSocks5Proxy.Text = "Remote proxy"; // // tableLayoutPanel9 // this.tableLayoutPanel9.AutoSize = true; + this.tableLayoutPanel9.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanel9.ColumnCount = 2; - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.Controls.Add(this.LabelS5Password, 0, 5); - this.tableLayoutPanel9.Controls.Add(this.LabelS5Username, 0, 4); - this.tableLayoutPanel9.Controls.Add(this.TextS5Pass, 1, 5); - this.tableLayoutPanel9.Controls.Add(this.LabelS5Port, 0, 3); - this.tableLayoutPanel9.Controls.Add(this.TextS5User, 1, 4); - this.tableLayoutPanel9.Controls.Add(this.LabelS5Server, 0, 2); - this.tableLayoutPanel9.Controls.Add(this.NumS5Port, 1, 3); - this.tableLayoutPanel9.Controls.Add(this.TextS5Server, 1, 2); - this.tableLayoutPanel9.Controls.Add(this.comboProxyType, 1, 1); - this.tableLayoutPanel9.Controls.Add(this.CheckSockProxy, 0, 0); - this.tableLayoutPanel9.Controls.Add(this.checkBoxPacProxy, 1, 0); - this.tableLayoutPanel9.Controls.Add(this.label1, 0, 6); - this.tableLayoutPanel9.Controls.Add(this.TextUserAgent, 1, 6); - this.tableLayoutPanel9.Location = new System.Drawing.Point(11, 32); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 240F)); + this.tableLayoutPanel9.Controls.Add(this.lblS5Password, 0, 5); + this.tableLayoutPanel9.Controls.Add(this.lblS5Username, 0, 4); + this.tableLayoutPanel9.Controls.Add(this.txtS5Pass, 1, 5); + this.tableLayoutPanel9.Controls.Add(this.lblS5Port, 0, 3); + this.tableLayoutPanel9.Controls.Add(this.txtS5User, 1, 4); + this.tableLayoutPanel9.Controls.Add(this.lblS5Server, 0, 2); + this.tableLayoutPanel9.Controls.Add(this.nudS5Port, 1, 3); + this.tableLayoutPanel9.Controls.Add(this.txtS5Server, 1, 2); + this.tableLayoutPanel9.Controls.Add(this.cmbProxyType, 1, 1); + this.tableLayoutPanel9.Controls.Add(this.chkSockProxy, 0, 0); + this.tableLayoutPanel9.Controls.Add(this.chkPacProxy, 1, 0); + this.tableLayoutPanel9.Controls.Add(this.lblUserAgent, 0, 6); + this.tableLayoutPanel9.Controls.Add(this.txtUserAgent, 1, 6); + this.tableLayoutPanel9.Location = new System.Drawing.Point(15, 25); + this.tableLayoutPanel9.Margin = new System.Windows.Forms.Padding(5); this.tableLayoutPanel9.Name = "tableLayoutPanel9"; this.tableLayoutPanel9.RowCount = 7; this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -265,240 +304,274 @@ private void InitializeComponent() this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel9.Size = new System.Drawing.Size(374, 209); + this.tableLayoutPanel9.Size = new System.Drawing.Size(320, 182); this.tableLayoutPanel9.TabIndex = 0; // - // LabelS5Password - // - this.LabelS5Password.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelS5Password.AutoSize = true; - this.LabelS5Password.Location = new System.Drawing.Point(25, 155); - this.LabelS5Password.Name = "LabelS5Password"; - this.LabelS5Password.Size = new System.Drawing.Size(71, 15); - this.LabelS5Password.TabIndex = 5; - this.LabelS5Password.Text = "Password"; - // - // LabelS5Username - // - this.LabelS5Username.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelS5Username.AutoSize = true; - this.LabelS5Username.Location = new System.Drawing.Point(25, 124); - this.LabelS5Username.Name = "LabelS5Username"; - this.LabelS5Username.Size = new System.Drawing.Size(71, 15); - this.LabelS5Username.TabIndex = 4; - this.LabelS5Username.Text = "Username"; - // - // TextS5Pass - // - this.TextS5Pass.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextS5Pass.Location = new System.Drawing.Point(102, 150); - this.TextS5Pass.Name = "TextS5Pass"; - this.TextS5Pass.Size = new System.Drawing.Size(236, 25); - this.TextS5Pass.TabIndex = 6; - // - // LabelS5Port - // - this.LabelS5Port.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelS5Port.AutoSize = true; - this.LabelS5Port.Location = new System.Drawing.Point(57, 93); - this.LabelS5Port.Name = "LabelS5Port"; - this.LabelS5Port.Size = new System.Drawing.Size(39, 15); - this.LabelS5Port.TabIndex = 1; - this.LabelS5Port.Text = "Port"; - // - // TextS5User - // - this.TextS5User.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextS5User.Location = new System.Drawing.Point(102, 119); - this.TextS5User.Name = "TextS5User"; - this.TextS5User.Size = new System.Drawing.Size(236, 25); - this.TextS5User.TabIndex = 5; - // - // LabelS5Server - // - this.LabelS5Server.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelS5Server.AutoSize = true; - this.LabelS5Server.Location = new System.Drawing.Point(17, 62); - this.LabelS5Server.Name = "LabelS5Server"; - this.LabelS5Server.Size = new System.Drawing.Size(79, 15); - this.LabelS5Server.TabIndex = 0; - this.LabelS5Server.Text = "Server IP"; - // - // NumS5Port - // - this.NumS5Port.ImeMode = System.Windows.Forms.ImeMode.Off; - this.NumS5Port.Location = new System.Drawing.Point(102, 88); - this.NumS5Port.Maximum = new decimal(new int[] { + // lblS5Password + // + this.lblS5Password.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblS5Password.AutoSize = true; + this.lblS5Password.Location = new System.Drawing.Point(24, 135); + this.lblS5Password.Margin = new System.Windows.Forms.Padding(3); + this.lblS5Password.Name = "lblS5Password"; + this.lblS5Password.Size = new System.Drawing.Size(53, 12); + this.lblS5Password.TabIndex = 5; + this.lblS5Password.Text = "Password"; + this.lblS5Password.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblS5Username + // + this.lblS5Username.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblS5Username.AutoSize = true; + this.lblS5Username.Location = new System.Drawing.Point(24, 108); + this.lblS5Username.Margin = new System.Windows.Forms.Padding(3); + this.lblS5Username.Name = "lblS5Username"; + this.lblS5Username.Size = new System.Drawing.Size(53, 12); + this.lblS5Username.TabIndex = 4; + this.lblS5Username.Text = "Username"; + this.lblS5Username.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtS5Pass + // + this.txtS5Pass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtS5Pass.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtS5Pass.Location = new System.Drawing.Point(83, 131); + this.txtS5Pass.Name = "txtS5Pass"; + this.txtS5Pass.Size = new System.Drawing.Size(234, 21); + this.txtS5Pass.TabIndex = 6; + // + // lblS5Port + // + this.lblS5Port.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblS5Port.AutoSize = true; + this.lblS5Port.Location = new System.Drawing.Point(48, 81); + this.lblS5Port.Margin = new System.Windows.Forms.Padding(3); + this.lblS5Port.Name = "lblS5Port"; + this.lblS5Port.Size = new System.Drawing.Size(29, 12); + this.lblS5Port.TabIndex = 1; + this.lblS5Port.Text = "Port"; + this.lblS5Port.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtS5User + // + this.txtS5User.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtS5User.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtS5User.Location = new System.Drawing.Point(83, 104); + this.txtS5User.Name = "txtS5User"; + this.txtS5User.Size = new System.Drawing.Size(234, 21); + this.txtS5User.TabIndex = 5; + // + // lblS5Server + // + this.lblS5Server.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblS5Server.AutoSize = true; + this.lblS5Server.Location = new System.Drawing.Point(18, 54); + this.lblS5Server.Margin = new System.Windows.Forms.Padding(3); + this.lblS5Server.Name = "lblS5Server"; + this.lblS5Server.Size = new System.Drawing.Size(59, 12); + this.lblS5Server.TabIndex = 0; + this.lblS5Server.Text = "Server IP"; + this.lblS5Server.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // nudS5Port + // + this.nudS5Port.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudS5Port.ImeMode = System.Windows.Forms.ImeMode.Off; + this.nudS5Port.Location = new System.Drawing.Point(83, 77); + this.nudS5Port.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); - this.NumS5Port.Name = "NumS5Port"; - this.NumS5Port.Size = new System.Drawing.Size(236, 25); - this.NumS5Port.TabIndex = 4; + this.nudS5Port.Name = "nudS5Port"; + this.nudS5Port.Size = new System.Drawing.Size(234, 21); + this.nudS5Port.TabIndex = 4; // - // TextS5Server + // txtS5Server // - this.TextS5Server.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextS5Server.Location = new System.Drawing.Point(102, 57); - this.TextS5Server.Name = "TextS5Server"; - this.TextS5Server.Size = new System.Drawing.Size(236, 25); - this.TextS5Server.TabIndex = 3; + this.txtS5Server.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtS5Server.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtS5Server.Location = new System.Drawing.Point(83, 50); + this.txtS5Server.Name = "txtS5Server"; + this.txtS5Server.Size = new System.Drawing.Size(234, 21); + this.txtS5Server.TabIndex = 3; // - // comboProxyType + // cmbProxyType // - this.comboProxyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboProxyType.FormattingEnabled = true; - this.comboProxyType.Items.AddRange(new object[] { + this.cmbProxyType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.cmbProxyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbProxyType.FormattingEnabled = true; + this.cmbProxyType.Items.AddRange(new object[] { "Socks5(support UDP)", "Http tunnel", "TCP Port tunnel"}); - this.comboProxyType.Location = new System.Drawing.Point(102, 28); - this.comboProxyType.Name = "comboProxyType"; - this.comboProxyType.Size = new System.Drawing.Size(236, 23); - this.comboProxyType.TabIndex = 2; - // - // CheckSockProxy - // - this.CheckSockProxy.AutoSize = true; - this.CheckSockProxy.Location = new System.Drawing.Point(3, 3); - this.CheckSockProxy.Name = "CheckSockProxy"; - this.CheckSockProxy.Size = new System.Drawing.Size(93, 19); - this.CheckSockProxy.TabIndex = 0; - this.CheckSockProxy.Text = "Proxy On"; - this.CheckSockProxy.UseVisualStyleBackColor = true; - // - // checkBoxPacProxy - // - this.checkBoxPacProxy.AutoSize = true; - this.checkBoxPacProxy.Location = new System.Drawing.Point(102, 3); - this.checkBoxPacProxy.Name = "checkBoxPacProxy"; - this.checkBoxPacProxy.Size = new System.Drawing.Size(269, 19); - this.checkBoxPacProxy.TabIndex = 1; - this.checkBoxPacProxy.Text = "PAC \"direct\" return this proxy"; - this.checkBoxPacProxy.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(17, 186); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(79, 15); - this.label1.TabIndex = 5; - this.label1.Text = "UserAgent"; - // - // TextUserAgent - // - this.TextUserAgent.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextUserAgent.Location = new System.Drawing.Point(102, 181); - this.TextUserAgent.Name = "TextUserAgent"; - this.TextUserAgent.Size = new System.Drawing.Size(236, 25); - this.TextUserAgent.TabIndex = 7; - // - // ListenGroup - // - this.ListenGroup.AutoSize = true; - this.ListenGroup.Controls.Add(this.tableLayoutPanel4); - this.ListenGroup.Location = new System.Drawing.Point(14, 265); - this.ListenGroup.Margin = new System.Windows.Forms.Padding(14, 0, 0, 0); - this.ListenGroup.Name = "ListenGroup"; - this.ListenGroup.Size = new System.Drawing.Size(339, 180); - this.ListenGroup.TabIndex = 1; - this.ListenGroup.TabStop = false; - this.ListenGroup.Text = "Local proxy"; + this.cmbProxyType.Location = new System.Drawing.Point(83, 19); + this.cmbProxyType.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8); + this.cmbProxyType.Name = "cmbProxyType"; + this.cmbProxyType.Size = new System.Drawing.Size(234, 20); + this.cmbProxyType.TabIndex = 2; + // + // chkSockProxy + // + this.chkSockProxy.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.chkSockProxy.AutoSize = true; + this.chkSockProxy.Location = new System.Drawing.Point(5, 0); + this.chkSockProxy.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkSockProxy.Name = "chkSockProxy"; + this.chkSockProxy.Size = new System.Drawing.Size(72, 16); + this.chkSockProxy.TabIndex = 0; + this.chkSockProxy.Text = "Proxy On"; + this.chkSockProxy.UseVisualStyleBackColor = true; + // + // chkPacProxy + // + this.chkPacProxy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.chkPacProxy.AutoSize = true; + this.chkPacProxy.Location = new System.Drawing.Point(83, 0); + this.chkPacProxy.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); + this.chkPacProxy.Name = "chkPacProxy"; + this.chkPacProxy.Size = new System.Drawing.Size(234, 16); + this.chkPacProxy.TabIndex = 1; + this.chkPacProxy.Text = "PAC \"direct\" return this proxy"; + this.chkPacProxy.UseVisualStyleBackColor = true; + // + // lblUserAgent + // + this.lblUserAgent.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblUserAgent.AutoSize = true; + this.lblUserAgent.Location = new System.Drawing.Point(12, 162); + this.lblUserAgent.Margin = new System.Windows.Forms.Padding(3); + this.lblUserAgent.Name = "lblUserAgent"; + this.lblUserAgent.Size = new System.Drawing.Size(65, 12); + this.lblUserAgent.TabIndex = 5; + this.lblUserAgent.Text = "User Agent"; + this.lblUserAgent.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtUserAgent + // + this.txtUserAgent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtUserAgent.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtUserAgent.Location = new System.Drawing.Point(83, 158); + this.txtUserAgent.Name = "txtUserAgent"; + this.txtUserAgent.Size = new System.Drawing.Size(234, 21); + this.txtUserAgent.TabIndex = 7; + // + // gbxListen + // + this.gbxListen.AutoSize = true; + this.gbxListen.Controls.Add(this.tableLayoutPanel4); + this.gbxListen.Location = new System.Drawing.Point(0, 229); + this.gbxListen.Margin = new System.Windows.Forms.Padding(0); + this.gbxListen.Name = "gbxListen"; + this.gbxListen.Size = new System.Drawing.Size(343, 144); + this.gbxListen.TabIndex = 1; + this.gbxListen.TabStop = false; + this.gbxListen.Text = "Local proxy"; // // tableLayoutPanel4 // this.tableLayoutPanel4.AutoSize = true; + this.tableLayoutPanel4.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 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.TextAuthPass, 1, 3); - this.tableLayoutPanel4.Controls.Add(this.LabelAuthPass, 0, 3); - this.tableLayoutPanel4.Controls.Add(this.TextAuthUser, 1, 2); - this.tableLayoutPanel4.Controls.Add(this.LabelAuthUser, 0, 2); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 240F)); + this.tableLayoutPanel4.Controls.Add(this.txtAuthPass, 1, 3); + this.tableLayoutPanel4.Controls.Add(this.lblAuthPass, 0, 3); + this.tableLayoutPanel4.Controls.Add(this.txtAuthUser, 1, 2); + this.tableLayoutPanel4.Controls.Add(this.lblAuthUser, 0, 2); this.tableLayoutPanel4.Controls.Add(this.checkShareOverLan, 1, 0); - this.tableLayoutPanel4.Controls.Add(this.NumProxyPort, 1, 1); - this.tableLayoutPanel4.Controls.Add(this.ProxyPortLabel, 0, 1); - this.tableLayoutPanel4.Location = new System.Drawing.Point(5, 32); + this.tableLayoutPanel4.Controls.Add(this.nudProxyPort, 1, 1); + this.tableLayoutPanel4.Controls.Add(this.lblProxyPort, 0, 1); + this.tableLayoutPanel4.Location = new System.Drawing.Point(15, 25); + this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(5); this.tableLayoutPanel4.Name = "tableLayoutPanel4"; this.tableLayoutPanel4.RowCount = 4; this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.Size = new System.Drawing.Size(328, 124); + this.tableLayoutPanel4.Size = new System.Drawing.Size(320, 97); this.tableLayoutPanel4.TabIndex = 0; // - // TextAuthPass - // - this.TextAuthPass.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextAuthPass.Location = new System.Drawing.Point(80, 90); - this.TextAuthPass.Name = "TextAuthPass"; - this.TextAuthPass.Size = new System.Drawing.Size(236, 25); - this.TextAuthPass.TabIndex = 11; - // - // LabelAuthPass - // - this.LabelAuthPass.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelAuthPass.AutoSize = true; - this.LabelAuthPass.Location = new System.Drawing.Point(3, 98); - this.LabelAuthPass.Name = "LabelAuthPass"; - this.LabelAuthPass.Size = new System.Drawing.Size(71, 15); - this.LabelAuthPass.TabIndex = 8; - this.LabelAuthPass.Text = "Password"; - // - // TextAuthUser - // - this.TextAuthUser.ImeMode = System.Windows.Forms.ImeMode.Off; - this.TextAuthUser.Location = new System.Drawing.Point(80, 59); - this.TextAuthUser.Name = "TextAuthUser"; - this.TextAuthUser.Size = new System.Drawing.Size(236, 25); - this.TextAuthUser.TabIndex = 10; - // - // LabelAuthUser - // - this.LabelAuthUser.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.LabelAuthUser.AutoSize = true; - this.LabelAuthUser.Location = new System.Drawing.Point(3, 64); - this.LabelAuthUser.Name = "LabelAuthUser"; - this.LabelAuthUser.Size = new System.Drawing.Size(71, 15); - this.LabelAuthUser.TabIndex = 5; - this.LabelAuthUser.Text = "Username"; + // txtAuthPass + // + this.txtAuthPass.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtAuthPass.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtAuthPass.Location = new System.Drawing.Point(83, 73); + this.txtAuthPass.Name = "txtAuthPass"; + this.txtAuthPass.Size = new System.Drawing.Size(234, 21); + this.txtAuthPass.TabIndex = 11; + // + // lblAuthPass + // + this.lblAuthPass.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblAuthPass.AutoSize = true; + this.lblAuthPass.Location = new System.Drawing.Point(24, 77); + this.lblAuthPass.Margin = new System.Windows.Forms.Padding(3); + this.lblAuthPass.Name = "lblAuthPass"; + this.lblAuthPass.Size = new System.Drawing.Size(53, 12); + this.lblAuthPass.TabIndex = 8; + this.lblAuthPass.Text = "Password"; + this.lblAuthPass.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtAuthUser + // + this.txtAuthUser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtAuthUser.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtAuthUser.Location = new System.Drawing.Point(83, 46); + this.txtAuthUser.Name = "txtAuthUser"; + this.txtAuthUser.Size = new System.Drawing.Size(234, 21); + this.txtAuthUser.TabIndex = 10; + // + // lblAuthUser + // + this.lblAuthUser.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblAuthUser.AutoSize = true; + this.lblAuthUser.Location = new System.Drawing.Point(24, 50); + this.lblAuthUser.Margin = new System.Windows.Forms.Padding(3); + this.lblAuthUser.Name = "lblAuthUser"; + this.lblAuthUser.Size = new System.Drawing.Size(53, 12); + this.lblAuthUser.TabIndex = 5; + this.lblAuthUser.Text = "Username"; + this.lblAuthUser.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // checkShareOverLan // + this.checkShareOverLan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.checkShareOverLan.AutoSize = true; - this.checkShareOverLan.Location = new System.Drawing.Point(80, 3); + this.checkShareOverLan.Location = new System.Drawing.Point(83, 0); + this.checkShareOverLan.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.checkShareOverLan.Name = "checkShareOverLan"; - this.checkShareOverLan.Size = new System.Drawing.Size(205, 19); + this.checkShareOverLan.Size = new System.Drawing.Size(234, 16); this.checkShareOverLan.TabIndex = 8; this.checkShareOverLan.Text = "Allow Clients from LAN"; this.checkShareOverLan.UseVisualStyleBackColor = true; // - // NumProxyPort + // nudProxyPort // - this.NumProxyPort.ImeMode = System.Windows.Forms.ImeMode.Off; - this.NumProxyPort.Location = new System.Drawing.Point(80, 28); - this.NumProxyPort.Maximum = new decimal(new int[] { + this.nudProxyPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudProxyPort.ImeMode = System.Windows.Forms.ImeMode.Off; + this.nudProxyPort.Location = new System.Drawing.Point(83, 19); + this.nudProxyPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0}); - this.NumProxyPort.Name = "NumProxyPort"; - this.NumProxyPort.Size = new System.Drawing.Size(236, 25); - this.NumProxyPort.TabIndex = 9; - // - // ProxyPortLabel - // - this.ProxyPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ProxyPortLabel.AutoSize = true; - this.ProxyPortLabel.Location = new System.Drawing.Point(35, 33); - this.ProxyPortLabel.Name = "ProxyPortLabel"; - this.ProxyPortLabel.Size = new System.Drawing.Size(39, 15); - this.ProxyPortLabel.TabIndex = 3; - this.ProxyPortLabel.Text = "Port"; + this.nudProxyPort.Name = "nudProxyPort"; + this.nudProxyPort.Size = new System.Drawing.Size(234, 21); + this.nudProxyPort.TabIndex = 9; + // + // lblProxyPort + // + this.lblProxyPort.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblProxyPort.AutoSize = true; + this.lblProxyPort.Location = new System.Drawing.Point(48, 23); + this.lblProxyPort.Margin = new System.Windows.Forms.Padding(3); + this.lblProxyPort.Name = "lblProxyPort"; + this.lblProxyPort.Size = new System.Drawing.Size(29, 12); + this.lblProxyPort.TabIndex = 3; + this.lblProxyPort.Text = "Port"; + this.lblProxyPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tableLayoutPanel10 // @@ -506,85 +579,37 @@ private void InitializeComponent() this.tableLayoutPanel10.AutoSize = true; this.tableLayoutPanel10.ColumnCount = 1; this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel10.Controls.Add(this.tableLayoutPanel3, 0, 2); - this.tableLayoutPanel10.Controls.Add(this.tableLayoutPanel5, 0, 1); - this.tableLayoutPanel10.Location = new System.Drawing.Point(445, 268); + this.tableLayoutPanel10.Controls.Add(this.tableLayoutPanel5, 1, 1); + this.tableLayoutPanel10.Location = new System.Drawing.Point(346, 232); this.tableLayoutPanel10.Name = "tableLayoutPanel10"; this.tableLayoutPanel10.RowCount = 3; this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel10.Size = new System.Drawing.Size(246, 207); + this.tableLayoutPanel10.Size = new System.Drawing.Size(250, 166); this.tableLayoutPanel10.TabIndex = 3; // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.tableLayoutPanel3.AutoSize = true; - this.tableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel3.ColumnCount = 2; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); - this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); - this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); - this.tableLayoutPanel3.Location = new System.Drawing.Point(33, 162); - this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 1; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel3.Size = new System.Drawing.Size(183, 42); - this.tableLayoutPanel3.TabIndex = 14; - // - // MyCancelButton - // - this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.MyCancelButton.Dock = System.Windows.Forms.DockStyle.Right; - this.MyCancelButton.Location = new System.Drawing.Point(96, 3); - this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); - this.MyCancelButton.Name = "MyCancelButton"; - this.MyCancelButton.Size = new System.Drawing.Size(87, 39); - this.MyCancelButton.TabIndex = 22; - this.MyCancelButton.Text = "Cancel"; - this.MyCancelButton.UseVisualStyleBackColor = true; - this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); - // - // OKButton - // - this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OKButton.Dock = System.Windows.Forms.DockStyle.Right; - this.OKButton.Location = new System.Drawing.Point(3, 3); - this.OKButton.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); - this.OKButton.Name = "OKButton"; - this.OKButton.Size = new System.Drawing.Size(87, 39); - this.OKButton.TabIndex = 21; - this.OKButton.Text = "OK"; - this.OKButton.UseVisualStyleBackColor = true; - this.OKButton.Click += new System.EventHandler(this.OKButton_Click); - // // tableLayoutPanel5 // - this.tableLayoutPanel5.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.tableLayoutPanel5.AutoSize = true; this.tableLayoutPanel5.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanel5.ColumnCount = 2; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel5.Controls.Add(this.ReconnectLabel, 0, 4); - this.tableLayoutPanel5.Controls.Add(this.NumReconnect, 1, 4); - this.tableLayoutPanel5.Controls.Add(this.TTLLabel, 0, 6); - this.tableLayoutPanel5.Controls.Add(this.NumTTL, 1, 6); - this.tableLayoutPanel5.Controls.Add(this.labelTimeout, 0, 5); - this.tableLayoutPanel5.Controls.Add(this.NumTimeout, 1, 5); - this.tableLayoutPanel5.Controls.Add(this.DNSText, 1, 1); - this.tableLayoutPanel5.Controls.Add(this.buttonDefault, 1, 0); - this.tableLayoutPanel5.Controls.Add(this.label2, 0, 1); - this.tableLayoutPanel5.Controls.Add(this.label3, 0, 2); - this.tableLayoutPanel5.Controls.Add(this.LocalDNSText, 1, 2); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 150F)); + this.tableLayoutPanel5.Controls.Add(this.lblReconnect, 0, 4); + this.tableLayoutPanel5.Controls.Add(this.nudReconnect, 1, 4); + this.tableLayoutPanel5.Controls.Add(this.lblTtl, 0, 6); + this.tableLayoutPanel5.Controls.Add(this.nudTTL, 1, 6); + this.tableLayoutPanel5.Controls.Add(this.lblTimeout, 0, 5); + this.tableLayoutPanel5.Controls.Add(this.nudTimeout, 1, 5); + this.tableLayoutPanel5.Controls.Add(this.txtDNS, 1, 1); + this.tableLayoutPanel5.Controls.Add(this.btnDefault, 1, 0); + this.tableLayoutPanel5.Controls.Add(this.lblDns, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.lblLocalDns, 0, 2); + this.tableLayoutPanel5.Controls.Add(this.txtLocalDNS, 1, 2); this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.Padding = new System.Windows.Forms.Padding(3); this.tableLayoutPanel5.RowCount = 7; this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -592,165 +617,187 @@ private void InitializeComponent() 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()); - this.tableLayoutPanel5.Size = new System.Drawing.Size(246, 170); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.Size = new System.Drawing.Size(250, 166); this.tableLayoutPanel5.TabIndex = 3; // - // ReconnectLabel + // lblReconnect // - this.ReconnectLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ReconnectLabel.AutoSize = true; - this.ReconnectLabel.Location = new System.Drawing.Point(46, 93); - this.ReconnectLabel.Name = "ReconnectLabel"; - this.ReconnectLabel.Size = new System.Drawing.Size(79, 15); - this.ReconnectLabel.TabIndex = 3; - this.ReconnectLabel.Text = "Reconnect"; + this.lblReconnect.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblReconnect.AutoSize = true; + this.lblReconnect.Location = new System.Drawing.Point(38, 92); + this.lblReconnect.Margin = new System.Windows.Forms.Padding(3); + this.lblReconnect.Name = "lblReconnect"; + this.lblReconnect.Size = new System.Drawing.Size(59, 12); + this.lblReconnect.TabIndex = 3; + this.lblReconnect.Text = "Reconnect"; + this.lblReconnect.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // NumReconnect + // nudReconnect // - this.NumReconnect.ImeMode = System.Windows.Forms.ImeMode.Off; - this.NumReconnect.Location = new System.Drawing.Point(131, 89); - this.NumReconnect.Maximum = new decimal(new int[] { + this.nudReconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudReconnect.ImeMode = System.Windows.Forms.ImeMode.Off; + this.nudReconnect.Location = new System.Drawing.Point(103, 88); + this.nudReconnect.Maximum = new decimal(new int[] { 20, 0, 0, 0}); - this.NumReconnect.Name = "NumReconnect"; - this.NumReconnect.Size = new System.Drawing.Size(109, 25); - this.NumReconnect.TabIndex = 18; - // - // TTLLabel - // - this.TTLLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.TTLLabel.AutoSize = true; - this.TTLLabel.Location = new System.Drawing.Point(94, 147); - this.TTLLabel.Name = "TTLLabel"; - this.TTLLabel.Size = new System.Drawing.Size(31, 15); - this.TTLLabel.TabIndex = 3; - this.TTLLabel.Text = "TTL"; - // - // NumTTL - // - this.NumTTL.ImeMode = System.Windows.Forms.ImeMode.Off; - this.NumTTL.Location = new System.Drawing.Point(131, 143); - this.NumTTL.Maximum = new decimal(new int[] { + this.nudReconnect.Name = "nudReconnect"; + this.nudReconnect.Size = new System.Drawing.Size(144, 21); + this.nudReconnect.TabIndex = 18; + // + // lblTtl + // + this.lblTtl.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblTtl.AutoSize = true; + this.lblTtl.Location = new System.Drawing.Point(74, 146); + this.lblTtl.Margin = new System.Windows.Forms.Padding(3); + this.lblTtl.Name = "lblTtl"; + this.lblTtl.Size = new System.Drawing.Size(23, 12); + this.lblTtl.TabIndex = 3; + this.lblTtl.Text = "TTL"; + this.lblTtl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // nudTTL + // + this.nudTTL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudTTL.ImeMode = System.Windows.Forms.ImeMode.Off; + this.nudTTL.Location = new System.Drawing.Point(103, 142); + this.nudTTL.Maximum = new decimal(new int[] { 600, 0, 0, 0}); - this.NumTTL.Name = "NumTTL"; - this.NumTTL.Size = new System.Drawing.Size(109, 25); - this.NumTTL.TabIndex = 20; - // - // labelTimeout - // - this.labelTimeout.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.labelTimeout.AutoSize = true; - this.labelTimeout.Location = new System.Drawing.Point(12, 120); - this.labelTimeout.Name = "labelTimeout"; - this.labelTimeout.Size = new System.Drawing.Size(119, 15); - this.labelTimeout.TabIndex = 3; - this.labelTimeout.Text = "ConnectTimeout"; - // - // NumTimeout - // - this.NumTimeout.ImeMode = System.Windows.Forms.ImeMode.Off; - this.NumTimeout.Location = new System.Drawing.Point(131, 116); - this.NumTimeout.Maximum = new decimal(new int[] { + this.nudTTL.Name = "nudTTL"; + this.nudTTL.Size = new System.Drawing.Size(144, 21); + this.nudTTL.TabIndex = 20; + // + // lblTimeout + // + this.lblTimeout.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblTimeout.AutoSize = true; + this.lblTimeout.Location = new System.Drawing.Point(8, 119); + this.lblTimeout.Margin = new System.Windows.Forms.Padding(3); + this.lblTimeout.Name = "lblTimeout"; + this.lblTimeout.Size = new System.Drawing.Size(89, 12); + this.lblTimeout.TabIndex = 3; + this.lblTimeout.Text = "ConnectTimeout"; + this.lblTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // nudTimeout + // + this.nudTimeout.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.nudTimeout.ImeMode = System.Windows.Forms.ImeMode.Off; + this.nudTimeout.Location = new System.Drawing.Point(103, 115); + this.nudTimeout.Maximum = new decimal(new int[] { 60, 0, 0, 0}); - this.NumTimeout.Name = "NumTimeout"; - this.NumTimeout.Size = new System.Drawing.Size(109, 25); - this.NumTimeout.TabIndex = 19; - // - // DNSText - // - this.DNSText.ImeMode = System.Windows.Forms.ImeMode.Off; - this.DNSText.Location = new System.Drawing.Point(131, 35); - this.DNSText.MaxLength = 0; - this.DNSText.Name = "DNSText"; - this.DNSText.Size = new System.Drawing.Size(109, 25); - this.DNSText.TabIndex = 17; - this.DNSText.WordWrap = false; - // - // buttonDefault - // - this.buttonDefault.Location = new System.Drawing.Point(131, 6); - this.buttonDefault.Name = "buttonDefault"; - this.buttonDefault.Size = new System.Drawing.Size(109, 23); - this.buttonDefault.TabIndex = 16; - this.buttonDefault.Text = "Set Default"; - this.buttonDefault.UseVisualStyleBackColor = true; - this.buttonDefault.Click += new System.EventHandler(this.buttonDefault_Click); - // - // label2 - // - this.label2.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(94, 40); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(31, 15); - this.label2.TabIndex = 3; - this.label2.Text = "DNS"; - // - // label3 - // - this.label3.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 66); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(59, 12); - this.label3.TabIndex = 3; - this.label3.Text = "Local DNS"; - // - // LocalDNSText - // - this.LocalDNSText.ImeMode = System.Windows.Forms.ImeMode.Off; - this.LocalDNSText.Location = new System.Drawing.Point(71, 62); - this.LocalDNSText.MaxLength = 0; - this.LocalDNSText.Name = "LocalDNSText"; - this.LocalDNSText.Size = new System.Drawing.Size(109, 21); - this.LocalDNSText.TabIndex = 17; - this.LocalDNSText.WordWrap = false; - // - // tableLayoutPanel6 - // - this.tableLayoutPanel6.ColumnCount = 2; - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel6.Controls.Add(this.LabelLogging, 0, 1); - this.tableLayoutPanel6.Controls.Add(this.CheckLogEnable, 1, 1); - this.tableLayoutPanel6.Location = new System.Drawing.Point(372, 132); - this.tableLayoutPanel6.Name = "tableLayoutPanel6"; - this.tableLayoutPanel6.RowCount = 3; - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.Size = new System.Drawing.Size(205, 100); - this.tableLayoutPanel6.TabIndex = 4; - // - // LabelLogging - // - this.LabelLogging.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.LabelLogging.AutoSize = true; - this.LabelLogging.Location = new System.Drawing.Point(3, 5); - this.LabelLogging.Name = "LabelLogging"; - this.LabelLogging.Size = new System.Drawing.Size(45, 13); - this.LabelLogging.TabIndex = 0; - this.LabelLogging.Text = "Logging"; - // - // CheckLogEnable - // - this.CheckLogEnable.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.CheckLogEnable.AutoSize = true; - this.CheckLogEnable.Location = new System.Drawing.Point(54, 3); - this.CheckLogEnable.Name = "CheckLogEnable"; - this.CheckLogEnable.Size = new System.Drawing.Size(80, 17); - this.CheckLogEnable.TabIndex = 1; - this.CheckLogEnable.Text = "Enable Log"; - this.CheckLogEnable.UseVisualStyleBackColor = true; + this.nudTimeout.Name = "nudTimeout"; + this.nudTimeout.Size = new System.Drawing.Size(144, 21); + this.nudTimeout.TabIndex = 19; + // + // txtDNS + // + this.txtDNS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtDNS.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtDNS.Location = new System.Drawing.Point(103, 34); + this.txtDNS.MaxLength = 0; + this.txtDNS.Name = "txtDNS"; + this.txtDNS.Size = new System.Drawing.Size(144, 21); + this.txtDNS.TabIndex = 17; + this.txtDNS.WordWrap = false; + // + // btnDefault + // + this.btnDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.btnDefault.Location = new System.Drawing.Point(103, 3); + this.btnDefault.Name = "btnDefault"; + this.btnDefault.Size = new System.Drawing.Size(144, 25); + this.btnDefault.TabIndex = 16; + this.btnDefault.Text = "Set Default"; + this.btnDefault.UseVisualStyleBackColor = true; + this.btnDefault.Click += new System.EventHandler(this.buttonDefault_Click); + // + // lblDns + // + this.lblDns.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblDns.AutoSize = true; + this.lblDns.Location = new System.Drawing.Point(74, 38); + this.lblDns.Margin = new System.Windows.Forms.Padding(3); + this.lblDns.Name = "lblDns"; + this.lblDns.Size = new System.Drawing.Size(23, 12); + this.lblDns.TabIndex = 3; + this.lblDns.Text = "DNS"; + this.lblDns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblLocalDns + // + this.lblLocalDns.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.lblLocalDns.AutoSize = true; + this.lblLocalDns.Location = new System.Drawing.Point(38, 65); + this.lblLocalDns.Margin = new System.Windows.Forms.Padding(3); + this.lblLocalDns.Name = "lblLocalDns"; + this.lblLocalDns.Size = new System.Drawing.Size(59, 12); + this.lblLocalDns.TabIndex = 3; + this.lblLocalDns.Text = "Local DNS"; + this.lblLocalDns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtLocalDNS + // + this.txtLocalDNS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.txtLocalDNS.ImeMode = System.Windows.Forms.ImeMode.Off; + this.txtLocalDNS.Location = new System.Drawing.Point(103, 61); + this.txtLocalDNS.MaxLength = 0; + this.txtLocalDNS.Name = "txtLocalDNS"; + this.txtLocalDNS.Size = new System.Drawing.Size(144, 21); + this.txtLocalDNS.TabIndex = 17; + this.txtLocalDNS.WordWrap = false; + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.tableLayoutPanel3.AutoSize = true; + this.tableLayoutPanel3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel3.ColumnCount = 2; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this.tableLayoutPanel3.Controls.Add(this.btnCancel, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.btnOK, 0, 0); + this.tableLayoutPanel3.Location = new System.Drawing.Point(413, 406); + this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0, 5, 0, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 1; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel3.Size = new System.Drawing.Size(186, 45); + this.tableLayoutPanel3.TabIndex = 14; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Dock = System.Windows.Forms.DockStyle.Right; + this.btnCancel.Location = new System.Drawing.Point(96, 3); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(87, 39); + this.btnCancel.TabIndex = 22; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.CancelButton_Click); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Dock = System.Windows.Forms.DockStyle.Right; + this.btnOK.Location = new System.Drawing.Point(3, 3); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(87, 39); + this.btnOK.TabIndex = 21; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.OKButton_Click); // // SettingsForm // @@ -771,26 +818,24 @@ private void InitializeComponent() this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); - this.Socks5ProxyGroup.ResumeLayout(false); - this.Socks5ProxyGroup.PerformLayout(); + this.gbxSocks5Proxy.ResumeLayout(false); + this.gbxSocks5Proxy.PerformLayout(); this.tableLayoutPanel9.ResumeLayout(false); this.tableLayoutPanel9.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumS5Port)).EndInit(); - this.ListenGroup.ResumeLayout(false); - this.ListenGroup.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudS5Port)).EndInit(); + this.gbxListen.ResumeLayout(false); + this.gbxListen.PerformLayout(); this.tableLayoutPanel4.ResumeLayout(false); this.tableLayoutPanel4.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumProxyPort)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudProxyPort)).EndInit(); this.tableLayoutPanel10.ResumeLayout(false); this.tableLayoutPanel10.PerformLayout(); - this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel5.ResumeLayout(false); this.tableLayoutPanel5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.NumReconnect)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumTTL)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.NumTimeout)).EndInit(); - this.tableLayoutPanel6.ResumeLayout(false); - this.tableLayoutPanel6.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudReconnect)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudTTL)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudTimeout)).EndInit(); + this.tableLayoutPanel3.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -799,56 +844,55 @@ private void InitializeComponent() #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.GroupBox Socks5ProxyGroup; + private System.Windows.Forms.GroupBox gbxSocks5Proxy; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9; - private System.Windows.Forms.TextBox TextS5Pass; - private System.Windows.Forms.TextBox TextS5User; - private System.Windows.Forms.Label LabelS5Password; - private System.Windows.Forms.Label LabelS5Server; - private System.Windows.Forms.Label LabelS5Port; - private System.Windows.Forms.TextBox TextS5Server; - private System.Windows.Forms.NumericUpDown NumS5Port; - private System.Windows.Forms.Label LabelS5Username; - private System.Windows.Forms.CheckBox CheckSockProxy; + private System.Windows.Forms.TextBox txtS5Pass; + private System.Windows.Forms.TextBox txtS5User; + private System.Windows.Forms.Label lblS5Password; + private System.Windows.Forms.Label lblS5Server; + private System.Windows.Forms.Label lblS5Port; + private System.Windows.Forms.TextBox txtS5Server; + private System.Windows.Forms.NumericUpDown nudS5Port; + private System.Windows.Forms.Label lblS5Username; + private System.Windows.Forms.CheckBox chkSockProxy; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.Button MyCancelButton; - private System.Windows.Forms.Button OKButton; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.NumericUpDown NumProxyPort; - private System.Windows.Forms.Label ProxyPortLabel; - private System.Windows.Forms.Label ReconnectLabel; - private System.Windows.Forms.NumericUpDown NumReconnect; - private System.Windows.Forms.Label TTLLabel; - private System.Windows.Forms.NumericUpDown NumTTL; + private System.Windows.Forms.NumericUpDown nudProxyPort; + private System.Windows.Forms.Label lblProxyPort; + private System.Windows.Forms.Label lblReconnect; + private System.Windows.Forms.NumericUpDown nudReconnect; + private System.Windows.Forms.Label lblTtl; + private System.Windows.Forms.NumericUpDown nudTTL; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Label LabelRandom; - private System.Windows.Forms.ComboBox RandomComboBox; - private System.Windows.Forms.CheckBox CheckAutoBan; - private System.Windows.Forms.CheckBox checkRandom; - private System.Windows.Forms.CheckBox checkAutoStartup; + private System.Windows.Forms.Label lblBalance; + private System.Windows.Forms.ComboBox cmbBalance; + private System.Windows.Forms.CheckBox chkAutoBan; + private System.Windows.Forms.CheckBox chkBalance; + private System.Windows.Forms.CheckBox chkAutoStartup; private System.Windows.Forms.CheckBox checkShareOverLan; - private System.Windows.Forms.ComboBox comboProxyType; - private System.Windows.Forms.GroupBox ListenGroup; + private System.Windows.Forms.ComboBox cmbProxyType; + private System.Windows.Forms.GroupBox gbxListen; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.TextBox TextAuthPass; - private System.Windows.Forms.Label LabelAuthPass; - private System.Windows.Forms.TextBox TextAuthUser; - private System.Windows.Forms.Label LabelAuthUser; - private System.Windows.Forms.CheckBox checkBoxPacProxy; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox TextUserAgent; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox DNSText; - private System.Windows.Forms.Label labelTimeout; - private System.Windows.Forms.NumericUpDown NumTimeout; - private System.Windows.Forms.Button buttonDefault; - private System.Windows.Forms.CheckBox checkBalanceInGroup; - private System.Windows.Forms.CheckBox checkSwitchAutoCloseAll; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox LocalDNSText; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; - private System.Windows.Forms.Label LabelLogging; - private System.Windows.Forms.CheckBox CheckLogEnable; + private System.Windows.Forms.TextBox txtAuthPass; + private System.Windows.Forms.Label lblAuthPass; + private System.Windows.Forms.TextBox txtAuthUser; + private System.Windows.Forms.Label lblAuthUser; + private System.Windows.Forms.CheckBox chkPacProxy; + private System.Windows.Forms.Label lblUserAgent; + private System.Windows.Forms.TextBox txtUserAgent; + private System.Windows.Forms.Label lblDns; + private System.Windows.Forms.TextBox txtDNS; + private System.Windows.Forms.Label lblTimeout; + private System.Windows.Forms.NumericUpDown nudTimeout; + private System.Windows.Forms.Button btnDefault; + private System.Windows.Forms.CheckBox chkBalanceInGroup; + private System.Windows.Forms.CheckBox chkSwitchAutoCloseAll; + private System.Windows.Forms.Label lblLocalDns; + private System.Windows.Forms.TextBox txtLocalDNS; + private System.Windows.Forms.CheckBox chkLogEnable; + private System.Windows.Forms.Label lblLogging; } } \ No newline at end of file diff --git a/shadowsocks-csharp/View/SettingsForm.cs b/shadowsocks-csharp/View/SettingsForm.cs index ed9576e3..f3df22dd 100644 --- a/shadowsocks-csharp/View/SettingsForm.cs +++ b/shadowsocks-csharp/View/SettingsForm.cs @@ -30,32 +30,34 @@ public SettingsForm(ShadowsocksController controller) controller.ConfigChanged += controller_ConfigChanged; int dpi_mul = Util.Utils.GetDpiMul(); - //int font_height = 9; - //Font new_font = new Font("Arial", (float)(9.0 * dpi_mul / 4)); - //this.Font = new_font; - - //comboProxyType.Height = comboProxyType.Height - font_height + font_height * dpi_mul / 4; - comboProxyType.Width = comboProxyType.Width * dpi_mul / 4; - //RandomComboBox.Height = RandomComboBox.Height - font_height + font_height * dpi_mul / 4; - RandomComboBox.Width = RandomComboBox.Width * dpi_mul / 4; - - TextS5Server.Width = TextS5Server.Width * dpi_mul / 4; - NumS5Port.Width = NumS5Port.Width * dpi_mul / 4; - TextS5User.Width = TextS5User.Width * dpi_mul / 4; - TextS5Pass.Width = TextS5Pass.Width * dpi_mul / 4; - TextUserAgent.Width = TextUserAgent.Width * dpi_mul / 4; - - NumProxyPort.Width = NumProxyPort.Width * dpi_mul / 4; - TextAuthUser.Width = TextAuthUser.Width * dpi_mul / 4; - TextAuthPass.Width = TextAuthPass.Width * dpi_mul / 4; - - buttonDefault.Height = buttonDefault.Height * dpi_mul / 4; - buttonDefault.Width = buttonDefault.Width * dpi_mul / 4; - DNSText.Width = DNSText.Width * dpi_mul / 4; - LocalDNSText.Width = LocalDNSText.Width * dpi_mul / 4; - NumReconnect.Width = NumReconnect.Width * dpi_mul / 4; - NumTimeout.Width = NumTimeout.Width * dpi_mul / 4; - NumTTL.Width = NumTTL.Width * dpi_mul / 4; + + //comment + ////int font_height = 9; + ////Font new_font = new Font("Arial", (float)(9.0 * dpi_mul / 4)); + ////this.Font = new_font; + + ////comboProxyType.Height = comboProxyType.Height - font_height + font_height * dpi_mul / 4; + //comboProxyType.Width = comboProxyType.Width * dpi_mul / 4; + ////RandomComboBox.Height = RandomComboBox.Height - font_height + font_height * dpi_mul / 4; + //RandomComboBox.Width = RandomComboBox.Width * dpi_mul / 4; + + //TextS5Server.Width = TextS5Server.Width * dpi_mul / 4; + //NumS5Port.Width = NumS5Port.Width * dpi_mul / 4; + //TextS5User.Width = TextS5User.Width * dpi_mul / 4; + //TextS5Pass.Width = TextS5Pass.Width * dpi_mul / 4; + //TextUserAgent.Width = TextUserAgent.Width * dpi_mul / 4; + + //NumProxyPort.Width = NumProxyPort.Width * dpi_mul / 4; + //TextAuthUser.Width = TextAuthUser.Width * dpi_mul / 4; + //TextAuthPass.Width = TextAuthPass.Width * dpi_mul / 4; + + //buttonDefault.Height = buttonDefault.Height * dpi_mul / 4; + //buttonDefault.Width = buttonDefault.Width * dpi_mul / 4; + //DNSText.Width = DNSText.Width * dpi_mul / 4; + //LocalDNSText.Width = LocalDNSText.Width * dpi_mul / 4; + //NumReconnect.Width = NumReconnect.Width * dpi_mul / 4; + //NumTimeout.Width = NumTimeout.Width * dpi_mul / 4; + //NumTTL.Width = NumTTL.Width * dpi_mul / 4; LoadCurrentConfiguration(); } @@ -67,50 +69,53 @@ private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e) private void UpdateTexts() { this.Text = I18N.GetString("Global Settings") + "(" - + (controller.GetCurrentConfiguration().shareOverLan ? "any" : "local") + ":" + controller.GetCurrentConfiguration().localPort.ToString() - + I18N.GetString(" Version") + UpdateChecker.FullVersion + + (controller.GetCurrentConfiguration().shareOverLan ? I18N.GetString("Any") : I18N.GetString("Local")) + ":" + controller.GetCurrentConfiguration().localPort.ToString() + + " " + I18N.GetString("Version") + ":" + UpdateChecker.FullVersion + ")"; - ListenGroup.Text = I18N.GetString(ListenGroup.Text); + gbxListen.Text = I18N.GetString(gbxListen.Text); checkShareOverLan.Text = I18N.GetString(checkShareOverLan.Text); - ProxyPortLabel.Text = I18N.GetString("Proxy Port"); - buttonDefault.Text = I18N.GetString("Set Default"); - ReconnectLabel.Text = I18N.GetString("Reconnect Times"); - TTLLabel.Text = I18N.GetString("TTL"); - labelTimeout.Text = I18N.GetString(labelTimeout.Text); - - checkAutoStartup.Text = I18N.GetString(checkAutoStartup.Text); - checkSwitchAutoCloseAll.Text = I18N.GetString(checkSwitchAutoCloseAll.Text); - checkRandom.Text = I18N.GetString(checkRandom.Text); - CheckAutoBan.Text = I18N.GetString("AutoBan"); - CheckLogEnable.Text = I18N.GetString("Enable Log"); - - Socks5ProxyGroup.Text = I18N.GetString(Socks5ProxyGroup.Text); - checkBoxPacProxy.Text = I18N.GetString(checkBoxPacProxy.Text); - CheckSockProxy.Text = I18N.GetString("Proxy On"); - LabelS5Server.Text = I18N.GetString("Server IP"); - LabelS5Port.Text = I18N.GetString("Server Port"); - LabelS5Server.Text = I18N.GetString("Server IP"); - LabelS5Port.Text = I18N.GetString("Server Port"); - LabelS5Username.Text = I18N.GetString("Username"); - LabelS5Password.Text = I18N.GetString("Password"); - LabelAuthUser.Text = I18N.GetString("Username"); - LabelAuthPass.Text = I18N.GetString("Password"); - - LabelRandom.Text = I18N.GetString("Balance"); - for (int i = 0; i < comboProxyType.Items.Count; ++i) + lblProxyPort.Text = I18N.GetString("Proxy Port"); + btnDefault.Text = I18N.GetString("Set Default"); + lblLocalDns.Text = I18N.GetString("Local Dns"); + lblReconnect.Text = I18N.GetString("Reconnect Times"); + lblTtl.Text = I18N.GetString("TTL"); + lblTimeout.Text = I18N.GetString(lblTimeout.Text); + + chkAutoStartup.Text = I18N.GetString(chkAutoStartup.Text); + chkSwitchAutoCloseAll.Text = I18N.GetString(chkSwitchAutoCloseAll.Text); + chkBalance.Text = I18N.GetString(chkBalance.Text); + chkAutoBan.Text = I18N.GetString("AutoBan"); + lblLogging.Text = I18N.GetString("Logging"); + chkLogEnable.Text = I18N.GetString("Enable Log"); + + gbxSocks5Proxy.Text = I18N.GetString(gbxSocks5Proxy.Text); + chkPacProxy.Text = I18N.GetString(chkPacProxy.Text); + chkSockProxy.Text = I18N.GetString("Proxy On"); + lblS5Server.Text = I18N.GetString("Server IP"); + lblS5Port.Text = I18N.GetString("Server Port"); + lblS5Server.Text = I18N.GetString("Server IP"); + lblS5Port.Text = I18N.GetString("Server Port"); + lblS5Username.Text = I18N.GetString("Username"); + lblS5Password.Text = I18N.GetString("Password"); + lblUserAgent.Text = I18N.GetString("User Agent"); + lblAuthUser.Text = I18N.GetString("Username"); + lblAuthPass.Text = I18N.GetString("Password"); + + lblBalance.Text = I18N.GetString("Balance"); + for (int i = 0; i < cmbProxyType.Items.Count; ++i) { - comboProxyType.Items[i] = I18N.GetString(comboProxyType.Items[i].ToString()); + cmbProxyType.Items[i] = I18N.GetString(cmbProxyType.Items[i].ToString()); } - checkBalanceInGroup.Text = I18N.GetString("Balance in group"); - for (int i = 0; i < RandomComboBox.Items.Count; ++i) + chkBalanceInGroup.Text = I18N.GetString("Balance in group"); + for (int i = 0; i < cmbBalance.Items.Count; ++i) { - _balanceIndexMap[i] = RandomComboBox.Items[i].ToString(); - RandomComboBox.Items[i] = I18N.GetString(RandomComboBox.Items[i].ToString()); + _balanceIndexMap[i] = cmbBalance.Items[i].ToString(); + cmbBalance.Items[i] = I18N.GetString(cmbBalance.Items[i].ToString()); } - OKButton.Text = I18N.GetString("OK"); - MyCancelButton.Text = I18N.GetString("Cancel"); + btnOK.Text = I18N.GetString("OK"); + btnCancel.Text = I18N.GetString("Cancel"); } private void controller_ConfigChanged(object sender, EventArgs e) @@ -128,38 +133,38 @@ private int SaveOldSelectedServer() { try { - int localPort = int.Parse(NumProxyPort.Text); + int localPort = int.Parse(nudProxyPort.Text); Configuration.CheckPort(localPort); int ret = 0; _modifiedConfiguration.shareOverLan = checkShareOverLan.Checked; _modifiedConfiguration.localPort = localPort; - _modifiedConfiguration.reconnectTimes = NumReconnect.Text.Length == 0 ? 0 : int.Parse(NumReconnect.Text); + _modifiedConfiguration.reconnectTimes = nudReconnect.Text.Length == 0 ? 0 : int.Parse(nudReconnect.Text); - if (checkAutoStartup.Checked != AutoStartup.Check() && !AutoStartup.Set(checkAutoStartup.Checked)) + if (chkAutoStartup.Checked != AutoStartup.Check() && !AutoStartup.Set(chkAutoStartup.Checked)) { MessageBox.Show(I18N.GetString("Failed to update registry")); } - _modifiedConfiguration.random = checkRandom.Checked; - _modifiedConfiguration.balanceAlgorithm = RandomComboBox.SelectedIndex >= 0 && RandomComboBox.SelectedIndex < _balanceIndexMap.Count ? _balanceIndexMap[RandomComboBox.SelectedIndex] : "OneByOne"; - _modifiedConfiguration.randomInGroup = checkBalanceInGroup.Checked; - _modifiedConfiguration.TTL = Convert.ToInt32(NumTTL.Value); - _modifiedConfiguration.connectTimeout = Convert.ToInt32(NumTimeout.Value); - _modifiedConfiguration.dnsServer = DNSText.Text; - _modifiedConfiguration.localDnsServer = LocalDNSText.Text; - _modifiedConfiguration.proxyEnable = CheckSockProxy.Checked; - _modifiedConfiguration.pacDirectGoProxy = checkBoxPacProxy.Checked; - _modifiedConfiguration.proxyType = comboProxyType.SelectedIndex; - _modifiedConfiguration.proxyHost = TextS5Server.Text; - _modifiedConfiguration.proxyPort = Convert.ToInt32(NumS5Port.Value); - _modifiedConfiguration.proxyAuthUser = TextS5User.Text; - _modifiedConfiguration.proxyAuthPass = TextS5Pass.Text; - _modifiedConfiguration.proxyUserAgent = TextUserAgent.Text; - _modifiedConfiguration.authUser = TextAuthUser.Text; - _modifiedConfiguration.authPass = TextAuthPass.Text; - - _modifiedConfiguration.autoBan = CheckAutoBan.Checked; - _modifiedConfiguration.checkSwitchAutoCloseAll = checkSwitchAutoCloseAll.Checked; - _modifiedConfiguration.logEnable = CheckLogEnable.Checked; + _modifiedConfiguration.random = chkBalance.Checked; + _modifiedConfiguration.balanceAlgorithm = cmbBalance.SelectedIndex >= 0 && cmbBalance.SelectedIndex < _balanceIndexMap.Count ? _balanceIndexMap[cmbBalance.SelectedIndex] : "OneByOne"; + _modifiedConfiguration.randomInGroup = chkBalanceInGroup.Checked; + _modifiedConfiguration.TTL = Convert.ToInt32(nudTTL.Value); + _modifiedConfiguration.connectTimeout = Convert.ToInt32(nudTimeout.Value); + _modifiedConfiguration.dnsServer = txtDNS.Text; + _modifiedConfiguration.localDnsServer = txtLocalDNS.Text; + _modifiedConfiguration.proxyEnable = chkSockProxy.Checked; + _modifiedConfiguration.pacDirectGoProxy = chkPacProxy.Checked; + _modifiedConfiguration.proxyType = cmbProxyType.SelectedIndex; + _modifiedConfiguration.proxyHost = txtS5Server.Text; + _modifiedConfiguration.proxyPort = Convert.ToInt32(nudS5Port.Value); + _modifiedConfiguration.proxyAuthUser = txtS5User.Text; + _modifiedConfiguration.proxyAuthPass = txtS5Pass.Text; + _modifiedConfiguration.proxyUserAgent = txtUserAgent.Text; + _modifiedConfiguration.authUser = txtAuthUser.Text; + _modifiedConfiguration.authPass = txtAuthPass.Text; + + _modifiedConfiguration.autoBan = chkAutoBan.Checked; + _modifiedConfiguration.checkSwitchAutoCloseAll = chkSwitchAutoCloseAll.Checked; + _modifiedConfiguration.logEnable = chkLogEnable.Checked; return ret; } @@ -173,11 +178,11 @@ private int SaveOldSelectedServer() private void LoadSelectedServer() { checkShareOverLan.Checked = _modifiedConfiguration.shareOverLan; - NumProxyPort.Value = _modifiedConfiguration.localPort; - NumReconnect.Value = _modifiedConfiguration.reconnectTimes; + nudProxyPort.Value = _modifiedConfiguration.localPort; + nudReconnect.Value = _modifiedConfiguration.reconnectTimes; - checkAutoStartup.Checked = AutoStartup.Check(); - checkRandom.Checked = _modifiedConfiguration.random; + chkAutoStartup.Checked = AutoStartup.Check(); + chkBalance.Checked = _modifiedConfiguration.random; int selectedIndex = 0; for (int i = 0; i < _balanceIndexMap.Count; ++i) { @@ -187,27 +192,27 @@ private void LoadSelectedServer() break; } } - RandomComboBox.SelectedIndex = selectedIndex; - checkBalanceInGroup.Checked = _modifiedConfiguration.randomInGroup; - NumTTL.Value = _modifiedConfiguration.TTL; - NumTimeout.Value = _modifiedConfiguration.connectTimeout; - DNSText.Text = _modifiedConfiguration.dnsServer; - LocalDNSText.Text = _modifiedConfiguration.localDnsServer; - - CheckSockProxy.Checked = _modifiedConfiguration.proxyEnable; - checkBoxPacProxy.Checked = _modifiedConfiguration.pacDirectGoProxy; - comboProxyType.SelectedIndex = _modifiedConfiguration.proxyType; - TextS5Server.Text = _modifiedConfiguration.proxyHost; - NumS5Port.Value = _modifiedConfiguration.proxyPort; - TextS5User.Text = _modifiedConfiguration.proxyAuthUser; - TextS5Pass.Text = _modifiedConfiguration.proxyAuthPass; - TextUserAgent.Text = _modifiedConfiguration.proxyUserAgent; - TextAuthUser.Text = _modifiedConfiguration.authUser; - TextAuthPass.Text = _modifiedConfiguration.authPass; - - CheckAutoBan.Checked = _modifiedConfiguration.autoBan; - checkSwitchAutoCloseAll.Checked = _modifiedConfiguration.checkSwitchAutoCloseAll; - CheckLogEnable.Checked = _modifiedConfiguration.logEnable; + cmbBalance.SelectedIndex = selectedIndex; + chkBalanceInGroup.Checked = _modifiedConfiguration.randomInGroup; + nudTTL.Value = _modifiedConfiguration.TTL; + nudTimeout.Value = _modifiedConfiguration.connectTimeout; + txtDNS.Text = _modifiedConfiguration.dnsServer; + txtLocalDNS.Text = _modifiedConfiguration.localDnsServer; + + chkSockProxy.Checked = _modifiedConfiguration.proxyEnable; + chkPacProxy.Checked = _modifiedConfiguration.pacDirectGoProxy; + cmbProxyType.SelectedIndex = _modifiedConfiguration.proxyType; + txtS5Server.Text = _modifiedConfiguration.proxyHost; + nudS5Port.Value = _modifiedConfiguration.proxyPort; + txtS5User.Text = _modifiedConfiguration.proxyAuthUser; + txtS5Pass.Text = _modifiedConfiguration.proxyAuthPass; + txtUserAgent.Text = _modifiedConfiguration.proxyUserAgent; + txtAuthUser.Text = _modifiedConfiguration.authUser; + txtAuthPass.Text = _modifiedConfiguration.authPass; + + chkAutoBan.Checked = _modifiedConfiguration.autoBan; + chkSwitchAutoCloseAll.Checked = _modifiedConfiguration.checkSwitchAutoCloseAll; + chkLogEnable.Checked = _modifiedConfiguration.logEnable; } private void LoadCurrentConfiguration() @@ -233,17 +238,17 @@ private void CancelButton_Click(object sender, EventArgs e) private void buttonDefault_Click(object sender, EventArgs e) { - if (CheckSockProxy.Checked) + if (chkSockProxy.Checked) { - NumReconnect.Value = 4; - NumTimeout.Value = 10; - NumTTL.Value = 60; + nudReconnect.Value = 4; + nudTimeout.Value = 10; + nudTTL.Value = 60; } else { - NumReconnect.Value = 4; - NumTimeout.Value = 5; - NumTTL.Value = 60; + nudReconnect.Value = 4; + nudTimeout.Value = 5; + nudTTL.Value = 60; } } }