Browse Source

prevent moving up and down when unsaved

tags/2.5.6
clowwindy 9 years ago
parent
commit
b1ebfe7772
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      shadowsocks-csharp/View/ConfigForm.cs

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

@@ -269,6 +269,10 @@ namespace Shadowsocks.View
private void MoveUpButton_Click(object sender, EventArgs e) private void MoveUpButton_Click(object sender, EventArgs e)
{ {
if (!SaveOldSelectedServer())
{
return;
}
if (ServersListBox.SelectedIndex > 0) if (ServersListBox.SelectedIndex > 0)
{ {
MoveConfigItem(-1); // -1 means move backward MoveConfigItem(-1); // -1 means move backward
@@ -277,6 +281,10 @@ namespace Shadowsocks.View
private void MoveDownButton_Click(object sender, EventArgs e) private void MoveDownButton_Click(object sender, EventArgs e)
{ {
if (!SaveOldSelectedServer())
{
return;
}
if (ServersListBox.SelectedIndex < ServersListBox.Items.Count - 1) if (ServersListBox.SelectedIndex < ServersListBox.Items.Count - 1)
{ {
MoveConfigItem(+1); // +1 means move forward MoveConfigItem(+1); // +1 means move forward


Loading…
Cancel
Save