ADD: Update hotkeys if default hotkey list is changed

This commit is contained in:
Alexander Koblov 2010-01-18 11:58:29 +00:00
commit 0e5094222d
3 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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');

View file

@ -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]);