浏览代码

Recognizing that all files are selected when dragging from remote panel

Source commit: cd6404caba4c407740c9b42ac6d361215233bbeb
Martin Prikryl 9 年之前
父节点
当前提交
5495859eed
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 10 1
      source/forms/CustomScpExplorer.cpp
  2. 1 0
      source/forms/CustomScpExplorer.h

+ 10 - 1
source/forms/CustomScpExplorer.cpp

@@ -2490,7 +2490,7 @@ void __fastcall TCustomScpExplorerForm::ExecuteCopyOperationCommand(
   TCustomDirView * DView = DirView(Side);
   TCustomDirView * DView = DirView(Side);
   Param.Options =
   Param.Options =
     FLAGMASK(FLAGSET(Flags, cocShortCutHint), coShortCutHint) |
     FLAGMASK(FLAGSET(Flags, cocShortCutHint), coShortCutHint) |
-    FLAGMASK((DView->SelCount == DView->FilesCount), coAllFiles);
+    FLAGMASK(SelectedAllFilesInDirView(DView), coAllFiles);
   if (FLAGSET(Flags, cocQueue))
   if (FLAGSET(Flags, cocQueue))
   {
   {
     Param.Queue = asOn;
     Param.Queue = asOn;
@@ -6465,6 +6465,10 @@ void __fastcall TCustomScpExplorerForm::RemoteFileControlDDEnd(TObject * Sender)
           {
           {
             Param.Queue = asOn;
             Param.Queue = asOn;
           }
           }
+          if (Sender == RemoteDirView)
+          {
+            Param.Options = FLAGMASK(SelectedAllFilesInDirView(RemoteDirView), coAllFiles);
+          }
 
 
           if (RemoteFileControlFileOperation(Sender, Operation,
           if (RemoteFileControlFileOperation(Sender, Operation,
                 (WinConfiguration->DDTransferConfirmation == asOff), &Param))
                 (WinConfiguration->DDTransferConfirmation == asOff), &Param))
@@ -7051,6 +7055,11 @@ TDragDropFilesEx * __fastcall TCustomScpExplorerForm::DragDropFiles(TObject * Se
   return Result;
   return Result;
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
+bool __fastcall TCustomScpExplorerForm::SelectedAllFilesInDirView(TCustomDirView * DView)
+{
+  return (DView->SelCount == DView->FilesCount);
+}
+//---------------------------------------------------------------------------
 bool __fastcall TCustomScpExplorerForm::DraggingAllFilesFromDirView(TOperationSide Side, TStrings * FileList)
 bool __fastcall TCustomScpExplorerForm::DraggingAllFilesFromDirView(TOperationSide Side, TStrings * FileList)
 {
 {
   return HasDirView[Side] && (DropSourceControl == DirView(Side)) && (FileList->Count == DirView(Side)->FilesCount);
   return HasDirView[Side] && (DropSourceControl == DirView(Side)) && (FileList->Count == DirView(Side)->FilesCount);

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -562,6 +562,7 @@ protected:
   void __fastcall DoTerminalListChanged(bool Force);
   void __fastcall DoTerminalListChanged(bool Force);
   void __fastcall NeedSession(bool ReloadSessions);
   void __fastcall NeedSession(bool ReloadSessions);
   bool __fastcall DraggingAllFilesFromDirView(TOperationSide Side, TStrings * FileList);
   bool __fastcall DraggingAllFilesFromDirView(TOperationSide Side, TStrings * FileList);
+  bool __fastcall SelectedAllFilesInDirView(TCustomDirView * DView);
   TSessionData * __fastcall SessionDataForCode();
   TSessionData * __fastcall SessionDataForCode();
 
 
 public:
 public: