From 70ec5df5b0f8926ca509dfb1ddce048a3a9ab169 Mon Sep 17 00:00:00 2001 From: Opportunity Date: Sat, 12 May 2018 20:31:59 +0800 Subject: [PATCH] Add temp folder path selection (#1827) * Translation * Environment Variables support --- .../Controller/ShadowsocksController.cs | 11 +- shadowsocks-csharp/Data/zh_CN.txt | 3 +- shadowsocks-csharp/Data/zh_TW.txt | 1 + shadowsocks-csharp/Model/Configuration.cs | 8 + .../Util/SystemProxy/Sysproxy.cs | 34 +- shadowsocks-csharp/Util/Util.cs | 36 +- .../View/ConfigForm.Designer.cs | 1367 +++++++++-------- shadowsocks-csharp/View/ConfigForm.cs | 14 +- shadowsocks-csharp/View/ConfigForm.resx | 376 ++--- 9 files changed, 904 insertions(+), 946 deletions(-) diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 55e6b1ce..ca5ffdb1 100644 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -182,6 +182,12 @@ namespace Shadowsocks.Controller Configuration.Save(_config); } + public void SaveTempFolder(string tempFolder) + { + _config.tempFolder = tempFolder; + Configuration.Save(_config); + } + public void SaveStrategyConfigurations(StatisticsStrategyConfiguration configuration) { StatisticsConfiguration = configuration; @@ -250,7 +256,8 @@ namespace Shadowsocks.Controller { _config.isVerboseLogging = enabled; SaveConfig(_config); - if ( VerboseLoggingStatusChanged != null ) { + if (VerboseLoggingStatusChanged != null) + { VerboseLoggingStatusChanged(this, new EventArgs()); } } @@ -656,7 +663,7 @@ namespace Shadowsocks.Controller { previous = trafficPerSecondQueue.Last(); current = new TrafficPerSecond(); - + current.inboundCounter = InboundCounter; current.outboundCounter = OutboundCounter; current.inboundIncreasement = current.inboundCounter - previous.inboundCounter; diff --git a/shadowsocks-csharp/Data/zh_CN.txt b/shadowsocks-csharp/Data/zh_CN.txt index 48511750..b8bf5018 100644 --- a/shadowsocks-csharp/Data/zh_CN.txt +++ b/shadowsocks-csharp/Data/zh_CN.txt @@ -62,6 +62,7 @@ Cancel=取消 New server=未配置的服务器 Move &Up=上移(&U) Move D&own=下移(&O) +Temp Folder=临时文件夹 # Proxy Form @@ -144,4 +145,4 @@ Proxy request failed=代理请求失败 Proxy handshake failed=代理握手失败 Register hotkey failed=注册热键失败 Cannot parse hotkey: {0}=解析热键失败: {0} -Timeout is invalid, it should not exceed {0}=超时无效,不应超过 {0} +Timeout is invalid, it should not exceed {0}=超时无效,不应超过 {0} \ No newline at end of file diff --git a/shadowsocks-csharp/Data/zh_TW.txt b/shadowsocks-csharp/Data/zh_TW.txt index d0d29c95..b8164ada 100644 --- a/shadowsocks-csharp/Data/zh_TW.txt +++ b/shadowsocks-csharp/Data/zh_TW.txt @@ -62,6 +62,7 @@ Cancel=取消 New server=新伺服器 Move &Up=上移 (&U) Move D&own=下移 (&O) +Temp Folder=臨時資料夾 # Proxy Form diff --git a/shadowsocks-csharp/Model/Configuration.cs b/shadowsocks-csharp/Model/Configuration.cs index 4b6f49c9..68762b88 100644 --- a/shadowsocks-csharp/Model/Configuration.cs +++ b/shadowsocks-csharp/Model/Configuration.cs @@ -30,6 +30,7 @@ namespace Shadowsocks.Model public LogViewerConfig logViewer; public ProxyConfig proxy; public HotkeyConfig hotkey; + public string tempFolder; private static string CONFIG_FILE = "gui-config.json"; @@ -145,6 +146,13 @@ namespace Shadowsocks.Model throw new ArgumentException(I18N.GetString("Port can't be 8123")); } + public static void CheckTempFolder(string tempPath) + { + if (string.IsNullOrWhiteSpace(tempPath)) + return; + Path.GetFullPath(tempPath); + } + private static void CheckPassword(string password) { if (password.IsNullOrEmpty()) diff --git a/shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs b/shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs index 0002f8fd..a97a6ae8 100644 --- a/shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs +++ b/shadowsocks-csharp/Util/SystemProxy/Sysproxy.cs @@ -35,7 +35,8 @@ namespace Shadowsocks.Util.SystemProxy static Sysproxy() { - try { + try + { FileManager.UncompressFile(Utils.GetTempPath("sysproxy.exe"), Environment.Is64BitOperatingSystem ? Resources.sysproxy64_exe : Resources.sysproxy_exe); } @@ -111,8 +112,10 @@ namespace Shadowsocks.Util.SystemProxy throw new ProxyException(stderr); } - if (arguments == "query") { - if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty()) { + if (arguments == "query") + { + if (stdout.IsNullOrWhiteSpace() || stdout.IsNullOrEmpty()) + { // we cannot get user settings throw new ProxyException("failed to query wininet settings"); } @@ -123,25 +126,34 @@ namespace Shadowsocks.Util.SystemProxy private static void Save() { - try { - using (StreamWriter sw = new StreamWriter(File.Open(_userWininetConfigFile, FileMode.Create))) { + try + { + using (StreamWriter sw = new StreamWriter(File.Open(Utils.GetTempPath(_userWininetConfigFile), FileMode.Create))) + { string jsonString = JsonConvert.SerializeObject(_userSettings, Formatting.Indented); sw.Write(jsonString); sw.Flush(); } - } catch (IOException e) { + } + catch (IOException e) + { Logging.LogUsefulException(e); } } private static void Read() { - try { - string configContent = File.ReadAllText(_userWininetConfigFile); + try + { + string configContent = File.ReadAllText(Utils.GetTempPath(_userWininetConfigFile)); _userSettings = JsonConvert.DeserializeObject(configContent); - } catch(Exception) { - // Suppress all exceptions. finally block will initialize new user config settings. - } finally { + } + catch (Exception) + { + // Suppress all exceptions. finally block will initialize new user config settings. + } + finally + { if (_userSettings == null) _userSettings = new SysproxyConfig(); } } diff --git a/shadowsocks-csharp/Util/Util.cs b/shadowsocks-csharp/Util/Util.cs index ceda5c11..d28fb3a2 100755 --- a/shadowsocks-csharp/Util/Util.cs +++ b/shadowsocks-csharp/Util/Util.cs @@ -2,10 +2,12 @@ using System.Diagnostics; using System.IO; using System.IO.Compression; +using System.Linq; using System.Runtime.InteropServices; using System.Windows.Forms; using Microsoft.Win32; using Shadowsocks.Controller; +using Shadowsocks.Model; namespace Shadowsocks.Util { @@ -26,6 +28,24 @@ namespace Shadowsocks.Util public static class Utils { private static string _tempPath = null; + private const string TEMP_LOG = "temp.log"; + private static readonly string[] COMMON_ENV = + { + "%Tmp%", + "%Temp%", + "%AppData%", + "%LocalAppData%", + "%Home%", + "%UserProfile%", + "%Public%", + "%CommonProgramFiles%", + "%CommonProgramFiles(x86)%", + "%CommonProgramW6432%", + "%ProgramFiles%", + "%ProgramFiles(x86)%", + "%ProgramW6432%", + "%ProgramData%", + }; // return path to store temporary files public static string GetTempPath() @@ -34,9 +54,19 @@ namespace Shadowsocks.Util { try { - Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ss_win_temp")); - // don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log - _tempPath = Path.Combine(Application.StartupPath, "ss_win_temp"); + var tempFolder = Configuration.Load().tempFolder; + if (string.IsNullOrWhiteSpace(tempFolder)) + // don't use "/", it will fail when we call explorer /select xxx/ss_win_temp\xxx.log + tempFolder = "ss_win_temp"; + else if (COMMON_ENV.Contains(tempFolder, StringComparer.OrdinalIgnoreCase)) + // add subfolder for these common folders + tempFolder += (@"\Shadowsocks\ss_win_temp_" + Application.ExecutablePath.GetHashCode()); + + tempFolder = Environment.ExpandEnvironmentVariables(tempFolder); + // If `tempFolder` is an absolute path, `Application.StartupPath` will be ignored. + var tempDirectory = Directory.CreateDirectory(Path.Combine(Application.StartupPath, tempFolder)); + _tempPath = tempDirectory.FullName; + File.AppendAllText(Path.Combine(_tempPath, TEMP_LOG), $"[{DateTimeOffset.Now.ToString("u")}] Temp folder used by \"{Application.ExecutablePath}\"{Environment.NewLine}"); } catch (Exception e) { diff --git a/shadowsocks-csharp/View/ConfigForm.Designer.cs b/shadowsocks-csharp/View/ConfigForm.Designer.cs index 5b694bc4..4ec5dfcc 100755 --- a/shadowsocks-csharp/View/ConfigForm.Designer.cs +++ b/shadowsocks-csharp/View/ConfigForm.Designer.cs @@ -1,671 +1,696 @@ -namespace Shadowsocks.View -{ - partial class ConfigForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.PluginOptionsLabel = new System.Windows.Forms.Label(); - this.PluginTextBox = new System.Windows.Forms.TextBox(); - this.RemarksTextBox = new System.Windows.Forms.TextBox(); - this.IPLabel = new System.Windows.Forms.Label(); - this.ServerPortLabel = new System.Windows.Forms.Label(); - this.PasswordLabel = new System.Windows.Forms.Label(); - this.IPTextBox = new System.Windows.Forms.TextBox(); - this.ServerPortTextBox = new System.Windows.Forms.TextBox(); - this.PasswordTextBox = new System.Windows.Forms.TextBox(); - this.EncryptionLabel = new System.Windows.Forms.Label(); - this.EncryptionSelect = new System.Windows.Forms.ComboBox(); - this.TimeoutLabel = new System.Windows.Forms.Label(); - this.TimeoutTextBox = new System.Windows.Forms.TextBox(); - this.PluginLabel = new System.Windows.Forms.Label(); - this.PluginOptionsTextBox = new System.Windows.Forms.TextBox(); - this.ShowPasswdCheckBox = new System.Windows.Forms.CheckBox(); - this.RemarksLabel = new System.Windows.Forms.Label(); - this.PluginArgumentsTextBox = new System.Windows.Forms.TextBox(); - this.PluginArgumentsLabel = new System.Windows.Forms.Label(); - this.panel2 = new System.Windows.Forms.Panel(); - this.OKButton = new System.Windows.Forms.Button(); - this.MyCancelButton = new System.Windows.Forms.Button(); - this.DeleteButton = new System.Windows.Forms.Button(); - this.AddButton = new System.Windows.Forms.Button(); - this.ServerGroupBox = new System.Windows.Forms.GroupBox(); - this.ServersListBox = new System.Windows.Forms.ListBox(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); - this.MoveDownButton = new System.Windows.Forms.Button(); - this.MoveUpButton = new System.Windows.Forms.Button(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.ProxyPortTextBox = new System.Windows.Forms.TextBox(); - this.ProxyPortLabel = new System.Windows.Forms.Label(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.DuplicateButton = new System.Windows.Forms.Button(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.tableLayoutPanel1.SuspendLayout(); - this.ServerGroupBox.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel6.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); - this.SuspendLayout(); - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.AutoSize = true; - this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - 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.PluginOptionsLabel, 0, 6); - this.tableLayoutPanel1.Controls.Add(this.PluginTextBox, 1, 5); - this.tableLayoutPanel1.Controls.Add(this.RemarksTextBox, 1, 9); - this.tableLayoutPanel1.Controls.Add(this.IPLabel, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.ServerPortLabel, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.PasswordLabel, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.IPTextBox, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.ServerPortTextBox, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.EncryptionLabel, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 4); - this.tableLayoutPanel1.Controls.Add(this.TimeoutLabel, 0, 10); - this.tableLayoutPanel1.Controls.Add(this.TimeoutTextBox, 1, 10); - this.tableLayoutPanel1.Controls.Add(this.PluginLabel, 0, 5); - this.tableLayoutPanel1.Controls.Add(this.PluginOptionsTextBox, 1, 6); - this.tableLayoutPanel1.Controls.Add(this.ShowPasswdCheckBox, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.PluginArgumentsTextBox, 1, 7); - this.tableLayoutPanel1.Controls.Add(this.PluginArgumentsLabel, 0, 7); - this.tableLayoutPanel1.Controls.Add(this.RemarksLabel, 0, 9); - this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 21); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); - this.tableLayoutPanel1.RowCount = 11; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(279, 270); - this.tableLayoutPanel1.TabIndex = 0; - // - // PluginOptionsLabel - // - this.PluginOptionsLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.PluginOptionsLabel.AutoSize = true; - this.PluginOptionsLabel.Location = new System.Drawing.Point(18, 166); - this.PluginOptionsLabel.Name = "PluginOptionsLabel"; - this.PluginOptionsLabel.Size = new System.Drawing.Size(89, 12); - this.PluginOptionsLabel.TabIndex = 6; - this.PluginOptionsLabel.Text = "Plugin Options"; - this.toolTip1.SetToolTip(this.PluginOptionsLabel, "Environment variables"); - // - // PluginTextBox - // - this.PluginTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.PluginTextBox.Location = new System.Drawing.Point(113, 135); - this.PluginTextBox.MaxLength = 256; - this.PluginTextBox.Name = "PluginTextBox"; - this.PluginTextBox.Size = new System.Drawing.Size(160, 21); - this.PluginTextBox.TabIndex = 5; - this.PluginTextBox.WordWrap = false; - // - // 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(113, 216); - this.RemarksTextBox.MaxLength = 32; - this.RemarksTextBox.Name = "RemarksTextBox"; - this.RemarksTextBox.Size = new System.Drawing.Size(160, 21); - this.RemarksTextBox.TabIndex = 8; - this.RemarksTextBox.WordWrap = false; - // - // IPLabel - // - this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.IPLabel.AutoSize = true; - this.IPLabel.Location = new System.Drawing.Point(48, 10); - this.IPLabel.Name = "IPLabel"; - this.IPLabel.Size = new System.Drawing.Size(59, 12); - this.IPLabel.TabIndex = 0; - this.IPLabel.Text = "Server IP"; - // - // ServerPortLabel - // - this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ServerPortLabel.AutoSize = true; - this.ServerPortLabel.Location = new System.Drawing.Point(36, 37); - this.ServerPortLabel.Name = "ServerPortLabel"; - this.ServerPortLabel.Size = new System.Drawing.Size(71, 12); - this.ServerPortLabel.TabIndex = 1; - this.ServerPortLabel.Text = "Server Port"; - // - // PasswordLabel - // - this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.PasswordLabel.AutoSize = true; - this.PasswordLabel.Location = new System.Drawing.Point(54, 64); - this.PasswordLabel.Name = "PasswordLabel"; - this.PasswordLabel.Size = new System.Drawing.Size(53, 12); - this.PasswordLabel.TabIndex = 2; - this.PasswordLabel.Text = "Password"; - this.PasswordLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // 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(113, 6); - this.IPTextBox.MaxLength = 512; - this.IPTextBox.Name = "IPTextBox"; - this.IPTextBox.Size = new System.Drawing.Size(160, 21); - this.IPTextBox.TabIndex = 0; - this.IPTextBox.WordWrap = false; - // - // ServerPortTextBox - // - this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.ServerPortTextBox.Location = new System.Drawing.Point(113, 33); - this.ServerPortTextBox.MaxLength = 10; - this.ServerPortTextBox.Name = "ServerPortTextBox"; - this.ServerPortTextBox.Size = new System.Drawing.Size(160, 21); - this.ServerPortTextBox.TabIndex = 1; - this.ServerPortTextBox.WordWrap = false; - // - // 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(113, 60); - this.PasswordTextBox.MaxLength = 256; - this.PasswordTextBox.Name = "PasswordTextBox"; - this.PasswordTextBox.Size = new System.Drawing.Size(160, 21); - this.PasswordTextBox.TabIndex = 2; - 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(42, 113); - this.EncryptionLabel.Name = "EncryptionLabel"; - this.EncryptionLabel.Size = new System.Drawing.Size(65, 12); - this.EncryptionLabel.TabIndex = 4; - this.EncryptionLabel.Text = "Encryption"; - // - // EncryptionSelect - // - this.EncryptionSelect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.EncryptionSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.EncryptionSelect.FormattingEnabled = true; - this.EncryptionSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.EncryptionSelect.ItemHeight = 12; - this.EncryptionSelect.Items.AddRange(new object[] { - "rc4-md5", - "salsa20", - "chacha20", - "chacha20-ietf", - "aes-256-cfb", - "aes-192-cfb", - "aes-128-cfb", - "aes-256-ctr", - "aes-192-ctr", - "aes-128-ctr", - "bf-cfb", - "camellia-128-cfb", - "camellia-192-cfb", - "camellia-256-cfb", - "aes-128-gcm", - "aes-192-gcm", - "aes-256-gcm", - "chacha20-ietf-poly1305", - "xchacha20-ietf-poly1305"}); - this.EncryptionSelect.Location = new System.Drawing.Point(113, 109); - this.EncryptionSelect.Name = "EncryptionSelect"; - this.EncryptionSelect.Size = new System.Drawing.Size(160, 20); - this.EncryptionSelect.TabIndex = 4; - // - // TimeoutLabel - // - this.TimeoutLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.TimeoutLabel.AutoSize = true; - this.TimeoutLabel.Location = new System.Drawing.Point(30, 247); - this.TimeoutLabel.Name = "TimeoutLabel"; - this.TimeoutLabel.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.TimeoutLabel.Size = new System.Drawing.Size(77, 12); - this.TimeoutLabel.TabIndex = 9; - this.TimeoutLabel.Text = "Timeout(Sec)"; - // - // TimeoutTextBox - // - this.TimeoutTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.TimeoutTextBox.Location = new System.Drawing.Point(113, 243); - this.TimeoutTextBox.MaxLength = 5; - this.TimeoutTextBox.Name = "TimeoutTextBox"; - this.TimeoutTextBox.Size = new System.Drawing.Size(160, 21); - this.TimeoutTextBox.TabIndex = 9; - // - // PluginLabel - // - this.PluginLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.PluginLabel.AutoSize = true; - this.PluginLabel.Location = new System.Drawing.Point(18, 139); - this.PluginLabel.Name = "PluginLabel"; - this.PluginLabel.Size = new System.Drawing.Size(89, 12); - this.PluginLabel.TabIndex = 5; - this.PluginLabel.Text = "Plugin Program"; - // - // PluginOptionsTextBox - // - this.PluginOptionsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.PluginOptionsTextBox.Location = new System.Drawing.Point(113, 162); - this.PluginOptionsTextBox.MaxLength = 256; - this.PluginOptionsTextBox.Name = "PluginOptionsTextBox"; - this.PluginOptionsTextBox.Size = new System.Drawing.Size(160, 21); - this.PluginOptionsTextBox.TabIndex = 6; - this.PluginOptionsTextBox.WordWrap = false; - // - // ShowPasswdCheckBox - // - this.ShowPasswdCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.ShowPasswdCheckBox.AutoSize = true; - this.ShowPasswdCheckBox.Location = new System.Drawing.Point(113, 87); - this.ShowPasswdCheckBox.Name = "ShowPasswdCheckBox"; - this.ShowPasswdCheckBox.Size = new System.Drawing.Size(102, 16); - this.ShowPasswdCheckBox.TabIndex = 3; - this.ShowPasswdCheckBox.Text = "Show Password"; - this.ShowPasswdCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.ShowPasswdCheckBox.UseVisualStyleBackColor = true; - this.ShowPasswdCheckBox.CheckedChanged += new System.EventHandler(this.ShowPasswdCheckBox_CheckedChanged); - // - // RemarksLabel - // - this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.RemarksLabel.AutoSize = true; - this.RemarksLabel.Location = new System.Drawing.Point(60, 220); - this.RemarksLabel.Name = "RemarksLabel"; - this.RemarksLabel.Size = new System.Drawing.Size(47, 12); - this.RemarksLabel.TabIndex = 8; - this.RemarksLabel.Text = "Remarks"; - // - // PluginArgumentsTextBox - // - this.PluginArgumentsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); - this.PluginArgumentsTextBox.Location = new System.Drawing.Point(113, 189); - this.PluginArgumentsTextBox.MaxLength = 512; - this.PluginArgumentsTextBox.Name = "PluginArgumentsTextBox"; - this.PluginArgumentsTextBox.Size = new System.Drawing.Size(160, 21); - this.PluginArgumentsTextBox.TabIndex = 7; - this.PluginArgumentsTextBox.WordWrap = false; - // - // PluginArgumentsLabel - // - this.PluginArgumentsLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.PluginArgumentsLabel.AutoSize = true; - this.PluginArgumentsLabel.Location = new System.Drawing.Point(6, 193); - this.PluginArgumentsLabel.Name = "PluginArgumentsLabel"; - this.PluginArgumentsLabel.Size = new System.Drawing.Size(101, 12); - this.PluginArgumentsLabel.TabIndex = 7; - this.PluginArgumentsLabel.Text = "Plugin Arguments"; - this.toolTip1.SetToolTip(this.PluginArgumentsLabel, "Not SIP003 standard. Used as CLI arguments.\r\nMandatory:\r\n%SS_LOCAL_HOST%, %SS_LOC" + - "SL_PORT%, %SS_REMOTE_HOST%, %SS_REMOTE_PORT%\r\nOptional:\r\n%SS_PLUGIN_OPTIONS%"); - // - // panel2 - // - this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.panel2.AutoSize = true; - this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.panel2.Location = new System.Drawing.Point(207, 187); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(0, 0); - this.panel2.TabIndex = 1; - // - // 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(75, 23); - this.OKButton.TabIndex = 17; - this.OKButton.Text = "OK"; - this.OKButton.UseVisualStyleBackColor = true; - this.OKButton.Click += new System.EventHandler(this.OKButton_Click); - // - // MyCancelButton - // - this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.MyCancelButton.Dock = System.Windows.Forms.DockStyle.Right; - this.MyCancelButton.Location = new System.Drawing.Point(84, 3); - this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); - this.MyCancelButton.Name = "MyCancelButton"; - this.MyCancelButton.Size = new System.Drawing.Size(75, 23); - this.MyCancelButton.TabIndex = 18; - this.MyCancelButton.Text = "Cancel"; - this.MyCancelButton.UseVisualStyleBackColor = true; - this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); - // - // DeleteButton - // - this.DeleteButton.Dock = System.Windows.Forms.DockStyle.Right; - this.DeleteButton.Location = new System.Drawing.Point(86, 6); - this.DeleteButton.Margin = new System.Windows.Forms.Padding(3, 6, 0, 3); - this.DeleteButton.Name = "DeleteButton"; - this.DeleteButton.Size = new System.Drawing.Size(80, 23); - this.DeleteButton.TabIndex = 13; - this.DeleteButton.Text = "&Delete"; - this.DeleteButton.UseVisualStyleBackColor = true; - this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); - // - // AddButton - // - this.AddButton.Dock = System.Windows.Forms.DockStyle.Left; - this.AddButton.Location = new System.Drawing.Point(0, 6); - this.AddButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); - this.AddButton.Name = "AddButton"; - this.AddButton.Size = new System.Drawing.Size(80, 23); - this.AddButton.TabIndex = 12; - this.AddButton.Text = "&Add"; - this.AddButton.UseVisualStyleBackColor = true; - this.AddButton.Click += new System.EventHandler(this.AddButton_Click); - // - // ServerGroupBox - // - this.ServerGroupBox.AutoSize = true; - this.ServerGroupBox.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ServerGroupBox.Controls.Add(this.tableLayoutPanel1); - this.ServerGroupBox.Location = new System.Drawing.Point(178, 0); - this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); - this.ServerGroupBox.Name = "ServerGroupBox"; - this.ServerGroupBox.Size = new System.Drawing.Size(290, 308); - this.ServerGroupBox.TabIndex = 0; - this.ServerGroupBox.TabStop = false; - this.ServerGroupBox.Text = "Server"; - // - // ServersListBox - // - this.ServersListBox.FormattingEnabled = true; - this.ServersListBox.IntegralHeight = false; - 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.Size = new System.Drawing.Size(166, 148); - this.ServersListBox.TabIndex = 11; - this.ServersListBox.SelectedIndexChanged += new System.EventHandler(this.ServersListBox_SelectedIndexChanged); - // - // 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()); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel6, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel5, 1, 1); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 2); - this.tableLayoutPanel2.Controls.Add(this.ServersListBox, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.ServerGroupBox, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel4, 0, 1); - this.tableLayoutPanel2.Location = new System.Drawing.Point(12, 12); - this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 3; - 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(468, 404); - this.tableLayoutPanel2.TabIndex = 7; - // - // tableLayoutPanel6 - // - this.tableLayoutPanel6.AutoSize = true; - this.tableLayoutPanel6.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel6.ColumnCount = 2; - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); - this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); - this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; - this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 372); - this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel6.Name = "tableLayoutPanel6"; - this.tableLayoutPanel6.RowCount = 1; - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.Size = new System.Drawing.Size(166, 32); - this.tableLayoutPanel6.TabIndex = 10; - // - // MoveDownButton - // - this.MoveDownButton.Dock = System.Windows.Forms.DockStyle.Right; - this.MoveDownButton.Location = new System.Drawing.Point(86, 6); - this.MoveDownButton.Margin = new System.Windows.Forms.Padding(3, 6, 0, 3); - this.MoveDownButton.Name = "MoveDownButton"; - this.MoveDownButton.Size = new System.Drawing.Size(80, 23); - this.MoveDownButton.TabIndex = 16; - this.MoveDownButton.Text = "Move D&own"; - this.MoveDownButton.UseVisualStyleBackColor = true; - this.MoveDownButton.Click += new System.EventHandler(this.MoveDownButton_Click); - // - // MoveUpButton - // - this.MoveUpButton.Dock = System.Windows.Forms.DockStyle.Left; - this.MoveUpButton.Location = new System.Drawing.Point(0, 6); - this.MoveUpButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); - this.MoveUpButton.Name = "MoveUpButton"; - this.MoveUpButton.Size = new System.Drawing.Size(80, 23); - this.MoveUpButton.TabIndex = 15; - this.MoveUpButton.Text = "Move &Up"; - this.MoveUpButton.UseVisualStyleBackColor = true; - this.MoveUpButton.Click += new System.EventHandler(this.MoveUpButton_Click); - // - // tableLayoutPanel5 - // - this.tableLayoutPanel5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - 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.ProxyPortTextBox, 1, 0); - this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0); - this.tableLayoutPanel5.Location = new System.Drawing.Point(272, 308); - 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 = 1; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(196, 64); - this.tableLayoutPanel5.TabIndex = 9; - // - // ProxyPortTextBox - // - this.ProxyPortTextBox.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.ProxyPortTextBox.Location = new System.Drawing.Point(77, 21); - this.ProxyPortTextBox.MaxLength = 10; - this.ProxyPortTextBox.Name = "ProxyPortTextBox"; - this.ProxyPortTextBox.Size = new System.Drawing.Size(113, 21); - this.ProxyPortTextBox.TabIndex = 10; - this.ProxyPortTextBox.WordWrap = false; - // - // ProxyPortLabel - // - this.ProxyPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.ProxyPortLabel.AutoSize = true; - this.ProxyPortLabel.Location = new System.Drawing.Point(6, 26); - this.ProxyPortLabel.Name = "ProxyPortLabel"; - this.ProxyPortLabel.Size = new System.Drawing.Size(65, 12); - this.ProxyPortLabel.TabIndex = 10; - this.ProxyPortLabel.Text = "Proxy Port"; - // - // tableLayoutPanel3 - // - 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, 20F)); - this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); - this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); - this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; - this.tableLayoutPanel3.Location = new System.Drawing.Point(309, 375); - 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(159, 26); - this.tableLayoutPanel3.TabIndex = 8; - // - // 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.DuplicateButton, 0, 1); - this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); - this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); - this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; - this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 308); - this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); - 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(166, 64); - this.tableLayoutPanel4.TabIndex = 8; - // - // DuplicateButton - // - this.DuplicateButton.Dock = System.Windows.Forms.DockStyle.Left; - this.DuplicateButton.Location = new System.Drawing.Point(0, 38); - this.DuplicateButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); - this.DuplicateButton.Name = "DuplicateButton"; - this.DuplicateButton.Size = new System.Drawing.Size(80, 23); - this.DuplicateButton.TabIndex = 14; - this.DuplicateButton.Text = "Dupli&cate"; - this.DuplicateButton.UseVisualStyleBackColor = true; - this.DuplicateButton.Click += new System.EventHandler(this.DuplicateButton_Click); - // - // ConfigForm - // - this.AcceptButton = this.OKButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.AutoSize = true; - this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.CancelButton = this.MyCancelButton; - this.ClientSize = new System.Drawing.Size(574, 438); - this.Controls.Add(this.tableLayoutPanel2); - this.Controls.Add(this.panel2); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ConfigForm"; - this.Padding = new System.Windows.Forms.Padding(12, 12, 12, 9); - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Edit Servers"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ConfigForm_FormClosed); - this.Load += new System.EventHandler(this.ConfigForm_Load); - this.Shown += new System.EventHandler(this.ConfigForm_Shown); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigForm_KeyDown); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); - this.ServerGroupBox.ResumeLayout(false); - this.ServerGroupBox.PerformLayout(); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel6.ResumeLayout(false); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - this.tableLayoutPanel3.ResumeLayout(false); - this.tableLayoutPanel4.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label IPLabel; - private System.Windows.Forms.Label ServerPortLabel; - private System.Windows.Forms.Label PasswordLabel; - private System.Windows.Forms.TextBox IPTextBox; - private System.Windows.Forms.TextBox ServerPortTextBox; - private System.Windows.Forms.Label EncryptionLabel; - private System.Windows.Forms.ComboBox EncryptionSelect; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button OKButton; - private System.Windows.Forms.Button MyCancelButton; - private System.Windows.Forms.Button DeleteButton; - private System.Windows.Forms.Button AddButton; - private System.Windows.Forms.GroupBox ServerGroupBox; - private System.Windows.Forms.ListBox ServersListBox; - private System.Windows.Forms.TextBox RemarksTextBox; - private System.Windows.Forms.Label RemarksLabel; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.TextBox ProxyPortTextBox; - private System.Windows.Forms.Label ProxyPortLabel; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; - private System.Windows.Forms.Button MoveDownButton; - private System.Windows.Forms.Button MoveUpButton; - private System.Windows.Forms.Button DuplicateButton; - private System.Windows.Forms.Label TimeoutLabel; - private System.Windows.Forms.TextBox TimeoutTextBox; - private System.Windows.Forms.Label PluginOptionsLabel; - private System.Windows.Forms.TextBox PluginTextBox; - private System.Windows.Forms.Label PluginLabel; - private System.Windows.Forms.TextBox PluginOptionsTextBox; - private System.Windows.Forms.CheckBox ShowPasswdCheckBox; - private System.Windows.Forms.TextBox PasswordTextBox; - private System.Windows.Forms.TextBox PluginArgumentsTextBox; - private System.Windows.Forms.Label PluginArgumentsLabel; - private System.Windows.Forms.ToolTip toolTip1; - } -} - +namespace Shadowsocks.View +{ + partial class ConfigForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.PluginOptionsLabel = new System.Windows.Forms.Label(); + this.PluginTextBox = new System.Windows.Forms.TextBox(); + this.RemarksTextBox = new System.Windows.Forms.TextBox(); + this.IPLabel = new System.Windows.Forms.Label(); + this.ServerPortLabel = new System.Windows.Forms.Label(); + this.PasswordLabel = new System.Windows.Forms.Label(); + this.IPTextBox = new System.Windows.Forms.TextBox(); + this.ServerPortTextBox = new System.Windows.Forms.TextBox(); + this.PasswordTextBox = new System.Windows.Forms.TextBox(); + this.EncryptionLabel = new System.Windows.Forms.Label(); + this.EncryptionSelect = new System.Windows.Forms.ComboBox(); + this.TimeoutLabel = new System.Windows.Forms.Label(); + this.TimeoutTextBox = new System.Windows.Forms.TextBox(); + this.PluginLabel = new System.Windows.Forms.Label(); + this.PluginOptionsTextBox = new System.Windows.Forms.TextBox(); + this.ShowPasswdCheckBox = new System.Windows.Forms.CheckBox(); + this.PluginArgumentsTextBox = new System.Windows.Forms.TextBox(); + this.PluginArgumentsLabel = new System.Windows.Forms.Label(); + this.RemarksLabel = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.OKButton = new System.Windows.Forms.Button(); + this.MyCancelButton = new System.Windows.Forms.Button(); + this.DeleteButton = new System.Windows.Forms.Button(); + this.AddButton = new System.Windows.Forms.Button(); + this.ServerGroupBox = new System.Windows.Forms.GroupBox(); + this.ServersListBox = new System.Windows.Forms.ListBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); + this.MoveDownButton = new System.Windows.Forms.Button(); + this.MoveUpButton = new System.Windows.Forms.Button(); + this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); + this.ProxyPortTextBox = new System.Windows.Forms.TextBox(); + this.ProxyPortLabel = new System.Windows.Forms.Label(); + this.TempFolderLabel = new System.Windows.Forms.Label(); + this.TempFolderTextBox = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.DuplicateButton = new System.Windows.Forms.Button(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.tableLayoutPanel1.SuspendLayout(); + this.ServerGroupBox.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel6.SuspendLayout(); + this.tableLayoutPanel5.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.AutoSize = true; + this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + 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.PluginOptionsLabel, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.PluginTextBox, 1, 5); + this.tableLayoutPanel1.Controls.Add(this.RemarksTextBox, 1, 9); + this.tableLayoutPanel1.Controls.Add(this.IPLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.ServerPortLabel, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.PasswordLabel, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.IPTextBox, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.ServerPortTextBox, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.PasswordTextBox, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.EncryptionLabel, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.EncryptionSelect, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.TimeoutLabel, 0, 10); + this.tableLayoutPanel1.Controls.Add(this.TimeoutTextBox, 1, 10); + this.tableLayoutPanel1.Controls.Add(this.PluginLabel, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.PluginOptionsTextBox, 1, 6); + this.tableLayoutPanel1.Controls.Add(this.ShowPasswdCheckBox, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.PluginArgumentsTextBox, 1, 7); + this.tableLayoutPanel1.Controls.Add(this.PluginArgumentsLabel, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.RemarksLabel, 0, 9); + this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 21); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); + this.tableLayoutPanel1.RowCount = 11; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(279, 270); + this.tableLayoutPanel1.TabIndex = 0; + // + // PluginOptionsLabel + // + this.PluginOptionsLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.PluginOptionsLabel.AutoSize = true; + this.PluginOptionsLabel.Location = new System.Drawing.Point(18, 166); + this.PluginOptionsLabel.Name = "PluginOptionsLabel"; + this.PluginOptionsLabel.Size = new System.Drawing.Size(89, 12); + this.PluginOptionsLabel.TabIndex = 6; + this.PluginOptionsLabel.Text = "Plugin Options"; + this.toolTip1.SetToolTip(this.PluginOptionsLabel, "Environment variables"); + // + // PluginTextBox + // + this.PluginTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.PluginTextBox.Location = new System.Drawing.Point(113, 135); + this.PluginTextBox.MaxLength = 256; + this.PluginTextBox.Name = "PluginTextBox"; + this.PluginTextBox.Size = new System.Drawing.Size(160, 21); + this.PluginTextBox.TabIndex = 5; + this.PluginTextBox.WordWrap = false; + // + // 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(113, 216); + this.RemarksTextBox.MaxLength = 32; + this.RemarksTextBox.Name = "RemarksTextBox"; + this.RemarksTextBox.Size = new System.Drawing.Size(160, 21); + this.RemarksTextBox.TabIndex = 8; + this.RemarksTextBox.WordWrap = false; + // + // IPLabel + // + this.IPLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.IPLabel.AutoSize = true; + this.IPLabel.Location = new System.Drawing.Point(48, 10); + this.IPLabel.Name = "IPLabel"; + this.IPLabel.Size = new System.Drawing.Size(59, 12); + this.IPLabel.TabIndex = 0; + this.IPLabel.Text = "Server IP"; + // + // ServerPortLabel + // + this.ServerPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.ServerPortLabel.AutoSize = true; + this.ServerPortLabel.Location = new System.Drawing.Point(36, 37); + this.ServerPortLabel.Name = "ServerPortLabel"; + this.ServerPortLabel.Size = new System.Drawing.Size(71, 12); + this.ServerPortLabel.TabIndex = 1; + this.ServerPortLabel.Text = "Server Port"; + // + // PasswordLabel + // + this.PasswordLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.PasswordLabel.AutoSize = true; + this.PasswordLabel.Location = new System.Drawing.Point(54, 64); + this.PasswordLabel.Name = "PasswordLabel"; + this.PasswordLabel.Size = new System.Drawing.Size(53, 12); + this.PasswordLabel.TabIndex = 2; + this.PasswordLabel.Text = "Password"; + this.PasswordLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // 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(113, 6); + this.IPTextBox.MaxLength = 512; + this.IPTextBox.Name = "IPTextBox"; + this.IPTextBox.Size = new System.Drawing.Size(160, 21); + this.IPTextBox.TabIndex = 0; + this.IPTextBox.WordWrap = false; + // + // ServerPortTextBox + // + this.ServerPortTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.ServerPortTextBox.Location = new System.Drawing.Point(113, 33); + this.ServerPortTextBox.MaxLength = 10; + this.ServerPortTextBox.Name = "ServerPortTextBox"; + this.ServerPortTextBox.Size = new System.Drawing.Size(160, 21); + this.ServerPortTextBox.TabIndex = 1; + this.ServerPortTextBox.WordWrap = false; + // + // 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(113, 60); + this.PasswordTextBox.MaxLength = 256; + this.PasswordTextBox.Name = "PasswordTextBox"; + this.PasswordTextBox.Size = new System.Drawing.Size(160, 21); + this.PasswordTextBox.TabIndex = 2; + 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(42, 113); + this.EncryptionLabel.Name = "EncryptionLabel"; + this.EncryptionLabel.Size = new System.Drawing.Size(65, 12); + this.EncryptionLabel.TabIndex = 4; + this.EncryptionLabel.Text = "Encryption"; + // + // EncryptionSelect + // + this.EncryptionSelect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.EncryptionSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.EncryptionSelect.FormattingEnabled = true; + this.EncryptionSelect.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.EncryptionSelect.ItemHeight = 12; + this.EncryptionSelect.Items.AddRange(new object[] { + "rc4-md5", + "salsa20", + "chacha20", + "chacha20-ietf", + "aes-256-cfb", + "aes-192-cfb", + "aes-128-cfb", + "aes-256-ctr", + "aes-192-ctr", + "aes-128-ctr", + "bf-cfb", + "camellia-128-cfb", + "camellia-192-cfb", + "camellia-256-cfb", + "aes-128-gcm", + "aes-192-gcm", + "aes-256-gcm", + "chacha20-ietf-poly1305", + "xchacha20-ietf-poly1305"}); + this.EncryptionSelect.Location = new System.Drawing.Point(113, 109); + this.EncryptionSelect.Name = "EncryptionSelect"; + this.EncryptionSelect.Size = new System.Drawing.Size(160, 20); + this.EncryptionSelect.TabIndex = 4; + // + // TimeoutLabel + // + this.TimeoutLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.TimeoutLabel.AutoSize = true; + this.TimeoutLabel.Location = new System.Drawing.Point(30, 247); + this.TimeoutLabel.Name = "TimeoutLabel"; + this.TimeoutLabel.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.TimeoutLabel.Size = new System.Drawing.Size(77, 12); + this.TimeoutLabel.TabIndex = 9; + this.TimeoutLabel.Text = "Timeout(Sec)"; + // + // TimeoutTextBox + // + this.TimeoutTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.TimeoutTextBox.Location = new System.Drawing.Point(113, 243); + this.TimeoutTextBox.MaxLength = 5; + this.TimeoutTextBox.Name = "TimeoutTextBox"; + this.TimeoutTextBox.Size = new System.Drawing.Size(160, 21); + this.TimeoutTextBox.TabIndex = 9; + // + // PluginLabel + // + this.PluginLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.PluginLabel.AutoSize = true; + this.PluginLabel.Location = new System.Drawing.Point(18, 139); + this.PluginLabel.Name = "PluginLabel"; + this.PluginLabel.Size = new System.Drawing.Size(89, 12); + this.PluginLabel.TabIndex = 5; + this.PluginLabel.Text = "Plugin Program"; + // + // PluginOptionsTextBox + // + this.PluginOptionsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.PluginOptionsTextBox.Location = new System.Drawing.Point(113, 162); + this.PluginOptionsTextBox.MaxLength = 256; + this.PluginOptionsTextBox.Name = "PluginOptionsTextBox"; + this.PluginOptionsTextBox.Size = new System.Drawing.Size(160, 21); + this.PluginOptionsTextBox.TabIndex = 6; + this.PluginOptionsTextBox.WordWrap = false; + // + // ShowPasswdCheckBox + // + this.ShowPasswdCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.ShowPasswdCheckBox.AutoSize = true; + this.ShowPasswdCheckBox.Location = new System.Drawing.Point(113, 87); + this.ShowPasswdCheckBox.Name = "ShowPasswdCheckBox"; + this.ShowPasswdCheckBox.Size = new System.Drawing.Size(102, 16); + this.ShowPasswdCheckBox.TabIndex = 3; + this.ShowPasswdCheckBox.Text = "Show Password"; + this.ShowPasswdCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.ShowPasswdCheckBox.UseVisualStyleBackColor = true; + this.ShowPasswdCheckBox.CheckedChanged += new System.EventHandler(this.ShowPasswdCheckBox_CheckedChanged); + // + // PluginArgumentsTextBox + // + this.PluginArgumentsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.PluginArgumentsTextBox.Location = new System.Drawing.Point(113, 189); + this.PluginArgumentsTextBox.MaxLength = 512; + this.PluginArgumentsTextBox.Name = "PluginArgumentsTextBox"; + this.PluginArgumentsTextBox.Size = new System.Drawing.Size(160, 21); + this.PluginArgumentsTextBox.TabIndex = 7; + this.PluginArgumentsTextBox.WordWrap = false; + // + // PluginArgumentsLabel + // + this.PluginArgumentsLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.PluginArgumentsLabel.AutoSize = true; + this.PluginArgumentsLabel.Location = new System.Drawing.Point(6, 193); + this.PluginArgumentsLabel.Name = "PluginArgumentsLabel"; + this.PluginArgumentsLabel.Size = new System.Drawing.Size(101, 12); + this.PluginArgumentsLabel.TabIndex = 7; + this.PluginArgumentsLabel.Text = "Plugin Arguments"; + this.toolTip1.SetToolTip(this.PluginArgumentsLabel, "Not SIP003 standard. Used as CLI arguments.\r\nMandatory:\r\n%SS_LOCAL_HOST%, %SS_LOC" + + "SL_PORT%, %SS_REMOTE_HOST%, %SS_REMOTE_PORT%\r\nOptional:\r\n%SS_PLUGIN_OPTIONS%"); + // + // RemarksLabel + // + this.RemarksLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.RemarksLabel.AutoSize = true; + this.RemarksLabel.Location = new System.Drawing.Point(60, 220); + this.RemarksLabel.Name = "RemarksLabel"; + this.RemarksLabel.Size = new System.Drawing.Size(47, 12); + this.RemarksLabel.TabIndex = 8; + this.RemarksLabel.Text = "Remarks"; + // + // panel2 + // + this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.panel2.AutoSize = true; + this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.panel2.Location = new System.Drawing.Point(165, 187); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(0, 0); + this.panel2.TabIndex = 1; + // + // 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(75, 23); + this.OKButton.TabIndex = 17; + this.OKButton.Text = "OK"; + this.OKButton.UseVisualStyleBackColor = true; + this.OKButton.Click += new System.EventHandler(this.OKButton_Click); + // + // MyCancelButton + // + this.MyCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.MyCancelButton.Dock = System.Windows.Forms.DockStyle.Right; + this.MyCancelButton.Location = new System.Drawing.Point(84, 3); + this.MyCancelButton.Margin = new System.Windows.Forms.Padding(3, 3, 0, 0); + this.MyCancelButton.Name = "MyCancelButton"; + this.MyCancelButton.Size = new System.Drawing.Size(75, 23); + this.MyCancelButton.TabIndex = 18; + this.MyCancelButton.Text = "Cancel"; + this.MyCancelButton.UseVisualStyleBackColor = true; + this.MyCancelButton.Click += new System.EventHandler(this.CancelButton_Click); + // + // DeleteButton + // + this.DeleteButton.Dock = System.Windows.Forms.DockStyle.Right; + this.DeleteButton.Location = new System.Drawing.Point(86, 6); + this.DeleteButton.Margin = new System.Windows.Forms.Padding(3, 6, 0, 3); + this.DeleteButton.Name = "DeleteButton"; + this.DeleteButton.Size = new System.Drawing.Size(80, 23); + this.DeleteButton.TabIndex = 13; + this.DeleteButton.Text = "&Delete"; + this.DeleteButton.UseVisualStyleBackColor = true; + this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); + // + // AddButton + // + this.AddButton.Dock = System.Windows.Forms.DockStyle.Left; + this.AddButton.Location = new System.Drawing.Point(0, 6); + this.AddButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); + this.AddButton.Name = "AddButton"; + this.AddButton.Size = new System.Drawing.Size(80, 23); + this.AddButton.TabIndex = 12; + this.AddButton.Text = "&Add"; + this.AddButton.UseVisualStyleBackColor = true; + this.AddButton.Click += new System.EventHandler(this.AddButton_Click); + // + // ServerGroupBox + // + this.ServerGroupBox.AutoSize = true; + this.ServerGroupBox.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.ServerGroupBox.Controls.Add(this.tableLayoutPanel1); + this.ServerGroupBox.Location = new System.Drawing.Point(178, 0); + this.ServerGroupBox.Margin = new System.Windows.Forms.Padding(12, 0, 0, 0); + this.ServerGroupBox.Name = "ServerGroupBox"; + this.ServerGroupBox.Size = new System.Drawing.Size(290, 308); + this.ServerGroupBox.TabIndex = 0; + this.ServerGroupBox.TabStop = false; + this.ServerGroupBox.Text = "Server"; + // + // ServersListBox + // + this.ServersListBox.FormattingEnabled = true; + this.ServersListBox.IntegralHeight = false; + 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.Size = new System.Drawing.Size(166, 148); + this.ServersListBox.TabIndex = 11; + this.ServersListBox.SelectedIndexChanged += new System.EventHandler(this.ServersListBox_SelectedIndexChanged); + // + // 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()); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel6, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel5, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.ServersListBox, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.ServerGroupBox, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel4, 0, 1); + this.tableLayoutPanel2.Location = new System.Drawing.Point(12, 12); + this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 3; + 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(468, 404); + this.tableLayoutPanel2.TabIndex = 7; + // + // tableLayoutPanel6 + // + this.tableLayoutPanel6.AutoSize = true; + this.tableLayoutPanel6.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel6.ColumnCount = 2; + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel6.Controls.Add(this.MoveDownButton, 1, 0); + this.tableLayoutPanel6.Controls.Add(this.MoveUpButton, 0, 0); + this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Top; + this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 372); + this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel6.Name = "tableLayoutPanel6"; + this.tableLayoutPanel6.RowCount = 1; + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.Size = new System.Drawing.Size(166, 32); + this.tableLayoutPanel6.TabIndex = 10; + // + // MoveDownButton + // + this.MoveDownButton.Dock = System.Windows.Forms.DockStyle.Right; + this.MoveDownButton.Location = new System.Drawing.Point(86, 6); + this.MoveDownButton.Margin = new System.Windows.Forms.Padding(3, 6, 0, 3); + this.MoveDownButton.Name = "MoveDownButton"; + this.MoveDownButton.Size = new System.Drawing.Size(80, 23); + this.MoveDownButton.TabIndex = 16; + this.MoveDownButton.Text = "Move D&own"; + this.MoveDownButton.UseVisualStyleBackColor = true; + this.MoveDownButton.Click += new System.EventHandler(this.MoveDownButton_Click); + // + // MoveUpButton + // + this.MoveUpButton.Dock = System.Windows.Forms.DockStyle.Left; + this.MoveUpButton.Location = new System.Drawing.Point(0, 6); + this.MoveUpButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); + this.MoveUpButton.Name = "MoveUpButton"; + this.MoveUpButton.Size = new System.Drawing.Size(80, 23); + this.MoveUpButton.TabIndex = 15; + this.MoveUpButton.Text = "Move &Up"; + this.MoveUpButton.UseVisualStyleBackColor = true; + this.MoveUpButton.Click += new System.EventHandler(this.MoveUpButton_Click); + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + 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.ProxyPortTextBox, 1, 0); + this.tableLayoutPanel5.Controls.Add(this.ProxyPortLabel, 0, 0); + this.tableLayoutPanel5.Controls.Add(this.TempFolderLabel, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.TempFolderTextBox, 1, 1); + this.tableLayoutPanel5.Location = new System.Drawing.Point(166, 308); + 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 = 2; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 58F)); + this.tableLayoutPanel5.Size = new System.Drawing.Size(202, 64); + this.tableLayoutPanel5.TabIndex = 9; + // + // ProxyPortTextBox + // + this.ProxyPortTextBox.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.ProxyPortTextBox.Location = new System.Drawing.Point(83, 6); + this.ProxyPortTextBox.MaxLength = 10; + this.ProxyPortTextBox.Name = "ProxyPortTextBox"; + this.ProxyPortTextBox.Size = new System.Drawing.Size(113, 21); + this.ProxyPortTextBox.TabIndex = 10; + this.ProxyPortTextBox.WordWrap = false; + // + // ProxyPortLabel + // + this.ProxyPortLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.ProxyPortLabel.AutoSize = true; + this.ProxyPortLabel.Location = new System.Drawing.Point(12, 10); + this.ProxyPortLabel.Name = "ProxyPortLabel"; + this.ProxyPortLabel.Size = new System.Drawing.Size(65, 12); + this.ProxyPortLabel.TabIndex = 10; + this.ProxyPortLabel.Text = "Proxy Port"; + // + // TempFolderLabel + // + this.TempFolderLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.TempFolderLabel.AutoSize = true; + this.TempFolderLabel.Location = new System.Drawing.Point(6, 39); + this.TempFolderLabel.Name = "TempFolderLabel"; + this.TempFolderLabel.Size = new System.Drawing.Size(71, 12); + this.TempFolderLabel.TabIndex = 9; + this.TempFolderLabel.Text = "Temp Folder"; + // + // TempFolderTextBox + // + this.TempFolderTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.TempFolderTextBox.Location = new System.Drawing.Point(83, 35); + this.TempFolderTextBox.Name = "TempFolderTextBox"; + this.TempFolderTextBox.Size = new System.Drawing.Size(113, 21); + this.TempFolderTextBox.TabIndex = 11; + // + // tableLayoutPanel3 + // + 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, 20F)); + this.tableLayoutPanel3.Controls.Add(this.MyCancelButton, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.OKButton, 0, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Right; + this.tableLayoutPanel3.Location = new System.Drawing.Point(309, 375); + 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(159, 26); + this.tableLayoutPanel3.TabIndex = 8; + // + // 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.DuplicateButton, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.DeleteButton, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.AddButton, 0, 0); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top; + this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 308); + this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); + 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(166, 64); + this.tableLayoutPanel4.TabIndex = 8; + // + // DuplicateButton + // + this.DuplicateButton.Dock = System.Windows.Forms.DockStyle.Left; + this.DuplicateButton.Location = new System.Drawing.Point(0, 38); + this.DuplicateButton.Margin = new System.Windows.Forms.Padding(0, 6, 3, 3); + this.DuplicateButton.Name = "DuplicateButton"; + this.DuplicateButton.Size = new System.Drawing.Size(80, 23); + this.DuplicateButton.TabIndex = 14; + this.DuplicateButton.Text = "Dupli&cate"; + this.DuplicateButton.UseVisualStyleBackColor = true; + this.DuplicateButton.Click += new System.EventHandler(this.DuplicateButton_Click); + // + // ConfigForm + // + this.AcceptButton = this.OKButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.CancelButton = this.MyCancelButton; + this.ClientSize = new System.Drawing.Size(491, 438); + this.Controls.Add(this.tableLayoutPanel2); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ConfigForm"; + this.Padding = new System.Windows.Forms.Padding(12, 12, 12, 9); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Edit Servers"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ConfigForm_FormClosed); + this.Load += new System.EventHandler(this.ConfigForm_Load); + this.Shown += new System.EventHandler(this.ConfigForm_Shown); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConfigForm_KeyDown); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ServerGroupBox.ResumeLayout(false); + this.ServerGroupBox.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel6.ResumeLayout(false); + this.tableLayoutPanel5.ResumeLayout(false); + this.tableLayoutPanel5.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label IPLabel; + private System.Windows.Forms.Label ServerPortLabel; + private System.Windows.Forms.Label PasswordLabel; + private System.Windows.Forms.TextBox IPTextBox; + private System.Windows.Forms.TextBox ServerPortTextBox; + private System.Windows.Forms.Label EncryptionLabel; + private System.Windows.Forms.ComboBox EncryptionSelect; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Button OKButton; + private System.Windows.Forms.Button MyCancelButton; + private System.Windows.Forms.Button DeleteButton; + private System.Windows.Forms.Button AddButton; + private System.Windows.Forms.GroupBox ServerGroupBox; + private System.Windows.Forms.ListBox ServersListBox; + private System.Windows.Forms.TextBox RemarksTextBox; + private System.Windows.Forms.Label RemarksLabel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.TextBox ProxyPortTextBox; + private System.Windows.Forms.Label ProxyPortLabel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; + private System.Windows.Forms.Button MoveDownButton; + private System.Windows.Forms.Button MoveUpButton; + private System.Windows.Forms.Button DuplicateButton; + private System.Windows.Forms.Label TimeoutLabel; + private System.Windows.Forms.TextBox TimeoutTextBox; + private System.Windows.Forms.Label PluginOptionsLabel; + private System.Windows.Forms.TextBox PluginTextBox; + private System.Windows.Forms.Label PluginLabel; + private System.Windows.Forms.TextBox PluginOptionsTextBox; + private System.Windows.Forms.CheckBox ShowPasswdCheckBox; + private System.Windows.Forms.TextBox PasswordTextBox; + private System.Windows.Forms.Label TempFolderLabel; + private System.Windows.Forms.TextBox PluginArgumentsTextBox; + private System.Windows.Forms.Label PluginArgumentsLabel; + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.TextBox TempFolderTextBox; + } +} + diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index 09e2551e..338eb402 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -9,6 +9,7 @@ using Microsoft.Win32; using Shadowsocks.Controller; using Shadowsocks.Model; using Shadowsocks.Properties; +using System.Threading.Tasks; namespace Shadowsocks.View { @@ -22,11 +23,12 @@ namespace Shadowsocks.View public ConfigForm(ShadowsocksController controller) { - this.Font = System.Drawing.SystemFonts.MessageBoxFont; + this.Font = SystemFonts.MessageBoxFont; InitializeComponent(); // a dirty hack - this.ServersListBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.ServersListBox.Dock = DockStyle.Fill; + this.tableLayoutPanel5.Dock = DockStyle.Fill; this.PerformLayout(); UpdateTexts(); @@ -52,6 +54,7 @@ namespace Shadowsocks.View PluginOptionsLabel.Text = I18N.GetString("Plugin Options"); PluginArgumentsLabel.Text = I18N.GetString("Plugin Arguments"); ProxyPortLabel.Text = I18N.GetString("Proxy Port"); + TempFolderLabel.Text = I18N.GetString("Temp Folder"); RemarksLabel.Text = I18N.GetString("Remarks"); TimeoutLabel.Text = I18N.GetString("Timeout(Sec)"); ServerGroupBox.Text = I18N.GetString("Server"); @@ -109,6 +112,7 @@ namespace Shadowsocks.View return false; } int localPort = int.Parse(ProxyPortTextBox.Text); + Configuration.CheckTempFolder(TempFolderTextBox.Text); Configuration.CheckServer(server); Configuration.CheckLocalPort(localPort); _modifiedConfiguration.configs[_lastSelectedIndex] = server; @@ -163,6 +167,7 @@ namespace Shadowsocks.View ServersListBox.SelectedIndex = _lastSelectedIndex; UpdateMoveUpAndDownButton(); LoadSelectedServer(); + TempFolderTextBox.Text = _modifiedConfiguration.tempFolder; } private void ConfigForm_Load(object sender, EventArgs e) @@ -231,14 +236,14 @@ namespace Shadowsocks.View _lastSelectedIndex = ServersListBox.SelectedIndex; } - private void DuplicateButton_Click( object sender, EventArgs e ) + private void DuplicateButton_Click(object sender, EventArgs e) { if (!SaveOldSelectedServer()) { return; } Server currServer = _modifiedConfiguration.configs[_lastSelectedIndex]; - var currIndex = _modifiedConfiguration.configs.IndexOf( currServer ); + var currIndex = _modifiedConfiguration.configs.IndexOf(currServer); _modifiedConfiguration.configs.Insert(currIndex + 1, currServer); LoadConfiguration(_modifiedConfiguration); ServersListBox.SelectedIndex = currIndex + 1; @@ -275,6 +280,7 @@ namespace Shadowsocks.View return; } controller.SaveServers(_modifiedConfiguration.configs, _modifiedConfiguration.localPort); + controller.SaveTempFolder(TempFolderTextBox.Text); // SelectedIndex remains valid // We handled this in event handlers, e.g. Add/DeleteButton, SelectedIndexChanged // and move operations diff --git a/shadowsocks-csharp/View/ConfigForm.resx b/shadowsocks-csharp/View/ConfigForm.resx index 3dcd3115..9d9bc4df 100755 --- a/shadowsocks-csharp/View/ConfigForm.resx +++ b/shadowsocks-csharp/View/ConfigForm.resx @@ -1,255 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - - 17, 17 - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - 17, 17 - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + \ No newline at end of file