From 7b0f0f35ccb5cc9b2d91df153d3ad3204e6d286a Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sun, 25 Oct 2020 20:48:35 +0800 Subject: [PATCH] fix: SettingForm load RedriectorTCP value wrong fix: Start Profile ModeComboBox.Text and ProfileNameText.Text wrong --- Netch/Forms/MainForm.Profile.cs | 6 ++---- Netch/Forms/SettingForm.cs | 2 +- NetchLib/SearchComboBox.cs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Netch/Forms/MainForm.Profile.cs b/Netch/Forms/MainForm.Profile.cs index 7ef62bc0..4b82baf8 100644 --- a/Netch/Forms/MainForm.Profile.cs +++ b/Netch/Forms/MainForm.Profile.cs @@ -79,7 +79,8 @@ namespace Netch.Forms private void LoadProfile(int index) { var p = Global.Settings.Profiles[index]; - ProfileNameText.Text = p.ModeRemark; + ProfileNameText.Text = p.ProfileName; + ModeComboBox.ResetCompletionList(); if (p.IsDummy) throw new Exception("Profile not found."); @@ -160,9 +161,6 @@ namespace Netch.Forms return; } - // Reset Mode ComboBox Items - ModeComboBox.Text = string.Empty; - try { LoadProfile(index); diff --git a/Netch/Forms/SettingForm.cs b/Netch/Forms/SettingForm.cs index 9936299f..de606314 100644 --- a/Netch/Forms/SettingForm.cs +++ b/Netch/Forms/SettingForm.cs @@ -40,7 +40,7 @@ namespace Netch.Forms BindTextBox(RedirectorTextBox, s => CheckPort("RedirectorTCP", s, Global.Settings.RedirectorTCPPort), s => Global.Settings.RedirectorTCPPort = s, - Global.Settings.HTTPLocalPort); + Global.Settings.RedirectorTCPPort); BindCheckBox(AllowDevicesCheckBox, c => Global.Settings.LocalAddress = AllowDevicesCheckBox.Checked ? "0.0.0.0" : "127.0.0.1", Global.Settings.LocalAddress switch diff --git a/NetchLib/SearchComboBox.cs b/NetchLib/SearchComboBox.cs index 36379e4e..9a76bad3 100644 --- a/NetchLib/SearchComboBox.cs +++ b/NetchLib/SearchComboBox.cs @@ -75,7 +75,7 @@ namespace System.Windows.Forms private bool IsOriginalItems => Items.Count == AutoFillTag.Length; - private void ResetCompletionList() + public void ResetCompletionList() { Keyword = null; try