From 1d4e5baafb9a1b92b5baa038cb9ab3f01177ad62 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 18 Apr 2022 18:57:56 +0800 Subject: [PATCH] Domain and IP are automatically sorted when saving --- .../RoutingRuleSettingDetailsForm.Designer.cs | 30 +- .../Forms/RoutingRuleSettingDetailsForm.cs | 12 +- .../Forms/RoutingRuleSettingDetailsForm.resx | 1048 +++++++++-------- ...RoutingRuleSettingDetailsForm.zh-Hans.resx | 3 + 4 files changed, 572 insertions(+), 521 deletions(-) diff --git a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.Designer.cs b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.Designer.cs index 3f0f1e40..ee32e22e 100644 --- a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.Designer.cs +++ b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.Designer.cs @@ -42,6 +42,7 @@ this.label4 = new System.Windows.Forms.Label(); this.cmbOutboundTag = new System.Windows.Forms.ComboBox(); this.panel4 = new System.Windows.Forms.Panel(); + this.chkAutoSort = new System.Windows.Forms.CheckBox(); this.btnClose = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); @@ -63,7 +64,6 @@ // // panel3 // - resources.ApplyResources(this.panel3, "panel3"); this.panel3.Controls.Add(this.chkEnabled); this.panel3.Controls.Add(this.clbInboundTag); this.panel3.Controls.Add(this.label2); @@ -74,6 +74,7 @@ this.panel3.Controls.Add(this.labRoutingTips); this.panel3.Controls.Add(this.label4); this.panel3.Controls.Add(this.cmbOutboundTag); + resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // // chkEnabled @@ -84,8 +85,8 @@ // // clbInboundTag // - resources.ApplyResources(this.clbInboundTag, "clbInboundTag"); this.clbInboundTag.CheckOnClick = true; + resources.ApplyResources(this.clbInboundTag, "clbInboundTag"); this.clbInboundTag.FormattingEnabled = true; this.clbInboundTag.Items.AddRange(new object[] { resources.GetString("clbInboundTag.Items"), @@ -100,8 +101,8 @@ // // clbProtocol // - resources.ApplyResources(this.clbProtocol, "clbProtocol"); this.clbProtocol.CheckOnClick = true; + resources.ApplyResources(this.clbProtocol, "clbProtocol"); this.clbProtocol.FormattingEnabled = true; this.clbProtocol.Items.AddRange(new object[] { resources.GetString("clbProtocol.Items"), @@ -127,8 +128,8 @@ // // labRoutingTips // - resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.ForeColor = System.Drawing.Color.Brown; + resources.ApplyResources(this.labRoutingTips, "labRoutingTips"); this.labRoutingTips.Name = "labRoutingTips"; // // label4 @@ -138,26 +139,33 @@ // // cmbOutboundTag // - resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbOutboundTag.FormattingEnabled = true; this.cmbOutboundTag.Items.AddRange(new object[] { resources.GetString("cmbOutboundTag.Items"), resources.GetString("cmbOutboundTag.Items1"), resources.GetString("cmbOutboundTag.Items2")}); + resources.ApplyResources(this.cmbOutboundTag, "cmbOutboundTag"); this.cmbOutboundTag.Name = "cmbOutboundTag"; // // panel4 // - resources.ApplyResources(this.panel4, "panel4"); + this.panel4.Controls.Add(this.chkAutoSort); this.panel4.Controls.Add(this.btnClose); this.panel4.Controls.Add(this.btnOK); + resources.ApplyResources(this.panel4, "panel4"); this.panel4.Name = "panel4"; // + // chkAutoSort + // + resources.ApplyResources(this.chkAutoSort, "chkAutoSort"); + this.chkAutoSort.Name = "chkAutoSort"; + this.chkAutoSort.UseVisualStyleBackColor = true; + // // btnClose // - resources.ApplyResources(this.btnClose, "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); @@ -171,15 +179,15 @@ // // panel2 // - resources.ApplyResources(this.panel2, "panel2"); this.panel2.Controls.Add(this.groupBox2); this.panel2.Controls.Add(this.groupBox1); + resources.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; // // groupBox2 // - resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Controls.Add(this.txtIP); + resources.ApplyResources(this.groupBox2, "groupBox2"); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; // @@ -190,8 +198,8 @@ // // groupBox1 // - resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Controls.Add(this.txtDomain); + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // @@ -214,6 +222,7 @@ this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); this.panel2.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); @@ -245,5 +254,6 @@ private System.Windows.Forms.CheckedListBox clbInboundTag; private System.Windows.Forms.Label label2; private System.Windows.Forms.CheckBox chkEnabled; + private System.Windows.Forms.CheckBox chkAutoSort; } } \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.cs b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.cs index 38f683cd..ef1e950e 100644 --- a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.cs +++ b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.cs @@ -48,8 +48,16 @@ namespace v2rayN.Forms } rulesItem.inboundTag = inboundTag; rulesItem.outboundTag = cmbOutboundTag.Text; - rulesItem.domain = Utils.String2ListSorted(txtDomain.Text); - rulesItem.ip = Utils.String2ListSorted(txtIP.Text); + if (chkAutoSort.Checked) + { + rulesItem.domain = Utils.String2ListSorted(txtDomain.Text); + rulesItem.ip = Utils.String2ListSorted(txtIP.Text); + } + else + { + rulesItem.domain = Utils.String2List(txtDomain.Text); + rulesItem.ip = Utils.String2List(txtIP.Text); + } var protocol = new List(); for (int i = 0; i < clbProtocol.Items.Count; i++) diff --git a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.resx b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.resx index fe5c1095..bbd5dbf2 100644 --- a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.resx +++ b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.resx @@ -117,577 +117,607 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 53, 12 - - - System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 32 - - - 245, 20 - - - 80 - - - 31 - - - proxy - - - 4, 4, 4, 4 - - - Fill - - - panel1 - - - 3 - - - clbProtocol - - - Protocol - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 7 - - - NoControl - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 3 - - - Left - - - 80 - - - NoControl - - - 0 - - - 29, 12 - - - 1 - - - http - - - panel2 - - - tls - - - RoutingSettingDetailsForm - - - NoControl - - - System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6 - - - Fill - - - 411, 15 - - - 119, 20 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 36 - - - Bottom - - - 0 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 344, 375 - - - $this - - - 598, 16 - - - groupBox1 - - - NoControl - - - 2 - - - 5 - - - label1 - - - 742, 395 - - - 0, 0 - - - 9 - - - True - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel3 - - - True - - - 3 - - - panel4 - - - 5 - - - bittorrent - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - socks - - - panel3 - - - 19, 82 - - - 25 - - - 347, 16 - - - 3, 17 - - - panel3 - - - 19, 20 - - - labRoutingTips - - - 19, 47 - - - 39 - - - groupBox1 - - - 1 - - - RoutingRuleSettingDetailsForm - - - panel2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel3 - - - 107, 43 - - - groupBox2 - - - 8 - - - 1 - - - 386, 375 - - - panel3 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel2 - - - Fill - - - panel4 - - - NoControl - - + Top - - $this - - - 42 - - - groupBox2 - - - panel3 - - - panel3 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - http - - - txtPort - - - 3, 17 - - - 1 + + + 0, 0 742, 10 - - 0, 0 - - - 24 - - - Port - - - Enable - - - label4 - - - &OK - - - 75, 23 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel4 - - - 34 - - - 274, 47 - - - 40 - - - block - - - 33 - - - 347, 43 - - - 0 - - - panel3 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnOK - - - 2 - - - 119, 21 - - - 4 - + 7 - - 0 + + panel1 - - 11 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - - panel3 - - - 8 - - - v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - label3 - - - inboundTag - - - Top - - - 742, 60 - - - 0, 121 - - + $this - - *Set the rules, separated by commas (,); The comma in the regular is replaced by <COMMA> - - - 245, 20 - - - 65, 12 - - - btnClose - - - 392, 0 - - - 742, 111 - - - True - - - 6, 12 - - - 0 - - - 617, 19 - - - 0, 10 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3 True - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl - - txtIP - - - direct - - - label2 + + 617, 19 60, 16 - - cmbOutboundTag + + 42 + + + Enable chkEnabled - - True + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 274, 20 + + panel3 - - NoControl + + 0 - - 742, 576 + + 80 - - 10 + + socks - - $this + + http - - 392, 395 + + 347, 16 - - 75, 23 - - - clbInboundTag - - - 4 - - - &Cancel - - - NoControl - - - NoControl - - - True - - - 4 - - - txtDomain + + 245, 20 41 - - IP + + clbInboundTag + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel3 + + 1 + + + True + + + NoControl + + + 274, 20 + + + 65, 12 + + + 40 + + + inboundTag + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 2 + + + 80 + + + http + + + tls + + + bittorrent + + + 347, 43 + + + 245, 20 + + + 39 + + + clbProtocol + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 3 + + + True + + + NoControl + + + 274, 47 + + + 53, 12 + + + 36 + + + Protocol + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 4 + + + 107, 43 + + + 119, 21 + + + 35 + + + txtPort + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 5 + + + True + + + NoControl + + + 19, 47 + + + 29, 12 + + + 34 + + + Port + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 6 + + + NoControl + + + 19, 82 + + + 598, 16 + + + 33 + + + *Set the rules, separated by commas (,); The comma in the regular is replaced by <COMMA> + + + labRoutingTips + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 7 + + + True + + + NoControl + + + 19, 20 + + + 71, 12 + + + 32 + + + outboundTag + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 8 + + + proxy + + + direct + + + block + + + 107, 16 + + + 119, 20 + + + 31 + + + cmbOutboundTag + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 9 + + + Top + + + 0, 10 + + + 742, 111 + + + 8 + + + panel3 + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - 0, 516 + + 2 - - 71, 12 + + True - - 350, 395 + + NoControl - - panel3 + + 41, 18 - - Domain + + 270, 16 - - Fill + + 41 + + + Domain and ip are auto sorted when saving + + + chkAutoSort + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 0 + + + NoControl 504, 15 - - 107, 16 + + 75, 23 - - outboundTag + + 4 + + + &Cancel + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 1 + + + NoControl + + + 411, 15 + + + 75, 23 + + + 5 + + + &OK + + + btnOK + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel4 + + + 2 + + + Bottom + + + 0, 516 + + + 742, 60 + + + 10 + + + panel4 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Fill + + + 3, 17 + + + True + + + 344, 375 + + + 25 + + + txtIP + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + Fill + + + 392, 0 + + + 350, 395 + + + 4 + + + IP + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + Fill + + + 3, 17 + + + True + + + 386, 375 + + + 24 + + + txtDomain + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Left + + + 0, 0 + + + 392, 395 + + + 3 + + + Domain + + + groupBox1 System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 35 + + panel2 + + + 1 + + + Fill + + + 0, 121 + + + 742, 395 + + + 11 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 True + + 6, 12 + + + 742, 576 + + + 4, 4, 4, 4 + + + RoutingSettingDetailsForm + + + RoutingRuleSettingDetailsForm + + + v2rayN.Forms.BaseForm, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.zh-Hans.resx b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.zh-Hans.resx index f050d4f5..0059a7ff 100644 --- a/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.zh-Hans.resx +++ b/v2rayN/v2rayN/Forms/RoutingRuleSettingDetailsForm.zh-Hans.resx @@ -170,4 +170,7 @@ 路由规则详情设置 + + 保存时Domain和IP自动排序 + \ No newline at end of file