Explorar o código

Bug 1538: Last download target folder in Explorer interface is not remembered when transferring on background

https://winscp.net/tracker/1538

Source commit: fe7eae9665594c3c0d6ef758d70f660fbb37877c
Martin Prikryl %!s(int64=8) %!d(string=hai) anos
pai
achega
227401b0d8

+ 8 - 0
source/forms/CustomScpExplorer.cpp

@@ -1016,6 +1016,12 @@ void __fastcall TCustomScpExplorerForm::EnableDDTransferConfirmation(TObject * /
   WinConfiguration->DDTransferConfirmation = asOn;
 }
 //---------------------------------------------------------------------------
+void __fastcall TCustomScpExplorerForm::CopyParamDialogAfter(
+  TTransferDirection /*Direction*/, bool /*Temp*/, const UnicodeString & /*TargetDirectory*/)
+{
+  // noop
+}
+//---------------------------------------------------------------------------
 bool __fastcall TCustomScpExplorerForm::CopyParamDialog(
   TTransferDirection Direction, TTransferType Type, bool Temp,
   TStrings * FileList, UnicodeString & TargetDirectory, TGUICopyParamType & CopyParam,
@@ -1090,6 +1096,8 @@ bool __fastcall TCustomScpExplorerForm::CopyParamDialog(
           WinConfiguration->DDTransferConfirmation = asOn;
         }
       }
+
+      CopyParamDialogAfter(Direction, Temp, TargetDirectory);
     }
   }
 

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -331,6 +331,7 @@ protected:
     TTransferType Type, bool Temp, TStrings * FileList,
     UnicodeString & TargetDirectory, TGUICopyParamType & CopyParam, bool Confirm,
     bool DragDrop, int Options);
+  virtual void __fastcall CopyParamDialogAfter(TTransferDirection Direction, bool Temp, const UnicodeString & TargetDirectory);
   virtual bool __fastcall RemoteTransferDialog(TTerminal *& Session,
     TStrings * FileList, UnicodeString & Target, UnicodeString & FileMask, bool & DirectCopy,
     bool NoConfirmation, bool Move);

+ 10 - 4
source/forms/ScpExplorer.cpp

@@ -134,6 +134,16 @@ UnicodeString __fastcall TScpExplorerForm::DefaultDownloadTargetDirectory()
   return WinConfiguration->ScpExplorer.LastLocalTargetDirectory;
 }
 //---------------------------------------------------------------------------
+void __fastcall TScpExplorerForm::CopyParamDialogAfter(
+  TTransferDirection Direction, bool Temp, const UnicodeString & TargetDirectory)
+{
+  TCustomScpExplorerForm::CopyParamDialogAfter(Direction, Temp, TargetDirectory);
+  if ((Direction == tdToLocal) && !Temp)
+  {
+    WinConfiguration->ScpExplorer.LastLocalTargetDirectory = TargetDirectory;
+  }
+}
+//---------------------------------------------------------------------------
 bool __fastcall TScpExplorerForm::CopyParamDialog(TTransferDirection Direction,
   TTransferType Type, Boolean Temp, TStrings * FileList,
   UnicodeString & TargetDirectory, TGUICopyParamType & CopyParam, bool Confirm,
@@ -147,10 +157,6 @@ bool __fastcall TScpExplorerForm::CopyParamDialog(TTransferDirection Direction,
   bool Result = TCustomScpExplorerForm::CopyParamDialog(
     Direction, Type, Temp, FileList, TargetDirectory, CopyParam, Confirm,
     DragDrop, Options);
-  if (Result && (Direction == tdToLocal) && !Temp)
-  {
-    WinConfiguration->ScpExplorer.LastLocalTargetDirectory = TargetDirectory;
-  }
   return Result;
 }
 //---------------------------------------------------------------------------

+ 1 - 0
source/forms/ScpExplorer.h

@@ -334,6 +334,7 @@ protected:
     TTransferType Type, bool Temp, TStrings * FileList,
     UnicodeString & TargetDirectory, TGUICopyParamType & CopyParam, bool Confirm,
     bool DragDrop, int Options);
+  virtual void __fastcall CopyParamDialogAfter(TTransferDirection Direction, bool Temp, const UnicodeString & TargetDirectory);
   virtual void __fastcall RestoreFormParams();
   virtual void __fastcall RestoreParams();
   virtual void __fastcall ConfigurationChanged();