#336, let menu observe -check_upgrade=0

This commit is contained in:
Kang Yu 2024-07-01 08:32:49 -07:00
parent 9733e4849f
commit d0ed7aa288
3 changed files with 8 additions and 7 deletions

View file

@ -316,8 +316,7 @@ namespace PersistentWindows.SystrayShell
}
}
systrayForm = new SystrayForm();
systrayForm.enableUpgradeNotice = check_upgrade;
systrayForm = new SystrayForm(check_upgrade);
systrayForm.autoUpgrade = auto_upgrade;
if (relaunch)

View file

@ -168,10 +168,6 @@ namespace PersistentWindows.SystrayShell
// pause/resume upgrade notice
//this.upgradeNoticeMenuItem.Text = "Disable upgrade notice";
this.upgradeNoticeMenuItem.Click += new System.EventHandler(this.PauseResumeUpgradeNotice);
if (this.enableUpgradeNotice)
this.upgradeNoticeMenuItem.Text = "Disable upgrade notice";
else
this.upgradeNoticeMenuItem.Text = "Enable upgrade notice";
//
// exitToolStripMenuItem

View file

@ -43,10 +43,16 @@ namespace PersistentWindows.SystrayShell
private Dictionary<string, bool> upgradeDownloaded = new Dictionary<string, bool>();
public SystrayForm()
public SystrayForm(bool enable_upgrade_notice)
{
InitializeComponent();
enableUpgradeNotice = enable_upgrade_notice;
if (enableUpgradeNotice)
upgradeNoticeMenuItem.Text = "Disable upgrade notice";
else
upgradeNoticeMenuItem.Text = "Enable upgrade notice";
clickDelayTimer = new System.Timers.Timer(1000);
clickDelayTimer.Elapsed += ClickTimerCallBack;
clickDelayTimer.SynchronizingObject = this.contextMenuStripSysTray;