1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Custom commands keyboard shortcuts work on Synchronization checklist dialog

Source commit: fd53f5801b8516cf207465672be3080df5479b10
This commit is contained in:
Martin Prikryl
2019-12-19 13:28:08 +00:00
parent 7e73c599d8
commit 94c286bb52
3 changed files with 27 additions and 4 deletions

View File

@@ -1073,10 +1073,7 @@ int __fastcall TNonVisualDataModule::CreateCustomCommandsListMenu(
Item->Tag = Item->Tag | CustomCommandBoth;
}
Item->Hint = CustomCommandHint(Command);
if (ListType != ccltBoth)
{
Item->ShortCut = Command->ShortCut;
}
Item->ShortCut = Command->ShortCut;
Item->OnClick = CustomCommandClick;
Menu->Add(Item);

View File

@@ -1387,3 +1387,28 @@ void __fastcall TSynchronizeChecklistDialog::BrowseRemoteActionExecute(TObject *
DoBrowse(osRemote);
}
//---------------------------------------------------------------------------
void __fastcall TSynchronizeChecklistDialog::KeyDown(Word & Key, TShiftState Shift)
{
TShortCut KeyShortCut = ShortCut(Key, Shift);
TShortCut CustomShortCut = NormalizeCustomShortCut(KeyShortCut);
if (IsCustomShortCut(CustomShortCut))
{
TTBXItem * MenuItem = new TTBXItem(this);
CustomCommandsAction->ActionComponent = MenuItem;
CustomCommandsAction->Execute();
for (int Index = 0; Index < MenuItem->Count; Index++)
{
TTBCustomItem * Item = MenuItem->Items[Index];
if (Item->Enabled && (Item->ShortCut == CustomShortCut))
{
TAutoFlag DontCopyCommandToClipboardFlag(DontCopyCommandToClipboard);
Item->Click();
Key = 0;
break;
}
}
}
TForm::KeyDown(Key, Shift);
}

View File

@@ -181,6 +181,7 @@ protected:
void __fastcall DoBrowse(TOperationSide Side);
void __fastcall ListViewHintShow(TCMHintShow & HintShow);
void __fastcall StatusBarHintShow(TCMHintShow & HintShow);
DYNAMIC void __fastcall KeyDown(Word & Key, TShiftState Shift);
};
//----------------------------------------------------------------------------
#endif