mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 21:15:38 +02:00
#347, remember the choice of disable webpage commander upon PW restart
This commit is contained in:
parent
7bd8511bb9
commit
697e79b1ba
2 changed files with 20 additions and 1 deletions
|
@ -380,7 +380,8 @@ namespace PersistentWindows.SystrayShell
|
|||
if (ignore_process.Length > 0)
|
||||
pwp.SetIgnoreProcess(ignore_process);
|
||||
|
||||
if (hotkey_window)
|
||||
string disable_webpage_commander= Path.Combine(Program.AppdataFolder, "disable_webpage_commander");
|
||||
if (!File.Exists(disable_webpage_commander) && hotkey_window)
|
||||
HotKeyForm.Start(hotkey);
|
||||
|
||||
if (!pwp.Start(auto_restore_from_db_at_startup))
|
||||
|
|
|
@ -53,6 +53,12 @@ namespace PersistentWindows.SystrayShell
|
|||
else
|
||||
upgradeNoticeMenuItem.Text = "Enable upgrade notice";
|
||||
|
||||
string disable_webpage_commander= Path.Combine(Program.AppdataFolder, "disable_webpage_commander");
|
||||
if (File.Exists(disable_webpage_commander))
|
||||
{
|
||||
invokeWebCommander.Text = "Enable webpage commander";
|
||||
}
|
||||
|
||||
clickDelayTimer = new System.Timers.Timer(1000);
|
||||
clickDelayTimer.Elapsed += ClickTimerCallBack;
|
||||
clickDelayTimer.SynchronizingObject = this.contextMenuStripSysTray;
|
||||
|
@ -351,15 +357,27 @@ namespace PersistentWindows.SystrayShell
|
|||
|
||||
private void WebCommander(object sender, EventArgs e)
|
||||
{
|
||||
string disable_webpage_commander= Path.Combine(Program.AppdataFolder, "disable_webpage_commander");
|
||||
|
||||
if ((User32.GetKeyState(0x11) & 0x8000) != 0)
|
||||
HotKeyForm.InvokeFromMenu();
|
||||
else if (this.invokeWebCommander.Text.Contains("Disable"))
|
||||
{
|
||||
File.Create(disable_webpage_commander);
|
||||
this.invokeWebCommander.Text = "Enable webpage commander";
|
||||
HotKeyForm.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(disable_webpage_commander);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.ToString());
|
||||
}
|
||||
|
||||
this.invokeWebCommander.Text = "Disable webpage commander";
|
||||
HotKeyForm.Start(Program.hotkey);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue