mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: HotMan: When adding default hotkeys don't add hotkey for a command that already has a different hotkey assigned.
This commit is contained in:
parent
b0d4a4c556
commit
3b1d2ee630
1 changed files with 10 additions and 3 deletions
|
|
@ -312,10 +312,17 @@ begin
|
|||
end;
|
||||
|
||||
function THotkeys.AddIfNotExists(Shortcut: String; Command, Params: String): THotkey;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
Result := Find(Shortcut);
|
||||
if not Assigned(Result) then
|
||||
Result := Add(Shortcut, Command, Params);
|
||||
// Check if the shortcut isn't already assigned to a different command
|
||||
// or if a different shortcut isn't already assigned to the command.
|
||||
for i := 0 to Count - 1 do
|
||||
begin
|
||||
if (Items[i].Shortcut = Shortcut) or (Items[i].Command = Command) then
|
||||
Exit(nil);
|
||||
end;
|
||||
Result := Add(Shortcut, Command, Params);
|
||||
end;
|
||||
|
||||
procedure THotkeys.Clear;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue