From 879163dc2b808ddd0bb812fda5c7f770b2360ffc Mon Sep 17 00:00:00 2001 From: icylogic Date: Wed, 2 Sep 2015 01:23:32 +0800 Subject: [PATCH 1/2] Add more clear log --- .../Controller/Service/AvailabilityStatistics.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs b/shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs index f3d088c5..08125e92 100644 --- a/shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs +++ b/shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs @@ -6,8 +6,8 @@ using System.Net.NetworkInformation; using System.Threading; using Shadowsocks.Model; using System.Reflection; -using Shadowsocks.Util; - +using Shadowsocks.Util; + namespace Shadowsocks.Controller { class AvailabilityStatistics @@ -81,6 +81,7 @@ namespace Shadowsocks.Controller } catch (Exception e) { + Console.WriteLine($"An exception occured when eveluating {server.FriendlyName()}"); Logging.LogUsefulException(e); } } From 2fdb26c063450a4ec306cd49bb77c92b995b8b4f Mon Sep 17 00:00:00 2001 From: Jackson Ming Hu Date: Fri, 4 Sep 2015 11:59:23 +1000 Subject: [PATCH 2/2] Fix a tiny bug Sometimes the users may hit enter key by mistake, and the form will close without saving entries. --- shadowsocks-csharp/View/ConfigForm.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index d7d5c1f3..dc290249 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -146,6 +146,28 @@ namespace Shadowsocks.View } + private void ConfigForm_KeyDown(object sender, KeyEventArgs e) + { + // Sometimes the users may hit enter key by mistake, and the form will close without saving entries. + + if (e.KeyCode == Keys.Enter) + { + Server server = controller.GetCurrentServer(); + if (!SaveOldSelectedServer()) + { + return; + } + if (_modifiedConfiguration.configs.Count == 0) + { + MessageBox.Show(I18N.GetString("Please add at least one server")); + return; + } + controller.SaveServers(_modifiedConfiguration.configs, _modifiedConfiguration.localPort); + controller.SelectServerIndex(_modifiedConfiguration.configs.IndexOf(server)); + } + + } + private void ServersListBox_SelectedIndexChanged(object sender, EventArgs e) { if (!ServersListBox.CanSelect)