After import update hotkeys

This commit is contained in:
Jaex 2016-02-12 02:15:23 +02:00
parent 26ba620f33
commit 354996ca8a
3 changed files with 24 additions and 2 deletions

View file

@ -503,7 +503,7 @@ private void btnImport_Click(object sender, EventArgs e)
btnImport.Enabled = true;
}
Program.MainForm.UpdateControls();
Program.MainForm.UpdateAll();
});
}
}

View file

@ -173,7 +173,7 @@ private void InitializeControls()
HandleCreated += MainForm_HandleCreated;
}
public void UpdateControls()
private void UpdateControls()
{
niTray.Visible = Program.Settings.ShowTray;
@ -246,6 +246,18 @@ public void UpdateControls()
AfterSettingsJobs();
}
public void UpdateAll()
{
UpdateControls();
if (Program.HotkeyManager != null)
{
Program.HotkeyManager.UpdateHotkeys(Program.HotkeysConfig.Hotkeys, true);
}
UpdateWorkflowsMenu();
}
private void AfterShownJobs()
{
if (Program.IsFirstTimeConfig)

View file

@ -52,6 +52,16 @@ public HotkeyManager(HotkeyForm form, List<HotkeySettings> hotkeys, bool showFai
hotkeyForm.HotkeyPress += hotkeyForm_HotkeyPress;
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;
RegisterAllHotkeys();