Browse Source

prompt user when the job which update pac via gfwlist have been ran on background

tags/2.3
Gang Zhuo 10 years ago
parent
commit
45d4667aa9
2 changed files with 21 additions and 5 deletions
  1. +1
    -0
      shadowsocks-csharp/Data/cn.txt
  2. +20
    -5
      shadowsocks-csharp/View/MenuViewController.cs

+ 1
- 0
shadowsocks-csharp/Data/cn.txt View File

@@ -42,3 +42,4 @@ Disabled=已禁用代理
Update PAC File via gfwlist...=基于 gfwlist 更新 PAC 文件...
Update PAC file failed=更新 PAC 文件失败
Update PAC file succeed=更新 PAC 文件成功
Job running...=任务正在执行中...

+ 20
- 5
shadowsocks-csharp/View/MenuViewController.cs View File

@@ -33,6 +33,8 @@ namespace Shadowsocks.View
private MenuItem PACModeItem;
private ConfigForm configForm;
private bool isUpdatePACFromGFWListRunning = false;
public MenuViewController(ShadowsocksController controller)
{
this.controller = controller;
@@ -181,6 +183,7 @@ namespace Shadowsocks.View
void controller_UpdatePACFromGFWListError(object sender, System.IO.ErrorEventArgs e)
{
isUpdatePACFromGFWListRunning = false;
_notifyIcon.BalloonTipTitle = I18N.GetString("Update PAC File via gfwlist...");
_notifyIcon.BalloonTipText = I18N.GetString("Update PAC file failed");
_notifyIcon.BalloonTipIcon = ToolTipIcon.Info;
@@ -190,6 +193,7 @@ namespace Shadowsocks.View
void controller_UpdatePACFromGFWListCompleted(object sender, EventArgs e)
{
isUpdatePACFromGFWListRunning = false;
_notifyIcon.BalloonTipTitle = I18N.GetString("Update PAC File via gfwlist...");
_notifyIcon.BalloonTipText = I18N.GetString("Update PAC file succeed");
_notifyIcon.BalloonTipIcon = ToolTipIcon.Info;
@@ -333,11 +337,22 @@ namespace Shadowsocks.View
private void UpdatePACFromGFWListItem_Click(object sender, EventArgs e)
{
_notifyIcon.BalloonTipTitle = I18N.GetString("Shadowsocks") + " " + UpdateChecker.Version;
_notifyIcon.BalloonTipText = I18N.GetString("Update PAC File via gfwlist...");
_notifyIcon.BalloonTipIcon = ToolTipIcon.Info;
_notifyIcon.ShowBalloonTip(5000);
controller.UpdatePACFromGFWList();
if (isUpdatePACFromGFWListRunning)
{
_notifyIcon.BalloonTipTitle = I18N.GetString("Update PAC File via gfwlist...");
_notifyIcon.BalloonTipText = I18N.GetString("Job running...");
_notifyIcon.BalloonTipIcon = ToolTipIcon.Info;
_notifyIcon.ShowBalloonTip(5000);
}
else
{
isUpdatePACFromGFWListRunning = true;
_notifyIcon.BalloonTipTitle = I18N.GetString("Shadowsocks") + " " + UpdateChecker.Version;
_notifyIcon.BalloonTipText = I18N.GetString("Update PAC File via gfwlist...");
_notifyIcon.BalloonTipIcon = ToolTipIcon.Info;
_notifyIcon.ShowBalloonTip(5000);
controller.UpdatePACFromGFWList();
}
}
private void AServerItem_Click(object sender, EventArgs e)


Loading…
Cancel
Save