Browse Source

Copy on double-click works even in local-local mode

Source commit: 8880595ea2611dd1d9a3393df4864368b1cd6dfd
Martin Prikryl 5 years ago
parent
commit
093035d11a

+ 10 - 3
source/forms/CustomScpExplorer.cpp

@@ -5321,8 +5321,14 @@ void __fastcall TCustomScpExplorerForm::DoDirViewExecFile(TObject * Sender,
         UnlockWindow();
         UnlockWindow();
         try
         try
         {
         {
-          ExecuteFileOperation(
-            foCopy, Side, true, !WinConfiguration->CopyOnDoubleClickConfirmation);
+          if (IsLocalBrowserMode())
+          {
+            LocalLocalCopy(foCopy, Side, true, !WinConfiguration->CopyOnDoubleClickConfirmation);
+          }
+          else
+          {
+            ExecuteFileOperation(foCopy, Side, true, !WinConfiguration->CopyOnDoubleClickConfirmation);
+          }
         }
         }
         __finally
         __finally
         {
         {
@@ -10999,7 +11005,8 @@ bool __fastcall TCustomScpExplorerForm::HasActiveTerminal()
   return IsActiveTerminal(Terminal);
   return IsActiveTerminal(Terminal);
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
-void TCustomScpExplorerForm::LocalLocalCopy(TFileOperation, TOperationSide, bool DebugUsedArg(OnFocused))
+void TCustomScpExplorerForm::LocalLocalCopy(
+  TFileOperation, TOperationSide, bool DebugUsedArg(OnFocused), bool DebugUsedArg(NoConfirmation))
 {
 {
   DebugFail();
   DebugFail();
 }
 }

+ 1 - 1
source/forms/CustomScpExplorer.h

@@ -729,7 +729,7 @@ public:
     bool OnFocused, bool NoConfirmation = false, void * Param = NULL);
     bool OnFocused, bool NoConfirmation = false, void * Param = NULL);
   void __fastcall ExecuteCopyOperationCommand(
   void __fastcall ExecuteCopyOperationCommand(
     TOperationSide Side, bool OnFocused, unsigned int Flags);
     TOperationSide Side, bool OnFocused, unsigned int Flags);
-  virtual void LocalLocalCopy(TFileOperation Operation, TOperationSide Side, bool OnFocused);
+  virtual void LocalLocalCopy(TFileOperation Operation, TOperationSide Side, bool OnFocused, bool NoConfirmation);
   void __fastcall AdHocCustomCommand(bool OnFocused);
   void __fastcall AdHocCustomCommand(bool OnFocused);
   virtual TCustomDirView * __fastcall DirView(TOperationSide Side);
   virtual TCustomDirView * __fastcall DirView(TOperationSide Side);
   virtual bool __fastcall DirViewEnabled(TOperationSide Side);
   virtual bool __fastcall DirViewEnabled(TOperationSide Side);

+ 6 - 6
source/forms/NonVisual.cpp

@@ -562,17 +562,17 @@ void __fastcall TNonVisualDataModule::ExplorerActionsExecute(
     EXE(LocalPropertiesAction2, ScpExplorer->ExecuteFileOperationCommand(foSetProperties, osLocal, false))
     EXE(LocalPropertiesAction2, ScpExplorer->ExecuteFileOperationCommand(foSetProperties, osLocal, false))
     EXE(LocalAddEditLinkAction3, ScpExplorer->AddEditLink(osLocal, false))
     EXE(LocalAddEditLinkAction3, ScpExplorer->AddEditLink(osLocal, false))
     EXE(LocalNewFileAction, ScpExplorer->EditNew(osLocal))
     EXE(LocalNewFileAction, ScpExplorer->EditNew(osLocal))
-    EXE(LocalLocalCopyAction, ScpExplorer->LocalLocalCopy(foCopy, osLocal, false))
-    EXE(LocalLocalMoveAction, ScpExplorer->LocalLocalCopy(foMove, osLocal, false))
-    EXE(LocalOtherCopyAction, ScpExplorer->LocalLocalCopy(foCopy, osOther, false))
-    EXE(LocalOtherMoveAction, ScpExplorer->LocalLocalCopy(foMove, osOther, false))
+    EXE(LocalLocalCopyAction, ScpExplorer->LocalLocalCopy(foCopy, osLocal, false, false))
+    EXE(LocalLocalMoveAction, ScpExplorer->LocalLocalCopy(foMove, osLocal, false, false))
+    EXE(LocalOtherCopyAction, ScpExplorer->LocalLocalCopy(foCopy, osOther, false, false))
+    EXE(LocalOtherMoveAction, ScpExplorer->LocalLocalCopy(foMove, osOther, false, false))
     // local focused operation
     // local focused operation
     EXE(LocalCopyFocusedAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, ShortCutFlag))
     EXE(LocalCopyFocusedAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, ShortCutFlag))
     EXE(LocalCopyFocusedQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, cocQueue))
     EXE(LocalCopyFocusedQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, cocQueue))
     EXE(LocalCopyFocusedNonQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, cocNonQueue))
     EXE(LocalCopyFocusedNonQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osLocal, true, cocNonQueue))
     EXE(LocalMoveFocusedAction, ScpExplorer->ExecuteFileOperationCommand(foMove, osLocal, true))
     EXE(LocalMoveFocusedAction, ScpExplorer->ExecuteFileOperationCommand(foMove, osLocal, true))
