diff --git a/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml b/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml index 476273e1..34e81af2 100644 --- a/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml +++ b/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml @@ -15,7 +15,7 @@ - + diff --git a/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml.cs b/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml.cs index 7d635c6d..3779041b 100644 --- a/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml.cs +++ b/MisakaTranslator-WPF/SettingsPages/TranslatorPages/TranslatorGeneralSettingsPage.xaml.cs @@ -56,9 +56,12 @@ private void EachRowTransCheckBox_Click(object sender, RoutedEventArgs e) Common.appSettings.EachRowTrans = EachRowTransCheckBox.IsChecked ?? false; } - private void HttpProxyBox_TextChanged(object sender, TextChangedEventArgs e) + private void HttpProxyBox_LostFocus(object sender, RoutedEventArgs e) { - Common.appSettings.HttpProxy = HttpProxyBox.Text; + string text = HttpProxyBox.Text.Trim(); + try { new Uri(text); } + catch (UriFormatException) { HandyControl.Controls.Growl.Error("Proxy url unsupported."); return; }; + Common.appSettings.HttpProxy = text; } private void TransLimitBox_ValueChanged(object sender, HandyControl.Data.FunctionEventArgs e)