Explorar el Código

Bug 1700: Ctrl+Shift+Alt-? keyboard shortcuts for custom commands and extensions were not working

https://winscp.net/tracker/1700
(cherry picked from commit 3e7789caa5dddcba159dec0d1e85cfa4a94e11e4)

# Conflicts:
#	source/windows/GUITools.cpp
#	source/windows/GUITools.h

Source commit: da13892af94d84e295e16ef8983b92569efd2fa3
Martin Prikryl hace 7 años
padre
commit
917744be0b

+ 1 - 0
source/forms/CustomScpExplorer.cpp

@@ -4192,6 +4192,7 @@ void __fastcall TCustomScpExplorerForm::CheckCustomCommandShortCut(
     KeyProcessed(Key, Shift);
     if (CustomCommandState(*Command, false, ccltAll) > 0)
     {
+      TAutoFlag DontCopyCommandToClipboardFlag(DontCopyCommandToClipboard);
       ExecuteFileOperationCommand(foCustomCommand, osRemote,
         false, false, const_cast<TCustomCommandType *>(Command));
     }

+ 3 - 1
source/windows/GUITools.cpp

@@ -257,9 +257,11 @@ bool __fastcall FindTool(const UnicodeString & Name, UnicodeString & Path)
   return Result;
 }
 //---------------------------------------------------------------------------
+bool DontCopyCommandToClipboard = false;
+//---------------------------------------------------------------------------
 bool __fastcall CopyCommandToClipboard(const UnicodeString & Command)
 {
-  bool Result = UseAlternativeFunction() && IsKeyPressed(VK_CONTROL);
+  bool Result = !DontCopyCommandToClipboard && UseAlternativeFunction() && IsKeyPressed(VK_CONTROL);
   if (Result)
   {
     TInstantOperationVisualizer Visualizer;

+ 1 - 0
source/windows/GUITools.h

@@ -17,6 +17,7 @@ void __fastcall ExecuteShellChecked(const UnicodeString Command);
 bool __fastcall ExecuteShell(const UnicodeString Path, const UnicodeString Params,
   HANDLE & Handle);
 void __fastcall ExecuteShellCheckedAndWait(const UnicodeString Command, TProcessMessagesEvent ProcessMessages);
+extern bool DontCopyCommandToClipboard;
 bool __fastcall CopyCommandToClipboard(const UnicodeString & Command);
 void __fastcall OpenSessionInPutty(const UnicodeString PuttyPath,
   TSessionData * SessionData);