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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user