Browse Source

add tray menu servers limit

pull/2295/head
2dust 3 years ago
parent
commit
4ada8fea27
  1. 2
      v2rayN/v2rayN/Forms/MainForm.cs
  2. 1
      v2rayN/v2rayN/Forms/MainMsgControl.Designer.cs
  3. 16
      v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs
  4. 13
      v2rayN/v2rayN/Forms/OptionSettingForm.cs
  5. 2572
      v2rayN/v2rayN/Forms/OptionSettingForm.resx
  6. 201
      v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx
  7. 4
      v2rayN/v2rayN/Handler/ConfigHandler.cs
  8. 2
      v2rayN/v2rayN/Mode/Config.cs

2
v2rayN/v2rayN/Forms/MainForm.cs

@ -345,7 +345,7 @@ namespace v2rayN.Forms
{
menuServers.DropDownItems.Clear();
if (lstVmess.Count > 30)
if (lstVmess.Count > config.trayMenuServersLimit)
{
menuServers.DropDownItems.Add(new ToolStripMenuItem(ResUI.TooManyServersTip));
return;

1
v2rayN/v2rayN/Forms/MainMsgControl.Designer.cs generated

@ -61,6 +61,7 @@ namespace v2rayN.Forms
this.txtMsgBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(226)))), ((int)(((byte)(228)))));
this.txtMsgBox.Name = "txtMsgBox";
this.txtMsgBox.ReadOnly = true;
this.txtMsgBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMsgBox_KeyDown);
//
// cmsMsgBox
//

16
v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs generated

@ -68,6 +68,8 @@
this.txtKcpmtu = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.txttrayMenuServersLimit = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.txtautoUpdateSubInterval = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.chkEnableSecurityProtocolTls13 = new System.Windows.Forms.CheckBox();
@ -376,6 +378,8 @@
// tabPage7
//
resources.ApplyResources(this.tabPage7, "tabPage7");
this.tabPage7.Controls.Add(this.txttrayMenuServersLimit);
this.tabPage7.Controls.Add(this.label17);
this.tabPage7.Controls.Add(this.txtautoUpdateSubInterval);
this.tabPage7.Controls.Add(this.label3);
this.tabPage7.Controls.Add(this.chkEnableSecurityProtocolTls13);
@ -392,6 +396,16 @@
this.tabPage7.Name = "tabPage7";
this.tabPage7.UseVisualStyleBackColor = true;
//
// txttrayMenuServersLimit
//
resources.ApplyResources(this.txttrayMenuServersLimit, "txttrayMenuServersLimit");
this.txttrayMenuServersLimit.Name = "txttrayMenuServersLimit";
//
// label17
//
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// txtautoUpdateSubInterval
//
resources.ApplyResources(this.txtautoUpdateSubInterval, "txtautoUpdateSubInterval");
@ -713,5 +727,7 @@
private System.Windows.Forms.TextBox txtuser;
private System.Windows.Forms.TextBox txtautoUpdateSubInterval;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txttrayMenuServersLimit;
private System.Windows.Forms.Label label17;
}
}

13
v2rayN/v2rayN/Forms/OptionSettingForm.cs

@ -111,10 +111,12 @@ namespace v2rayN.Forms
}
chkIgnoreGeoUpdateCore.Checked = config.ignoreGeoUpdateCore;
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
txtautoUpdateSubInterval.Text = config.autoUpdateSubInterval.ToString();
chkEnableAutoAdjustMainLvColWidth.Checked = config.uiItem.enableAutoAdjustMainLvColWidth;
chkEnableSecurityProtocolTls13.Checked = config.enableSecurityProtocolTls13;
txtautoUpdateInterval.Text = config.autoUpdateInterval.ToString();
txtautoUpdateSubInterval.Text = config.autoUpdateSubInterval.ToString();
txttrayMenuServersLimit.Text = config.trayMenuServersLimit.ToString();
}
private void InitCoreType()
@ -305,11 +307,12 @@ namespace v2rayN.Forms
config.keepOlderDedupl = chkKeepOlderDedupl.Checked;
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.autoUpdateSubInterval = Utils.ToInt(txtautoUpdateSubInterval.Text);
config.uiItem.enableAutoAdjustMainLvColWidth = chkEnableAutoAdjustMainLvColWidth.Checked;
config.enableSecurityProtocolTls13 = chkEnableSecurityProtocolTls13.Checked;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.autoUpdateSubInterval = Utils.ToInt(txtautoUpdateSubInterval.Text);
config.trayMenuServersLimit = Utils.ToInt(txttrayMenuServersLimit.Text);
return 0;
}
@ -339,6 +342,6 @@ namespace v2rayN.Forms
{
Process.Start(Utils.GetPath("EnableLoopback.exe"));
}
}
}

