diff --git a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.Common/PersistentWindowProcessor.cs index 3fa3448..11d43bd 100755 --- a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.Common/PersistentWindowProcessor.cs @@ -134,6 +134,7 @@ namespace Ninjacrab.PersistentWindows.Common public delegate void CallBackBool(bool en); public CallBackBool enableRestoreMenu; + public CallBackBool enableRestoreSnapshotMenu; private PowerModeChangedEventHandler powerModeChangedHandler; private EventHandler displaySettingsChangingHandler; diff --git a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/Program.cs index ee6b982..f732203 100755 --- a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/Program.cs @@ -292,6 +292,8 @@ namespace Ninjacrab.PersistentWindows.SystrayShell if (prompt) systrayForm.notifyIconMain.ShowBalloonTip(5000, $"snapshot '{c}' is captured", $"click icon then immediately press key '{c}' to restore the snapshot", ToolTipIcon.Info); } + + systrayForm.EnableSnapshotRestore(); } static public void ChangeZorderMethod() diff --git a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.Designer.cs b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.Designer.cs index 6b74fd0..6a54910 100644 --- a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.Designer.cs +++ b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.Designer.cs @@ -137,6 +137,8 @@ namespace Ninjacrab.PersistentWindows.SystrayShell this.restoreSnapshotMenuItem.Size = new System.Drawing.Size(135, 22); this.restoreSnapshotMenuItem.Text = "R&estore snapshot"; this.restoreSnapshotMenuItem.Click += new System.EventHandler(this.RestoreSnapshotClickHandler); + this.restoreSnapshotMenuItem.Enabled = false; + // suspend/resume auto restore // this.pauseResumeToolStripMenuItem.Name = "suspend/resume"; diff --git a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.cs b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.cs index 8b554c6..05b6773 100644 --- a/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.cs +++ b/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.SystrayShell/SystrayForm.cs @@ -175,6 +175,11 @@ namespace Ninjacrab.PersistentWindows.SystrayShell } } } + + public void EnableSnapshotRestore() + { + restoreSnapshotMenuItem.Enabled = true; + } private void CheckUpgrade() {