mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
After import update hotkeys
This commit is contained in:
parent
26ba620f33
commit
354996ca8a
3 changed files with 24 additions and 2 deletions
|
@ -503,7 +503,7 @@ private void btnImport_Click(object sender, EventArgs e)
|
||||||
btnImport.Enabled = true;
|
btnImport.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.MainForm.UpdateControls();
|
Program.MainForm.UpdateAll();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ private void InitializeControls()
|
||||||
HandleCreated += MainForm_HandleCreated;
|
HandleCreated += MainForm_HandleCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateControls()
|
private void UpdateControls()
|
||||||
{
|
{
|
||||||
niTray.Visible = Program.Settings.ShowTray;
|
niTray.Visible = Program.Settings.ShowTray;
|
||||||
|
|
||||||
|
@ -246,6 +246,18 @@ public void UpdateControls()
|
||||||
AfterSettingsJobs();
|
AfterSettingsJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateAll()
|
||||||
|
{
|
||||||
|
UpdateControls();
|
||||||
|
|
||||||
|
if (Program.HotkeyManager != null)
|
||||||
|
{
|
||||||
|
Program.HotkeyManager.UpdateHotkeys(Program.HotkeysConfig.Hotkeys, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateWorkflowsMenu();
|
||||||
|
}
|
||||||
|
|
||||||
private void AfterShownJobs()
|
private void AfterShownJobs()
|
||||||
{
|
{
|
||||||
if (Program.IsFirstTimeConfig)
|
if (Program.IsFirstTimeConfig)
|
||||||
|
|
|
@ -52,6 +52,16 @@ public HotkeyManager(HotkeyForm form, List<HotkeySettings> hotkeys, bool showFai
|
||||||
hotkeyForm.HotkeyPress += hotkeyForm_HotkeyPress;
|
hotkeyForm.HotkeyPress += hotkeyForm_HotkeyPress;
|
||||||
hotkeyForm.FormClosed += (sender, e) => hotkeyForm.InvokeSafe(() => UnregisterAllHotkeys(false));
|
hotkeyForm.FormClosed += (sender, e) => hotkeyForm.InvokeSafe(() => UnregisterAllHotkeys(false));
|
||||||
|
|
||||||
|
UpdateHotkeys(hotkeys, showFailedHotkeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateHotkeys(List<HotkeySettings> hotkeys, bool showFailedHotkeys)
|
||||||
|
{
|
||||||
|
if (Hotkeys != null)
|
||||||
|
{
|
||||||
|
UnregisterAllHotkeys();
|
||||||
|
}
|
||||||
|
|
||||||
Hotkeys = hotkeys;
|
Hotkeys = hotkeys;
|
||||||
|
|
||||||
RegisterAllHotkeys();
|
RegisterAllHotkeys();
|
||||||
|
|
Loading…
Reference in a new issue