Copy.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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 = UniversalIncludeTrailingBackslash(RemotePaths(), value);
  307. }
  308. DirectoryEdit->Text = value + GetFileMask();
  309. }
  310. //---------------------------------------------------------------------------
  311. UnicodeString __fastcall TCopyDialog::GetDirectory()
  312. {
  313. DebugAssert(DirectoryEdit);
  314. UnicodeString Result = DirectoryEdit->Text;
  315. if (RemotePaths())
  316. {
  317. Result = UnixExtractFilePath(Result);
  318. }
  319. else
  320. {
  321. Result = ExtractFilePath(Result);
  322. }
  323. if (!Result.IsEmpty())
  324. {
  325. Result = UniversalIncludeTrailingBackslash(RemotePaths(), Result);
  326. }
  327. return Result;
  328. }
  329. //---------------------------------------------------------------------------
  330. int __fastcall TCopyDialog::ActualCopyParamAttrs()
  331. {
  332. return FCopyParamAttrs | FLAGMASK(QueueCheck2->Checked && WinConfiguration->DefaultCopyParam.QueueParallel, cpaNoCalculateSize);
  333. }
  334. //---------------------------------------------------------------------------
  335. void __fastcall TCopyDialog::UpdateControls()
  336. {
  337. if (!FToRemote && FLAGSET(FOptions, coAllowRemoteTransfer))
  338. {
  339. UnicodeString Directory = DirectoryEdit->Text;
  340. bool RemoteTransfer = (Directory.Pos(L"\\") == 0) && (Directory.Pos(L"/") > 0);
  341. if (RemoteTransfer != FLAGSET(FOutputOptions, cooRemoteTransfer))
  342. {
  343. FOutputOptions =
  344. (FOutputOptions & ~cooRemoteTransfer) |
  345. FLAGMASK(RemoteTransfer, cooRemoteTransfer);
  346. AdjustTransferControls();
  347. }
  348. }
  349. UnicodeString InfoStr = FCopyParams.GetInfoStr(L"; ", ActualCopyParamAttrs());
  350. SetLabelHintPopup(CopyParamLabel, InfoStr);
  351. bool RemoteTransfer = FLAGSET(FOutputOptions, cooRemoteTransfer);
  352. EnableControl(QueueCheck2,
  353. ((FOptions & (coDisableQueue | coTemp)) == 0) && !RemoteTransfer);
  354. }
  355. //---------------------------------------------------------------------------
  356. void __fastcall TCopyDialog::FormShow(TObject * /*Sender*/)
  357. {
  358. DebugAssert(FFileList && (FFileList->Count > 0));
  359. if (DirectoryEdit->Enabled && DirectoryEdit->Visible)
  360. {
  361. ActiveControl = DirectoryEdit;
  362. }
  363. else
  364. {
  365. ActiveControl = OkButton;
  366. }
  367. UpdateControls();
  368. InstallPathWordBreakProc(RemoteDirectoryEdit);
  369. InstallPathWordBreakProc(LocalDirectoryEdit);
  370. // Does not work when set from a constructor
  371. ShortCutHintPanel->Color = Application->HintColor;
  372. }
  373. //---------------------------------------------------------------------------
  374. bool __fastcall TCopyDialog::Execute()
  375. {
  376. // at start assume that copy param is current preset
  377. FPreset = GUIConfiguration->CopyParamCurrent;
  378. DirectoryEdit->Items = CustomWinConfiguration->History[
  379. FToRemote ? L"RemoteTarget" : L"LocalTarget"];
  380. FExplore = false;
  381. bool Result = (ShowModal() == DefaultResult(this));
  382. if (Result)
  383. {
  384. Configuration->BeginUpdate();
  385. try
  386. {
  387. if (FLAGSET(OutputOptions, cooSaveSettings))
  388. {
  389. GUIConfiguration->DefaultCopyParam = Params;
  390. }
  391. DirectoryEdit->SaveToHistory();
  392. CustomWinConfiguration->History[FToRemote ?
  393. L"RemoteTarget" : L"LocalTarget"] = DirectoryEdit->Items;
  394. if (FLAGSET(FOptions, coShortCutHint))
  395. {
  396. CustomWinConfiguration->CopyShortCutHintShown = true;
  397. }
  398. }
  399. __finally
  400. {
  401. Configuration->EndUpdate();
  402. }
  403. }
  404. return Result;
  405. }
  406. //---------------------------------------------------------------------------
  407. void __fastcall TCopyDialog::FormCloseQuery(TObject * /*Sender*/,
  408. bool &CanClose)
  409. {
  410. if ((ModalResult == DefaultResult(this)) && !FExplore)
  411. {
  412. ExitActiveControl(this);
  413. if (!RemotePaths() && ((FOptions & coTemp) == 0))
  414. {
  415. CanClose = CopyDialogValidateLocalDirectory(Directory, DirectoryEdit);
  416. }
  417. if (CanClose)
  418. {
  419. CanClose = CopyDialogValidateFileMask(GetFileMask(), DirectoryEdit, (FFileList->Count > 1), RemotePaths());
  420. }
  421. }
  422. }
  423. //---------------------------------------------------------------------------
  424. void __fastcall TCopyDialog::LocalDirectoryBrowseButtonClick(
  425. TObject * /*Sender*/)
  426. {
  427. DebugAssert(!FToRemote);
  428. UnicodeString ADirectory;
  429. // if we are duplicating, we have remote path there
  430. if (!RemotePaths())
  431. {
  432. ADirectory = Directory;
  433. }
  434. if (SelectDirectory(ADirectory, LoadStr(SELECT_LOCAL_DIRECTORY)))
  435. {
  436. Directory = ADirectory;
  437. UpdateControls();
  438. }
  439. }
  440. //---------------------------------------------------------------------------
  441. void __fastcall TCopyDialog::ControlChange(TObject * /*Sender*/)
  442. {
  443. UpdateControls();
  444. ResetSystemSettings(this);
  445. }
  446. //---------------------------------------------------------------------------
  447. void __fastcall TCopyDialog::TransferSettingsButtonClick(TObject * /*Sender*/)
  448. {
  449. CopyParamGroupClick(NULL);
  450. }
  451. //---------------------------------------------------------------------------
  452. void __fastcall TCopyDialog::GenerateCode()
  453. {
  454. TFilesSelected FilesSelected = FLAGSET(FOptions, coAllFiles) ? fsAll : fsList;
  455. DoGenerateTransferCodeDialog(FToRemote, FMove, ActualCopyParamAttrs(), FSessionData, FilesSelected, FFileList, Directory, Params);
  456. }
  457. //---------------------------------------------------------------------------
  458. void __fastcall TCopyDialog::CopyParamClick(TObject * Sender)
  459. {
  460. // Save including the preset-unspecific queue properties,
  461. // so that they are preserved when assigning back later
  462. TGUICopyParamType Param = Params;
  463. bool PrevSaveSettings = FSaveSettings;
  464. int Result = CopyParamListPopupClick(Sender, Param, FPreset, ActualCopyParamAttrs(), &FSaveSettings);
  465. if (Result < 0)
  466. {
  467. if (DebugAlwaysTrue(Result == -cplGenerateCode))
  468. {
  469. GenerateCode();
  470. }
  471. }
  472. else
  473. {
  474. if (Result > 0)
  475. {
  476. Params = Param;
  477. }
  478. else
  479. {
  480. UpdateControls();
  481. }
  482. if (PrevSaveSettings && !FSaveSettings)
  483. {
  484. NeverShowAgainCheck->Checked = false;
  485. }
  486. }
  487. }
  488. //---------------------------------------------------------------------------
  489. void __fastcall TCopyDialog::HelpButtonClick(TObject * /*Sender*/)
  490. {
  491. FormHelp(this);
  492. }
  493. //---------------------------------------------------------------------------
  494. void __fastcall TCopyDialog::CopyParamGroupClick(TObject * /*Sender*/)
  495. {
  496. if (CopyParamGroup->Enabled)
  497. {
  498. if (DoCopyParamCustomDialog(FCopyParams, ActualCopyParamAttrs()))
  499. {
  500. UpdateControls();
  501. }
  502. }
  503. }
  504. //---------------------------------------------------------------------------
  505. void __fastcall TCopyDialog::CopyParamGroupContextPopup(TObject * /*Sender*/,
  506. TPoint & MousePos, bool & Handled)
  507. {
  508. CopyParamListPopup(CalculatePopupRect(CopyParamGroup, MousePos), cplCustomizeDefault);
  509. Handled = true;
  510. }
  511. //---------------------------------------------------------------------------
  512. void __fastcall TCopyDialog::CopyParamListPopup(TRect R, int AdditionalOptions)
  513. {
  514. bool RemoteTransfer = FLAGSET(FOutputOptions, cooRemoteTransfer);
  515. ::CopyParamListPopup(R, FPresetsMenu,
  516. FCopyParams, FPreset, CopyParamClick,
  517. AdditionalOptions |
  518. FLAGMASK(!RemoteTransfer, cplSaveSettings) |
  519. FLAGMASK(FLAGCLEAR(FOutputOptions, cooRemoteTransfer) && FLAGCLEAR(FOptions, coTemp), cplGenerateCode),
  520. ActualCopyParamAttrs(),
  521. FSaveSettings);
  522. }
  523. //---------------------------------------------------------------------------
  524. void __fastcall TCopyDialog::TransferSettingsButtonDropDownClick(TObject * /*Sender*/)
  525. {
  526. CopyParamListPopup(CalculatePopupRect(TransferSettingsButton), cplCustomizeDefault);
  527. }
  528. //---------------------------------------------------------------------------
  529. void __fastcall TCopyDialog::NeverShowAgainCheckClick(TObject * /*Sender*/)
  530. {
  531. FSaveSettings = NeverShowAgainCheck->Checked;
  532. UpdateControls();
  533. }
  534. //---------------------------------------------------------------------------
  535. void __fastcall TCopyDialog::ShortCutHintLabelClick(TObject * /*Sender*/)
  536. {
  537. DoPreferencesDialog(pmCommander);
  538. }
  539. //---------------------------------------------------------------------------
  540. void __fastcall TCopyDialog::LocalDirectoryEditExit(TObject *)
  541. {
  542. if (!RemotePaths())
  543. {
  544. if (DirectoryExistsFix(LocalDirectoryEdit->Text))
  545. {
  546. LocalDirectoryEdit->Text = IncludeTrailingBackslash(LocalDirectoryEdit->Text) + AnyMask;
  547. }
  548. }
  549. }
  550. //---------------------------------------------------------------------------
  551. void __fastcall TCopyDialog::DownloadItemClick(TObject *)
  552. {
  553. OkButton->Click();
  554. }
  555. //---------------------------------------------------------------------------
  556. void __fastcall TCopyDialog::ExploreItemClick(TObject *)
  557. {
  558. FExplore = true;
  559. OkButton->Click();
  560. }
  561. //---------------------------------------------------------------------------
  562. void __fastcall TCopyDialog::OkButtonDropDownClick(TObject *)
  563. {
  564. MenuPopup(OkMenu, OkButton);
  565. }
  566. //---------------------------------------------------------------------------
  567. void __fastcall TCopyDialog::FormAfterMonitorDpiChanged(TObject *, int OldDPI, int NewDPI)
  568. {
  569. DebugUsedParam2(OldDPI, NewDPI);
  570. AutoSizeCheckBox(NeverShowAgainCheck);
  571. }
  572. //---------------------------------------------------------------------------
  573. void __fastcall TCopyDialog::CreateWnd()
  574. {
  575. TForm::CreateWnd();
  576. ApplyColorMode(this);
  577. }
  578. //---------------------------------------------------------------------------