Squashed commit of the following:

commit 48eb4d88391b85986190ace825ec0a167df16f8a
Author: Syrone Wong <wong.syrone@gmail.com>
Date:   Sun Sep 18 15:46:09 2016 +0800

    Drop useless interface impl

    Signed-off-by: Syrone Wong <wong.syrone@gmail.com>

commit c0a4f3421a
Author: Logan Zhou <xorcererzc@gmail.com>
Date:   Sun Sep 18 00:58:02 2016 +0800

    Revert "Updated to meet the hint from Wongsyrone."

    This reverts commit 84c8053577.

commit 84c8053577
Author: Logan Zhou <xorcererzc@gmail.com>
Date:   Sun Sep 18 00:52:21 2016 +0800

    Updated to meet the hint from Wongsyrone.

commit 333ccb6d1f
Author: Logan Zhou <xorcererzc@gmail.com>
Date:   Sun Sep 18 00:34:52 2016 +0800

    Added duplicate button to config form.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
Syrone Wong
2016-09-18 16:06:00 +08:00
parent 50b601c6e5
commit ef17b72d25
4 changed files with 40 additions and 8 deletions
+14
View File
@@ -42,6 +42,7 @@ namespace Shadowsocks.View
{
AddButton.Text = I18N.GetString("&Add");
DeleteButton.Text = I18N.GetString("&Delete");
DuplicateButton.Text = I18N.GetString("Dupli&cate");
IPLabel.Text = I18N.GetString("Server Addr");
ServerPortLabel.Text = I18N.GetString("Server Port");
PasswordLabel.Text = I18N.GetString("Password");
@@ -210,6 +211,19 @@ namespace Shadowsocks.View
_lastSelectedIndex = ServersListBox.SelectedIndex;
}
private void DuplicateButton_Click( object sender, EventArgs e )
{
if (!SaveOldSelectedServer())
{
return;
}
Server currServer = _modifiedConfiguration.configs[_lastSelectedIndex];
_modifiedConfiguration.configs.Add(currServer);
LoadConfiguration(_modifiedConfiguration);
ServersListBox.SelectedIndex = _modifiedConfiguration.configs.Count - 1;
_lastSelectedIndex = ServersListBox.SelectedIndex;
}
private void DeleteButton_Click(object sender, EventArgs e)
{
_lastSelectedIndex = ServersListBox.SelectedIndex;