Copy.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <Common.h>
  5. #include <WinInterface.h>
  6. #include <CoreMain.h>
  7. #include <TextsWin.h>
  8. #include <VCLCommon.h>
  9. #include <CustomWinConfiguration.h>
  10. #include <Tools.h>
  11. #include <GUITools.h>
  12. #include "Copy.h"
  13. //---------------------------------------------------------------------------
  14. #pragma package(smart_init)
  15. #pragma link "Rights"
  16. #pragma link "CopyParams"
  17. #pragma link "HistoryComboBox"
  18. #pragma resource "*.dfm"
  19. //---------------------------------------------------------------------------
  20. bool __fastcall DoCopyDialog(
  21. bool ToRemote, bool Move, TStrings * FileList, UnicodeString & TargetDirectory,
  22. TGUICopyParamType * Params, int Options, int CopyParamAttrs, TSessionData * SessionData,
  23. int * OutputOptions, int AutoSubmit)
  24. {
  25. bool Result;
  26. TCopyDialog *CopyDialog = new TCopyDialog(Application, ToRemote, Move, FileList, Options, CopyParamAttrs, SessionData);
  27. try
  28. {
  29. if (FLAGSET(CopyParamAttrs, cpaNoTransferMode))
  30. {
  31. // If local and remote EOL types are the same, there is no need
  32. // for ASCII (or Automatic) mode
  33. Params->TransferMode = tmBinary;
  34. }
  35. if (OutputOptions != NULL)
  36. {
  37. CopyDialog->OutputOptions = *OutputOptions;
  38. }
  39. CopyDialog->Directory = TargetDirectory;
  40. CopyDialog->Params = *Params;
  41. if (AutoSubmit > 0)
  42. {
  43. InitiateDialogTimeout(CopyDialog, AutoSubmit * MSecsPerSec, CopyDialog->OkButton);
  44. }
  45. Result = CopyDialog->Execute();
  46. if (Result)
  47. {
  48. TargetDirectory = CopyDialog->Directory;
  49. *Params = CopyDialog->Params;
  50. if (OutputOptions != NULL)
  51. {
  52. *OutputOptions = CopyDialog->OutputOptions;
  53. }
  54. }
  55. }
  56. __finally
  57. {
  58. delete CopyDialog;
  59. }
  60. return Result;
  61. }
  62. //---------------------------------------------------------------------------
  63. bool CopyDialogValidateLocalDirectory(const UnicodeString & Directory, THistoryComboBox * DirectoryEdit)
  64. {
  65. bool Result = true;
  66. UnicodeString Drive = ExtractFileDrive(Directory);
  67. if (!DirectoryExistsFix(Directory))
  68. {
  69. if (MessageDialog(MainInstructions(FMTLOAD(CREATE_LOCAL_DIRECTORY, (Directory))),
  70. qtConfirmation, qaOK | qaCancel, HELP_NONE) != qaCancel)
  71. {
  72. if (!ForceDirectories(ApiPath(Directory)))
  73. {
  74. SimpleErrorDialog(FMTLOAD(CREATE_LOCAL_DIR_ERROR, (Directory)));
  75. Result = false;
  76. }
  77. }
  78. else
  79. {
  80. Result = False;
  81. }
  82. }
  83. if (!Result)
  84. {
  85. DirectoryEdit->SelectAll();
  86. DirectoryEdit->SetFocus();
  87. }
  88. return Result;
  89. }
  90. //---------------------------------------------------------------------------
  91. bool CopyDialogValidateFileMask(
  92. const UnicodeString & FileMask, THistoryComboBox * DirectoryEdit, bool MultipleFiles, bool RemotePaths)
  93. {
  94. bool Result = true;
  95. if (!IsFileNameMask(FileMask) && MultipleFiles)
  96. {
  97. UnicodeString Message =
  98. FormatMultiFilesToOneConfirmation(DirectoryEdit->Text, RemotePaths);
  99. Result = (MessageDialog(Message, qtConfirmation, qaOK | qaCancel, HELP_NONE) != qaCancel);
  100. }
  101. if (!Result)
  102. {
  103. DirectoryEdit->SelectAll();
  104. DirectoryEdit->SetFocus();
  105. }
  106. return Result;
  107. }
  108. //---------------------------------------------------------------------------
  109. __fastcall TCopyDialog::TCopyDialog(
  110. TComponent* Owner, bool ToRemote, bool Move, TStrings * FileList, int Options,
  111. int CopyParamAttrs, TSessionData * SessionData) : TForm(Owner)
  112. {
  113. FToRemote = ToRemote;
  114. FMove = Move;
  115. FOptions = Options;
  116. FCopyParamAttrs = CopyParamAttrs;
  117. FFileList = FileList;
  118. FSessionData = SessionData;
  119. FOutputOptions = 0;
  120. AdjustControls();
  121. FPresetsMenu = new TPopupMenu(this);
  122. HotTrackLabel(CopyParamLabel);
  123. HotTrackLabel(ShortCutHintLabel);
  124. if (FLAGSET(FOptions, coBrowse))
  125. {
  126. DebugAssert(!FToRemote);
  127. OkButton->Style = TCustomButton::bsSplitButton;
  128. }
  129. AutoSizeCheckBox(NeverShowAgainCheck);
  130. UseSystemSettings(this);
  131. }
  132. //---------------------------------------------------------------------------
  133. __fastcall TCopyDialog::~TCopyDialog()
  134. {
  135. delete FPresetsMenu;
  136. }
  137. //---------------------------------------------------------------------------
  138. void __fastcall TCopyDialog::AdjustTransferControls()
  139. {
  140. if (FFileList && FFileList->Count)
  141. {
  142. if (!FToRemote && !FMove && FLAGSET(FOutputOptions, cooRemoteTransfer))
  143. {
  144. UnicodeString Label;
  145. if (FFileList->Count == 1)
  146. {
  147. UnicodeString FileName;
  148. if (!FToRemote) FileName = UnixExtractFileName(FFileList->Strings[0]);
  149. else FileName = ExtractFileName(FFileList->Strings[0]);
  150. Label = FMTLOAD(REMOTE_COPY_FILE, (FileName));
  151. }
  152. else
  153. {
  154. Label = FMTLOAD(REMOTE_COPY_FILES, (FFileList->Count));
  155. }
  156. DirectoryLabel->Caption = Label;
  157. }
  158. else
  159. {
  160. UnicodeString TransferStr =
  161. LoadStr(RemotePaths() ? COPY_COPY_TOREMOTE : COPY_COPY_TOLOCAL);
  162. // currently the copy dialog is shown when downloading to temp folder
  163. // only for drag&drop downloads, so we dare to display d&d specific prompt
  164. UnicodeString DirectionStr =
  165. LoadStr(((FOptions & coTemp) != 0) ? COPY_TODROP :
  166. (RemotePaths() ? COPY_TOREMOTE : COPY_TOLOCAL));
  167. if (FFileList->Count == 1)
  168. {
  169. UnicodeString FileName;
  170. if (!FToRemote) FileName = UnixExtractFileName(FFileList->Strings[0]);
  171. else FileName = ExtractFileName(FFileList->Strings[0]);
  172. DirectoryLabel->Caption = FMTLOAD((FMove ? MOVE_FILE : COPY_FILE),
  173. (TransferStr, FileName, DirectionStr));
  174. }
  175. else
  176. {
  177. DirectoryLabel->Caption = FMTLOAD((FMove ? MOVE_FILES : COPY_FILES),
  178. (TransferStr, FFileList->Count, DirectionStr));
  179. }
  180. }
  181. }
  182. UnicodeString ImageName;
  183. UnicodeString ACaption;
  184. if (!FMove)
  185. {
  186. if (!FToRemote && FLAGSET(FOutputOptions, cooRemoteTransfer))
  187. {
  188. ACaption = LoadStr(REMOTE_COPY_TITLE);
  189. ImageName = L"Duplicate L to R";
  190. }
  191. else
  192. {
  193. if (RemotePaths())
  194. {
  195. ACaption = LoadStr(COPY_COPY_TOREMOTE_CAPTION);
  196. ImageName = L"Upload File";
  197. }
  198. else
  199. {
  200. ACaption = LoadStr(COPY_COPY_TOLOCAL_CAPTION);
  201. ImageName = L"Download File";
  202. }
  203. }
  204. }
  205. else
  206. {
  207. if (!FToRemote && FLAGSET(FOutputOptions, cooRemoteTransfer))
  208. {
  209. ACaption = LoadStr(COPY_MOVE_CAPTION);
  210. ImageName = L"Move L to R";
  211. }
  212. else
  213. {
  214. if (RemotePaths())
  215. {
  216. ACaption = LoadStr(COPY_MOVE_TOREMOTE_CAPTION);
  217. ImageName = L"Upload File Remove Original";
  218. }
  219. else
  220. {
  221. ACaption = LoadStr(COPY_MOVE_TOLOCAL_CAPTION);
  222. ImageName = L"Download File Remove Original";
  223. }
  224. }
  225. }
  226. Caption = FormatFormCaption(this, ACaption);
  227. LoadDialogImage(Image, ImageName);
  228. bool RemoteTransfer = FLAGSET(FOutputOptions, cooRemoteTransfer);
  229. DebugAssert(FLAGSET(FOptions, coAllowRemoteTransfer) || !RemoteTransfer);
  230. EnableControl(TransferSettingsButton, !RemoteTransfer);
  231. EnableControl(CopyParamGroup, !RemoteTransfer);
  232. }
  233. //---------------------------------------------------------------------------
  234. void __fastcall TCopyDialog::AdjustControls()
  235. {
  236. RemoteDirectoryEdit->Visible = false;
  237. LocalDirectoryEdit->Visible = false;
  238. DirectoryEdit->Visible = FLAGCLEAR(FOptions, coTemp);
  239. EnableControl(DirectoryLabel, DirectoryEdit->Enabled);
  240. EnableControl(LocalDirectoryBrowseButton, DirectoryEdit->Enabled);
  241. DirectoryLabel->FocusControl = DirectoryEdit;
  242. QueueCheck2->Caption = FMTLOAD(COPY_QUEUE, (LoadStr(COPY_BACKGROUND)));
  243. AdjustTransferControls();
  244. LocalDirectoryBrowseButton->Visible = !FToRemote &&
  245. FLAGCLEAR(FOptions, coTemp);
  246. if (FLAGCLEAR(FOptions, coDoNotShowAgain))
  247. {
  248. // Command-line transfers
  249. NeverShowAgainCheck->Visible = false;
  250. ClientHeight = ClientHeight -
  251. (ShortCutHintPanel->Top - NeverShowAgainCheck->Top);
  252. }
  253. if (FLAGCLEAR(FOptions, coShortCutHint) || CustomWinConfiguration->CopyShortCutHintShown)
  254. {
  255. ShortCutHintPanel->Visible = false;
  256. ClientHeight = ClientHeight - ShortCutHintPanel->Height;
  257. }
  258. UpdateControls();
  259. }
  260. //---------------------------------------------------------------------------
  261. void __fastcall TCopyDialog::SetOutputOptions(int value)
  262. {
  263. if (OutputOptions != value)
  264. {
  265. FSaveSettings = FLAGSET(value, cooSaveSettings);
  266. NeverShowAgainCheck->Checked = FLAGSET(value, cooDoNotShowAgain);
  267. FOutputOptions = (value & ~(cooDoNotShowAgain | cooSaveSettings));
  268. }
  269. }
  270. //---------------------------------------------------------------------------
  271. int __fastcall TCopyDialog::GetOutputOptions()
  272. {
  273. return FOutputOptions |
  274. FLAGMASK(FSaveSettings, cooSaveSettings) |
  275. FLAGMASK(NeverShowAgainCheck->Checked, cooDoNotShowAgain) |
  276. FLAGMASK(FBrowse, cooBrowse);
  277. }
  278. //---------------------------------------------------------------------------
  279. THistoryComboBox * __fastcall TCopyDialog::GetDirectoryEdit()
  280. {
  281. return FToRemote ? RemoteDirectoryEdit : LocalDirectoryEdit;
  282. }
  283. //---------------------------------------------------------------------------
  284. bool __fastcall TCopyDialog::RemotePaths()
  285. {
  286. return (FToRemote || FLAGSET(FOutputOptions, cooRemoteTransfer));
  287. }
  288. //---------------------------------------------------------------------------
  289. UnicodeString __fastcall TCopyDialog::GetFileMask()
  290. {
  291. return ExtractFileName(DirectoryEdit->Text, RemotePaths());
  292. }
  293. //---------------------------------------------------------------------------
  294. void __fastcall TCopyDialog::SetParams(const TGUICopyParamType & value)
  295. {
  296. FParams = value;
  297. FCopyParams = value;
  298. DirectoryEdit->Text = Directory + FParams.FileMask;
  299. QueueCheck2->Checked = FParams.Queue;
  300. UpdateControls();
  301. }
  302. //---------------------------------------------------------------------------
  303. TGUICopyParamType __fastcall TCopyDialog::GetParams()
  304. {
  305. // overwrites TCopyParamType fields only
  306. FParams = FCopyParams;
  307. FParams.FileMask = GetFileMask();
  308. FParams.Queue = QueueCheck2->Checked;
  309. return FParams;
  310. }
  311. //---------------------------------------------------------------------------
  312. void __fastcall TCopyDialog::SetDirectory(UnicodeString value)
  313. {
  314. if (!value.IsEmpty())
  315. {
  316. value = RemotePaths() ?
  317. UnicodeString(UnixIncludeTrailingBackslash(value)) : IncludeTrailingBackslash(value);
  318. }
  319. DirectoryEdit->Text = value + GetFileMask();
  320. }
  321. //---------------------------------------------------------------------------
  322. UnicodeString __fastcall TCopyDialog::GetDirectory()
  323. {
  324. DebugAssert(DirectoryEdit);
  325. UnicodeString Result = DirectoryEdit->Text;
  326. if (RemotePaths())
  327. {
  328. Result = UnixExtractFilePath(Result);
  329. if (!Result.IsEmpty())
  330. {
  331. Result = UnixIncludeTrailingBackslash(Result);
  332. }
  333. }
  334. else
  335. {
  336. Result = ExtractFilePath(Result);
  337. if (!Result.IsEmpty())
  338. {
  339. Result = IncludeTrailingBackslash(Result);
  340. }
  341. }
  342. return Result;
  343. }
  344. //---------------------------------------------------------------------------
  345. int __fastcall TCopyDialog::ActualCopyParamAttrs()
  346. {
  347. return FCopyParamAttrs | FLAGMASK(QueueCheck2->Checked && WinConfiguration->DefaultCopyParam.QueueParallel, cpaNoCalculateSize);
  348. }
  349. //---------------------------------------------------------------------------
  350. void __fastcall TCopyDialog::UpdateControls()
  351. {
  352. if (!FToRemote && FLAGSET(FOptions, coAllowRemoteTransfer))
  353. {
  354. UnicodeString Directory = DirectoryEdit->Text;
  355. bool RemoteTransfer = (Directory.Pos(L"\\") == 0) && (Directory.Pos(L"/") > 0);
  356. if (RemoteTransfer != FLAGSET(FOutputOptions, cooRemoteTransfer))
  357. {
  358. FOutputOptions =
  359. (FOutputOptions & ~cooRemoteTransfer) |
  360. FLAGMASK(RemoteTransfer, cooRemoteTransfer);
  361. AdjustTransferControls();
  362. }
  363. }
  364. UnicodeString InfoStr = FCopyParams.GetInfoStr(L"; ", ActualCopyParamAttrs());
  365. SetLabelHintPopup(CopyParamLabel, InfoStr);
  366. bool RemoteTransfer = FLAGSET(FOutputOptions, cooRemoteTransfer);
  367. EnableControl(QueueCheck2,
  368. ((FOptions & (coDisableQueue | coTemp)) == 0) && !RemoteTransfer);
  369. }
  370. //---------------------------------------------------------------------------
  371. void __fastcall TCopyDialog::FormShow(TObject * /*Sender*/)
  372. {
  373. DebugAssert(FFileList && (FFileList->Count > 0));
  374. if (DirectoryEdit->Enabled && DirectoryEdit->Visible)
  375. {
  376. ActiveControl = DirectoryEdit;
  377. }
  378. else
  379. {
  380. ActiveControl = OkButton;
  381. }
  382. UpdateControls();
  383. InstallPathWordBreakProc(RemoteDirectoryEdit);
  384. InstallPathWordBreakProc(LocalDirectoryEdit);
  385. // Does not work when set from a constructor
  386. ShortCutHintPanel->Color = Application->HintColor;
  387. }
  388. //---------------------------------------------------------------------------
  389. bool __fastcall TCopyDialog::Execute()
  390. {
  391. // at start assume that copy param is current preset
  392. FPreset = GUIConfiguration->CopyParamCurrent;
  393. DirectoryEdit->Items = CustomWinConfiguration->History[
  394. FToRemote ? L"RemoteTarget" : L"LocalTarget"];
  395. FBrowse = false;
  396. bool Result = (ShowModal() == DefaultResult(this));
  397. if (Result)
  398. {
  399. Configuration->BeginUpdate();
  400. try
  401. {
  402. if (FLAGSET(OutputOptions, cooSaveSettings))
  403. {
  404. GUIConfiguration->DefaultCopyParam = Params;
  405. }
  406. DirectoryEdit->SaveToHistory();
  407. CustomWinConfiguration->History[FToRemote ?
  408. L"RemoteTarget" : L"LocalTarget"] = DirectoryEdit->Items;
  409. if (FLAGSET(FOptions, coShortCutHint))
  410. {
  411. CustomWinConfiguration->CopyShortCutHintShown = true;
  412. }
  413. }
  414. __finally
  415. {
  416. Configuration->EndUpdate();
  417. }
  418. }
  419. return Result;
  420. }
  421. //---------------------------------------------------------------------------
  422. void __fastcall TCopyDialog::FormCloseQuery(TObject * /*Sender*/,
  423. bool &CanClose)
  424. {
  425. if ((ModalResult == DefaultResult(this)) && !FBrowse)
  426. {
  427. ExitActiveControl(this);
  428. if (!RemotePaths() && ((FOptions & coTemp) == 0))
  429. {
  430. CanClose = CopyDialogValidateLocalDirectory(Directory, DirectoryEdit);
  431. }
  432. if (CanClose)
  433. {
  434. CanClose = CopyDialogValidateFileMask(GetFileMask(), DirectoryEdit, (FFileList->Count > 1), RemotePaths());
  435. }
  436. }
  437. }
  438. //---------------------------------------------------------------------------
  439. void __fastcall TCopyDialog::LocalDirectoryBrowseButtonClick(
  440. TObject * /*Sender*/)
  441. {
  442. DebugAssert(!FToRemote);
  443. UnicodeString ADirectory;
  444. // if we are duplicating, we have remote path there
  445. if (!RemotePaths())
  446. {
  447. ADirectory = Directory;
  448. }
  449. if (SelectDirectory(ADirectory, LoadStr(SELECT_LOCAL_DIRECTORY), true))
  450. {
  451. Directory = ADirectory;
  452. UpdateControls();
  453. }
  454. }
  455. //---------------------------------------------------------------------------
  456. void __fastcall TCopyDialog::ControlChange(TObject * /*Sender*/)
  457. {
  458. UpdateControls();
  459. ResetSystemSettings(this);
  460. }
  461. //---------------------------------------------------------------------------
  462. void __fastcall TCopyDialog::TransferSettingsButtonClick(TObject * /*Sender*/)
  463. {
  464. CopyParamGroupClick(NULL);
  465. }
  466. //---------------------------------------------------------------------------
  467. void __fastcall TCopyDialog::GenerateCode()
  468. {
  469. TFilesSelected FilesSelected = FLAGSET(FOptions, coAllFiles) ? fsAll : fsList;
  470. DoGenerateTransferCodeDialog(FToRemote, FMove, ActualCopyParamAttrs(), FSessionData, FilesSelected, FFileList, Directory, Params);
  471. }
  472. //---------------------------------------------------------------------------
  473. void __fastcall TCopyDialog::CopyParamClick(TObject * Sender)
  474. {
  475. // Save including the preset-unspecific queue properties,
  476. // so that they are preserved when assigning back later
  477. TGUICopyParamType Param = Params;
  478. bool PrevSaveSettings = FSaveSettings;
  479. int Result = CopyParamListPopupClick(Sender, Param, FPreset, ActualCopyParamAttrs(), &FSaveSettings);
  480. if (Result < 0)
  481. {
  482. if (DebugAlwaysTrue(Result == -cplGenerateCode))
  483. {
  484. GenerateCode();
  485. }
  486. }
  487. else
  488. {
  489. if (Result > 0)
  490. {
  491. Params = Param;
  492. }
  493. else
  494. {
  495. UpdateControls();
  496. }
  497. if (PrevSaveSettings && !FSaveSettings)
  498. {
  499. NeverShowAgainCheck->Checked = false;
  500. }
  501. }
  502. }
  503. //---------------------------------------------------------------------------
  504. void __fastcall TCopyDialog::HelpButtonClick(TObject * /*Sender*/)
  505. {
  506. FormHelp(this);
  507. }
  508. //---------------------------------------------------------------------------
  509. void __fastcall TCopyDialog::CopyParamGroupClick(TObject * /*Sender*/)
  510. {
  511. if (CopyParamGroup->Enabled)
  512. {
  513. if (DoCopyParamCustomDialog(FCopyParams, ActualCopyParamAttrs()))
  514. {
  515. UpdateControls();
  516. }
  517. }
  518. }
  519. //---------------------------------------------------------------------------
  520. void __fastcall TCopyDialog::CopyParamGroupContextPopup(TObject * /*Sender*/,
  521. TPoint & MousePos, bool & Handled)
  522. {
  523. CopyParamListPopup(CalculatePopupRect(CopyParamGroup, MousePos), cplCustomizeDefault);
  524. Handled = true;
  525. }
  526. //---------------------------------------------------------------------------
  527. void __fastcall TCopyDialog::CopyParamListPopup(TRect R, int AdditionalOptions)
  528. {
  529. bool RemoteTransfer = FLAGSET(FOutputOptions, cooRemoteTransfer);
  530. ::CopyParamListPopup(R, FPresetsMenu,
  531. FCopyParams, FPreset, CopyParamClick,
  532. AdditionalOptions |
  533. FLAGMASK(!RemoteTransfer, cplSaveSettings) |
  534. FLAGMASK(FLAGCLEAR(FOutputOptions, cooRemoteTransfer) && FLAGCLEAR(FOptions, coTemp), cplGenerateCode),
  535. ActualCopyParamAttrs(),
  536. FSaveSettings);
  537. }
  538. //---------------------------------------------------------------------------
  539. void __fastcall TCopyDialog::TransferSettingsButtonDropDownClick(TObject * /*Sender*/)
  540. {
  541. CopyParamListPopup(CalculatePopupRect(TransferSettingsButton), cplCustomizeDefault);
  542. }
  543. //---------------------------------------------------------------------------
  544. void __fastcall TCopyDialog::NeverShowAgainCheckClick(TObject * /*Sender*/)
  545. {
  546. FSaveSettings = NeverShowAgainCheck->Checked;
  547. UpdateControls();
  548. }
  549. //---------------------------------------------------------------------------
  550. void __fastcall TCopyDialog::ShortCutHintLabelClick(TObject * /*Sender*/)
  551. {
  552. DoPreferencesDialog(pmCommander);
  553. }
  554. //---------------------------------------------------------------------------
  555. void __fastcall TCopyDialog::LocalDirectoryEditExit(TObject *)
  556. {
  557. if (!RemotePaths())
  558. {
  559. if (DirectoryExistsFix(LocalDirectoryEdit->Text))
  560. {
  561. LocalDirectoryEdit->Text = IncludeTrailingBackslash(LocalDirectoryEdit->Text) + AnyMask;
  562. }
  563. }
  564. }
  565. //---------------------------------------------------------------------------
  566. void __fastcall TCopyDialog::DownloadItemClick(TObject *)
  567. {
  568. OkButton->Click();
  569. }
  570. //---------------------------------------------------------------------------
  571. void __fastcall TCopyDialog::BrowseItemClick(TObject *)
  572. {
  573. FBrowse = true;
  574. OkButton->Click();
  575. }
  576. //---------------------------------------------------------------------------
  577. void __fastcall TCopyDialog::OkButtonDropDownClick(TObject *)
  578. {
  579. MenuPopup(OkMenu, OkButton);
  580. }
  581. //---------------------------------------------------------------------------
  582. void __fastcall TCopyDialog::FormAfterMonitorDpiChanged(TObject *, int OldDPI, int NewDPI)
  583. {
  584. DebugUsedParam2(OldDPI, NewDPI);
  585. AutoSizeCheckBox(NeverShowAgainCheck);
  586. }
  587. //---------------------------------------------------------------------------