2572
v2rayN/v2rayN/Forms/OptionSettingForm.resx

File diff suppressed because it is too large Load Diff

201
v2rayN/v2rayN/Forms/OptionSettingForm.zh-Hans.resx

@ -121,15 +121,120 @@
<value>取消(&amp;C)</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="tabPage1.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage1.Text" xml:space="preserve">
<value> Core:基础设置 </value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:DNS设置 </value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="txttrayMenuServersLimit.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 211</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>185, 12</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>托盘右键菜单服务器展示数量限制</value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 184</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 16</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
<value>自动调整服务器列宽在更新订阅后</value>
</data>
<data name="btnSetLoopback.Text" xml:space="preserve">
<value>解除Windows10 UWP应用回环代理限制</value>
</data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 157</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>自动更新Geo文件的间隔(单位小时)</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
</data>
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value>
</data>
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>431, 37</value>
</data>
<data name="lbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>339, 41</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 16</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPageCoreType.Text" xml:space="preserve">
<value> Core类型设置 </value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="tabControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>662, 469</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>648, 437</value>
</data>
@ -220,12 +325,6 @@
<data name="label2.Text" xml:space="preserve">
<value>本地监听端口</value>
</data>
<data name="tabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage2.Text" xml:space="preserve">
<value> Core:DNS设置 </value>
</data>
<data name="linkDnsObjectDoc.Size" type="System.Drawing.Size, System.Drawing">
<value>161, 12</value>
</data>
@ -238,90 +337,6 @@
<data name="label14.Text" xml:space="preserve">
<value>自定义DNS(可多个,用逗号(,)隔开)</value>
</data>
<data name="tabPage6.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage6.Text" xml:space="preserve">
<value> Core:KCP设置 </value>
</data>
<data name="tabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage7.Text" xml:space="preserve">
<value> v2rayN设置 </value>
</data>
<data name="txtautoUpdateSubInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 159</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 12</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>自动更新订阅的间隔(单位小时)</value>
</data>
<data name="chkEnableSecurityProtocolTls13.Text" xml:space="preserve">
<value>启用安全协议TLS v1.3 (订阅/检查更新/测速)</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Size" type="System.Drawing.Size, System.Drawing">
<value>204, 16</value>
</data>
<data name="chkEnableAutoAdjustMainLvColWidth.Text" xml:space="preserve">
<value>自动调整服务器列宽在更新订阅后</value>
</data>
<data name="btnSetLoopback.Text" xml:space="preserve">
<value>解除Windows10 UWP应用回环代理限制</value>
</data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 134</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>191, 12</value>
</data>
<data name="label15.Text" xml:space="preserve">
<value>自动更新Geo文件的间隔(单位小时)</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Size" type="System.Drawing.Size, System.Drawing">
<value>150, 16</value>
</data>
<data name="chkIgnoreGeoUpdateCore.Text" xml:space="preserve">
<value>更新Core时忽略Geo文件</value>
</data>
<data name="chkKeepOlderDedupl.Size" type="System.Drawing.Size, System.Drawing">
<value>156, 16</value>
</data>
<data name="chkKeepOlderDedupl.Text" xml:space="preserve">
<value>去重时保留序号较小的项</value>
</data>
<data name="lbFreshrate.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 12</value>
</data>
<data name="lbFreshrate.Text" xml:space="preserve">
<value>统计刷新频率</value>
</data>
<data name="chkEnableStatistics.Size" type="System.Drawing.Size, System.Drawing">
<value>372, 16</value>
</data>
<data name="chkEnableStatistics.Text" xml:space="preserve">
<value>启用统计(实时网速显示和使用流量显示,需要重启v2rayN客户端)</value>
</data>
<data name="chkAutoRun.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 16</value>
</data>
<data name="chkAutoRun.Text" xml:space="preserve">
<value>开机自动启动(可能会不成功)</value>
</data>
<data name="tabPageCoreType.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPageCoreType.Text" xml:space="preserve">
<value> Core类型设置 </value>
</data>
<data name="tabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>
<data name="tabPage3.Text" xml:space="preserve">
<value> 系统代理设置 </value>
</data>
<data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
<value>654, 443</value>
</data>

4
v2rayN/v2rayN/Handler/ConfigHandler.cs

@ -1206,6 +1206,10 @@ namespace v2rayN.Handler
{
config.routingIndex = 0;
}
if (config.trayMenuServersLimit <= 0)
{
config.trayMenuServersLimit = 30;
}
Global.reloadV2ray = true;

2
v2rayN/v2rayN/Mode/Config.cs

@ -134,6 +134,8 @@ namespace v2rayN.Mode
get; set;
}
public int trayMenuServersLimit { get; set; }
#endregion
#region other entities

Loading…
Cancel
Save