mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Code quality
This commit is contained in:
parent
730625c6db
commit
1c8a8d0fc6
1 changed files with 31 additions and 27 deletions
|
|
@ -217,33 +217,6 @@ internal static class HotKeyMapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ChangeRegisteredHotkey(RegisteredHotkeyType registeredType, string newHotkeyStr)
|
|
||||||
{
|
|
||||||
var newHotkey = new HotkeyModel(newHotkeyStr);
|
|
||||||
ChangeRegisteredHotkey(registeredType, newHotkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ChangeRegisteredHotkey(RegisteredHotkeyType registeredType, HotkeyModel newHotkey)
|
|
||||||
{
|
|
||||||
// Find the old registered hotkey data item
|
|
||||||
var registeredHotkeyData = _settings.RegisteredHotkeys.FirstOrDefault(h => h.RegisteredType == registeredType);
|
|
||||||
|
|
||||||
// If it is not found, return
|
|
||||||
if (registeredHotkeyData == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the old hotkey
|
|
||||||
RemoveHotkey(registeredHotkeyData);
|
|
||||||
|
|
||||||
// Update the hotkey string
|
|
||||||
registeredHotkeyData.Hotkey = newHotkey;
|
|
||||||
|
|
||||||
// Set the new hotkey
|
|
||||||
SetHotkey(registeredHotkeyData);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// TODO: Deprecated
|
// TODO: Deprecated
|
||||||
|
|
@ -509,6 +482,37 @@ internal static class HotKeyMapper
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Hotkey Changing
|
||||||
|
|
||||||
|
private static void ChangeRegisteredHotkey(RegisteredHotkeyType registeredType, string newHotkeyStr)
|
||||||
|
{
|
||||||
|
var newHotkey = new HotkeyModel(newHotkeyStr);
|
||||||
|
ChangeRegisteredHotkey(registeredType, newHotkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ChangeRegisteredHotkey(RegisteredHotkeyType registeredType, HotkeyModel newHotkey)
|
||||||
|
{
|
||||||
|
// Find the old registered hotkey data item
|
||||||
|
var registeredHotkeyData = _settings.RegisteredHotkeys.FirstOrDefault(h => h.RegisteredType == registeredType);
|
||||||
|
|
||||||
|
// If it is not found, return
|
||||||
|
if (registeredHotkeyData == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the old hotkey
|
||||||
|
RemoveHotkey(registeredHotkeyData);
|
||||||
|
|
||||||
|
// Update the hotkey string
|
||||||
|
registeredHotkeyData.Hotkey = newHotkey;
|
||||||
|
|
||||||
|
// Set the new hotkey
|
||||||
|
SetHotkey(registeredHotkeyData);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Commands
|
#region Commands
|
||||||
|
|
||||||
private static RelayCommand<CustomPluginHotkey> _customQueryHotkeyCommand;
|
private static RelayCommand<CustomPluginHotkey> _customQueryHotkeyCommand;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue