fix: Disable update ACL after startup

This commit is contained in:
ChsBuffer
2020-10-26 16:58:45 +08:00
parent 8e223faa71
commit c774122fdb
2 changed files with 7 additions and 12 deletions

View File

@@ -256,19 +256,13 @@ namespace Netch.Forms
private async void UpdateACL(bool useProxy)
{
void DisableItems(bool v)
{
UpdateACLToolStripMenuItem.Enabled = updateACLWithProxyToolStripMenuItem.Enabled = v;
}
if (useProxy && ServerComboBox.SelectedIndex == -1)
{
MessageBoxX.Show(i18N.Translate("Please select a server first"));
return;
}
DisableItems(false);
Enabled = false;
NotifyTip(i18N.Translate("Updating in the background"));
try
@@ -304,7 +298,7 @@ namespace Netch.Forms
State = State.Stopped;
}
DisableItems(true);
Enabled = true;
}
}

View File

@@ -35,10 +35,11 @@ namespace Netch.Forms
// 启动需要禁用的控件
UninstallServiceToolStripMenuItem.Enabled =
updateACLWithProxyToolStripMenuItem.Enabled =
UpdateServersFromSubscribeLinksToolStripMenuItem.Enabled =
UninstallTapDriverToolStripMenuItem.Enabled =
ReloadModesToolStripMenuItem.Enabled = enabled;
UpdateACLToolStripMenuItem.Enabled =
updateACLWithProxyToolStripMenuItem.Enabled =
UpdateServersFromSubscribeLinksToolStripMenuItem.Enabled =
UninstallTapDriverToolStripMenuItem.Enabled =
ReloadModesToolStripMenuItem.Enabled = enabled;
}
_state = value;