Prechádzať zdrojové kódy

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

https://winscp.net/tracker/1700

Source commit: 8fcc8a8be903f1d812cce10257da2f1fb31de348
Martin Prikryl 7 rokov pred
rodič
commit
3e7789caa5

+ 1 - 0
source/forms/CustomScpExplorer.cpp

@@ -4359,6 +4359,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

@@ -312,9 +312,11 @@ TObjectList * StartCreationDirectoryMonitorsOnEachDrive(unsigned int Filter, TFi
   return Result.release();
 }
 //---------------------------------------------------------------------------
+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

@@ -20,6 +20,7 @@ bool __fastcall ExecuteShell(const UnicodeString Path, const UnicodeString Param
   HANDLE & Handle);
 void __fastcall ExecuteShellCheckedAndWait(const UnicodeString Command, TProcessMessagesEvent ProcessMessages);
 TObjectList * StartCreationDirectoryMonitorsOnEachDrive(unsigned int Filter, TFileChangedEvent OnChanged);
+extern bool DontCopyCommandToClipboard;
 bool __fastcall CopyCommandToClipboard(const UnicodeString & Command);
 void __fastcall OpenSessionInPutty(const UnicodeString PuttyPath,
   TSessionData * SessionData);