mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: Update hotkeys if default hotkey list is changed
This commit is contained in:
parent
2a3d637083
commit
0e5094222d
3 changed files with 8 additions and 4 deletions
|
|
@ -641,7 +641,7 @@ begin
|
|||
HotMan.RegisterHotkeyManager(Self);
|
||||
HotMan.RegisterHotkeyManager(edtCommand);
|
||||
|
||||
if (HotMan.HotkeyList.Count = 0) or (CompareText(HotMan.Version, dcVersion) <> 0) then
|
||||
if (HotMan.HotkeyList.Count = 0) or (CompareText(HotMan.Version, hkVersion) <> 0) then
|
||||
LoadDefaultHotkeyBindings;
|
||||
// load shortcuts to action list for showing it in menu
|
||||
HotMan.LoadShortCutToActionList(ActionLst);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ type
|
|||
{ Show icons mode }
|
||||
TShowIconsMode = (sim_none, sim_standart, sim_all, sim_all_and_exe);
|
||||
|
||||
const
|
||||
{ Default hotkey list version number }
|
||||
hkVersion: String = '0.4.6.r2205';
|
||||
|
||||
var
|
||||
{ Double Commander Version }
|
||||
dcVersion: String;
|
||||
|
|
@ -255,8 +259,8 @@ uses
|
|||
|
||||
procedure LoadDefaultHotkeyBindings;
|
||||
begin
|
||||
// if not assigned(HotMan) then exit;
|
||||
With HotMan do
|
||||
// Note: Update hkVersion if you change default hotkeys list
|
||||
with HotMan do
|
||||
begin
|
||||
AddHotKeyEx('Alt+X','cm_Exit','','FrmMain','FrmMain');
|
||||
AddHotKeyEx('F1','cm_About','','FrmMain','FrmMain');
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ begin
|
|||
begin
|
||||
if FileExists(FileName) then DeleteFile(FileName);
|
||||
ini:=TIniFileEx.Create(FileName);
|
||||
ini.WriteString('Configuration', 'Version', dcVersion);
|
||||
ini.WriteString('Configuration', 'Version', hkVersion);
|
||||
for i:=0 to FHotList.Count-1 do
|
||||
begin
|
||||
fst:=TStringList(FHotList.Objects[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue