feature auto update subscribe

This commit is contained in:
Qixiny 2021-10-22 19:37:15 +08:00
parent 3bc7812e1a
commit 7013e1490d
9 changed files with 90 additions and 13 deletions

View file

@ -83,6 +83,8 @@ namespace v2rayN.Forms
HideForm();
AutoUpdateSubscription();
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
@ -1354,6 +1356,18 @@ namespace v2rayN.Forms
(new UpdateHandle()).UpdateSubscriptionProcess(config, _updateUI);
}
/// <summary>
/// If enabled this setting,Then automatic update subscription on start
/// </summary>
private void AutoUpdateSubscription()
{
if (config.autoUpdateSubscribe)
{
ShowMsg(UIRes.I18N("StartAutoUpdateSubscribe"));
UpdateSubscriptionProcess();
}
}
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
{
bool bShow = tsbQRCodeSwitch.Checked;

View file

@ -88,6 +88,7 @@
this.panel2 = new System.Windows.Forms.Panel();
this.btnOK = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.chkAutoUpdateSubscribe = new System.Windows.Forms.CheckBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
@ -373,6 +374,7 @@
//
// tabPage7
//
this.tabPage7.Controls.Add(this.chkAutoUpdateSubscribe);
this.tabPage7.Controls.Add(this.txtautoUpdateInterval);
this.tabPage7.Controls.Add(this.label15);
this.tabPage7.Controls.Add(this.chkIgnoreGeoUpdateCore);
@ -505,6 +507,12 @@
resources.ApplyResources(this.panel1, "panel1");
this.panel1.Name = "panel1";
//
// chkAutoUpdateSubscribe
//
resources.ApplyResources(this.chkAutoUpdateSubscribe, "chkAutoUpdateSubscribe");
this.chkAutoUpdateSubscribe.Name = "chkAutoUpdateSubscribe";
this.chkAutoUpdateSubscribe.UseVisualStyleBackColor = true;
//
// OptionSettingForm
//
resources.ApplyResources(this, "$this");
@ -595,5 +603,6 @@
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox txtautoUpdateInterval;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.CheckBox chkAutoUpdateSubscribe;
}
}

View file

@ -96,6 +96,7 @@ namespace v2rayN.Forms
chkAllowLANConn.Checked = config.allowLANConn;
chkEnableStatistics.Checked = config.enableStatistics;
chkKeepOlderDedupl.Checked = config.keepOlderDedupl;
chkAutoUpdateSubscribe.Checked = config.autoUpdateSubscribe;
ComboItem[] cbSource = new ComboItem[]
{
@ -292,6 +293,7 @@ namespace v2rayN.Forms
config.ignoreGeoUpdateCore = chkIgnoreGeoUpdateCore.Checked;
config.coreType = (ECoreType)cmbCoreType.SelectedIndex;
config.autoUpdateInterval = Utils.ToInt(txtautoUpdateInterval.Text);
config.autoUpdateSubscribe = chkAutoUpdateSubscribe.Checked;
return 0;
}

View file

@ -1137,6 +1137,36 @@
<data name="&gt;&gt;tabPage6.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="chkAutoUpdateSubscribe.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkAutoUpdateSubscribe.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="chkAutoUpdateSubscribe.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 189</value>
</data>
<data name="chkAutoUpdateSubscribe.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 16</value>
</data>
<data name="chkAutoUpdateSubscribe.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="chkAutoUpdateSubscribe.Text" xml:space="preserve">
<value>Update subscribe on start</value>
</data>
<data name="&gt;&gt;chkAutoUpdateSubscribe.Name" xml:space="preserve">
<value>chkAutoUpdateSubscribe</value>
</data>
<data name="&gt;&gt;chkAutoUpdateSubscribe.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;chkAutoUpdateSubscribe.Parent" xml:space="preserve">
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkAutoUpdateSubscribe.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="txtautoUpdateInterval.Location" type="System.Drawing.Point, System.Drawing">
<value>325, 156</value>
</data>
@ -1156,7 +1186,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;txtautoUpdateInterval.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1186,7 +1216,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="chkIgnoreGeoUpdateCore.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1216,7 +1246,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkIgnoreGeoUpdateCore.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="cmbCoreType.Items" xml:space="preserve">
<value>v2fly_core</value>
@ -1243,7 +1273,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;cmbCoreType.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1273,7 +1303,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="chkKeepOlderDedupl.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1303,7 +1333,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkKeepOlderDedupl.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="cbFreshrate.Location" type="System.Drawing.Point, System.Drawing">
<value>161, 84</value>
@ -1324,7 +1354,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;cbFreshrate.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="lbFreshrate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1354,7 +1384,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;lbFreshrate.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="chkEnableStatistics.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1384,7 +1414,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkEnableStatistics.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="chkAllowLANConn.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1411,7 +1441,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkAllowLANConn.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="chkAutoRun.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1438,7 +1468,7 @@
<value>tabPage7</value>
</data>
<data name="&gt;&gt;chkAutoRun.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="tabPage7.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>

View file

@ -322,4 +322,7 @@
<data name="$this.Text" xml:space="preserve">
<value>参数设置</value>
</data>
<data name="chkAutoUpdateSubscribe.Text" xml:space="preserve">
<value>启动时自动更新订阅</value>
</data>
</root>

View file

@ -200,6 +200,10 @@ namespace v2rayN.Mode
get; set;
} = 0;
public bool autoUpdateSubscribe
{
get;set;
}
#region
public string address()

View file

@ -47,8 +47,8 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
@ -825,6 +825,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Start automatic update subscribe 的本地化字符串。
/// </summary>
internal static string StartAutoUpdateSubscribe {
get {
return ResourceManager.GetString("StartAutoUpdateSubscribe", resourceCulture);
}
}
/// <summary>
/// 查找类似 PAC failed to start. Run it with Admin right. 的本地化字符串。
/// </summary>

View file

@ -394,4 +394,7 @@
<data name="MsgInformationTitle" xml:space="preserve">
<value>Informations (Filter : {0})</value>
</data>
<data name="StartAutoUpdateSubscribe" xml:space="preserve">
<value>Start automatic update subscribe</value>
</data>
</root>

View file

@ -394,4 +394,7 @@
<data name="MsgInformationTitle" xml:space="preserve">
<value>信息 (过滤器 : {0})</value>
</data>
<data name="StartAutoUpdateSubscribe" xml:space="preserve">
<value>自动订阅更新开始</value>
</data>
</root>