From 25a10d2635713a3da9e6fd9bce5d152f4fa5f5fb Mon Sep 17 00:00:00 2001 From: Stzx Date: Sun, 15 Mar 2020 16:22:24 +0800 Subject: [PATCH 1/4] Fix #2830 --- shadowsocks-csharp/View/ConfigForm.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index 68fc3a7d..aa337e6e 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -575,21 +575,18 @@ namespace Shadowsocks.View private void MoveConfigItem(int step) { - int index = ServersListBox.SelectedIndex; - Server server = _modifiedConfiguration.configs[index]; - object item = ServersListBox.Items[index]; + var server = _modifiedConfiguration.configs[_lastSelectedIndex]; + var newIndex = _lastSelectedIndex + step; - _modifiedConfiguration.configs.Remove(server); - _modifiedConfiguration.configs.Insert(index + step, server); - _modifiedConfiguration.index += step; + _modifiedConfiguration.configs.RemoveAt(_lastSelectedIndex); + _modifiedConfiguration.configs.Insert(newIndex, server); ServersListBox.BeginUpdate(); - ServersListBox.Enabled = false; - _lastSelectedIndex = index + step; - ServersListBox.Items.Remove(item); - ServersListBox.Items.Insert(index + step, item); - ServersListBox.Enabled = true; - ServersListBox.SelectedIndex = index + step; + + LoadServerNameListToUI(_modifiedConfiguration); + + _lastSelectedIndex = newIndex; + ServersListBox.SelectedIndex = newIndex; ServersListBox.EndUpdate(); UpdateButtons(); From 6893af10b5e5da9391e041c705abade9716e55f4 Mon Sep 17 00:00:00 2001 From: celeron533 Date: Tue, 31 Mar 2020 22:38:52 +0800 Subject: [PATCH 2/4] Update CHANGES and bump version --- CHANGES | 12 ++++++++++++ .../Controller/Service/UpdateChecker.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fdae0471..bb165554 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +4.1.9.3 2020-03-31 +- Set default method to chacha20-ietf-poly1305 +- Using hash in PAC URL (#2759) +- Rename and translate title of statistics form (#2768) +- Russian translation (#2767) +- Refine Updated Notification logic +- Using NLog (#2783) +- Bug fix: wrong server in tray menu (#2782) +- Deprecate unsafe encryption method (#2757, #2801) +- Bug fix: server config is overwritten by others when moving up/down (#2830) +- Other minor bug fixes and improvements + 4.1.9.2 2019-12-25 - Fix i18n issues (#2740, #2741) diff --git a/shadowsocks-csharp/Controller/Service/UpdateChecker.cs b/shadowsocks-csharp/Controller/Service/UpdateChecker.cs index fb1aa331..bfbc460e 100644 --- a/shadowsocks-csharp/Controller/Service/UpdateChecker.cs +++ b/shadowsocks-csharp/Controller/Service/UpdateChecker.cs @@ -26,7 +26,7 @@ namespace Shadowsocks.Controller public string LatestVersionLocalName; public event EventHandler CheckUpdateCompleted; - public const string Version = "4.1.9.2"; + public const string Version = "4.1.9.3"; private class CheckUpdateTimer : System.Timers.Timer { From adab9f96724d6af21eef0fd1079d529c791c791a Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Thu, 2 Apr 2020 17:41:23 +0800 Subject: [PATCH 3/4] https://stackoverflow.com/questions/7693429/process-start-to-open-an-url-getting-an-exception --- shadowsocks-csharp/View/MenuViewController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shadowsocks-csharp/View/MenuViewController.cs b/shadowsocks-csharp/View/MenuViewController.cs index e31fa67b..40abf6fc 100644 --- a/shadowsocks-csharp/View/MenuViewController.cs +++ b/shadowsocks-csharp/View/MenuViewController.cs @@ -624,7 +624,11 @@ namespace Shadowsocks.View private void AboutItem_Click(object sender, EventArgs e) { - Process.Start("https://github.com/shadowsocks/shadowsocks-windows"); + Process.Start(new ProcessStartInfo("https://github.com/shadowsocks/shadowsocks-windows") + { + UseShellExecute = true, + Verb = "open" + }); } private void notifyIcon1_Click(object sender, MouseEventArgs e) From 7dfd0493afd5853941ff245dcb26b0cf9a908216 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Thu, 2 Apr 2020 17:45:37 +0800 Subject: [PATCH 4/4] https://stackoverflow.com/questions/7693429/process-start-to-open-an-url-getting-an-exception --- shadowsocks-csharp/Util/Util.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shadowsocks-csharp/Util/Util.cs b/shadowsocks-csharp/Util/Util.cs index 81ea61e5..79dd63f7 100755 --- a/shadowsocks-csharp/Util/Util.cs +++ b/shadowsocks-csharp/Util/Util.cs @@ -279,8 +279,11 @@ namespace Shadowsocks.Util // hack because of this: https://github.com/dotnet/corefx/issues/10361 if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - url = url.Replace("&", "^&"); - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + Process.Start(new ProcessStartInfo(url) + { + UseShellExecute = true, + Verb = "open" + }); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {