Skip to content

Commit

Permalink
user pac rules
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Dec 11, 2019
1 parent f8517a3 commit cf04c64
Show file tree
Hide file tree
Showing 9 changed files with 1,377 additions and 1,236 deletions.
85 changes: 62 additions & 23 deletions v2rayN/v2rayN/Forms/OptionSettingForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion v2rayN/v2rayN/Forms/OptionSettingForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ private void OptionSettingForm_Load(object sender, EventArgs e)
InitKCP();

InitGUI();

InitUserPAC();
}

/// <summary>
Expand Down Expand Up @@ -142,6 +144,11 @@ private void InitGUI()

}

private void InitUserPAC()
{
txtuserPacRule.Text = Utils.List2String(config.userPacRule, true);
}

private void btnOK_Click(object sender, EventArgs e)
{
if (SaveBase() != 0)
Expand All @@ -164,6 +171,11 @@ private void btnOK_Click(object sender, EventArgs e)
return;
}

if (SaveUserPAC() != 0)
{
return;
}

if (ConfigHandler.SaveConfig(ref config) == 0)
{
this.DialogResult = DialogResult.OK;
Expand Down Expand Up @@ -250,7 +262,7 @@ private int SaveBase()

//remoteDNS
config.remoteDNS = txtremoteDNS.Text.TrimEx();

config.listenerType = cmblistenerType.SelectedIndex;
return 0;
}
Expand Down Expand Up @@ -344,6 +356,15 @@ private int SaveGUI()
return 0;
}

private int SaveUserPAC()
{
string userPacRule = txtuserPacRule.Text.TrimEx();
userPacRule = userPacRule.Replace("\"", "");

config.userPacRule = Utils.String2List(userPacRule);

return 0;
}
private void btnClose_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
Expand Down
Loading

0 comments on commit cf04c64

Please sign in to comment.