Copy.cpp 19 KB

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