fix: SettingForm load RedriectorTCP value wrong

fix: Start Profile ModeComboBox.Text and ProfileNameText.Text wrong
This commit is contained in:
ChsBuffer
2020-10-25 20:48:35 +08:00
parent 89ce721d4c
commit 7b0f0f35cc
3 changed files with 4 additions and 6 deletions

View File

@@ -79,7 +79,8 @@ namespace Netch.Forms
private void LoadProfile(int index) private void LoadProfile(int index)
{ {
var p = Global.Settings.Profiles[index]; var p = Global.Settings.Profiles[index];
ProfileNameText.Text = p.ModeRemark; ProfileNameText.Text = p.ProfileName;
ModeComboBox.ResetCompletionList();
if (p.IsDummy) if (p.IsDummy)
throw new Exception("Profile not found."); throw new Exception("Profile not found.");
@@ -160,9 +161,6 @@ namespace Netch.Forms
return; return;
} }
// Reset Mode ComboBox Items
ModeComboBox.Text = string.Empty;
try try
{ {
LoadProfile(index); LoadProfile(index);

View File

@@ -40,7 +40,7 @@ namespace Netch.Forms
BindTextBox<ushort>(RedirectorTextBox, BindTextBox<ushort>(RedirectorTextBox,
s => CheckPort("RedirectorTCP", s, Global.Settings.RedirectorTCPPort), s => CheckPort("RedirectorTCP", s, Global.Settings.RedirectorTCPPort),
s => Global.Settings.RedirectorTCPPort = s, s => Global.Settings.RedirectorTCPPort = s,
Global.Settings.HTTPLocalPort); Global.Settings.RedirectorTCPPort);
BindCheckBox(AllowDevicesCheckBox, BindCheckBox(AllowDevicesCheckBox,
c => Global.Settings.LocalAddress = AllowDevicesCheckBox.Checked ? "0.0.0.0" : "127.0.0.1", c => Global.Settings.LocalAddress = AllowDevicesCheckBox.Checked ? "0.0.0.0" : "127.0.0.1",
Global.Settings.LocalAddress switch Global.Settings.LocalAddress switch

View File

@@ -75,7 +75,7 @@ namespace System.Windows.Forms
private bool IsOriginalItems => Items.Count == AutoFillTag.Length; private bool IsOriginalItems => Items.Count == AutoFillTag.Length;
private void ResetCompletionList() public void ResetCompletionList()
{ {
Keyword = null; Keyword = null;
try try