فهرست منبع

Bug fix: Customizing custom commands from Synchronization checklist window was not working

Caused by Bug 1272

(cherry picked from commit c4a15d4a314cf8a48a23642305bf6de61f6b74bb)
https://winscp.net/tracker/1908

Source commit: df84bd589dcb5fcd3388878aaa8750ff99b93b59
Martin Prikryl 5 سال پیش
والد
کامیت
1997963d00
2فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 11 1
      source/forms/NonVisual.cpp
  2. 1 0
      source/forms/NonVisual.h

+ 11 - 1
source/forms/NonVisual.cpp

@@ -756,7 +756,7 @@ void __fastcall TNonVisualDataModule::ExplorerActionsExecute(
     EXE(CustomCommandsEnterFocusedAction, ScpExplorer->AdHocCustomCommand(true))
     EXE(CustomCommandsLastAction, ScpExplorer->LastCustomCommand(false))
     EXE(CustomCommandsLastFocusedAction, ScpExplorer->LastCustomCommand(true))
-    EXE(CustomCommandsCustomizeAction, PreferencesDialog(pmCustomCommands))
+    EXE(CustomCommandsCustomizeAction, CustomCommandsCustomize(NULL))
 
     // QUEUE
     EXE(QueueEnableAction, ScpExplorer->ToggleQueueEnabled())
@@ -1108,6 +1108,11 @@ int __fastcall TNonVisualDataModule::CreateCustomCommandsListMenu(
   return Result;
 }
 //---------------------------------------------------------------------------
+void __fastcall TNonVisualDataModule::CustomCommandsCustomize(TObject *)
+{
+  PreferencesDialog(pmCustomCommands);
+}
+//---------------------------------------------------------------------------
 void __fastcall TNonVisualDataModule::CreateCustomCommandsMenu(
   TTBCustomItem * Menu, bool OnFocused, bool Toolbar, TCustomCommandListType ListType, TStrings * HiddenCommands)
 {
@@ -1162,6 +1167,11 @@ void __fastcall TNonVisualDataModule::CreateCustomCommandsMenu(
 
   Item = new TTBXItem(Menu);
   Item->Action = CustomCommandsCustomizeAction;
+  if (ListType == ccltBoth)
+  {
+    // Hack. Bypass the Busy test in ExplorerActionsExecute.
+    Item->OnClick = CustomCommandsCustomize;
+  }
   Menu->Add(Item);
 }
 //---------------------------------------------------------------------------

+ 1 - 0
source/forms/NonVisual.h

@@ -711,6 +711,7 @@ protected:
   TAction * __fastcall CurrentQueueOnceEmptyAction();
   void __fastcall CloneShortcuts();
   void __fastcall ToolbarButtonItemClick(TObject * Sender);
+  void __fastcall CustomCommandsCustomize(TObject * Sender);
 
 public:
   __fastcall TNonVisualDataModule(TComponent * Owner);