-    EXE(LocalLocalCopyFocusedAction, ScpExplorer->LocalLocalCopy(foCopy, osCurrent, true))
-    EXE(LocalLocalMoveFocusedAction, ScpExplorer->LocalLocalCopy(foMove, osCurrent, true))
+    EXE(LocalLocalCopyFocusedAction, ScpExplorer->LocalLocalCopy(foCopy, osCurrent, true, false))
+    EXE(LocalLocalMoveFocusedAction, ScpExplorer->LocalLocalCopy(foMove, osCurrent, true, false))
     // remote selected operation
     // remote selected operation
     EXE(RemoteCopyAction, ScpExplorer->ExecuteCopyOperationCommand(osRemote, false, ShortCutFlag))
     EXE(RemoteCopyAction, ScpExplorer->ExecuteCopyOperationCommand(osRemote, false, ShortCutFlag))
     EXE(RemoteCopyQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osRemote, false, cocQueue))
     EXE(RemoteCopyQueueAction, ScpExplorer->ExecuteCopyOperationCommand(osRemote, false, cocQueue))

+ 1 - 1
source/forms/NonVisual.dfm

@@ -3236,7 +3236,7 @@ object NonVisualDataModule: TNonVisualDataModule
         Action = LocalMoveFocusedAction
         Action = LocalMoveFocusedAction
       end
       end
     end
     end
-    object TBXItem102: TTBXItem
+    object LocalLocalCopyMenuItem: TTBXItem
       Action = LocalLocalCopyFocusedAction
       Action = LocalLocalCopyFocusedAction
     end
     end
     object TBXItem101: TTBXItem
     object TBXItem101: TTBXItem

+ 1 - 1
source/forms/NonVisual.h

@@ -661,7 +661,7 @@ __published:    // IDE-managed Components
   TAction *LocalLocalCopyFocusedAction;
   TAction *LocalLocalCopyFocusedAction;
   TAction *LocalLocalMoveFocusedAction;
   TAction *LocalLocalMoveFocusedAction;
   TTBXItem *TBXItem101;
   TTBXItem *TBXItem101;
-  TTBXItem *TBXItem102;
+  TTBXItem *LocalLocalCopyMenuItem;
   void __fastcall ExplorerActionsUpdate(TBasicAction *Action, bool &Handled);
   void __fastcall ExplorerActionsUpdate(TBasicAction *Action, bool &Handled);
   void __fastcall ExplorerActionsExecute(TBasicAction *Action, bool &Handled);
   void __fastcall ExplorerActionsExecute(TBasicAction *Action, bool &Handled);
   void __fastcall SessionIdleTimerTimer(TObject *Sender);
   void __fastcall SessionIdleTimerTimer(TObject *Sender);

+ 10 - 2
source/forms/ScpCommander.cpp

@@ -2393,7 +2393,14 @@ void __fastcall TScpCommanderForm::DoLocalDirViewContextPopup(TOperationSide Sid
   {
   {
     DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalOpenMenuItem, dcaOpen);
     DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalOpenMenuItem, dcaOpen);
     DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalEditMenuItem, dcaEdit);
     DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalEditMenuItem, dcaEdit);
-    DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalCopyMenuItem, dcaCopy);
+    if (IsLocalBrowserMode())
+    {
+      DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalLocalCopyMenuItem, dcaCopy);
+    }
+    else
+    {
+      DirViewContextPopupDefaultItem(Side, NonVisualDataModule->LocalCopyMenuItem, dcaCopy);
+    }
 
 
     DirViewContextPopup(Side, fcLocalPopup, MousePos);
     DirViewContextPopup(Side, fcLocalPopup, MousePos);
     Handled = true;
     Handled = true;
@@ -2602,7 +2609,8 @@ void __fastcall TScpCommanderForm::LocalDriveViewNeedHiddenDirectories(TObject *
   }
   }
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
-void TScpCommanderForm::LocalLocalCopy(::TFileOperation Operation, TOperationSide Side, bool OnFocused)
+void TScpCommanderForm::LocalLocalCopy(
+  ::TFileOperation Operation, TOperationSide Side, bool OnFocused, bool DebugUsedArg(NoConfirmation))
 {
 {
   std::unique_ptr<TFileOperator> FileOperator(new TFileOperator(NULL));
   std::unique_ptr<TFileOperator> FileOperator(new TFileOperator(NULL));
   switch (Operation)
   switch (Operation)

+ 1 - 1
source/forms/ScpCommander.h

@@ -649,7 +649,7 @@ public:
   virtual void __fastcall BrowseFile();
   virtual void __fastcall BrowseFile();
   virtual bool IsSideLocalBrowser(TOperationSide Side);
   virtual bool IsSideLocalBrowser(TOperationSide Side);
   virtual bool IsLocalBrowserMode();
   virtual bool IsLocalBrowserMode();
-  virtual void LocalLocalCopy(::TFileOperation Operation, TOperationSide Side, bool OnFocused);
+  virtual void LocalLocalCopy(::TFileOperation Operation, TOperationSide Side, bool OnFocused, bool NoConfirmation);
 
 
   __property double LeftPanelWidth = { read = GetLeftPanelWidth, write = SetLeftPanelWidth };
   __property double LeftPanelWidth = { read = GetLeftPanelWidth, write = SetLeftPanelWidth };
 };
 };