Browse Source

Merge remote-tracking branch 'upstream/master'

tags/3.0
kimw 9 years ago
parent
commit
4f310efeac
2 changed files with 25 additions and 2 deletions
  1. +3
    -2
      shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs
  2. +22
    -0
      shadowsocks-csharp/View/ConfigForm.cs

+ 3
- 2
shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs View File

@@ -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);
}
}


+ 22
- 0
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -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)


Loading…
Cancel
Save