From 5077854a304d16deaf1e12e54a9771c2006068b9 Mon Sep 17 00:00:00 2001 From: VegeHime <33897984+VegeHime@users.noreply.github.com> Date: Sun, 29 Dec 2019 14:16:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E4=B8=AA=E8=AE=A2=E9=98=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayN/Forms/MainForm.cs | 152 ++-- .../Forms/SubSettingControl.Designer.cs | 152 ++-- v2rayN/v2rayN/Forms/SubSettingControl.cs | 136 ++-- v2rayN/v2rayN/Forms/SubSettingControl.resx | 712 ++++++++++-------- .../Forms/SubSettingControl.zh-Hans.resx | 297 ++++---- .../v2rayN/Forms/SubSettingForm.Designer.cs | 114 +-- v2rayN/v2rayN/Forms/SubSettingForm.cs | 10 +- v2rayN/v2rayN/Forms/SubSettingForm.resx | 547 +++++++------- 8 files changed, 1134 insertions(+), 986 deletions(-) diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs index 8ab48a1d..4f876668 100644 --- a/v2rayN/v2rayN/Forms/MainForm.cs +++ b/v2rayN/v2rayN/Forms/MainForm.cs @@ -1369,12 +1369,67 @@ namespace v2rayN.Forms private void tsbSubSetting_Click(object sender, EventArgs e) { SubSettingForm fm = new SubSettingForm(); + fm.SubUpdate_Event += new SubUpdate_Delegate(SubUpdate_Single); if (fm.ShowDialog() == DialogResult.OK) { RefreshServers(); } } - + public delegate void SubUpdate_Delegate(SubItem item, int index); + private void SubUpdate_Single(SubItem item, int index=-1) + { + if (index == -1) index = config.subItem.IndexOf(item)+1; + string id = config.subItem[index - 1].id.TrimEx(); + string url = config.subItem[index - 1].url.TrimEx(); + string hashCode = $"{index}->"; + if (config.subItem[index - 1].enabled == false) + { + return; + } + if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url)) + { + AppendText(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}"); + return; + } + + DownloadHandle downloadHandle3 = new DownloadHandle(); + downloadHandle3.UpdateCompleted += (sender2, args) => + { + if (args.Success) + { + AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}"); + var result = Utils.Base64Decode(args.Msg); + if (Utils.IsNullOrEmpty(result)) + { + AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}"); + return; + } + + ConfigHandler.RemoveServerViaSubid(ref config, id); + AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}"); + RefreshServers(); + if (AddBatchServers(result, id) == 0) + { + } + else + { + AppendText(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}"); + } + AppendText(false, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}"); + } + else + { + AppendText(false, args.Msg); + } + }; + downloadHandle3.Error += (sender2, args) => + { + AppendText(true, args.GetException().Message); + }; + + downloadHandle3.WebDownloadString(url); + AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}"); + } private void tsbSubUpdate_Click(object sender, EventArgs e) { AppendText(false, UIRes.I18N("MsgUpdateSubscriptionStart")); @@ -1387,56 +1442,57 @@ namespace v2rayN.Forms for (int k = 1; k <= config.subItem.Count; k++) { - string id = config.subItem[k - 1].id.TrimEx(); - string url = config.subItem[k - 1].url.TrimEx(); - string hashCode = $"{k}->"; - if (config.subItem[k - 1].enabled == false) - { - continue; - } - if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url)) - { - AppendText(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}"); - continue; - } + SubUpdate_Single(config.subItem[k - 1], k); + //string id = config.subItem[k - 1].id.TrimEx(); + //string url = config.subItem[k - 1].url.TrimEx(); + //string hashCode = $"{k}->"; + //if (config.subItem[k - 1].enabled == false) + //{ + // continue; + //} + //if (Utils.IsNullOrEmpty(id) || Utils.IsNullOrEmpty(url)) + //{ + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgNoValidSubscription")}"); + // continue; + //} - DownloadHandle downloadHandle3 = new DownloadHandle(); - downloadHandle3.UpdateCompleted += (sender2, args) => - { - if (args.Success) - { - AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}"); - var result = Utils.Base64Decode(args.Msg); - if (Utils.IsNullOrEmpty(result)) - { - AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}"); - return; - } + //DownloadHandle downloadHandle3 = new DownloadHandle(); + //downloadHandle3.UpdateCompleted += (sender2, args) => + //{ + // if (args.Success) + // { + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}"); + // var result = Utils.Base64Decode(args.Msg); + // if (Utils.IsNullOrEmpty(result)) + // { + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}"); + // return; + // } - ConfigHandler.RemoveServerViaSubid(ref config, id); - AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}"); - RefreshServers(); - if (AddBatchServers(result, id) == 0) - { - } - else - { - AppendText(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}"); - } - AppendText(false, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}"); - } - else - { - AppendText(false, args.Msg); - } - }; - downloadHandle3.Error += (sender2, args) => - { - AppendText(true, args.GetException().Message); - }; + // ConfigHandler.RemoveServerViaSubid(ref config, id); + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}"); + // RefreshServers(); + // if (AddBatchServers(result, id) == 0) + // { + // } + // else + // { + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgFailedImportSubscription")}"); + // } + // AppendText(false, $"{hashCode}{UIRes.I18N("MsgUpdateSubscriptionEnd")}"); + // } + // else + // { + // AppendText(false, args.Msg); + // } + //}; + //downloadHandle3.Error += (sender2, args) => + //{ + // AppendText(true, args.GetException().Message); + //}; - downloadHandle3.WebDownloadString(url); - AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}"); + //downloadHandle3.WebDownloadString(url); + //AppendText(false, $"{hashCode}{UIRes.I18N("MsgStartGettingSubscriptions")}"); } } diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs b/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs index 30fcadf5..cc54a67b 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs +++ b/v2rayN/v2rayN/Forms/SubSettingControl.Designer.cs @@ -28,76 +28,85 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl)); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.chkEnabled = new System.Windows.Forms.CheckBox(); - this.btnRemove = new System.Windows.Forms.Button(); - this.txtUrl = new System.Windows.Forms.TextBox(); - this.txtRemarks = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.groupBox2.SuspendLayout(); - this.SuspendLayout(); - // - // groupBox2 - // - resources.ApplyResources(this.groupBox2, "groupBox2"); - this.groupBox2.Controls.Add(this.chkEnabled); - this.groupBox2.Controls.Add(this.btnRemove); - this.groupBox2.Controls.Add(this.txtUrl); - this.groupBox2.Controls.Add(this.txtRemarks); - this.groupBox2.Controls.Add(this.label2); - this.groupBox2.Controls.Add(this.label3); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.TabStop = false; - // - // chkEnabled - // - resources.ApplyResources(this.chkEnabled, "chkEnabled"); - this.chkEnabled.Name = "chkEnabled"; - this.chkEnabled.UseVisualStyleBackColor = true; - this.chkEnabled.Leave += new System.EventHandler(this.txtRemarks_Leave); - // - // btnRemove - // - resources.ApplyResources(this.btnRemove, "btnRemove"); - this.btnRemove.Name = "btnRemove"; - this.btnRemove.UseVisualStyleBackColor = true; - this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); - // - // txtUrl - // - resources.ApplyResources(this.txtUrl, "txtUrl"); - this.txtUrl.Name = "txtUrl"; - this.txtUrl.Leave += new System.EventHandler(this.txtRemarks_Leave); - // - // txtRemarks - // - resources.ApplyResources(this.txtRemarks, "txtRemarks"); - this.txtRemarks.Name = "txtRemarks"; - this.txtRemarks.Leave += new System.EventHandler(this.txtRemarks_Leave); - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; - // - // SubSettingControl - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.groupBox2); - this.Name = "SubSettingControl"; - this.Load += new System.EventHandler(this.SubSettingControl_Load); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.ResumeLayout(false); - + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingControl)); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.btnUpdate = new System.Windows.Forms.Button(); + this.chkEnabled = new System.Windows.Forms.CheckBox(); + this.btnRemove = new System.Windows.Forms.Button(); + this.txtUrl = new System.Windows.Forms.TextBox(); + this.txtRemarks = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox2 + // + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.Controls.Add(this.btnUpdate); + this.groupBox2.Controls.Add(this.chkEnabled); + this.groupBox2.Controls.Add(this.btnRemove); + this.groupBox2.Controls.Add(this.txtUrl); + this.groupBox2.Controls.Add(this.txtRemarks); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; + // + // btnUpdate + // + resources.ApplyResources(this.btnUpdate, "btnUpdate"); + this.btnUpdate.Name = "btnUpdate"; + this.btnUpdate.UseVisualStyleBackColor = true; + this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click); + // + // chkEnabled + // + resources.ApplyResources(this.chkEnabled, "chkEnabled"); + this.chkEnabled.Name = "chkEnabled"; + this.chkEnabled.UseVisualStyleBackColor = true; + this.chkEnabled.Leave += new System.EventHandler(this.txtRemarks_Leave); + // + // btnRemove + // + resources.ApplyResources(this.btnRemove, "btnRemove"); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.UseVisualStyleBackColor = true; + this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); + // + // txtUrl + // + resources.ApplyResources(this.txtUrl, "txtUrl"); + this.txtUrl.Name = "txtUrl"; + this.txtUrl.Leave += new System.EventHandler(this.txtRemarks_Leave); + // + // txtRemarks + // + resources.ApplyResources(this.txtRemarks, "txtRemarks"); + this.txtRemarks.Name = "txtRemarks"; + this.txtRemarks.Leave += new System.EventHandler(this.txtRemarks_Leave); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // SubSettingControl + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Name = "SubSettingControl"; + this.Load += new System.EventHandler(this.SubSettingControl_Load); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + } #endregion @@ -108,6 +117,7 @@ private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Button btnRemove; - private System.Windows.Forms.CheckBox chkEnabled; + private System.Windows.Forms.CheckBox chkEnabled; + private System.Windows.Forms.Button btnUpdate; } } diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.cs b/v2rayN/v2rayN/Forms/SubSettingControl.cs index a3f09593..92a95f10 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.cs +++ b/v2rayN/v2rayN/Forms/SubSettingControl.cs @@ -1,63 +1,73 @@ -using System; -using System.Windows.Forms; -using v2rayN.Base; -using v2rayN.Mode; - -namespace v2rayN.Forms -{ - public delegate void ChangeEventHandler(object sender, EventArgs e); - public partial class SubSettingControl : UserControl - { - public event ChangeEventHandler OnButtonClicked; - - - public SubItem subItem { get; set; } - - public SubSettingControl() - { - InitializeComponent(); - } - - private void SubSettingControl_Load(object sender, EventArgs e) - { - BindingSub(); - } - - private void BindingSub() - { - if (subItem != null) - { - txtRemarks.Text = subItem.remarks.ToString(); - txtUrl.Text = subItem.url.ToString(); - chkEnabled.Checked = subItem.enabled; - } - } - private void EndBindingSub() - { - if (subItem != null) - { - subItem.remarks = txtRemarks.Text.TrimEx(); - subItem.url = txtUrl.Text.TrimEx(); - subItem.enabled = chkEnabled.Checked; - } - } - private void txtRemarks_Leave(object sender, EventArgs e) - { - EndBindingSub(); - } - - private void btnRemove_Click(object sender, EventArgs e) - { - if (subItem != null) - { - subItem.remarks = string.Empty; - subItem.url = string.Empty; - } - - if (OnButtonClicked != null) - { - OnButtonClicked(sender, e); - } - } - } -} +using System; +using System.Windows.Forms; +using v2rayN.Base; +using v2rayN.Mode; +using v2rayN.Handler; +using static v2rayN.Forms.MainForm; + +namespace v2rayN.Forms +{ + public delegate void ChangeEventHandler(object sender, EventArgs e); + public partial class SubSettingControl : UserControl + { + public event ChangeEventHandler OnButtonClicked; + + + public SubItem subItem { get; set; } + + public SubSettingControl() + { + InitializeComponent(); + } + + private void SubSettingControl_Load(object sender, EventArgs e) + { + BindingSub(); + } + + private void BindingSub() + { + if (subItem != null) + { + txtRemarks.Text = subItem.remarks.ToString(); + txtUrl.Text = subItem.url.ToString(); + chkEnabled.Checked = subItem.enabled; + } + } + private void EndBindingSub() + { + if (subItem != null) + { + subItem.remarks = txtRemarks.Text.TrimEx(); + subItem.url = txtUrl.Text.TrimEx(); + subItem.enabled = chkEnabled.Checked; + } + } + private void txtRemarks_Leave(object sender, EventArgs e) + { + EndBindingSub(); + } + + private void btnRemove_Click(object sender, EventArgs e) + { + if (subItem != null) + { + subItem.remarks = string.Empty; + subItem.url = string.Empty; + } + + if (OnButtonClicked != null) + { + OnButtonClicked(sender, e); + } + } + public event SubUpdate_Delegate SubUpdate_Event; + private void btnUpdate_Click(object sender, EventArgs e) + { + if (subItem != null) + { + SubUpdate_Event(subItem, -1); + } + } + } +} diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.resx b/v2rayN/v2rayN/Forms/SubSettingControl.resx index af5f03e9..3c430066 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.resx +++ b/v2rayN/v2rayN/Forms/SubSettingControl.resx @@ -1,330 +1,384 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - NoControl - - - groupBox2 - - - - 60, 16 - - - txtUrl - - - &Remove - - - 484, 21 - - - - 24 - - - 432, 46 - - - SubSettingControl - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - groupBox2 - - - 83, 12 - - - groupBox2 - - - 6, 12 - - - label3 - - - 127, 21 - - - True - - - 0 - - - 12, 55 - - - 127, 55 - - - 10 - - - Bottom - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - groupBox2 - - - 4 - - - 47, 12 - - - Subscription details - - - 0, 9 - - - Enable - - - chkEnabled - - - 3 - - - NoControl - - - Address (url) - - - 25 - - - 23 - - - groupBox2 - - - groupBox2 - - - 406, 23 - - - True - - - True - - - btnRemove - - - NoControl - - - label2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 584, 110 - - - NoControl - - - 584, 119 - - - 11 - - - Remarks - - - 0 - - - 12, 25 - - - 75, 23 - - - groupBox2 - - - 265, 21 - - - 10 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - txtRemarks - - - 5 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - zh-Hans - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + NoControl + + + groupBox2 + + + 4, 4, 4, 4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + txtUrl + + + + 80, 29 + + + &Remove + + + txtRemarks + + + + 24 + + + 623, 56 + + + 4, 4, 4, 4 + + + 4, 4, 4, 4 + + + 80, 29 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + groupBox2 + + + 111, 15 + + + 352, 25 + + + 26 + + + 8, 15 + + + 4, 4, 4, 4 + + + label3 + + + 155, 26 + + + True + + + groupBox2 + + + 4, 4, 4, 4 + + + 77, 19 + + + 1 + + + 16, 69 + + + 155, 69 + + + 10 + + + btnUpdate + + + Bottom + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 3 + + + groupBox2 + + + 5 + + + 4, 0, 4, 0 + + + 63, 15 + + + btnRemove + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Enable + + + chkEnabled + + + 4 + + + NoControl + + + 800, 149 + + + 612, 24 + + + 2 + + + 4, 0, 4, 0 + + + 25 + + + 23 + + + 4, 4, 4, 4 + + + NoControl + + + groupBox2 + + + 527, 29 + + + True + + + True + + + NoControl + + + label2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4, 4, 4, 4 + + + SubSettingControl + + + NoControl + + + 800, 138 + + + 11 + + + Remarks + + + 0 + + + 699, 24 + + + 16, 31 + + + groupBox2 + + + groupBox2 + + + 0 + + + Subscription details + + + 10 + + + groupBox2 + + + 0, 11 + + + Address (url) + + + Update + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + $this + + + 6 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + zh-Hans + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx b/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx index 12e6dbd4..8ad8fe0b 100644 --- a/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/SubSettingControl.zh-Hans.resx @@ -1,145 +1,154 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - 48, 16 - - - 启用 - - - 移除 - - - 29, 12 - - - 备注 - - - 65, 12 - - - 地址 (url) - - - 订阅详情 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 685, 24 + + + 更新 + + + 59, 19 + + + 启用 + + + 594, 24 + + + 移除 + + + 37, 15 + + + 备注 + + + 85, 15 + + + 地址 (url) + + + 订阅详情 + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/SubSettingForm.Designer.cs b/v2rayN/v2rayN/Forms/SubSettingForm.Designer.cs index 489693c8..2464fa17 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/SubSettingForm.Designer.cs @@ -28,63 +28,63 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingForm)); - this.btnClose = new System.Windows.Forms.Button(); - this.panCon = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); - this.btnAdd = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.panel2.SuspendLayout(); - this.SuspendLayout(); - // - // btnClose - // - this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.btnClose, "btnClose"); - this.btnClose.Name = "btnClose"; - this.btnClose.UseVisualStyleBackColor = true; - this.btnClose.Click += new System.EventHandler(this.btnClose_Click); - // - // panCon - // - resources.ApplyResources(this.panCon, "panCon"); - this.panCon.Name = "panCon"; - // - // panel2 - // - this.panel2.Controls.Add(this.btnAdd); - this.panel2.Controls.Add(this.btnClose); - this.panel2.Controls.Add(this.btnOK); - resources.ApplyResources(this.panel2, "panel2"); - this.panel2.Name = "panel2"; - // - // btnAdd - // - resources.ApplyResources(this.btnAdd, "btnAdd"); - this.btnAdd.Name = "btnAdd"; - this.btnAdd.UseVisualStyleBackColor = true; - this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); - // - // btnOK - // - resources.ApplyResources(this.btnOK, "btnOK"); - this.btnOK.Name = "btnOK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // SubSettingForm - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnClose; - this.Controls.Add(this.panCon); - this.Controls.Add(this.panel2); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Name = "SubSettingForm"; - this.Load += new System.EventHandler(this.SubSettingForm_Load); - this.panel2.ResumeLayout(false); - this.ResumeLayout(false); - + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SubSettingForm)); + this.btnClose = new System.Windows.Forms.Button(); + this.panCon = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.panel2.SuspendLayout(); + this.SuspendLayout(); + // + // btnClose + // + this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.btnClose, "btnClose"); + this.btnClose.Name = "btnClose"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // panCon + // + resources.ApplyResources(this.panCon, "panCon"); + this.panCon.Name = "panCon"; + // + // panel2 + // + this.panel2.Controls.Add(this.btnAdd); + this.panel2.Controls.Add(this.btnClose); + this.panel2.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel2, "panel2"); + this.panel2.Name = "panel2"; + // + // btnAdd + // + resources.ApplyResources(this.btnAdd, "btnAdd"); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnOK + // + resources.ApplyResources(this.btnOK, "btnOK"); + this.btnOK.Name = "btnOK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // SubSettingForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnClose; + this.Controls.Add(this.panCon); + this.Controls.Add(this.panel2); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "SubSettingForm"; + this.Load += new System.EventHandler(this.SubSettingForm_Load); + this.panel2.ResumeLayout(false); + this.ResumeLayout(false); + } #endregion diff --git a/v2rayN/v2rayN/Forms/SubSettingForm.cs b/v2rayN/v2rayN/Forms/SubSettingForm.cs index 14b5fbf6..3060f363 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.cs +++ b/v2rayN/v2rayN/Forms/SubSettingForm.cs @@ -3,7 +3,8 @@ using System.Collections.Generic; using System.Windows.Forms; using v2rayN.Handler; using v2rayN.Mode; - +using static v2rayN.Forms.MainForm; + namespace v2rayN.Forms { public partial class SubSettingForm : BaseForm @@ -28,6 +29,7 @@ namespace v2rayN.Forms /// /// 刷新列表 /// + public event SubUpdate_Delegate SubUpdate_Event; private void RefreshSubsView() { panCon.Controls.Clear(); @@ -51,6 +53,7 @@ namespace v2rayN.Forms { var item = config.subItem[k]; SubSettingControl control = new SubSettingControl(); + control.SubUpdate_Event += new SubUpdate_Delegate(SubUpdate_Notice); control.OnButtonClicked += Control_OnButtonClicked; control.subItem = item; control.Dock = DockStyle.Top; @@ -61,7 +64,10 @@ namespace v2rayN.Forms lstControls.Add(control); } } - + private void SubUpdate_Notice(SubItem item, int index) + { + SubUpdate_Event(item, index); + } private void Control_OnButtonClicked(object sender, EventArgs e) { RefreshSubsView(); diff --git a/v2rayN/v2rayN/Forms/SubSettingForm.resx b/v2rayN/v2rayN/Forms/SubSettingForm.resx index 05d3db7b..40b061de 100644 --- a/v2rayN/v2rayN/Forms/SubSettingForm.resx +++ b/v2rayN/v2rayN/Forms/SubSettingForm.resx @@ -1,273 +1,276 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - NoControl - - - - 448, 17 - - - 75, 23 - - - - 4 - - - &Cancel - - - btnClose - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 1 - - - True - - - Fill - - - 0, 0 - - - 581, 569 - - - 10 - - - panCon - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - NoControl - - - 47, 17 - - - 75, 23 - - - 6 - - - &Add - - - btnAdd - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 0 - - - NoControl - - - 355, 17 - - - 75, 23 - - - 5 - - - &OK - - - btnOK - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - 2 - - - Bottom - - - 0, 569 - - - 581, 60 - - - 7 - - - panel2 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - 6, 12 - - - 581, 629 - - - Subscription settings - - - SubSettingForm - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + NoControl + + + + 448, 17 + + + 75, 23 + + + + 4 + + + &Cancel + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 1 + + + True + + + Fill + + + 0, 0 + + + 797, 726 + + + 10 + + + panCon + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + NoControl + + + 47, 17 + + + 75, 23 + + + 6 + + + &Add + + + btnAdd + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + NoControl + + + 355, 17 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 2 + + + Bottom + + + 0, 726 + + + 797, 60 + + + 7 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 8, 15 + + + 797, 786 + + + 5, 5, 5, 5 + + + Subscription settings + + + SubSettingForm + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file