1
0

Copy.cpp 19 KB

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