Preferences.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. //----------------------------------------------------------------------------
  2. #ifndef PreferencesH
  3. #define PreferencesH
  4. //----------------------------------------------------------------------------
  5. #include "ComboEdit.hpp"
  6. #include "UpDownEdit.hpp"
  7. #include <System.Classes.hpp>
  8. #include <Vcl.ComCtrls.hpp>
  9. #include <Vcl.Controls.hpp>
  10. #include <Vcl.ExtCtrls.hpp>
  11. #include <Vcl.Forms.hpp>
  12. #include <Vcl.Mask.hpp>
  13. #include <Vcl.StdCtrls.hpp>
  14. //----------------------------------------------------------------------------
  15. #include "UpDownEdit.hpp"
  16. #include <Dialogs.hpp>
  17. #include <PasTools.hpp>
  18. #include "HistoryComboBox.hpp"
  19. #include <WinInterface.h>
  20. #include <Vcl.Imaging.pngimage.hpp>
  21. //----------------------------------------------------------------------------
  22. class TCustomCommandList;
  23. class TEditorList;
  24. //----------------------------------------------------------------------------
  25. class TPreferencesDialog : public TForm
  26. {
  27. __published:
  28. TButton *OKButton;
  29. TButton *CloseButton;
  30. TPanel *MainPanel;
  31. TPageControl *PageControl;
  32. TTabSheet *PreferencesSheet;
  33. TGroupBox *CommonPreferencesGroup;
  34. TCheckBox *ConfirmOverwritingCheck;
  35. TCheckBox *ConfirmDeletingCheck;
  36. TCheckBox *ConfirmClosingSessionCheck;
  37. TCheckBox *DDTransferConfirmationCheck;
  38. TCheckBox *ContinueOnErrorCheck;
  39. TTabSheet *LogSheet;
  40. TTabSheet *GeneralSheet;
  41. TLabel *InterfaceChangeLabel;
  42. TTabSheet *PanelsSheet;
  43. TGroupBox *PanelsRemoteDirectoryGroup;
  44. TCheckBox *ShowInaccesibleDirectoriesCheck;
  45. TGroupBox *PanelsCommonGroup;
  46. TCheckBox *ShowHiddenFilesCheck;
  47. TCheckBox *DefaultDirIsHomeCheck;
  48. TTabSheet *CommanderSheet;
  49. TLabel *Label3;
  50. TGroupBox *PanelsGroup;
  51. TCheckBox *PreserveLocalDirectoryCheck;
  52. TGroupBox *CommanderMiscGroup;
  53. TCheckBox *UseLocationProfilesCheck;
  54. TGroupBox *CompareCriterionsGroup;
  55. TCheckBox *CompareByTimeCheck;
  56. TCheckBox *CompareBySizeCheck;
  57. TTabSheet *ExplorerSheet;
  58. TLabel *Label4;
  59. TGroupBox *GroupBox2;
  60. TCheckBox *ShowFullAddressCheck;
  61. TTabSheet *EditorSheet;
  62. TGroupBox *EditorPreferenceGroup;
  63. TGroupBox *InternalEditorGroup;
  64. TLabel *EditorFontLabel;
  65. TButton *EditorFontButton;
  66. TTabSheet *IntegrationSheet;
  67. TGroupBox *ShellIconsGroup;
  68. TButton *DesktopIconButton;
  69. TButton *QuickLaunchIconButton;
  70. TButton *SendToHookButton;
  71. TTabSheet *CustomCommandsSheet;
  72. TGroupBox *CustomCommandsGroup;
  73. TListView *CustomCommandsView;
  74. TButton *AddCommandButton;
  75. TButton *RemoveCommandButton;
  76. TButton *UpCommandButton;
  77. TButton *DownCommandButton;
  78. TButton *EditCommandButton;
  79. TPanel *LeftPanel;
  80. TTreeView *NavigationTree;
  81. TCheckBox *DeleteToRecycleBinCheck;
  82. TButton *RegisterAsUrlHandlerButton;
  83. TTabSheet *DragDropSheet;
  84. TGroupBox *DragDropDownloadsGroup;
  85. TLabel *DDExtEnabledLabel;
  86. TLabel *DDExtDisabledLabel;
  87. TRadioButton *DDExtEnabledButton;
  88. TRadioButton *DDExtDisabledButton;
  89. TPanel *DDExtDisabledPanel;
  90. TCheckBox *DDWarnLackOfTempSpaceCheck;
  91. TCheckBox *DDWarnOnMoveCheck;
  92. TCheckBox *ConfirmExitOnCompletionCheck;
  93. TTabSheet *QueueSheet;
  94. TGroupBox *QueueGroup;
  95. TUpDownEdit *QueueTransferLimitEdit;
  96. TLabel *Label5;
  97. TGroupBox *QueueViewGroup;
  98. TRadioButton *QueueViewShowButton;
  99. TRadioButton *QueueViewHideWhenEmptyButton;
  100. TRadioButton *QueueViewHideButton;
  101. TCheckBox *QueueAutoPopupCheck;
  102. TCheckBox *QueueCheck;
  103. TCheckBox *DDAllowMoveInitCheck;
  104. TCheckBox *ConfirmResumeCheck;
  105. TTabSheet *StorageSheet;
  106. TGroupBox *StorageGroup;
  107. TRadioButton *RegistryStorageButton;
  108. TRadioButton *IniFileStorageButton2;
  109. TGroupBox *NotificationsGroup;
  110. TCheckBox *BeepOnFinishCheck;
  111. TUpDownEdit *BeepOnFinishAfterEdit;
  112. TLabel *BeepOnFinishAfterText;
  113. TTabSheet *TransferEnduranceSheet;
  114. TGroupBox *ResumeBox;
  115. TLabel *ResumeThresholdUnitLabel;
  116. TRadioButton *ResumeOnButton;
  117. TRadioButton *ResumeSmartButton;
  118. TRadioButton *ResumeOffButton;
  119. TUpDownEdit *ResumeThresholdEdit;
  120. TCheckBox *ConfirmCommandSessionCheck;
  121. TGroupBox *TemporaryDirectoryGrouo;
  122. TRadioButton *DDSystemTemporaryDirectoryButton;
  123. TRadioButton *DDCustomTemporaryDirectoryButton;
  124. TDirectoryEdit *DDTemporaryDirectoryEdit;
  125. TLabel *Label6;
  126. TCheckBox *TemporaryDirectoryCleanupCheck;
  127. TCheckBox *ConfirmTemporaryDirectoryCleanupCheck;
  128. TGroupBox *OtherStorageGroup;
  129. TLabel *RandomSeedFileLabel;
  130. TFilenameEdit *RandomSeedFileEdit;
  131. TCheckBox *SwappedPanelsCheck;
  132. TCheckBox *PreservePanelStateCheck;
  133. TButton *AddSearchPathButton;
  134. TCheckBox *QueueNoConfirmationCheck;
  135. TCheckBox *EditorWordWrapCheck;
  136. TGroupBox *PathInCaptionGroup;
  137. TRadioButton *PathInCaptionFullButton;
  138. TRadioButton *PathInCaptionShortButton;
  139. TRadioButton *PathInCaptionNoneButton;
  140. TTabSheet *UpdatesSheet;
  141. TGroupBox *UpdatesGroup;
  142. TGroupBox *UpdatesProxyGroup;
  143. TLabel *UpdatesProxyHostLabel;
  144. TLabel *UpdatesProxyPortLabel;
  145. TUpDownEdit *UpdatesProxyPortEdit;
  146. TEdit *UpdatesProxyHostEdit;
  147. TRadioButton *UpdatesProxyCheck;
  148. TTabSheet *CopyParamListSheet;
  149. TGroupBox *CopyParamListGroup;
  150. TListView *CopyParamListView;
  151. TButton *AddCopyParamButton;
  152. TButton *RemoveCopyParamButton;
  153. TButton *UpCopyParamButton;
  154. TButton *DownCopyParamButton;
  155. TButton *EditCopyParamButton;
  156. TButton *DuplicateCopyParamButton;
  157. TCheckBox *CopyParamAutoSelectNoticeCheck;
  158. TButton *HelpButton;
  159. TGroupBox *ThemeGroup;
  160. TLabel *Label7;
  161. TComboBox *ThemeCombo;
  162. TListView *EditorListView3;
  163. TButton *AddEditorButton;
  164. TButton *EditEditorButton;
  165. TButton *UpEditorButton;
  166. TButton *DownEditorButton;
  167. TButton *RemoveEditorButton;
  168. TGroupBox *DoubleClickGroup;
  169. TCheckBox *CopyOnDoubleClickConfirmationCheck;
  170. TLabel *DoubleClickActionLabel;
  171. TComboBox *DoubleClickActionCombo;
  172. TLabel *Label8;
  173. TComboBox *NortonLikeModeCombo;
  174. TStaticText *ShellIconsText2;
  175. TCheckBox *FullRowSelectCheck;
  176. TGroupBox *SessionReopenGroup;
  177. TLabel *SessionReopenAutoLabel;
  178. TCheckBox *SessionReopenAutoCheck;
  179. TLabel *SessionReopenAutoSecLabel;
  180. TUpDownEdit *SessionReopenAutoEdit;
  181. TTabSheet *WindowSheet;
  182. TCheckBox *AutoReadDirectoryAfterOpCheck;
  183. TCheckBox *ConfirmRecyclingCheck;
  184. TGroupBox *WindowMiscellaneousGroup;
  185. TCheckBox *MinimizeToTrayCheck;
  186. TCheckBox *BalloonNotificationsCheck;
  187. TTabSheet *IntegrationAppSheet;
  188. TGroupBox *ExternalAppsGroup;
  189. TLabel *PuttyPathLabel;
  190. THistoryComboBox *PuttyPathEdit;
  191. TCheckBox *PuttyPasswordCheck2;
  192. TCheckBox *AutoOpenInPuttyCheck;
  193. TButton *PuttyPathBrowseButton;
  194. TCheckBox *TelnetForFtpInPuttyCheck;
  195. TRadioButton *UpdatesDirectCheck;
  196. TRadioButton *UpdatesAutoCheck;
  197. TLabel *Label9;
  198. TUpDownEdit *EditorTabSizeEdit;
  199. TCheckBox *ConfirmTransferringCheck;
  200. TGroupBox *UpdatesOptionsGroup;
  201. TCheckBox *QueueIndividuallyCheck;
  202. TCheckBox *SessionReopenAutoIdleCheck;
  203. TCheckBox *RenameWholeNameCheck;
  204. TCheckBox *TreeOnLeftCheck;
  205. TCheckBox *TemporaryDirectoryAppendSessionCheck;
  206. TCheckBox *TemporaryDirectoryAppendPathCheck;
  207. TLabel *SessionReopenTimeoutLabel;
  208. TUpDownEdit *SessionReopenTimeoutEdit;
  209. TLabel *SessionReopenTimeoutSecLabel;
  210. TTabSheet *SecuritySheet;
  211. TGroupBox *MasterPasswordGroup;
  212. TButton *SetMasterPasswordButton;
  213. TCheckBox *UseMasterPasswordCheck;
  214. TTabSheet *NetworkSheet;
  215. TGroupBox *ExternalIpAddressGroupBox;
  216. TRadioButton *RetrieveExternalIpAddressButton;
  217. TRadioButton *CustomExternalIpAddressButton;
  218. TEdit *CustomExternalIpAddressEdit;
  219. TCheckBox *FormatSizeBytesCheck;
  220. TCheckBox *SessionReopenAutoStallCheck;
  221. TLabel *SessionReopenAutoStallLabel;
  222. TUpDownEdit *SessionReopenAutoStallEdit;
  223. TLabel *SessionReopenAutoStallSecLabel;
  224. TCheckBox *EnableQueueByDefaultCheck;
  225. TLabel *Label11;
  226. TComboBox *EditorEncodingCombo;
  227. TCheckBox *RefreshRemotePanelCheck;
  228. TUpDownEdit *RefreshRemotePanelIntervalEdit;
  229. TLabel *RefreshRemoteDirectoryUnitLabel;
  230. TLabel *Label12;
  231. TComboBox *UpdatesPeriodCombo;
  232. TLabel *UpdatesBetaVersionsLabel;
  233. TComboBox *UpdatesBetaVersionsCombo;
  234. TCheckBox *CollectUsageCheck;
  235. TButton *UsageViewButton;
  236. TTabSheet *PanelRemoteSheet;
  237. TGroupBox *WorkspacesGroup;
  238. TCheckBox *AutoSaveWorkspaceCheck;
  239. TComboBox *AutoWorkspaceCombo;
  240. TCheckBox *AutoSaveWorkspacePasswordsCheck;
  241. TLabel *CopyParamLabel;
  242. TGroupBox *ConnectionsGroup;
  243. TCheckBox *TryFtpWhenSshFailsCheck;
  244. TLabel *QueueKeepDoneItemsCheck;
  245. TComboBox *QueueKeepDoneItemsForCombo;
  246. TLabel *Label10;
  247. TComboBox *ExplorerKeyboardShortcutsCombo;
  248. TLabel *SessionReopenAutoIdleLabel;
  249. TUpDownEdit *SessionReopenAutoIdleEdit;
  250. TLabel *SessionReopenAutoIdleSecLabel;
  251. TTabSheet *PanelLocalSheet;
  252. TGroupBox *LocalPanelGroup;
  253. TCheckBox *SystemContextMenuCheck;
  254. TGroupBox *PasswordGroupBox;
  255. TCheckBox *SessionRememberPasswordCheck;
  256. TStaticText *PuttyPathHintText;
  257. TLabel *PuttyRegistryStorageKeyLabel;
  258. THistoryComboBox *PuttyRegistryStorageKeyEdit;
  259. TTabSheet *LanguagesSheet;
  260. TGroupBox *LanguagesGroup;
  261. TListView *LanguagesView;
  262. TLabel *LanguageChangeLabel;
  263. TButton *LanguagesGetMoreButton;
  264. TGroupBox *LoggingGroup;
  265. TLabel *LogWindowLinesText;
  266. TCheckBox *LogToFileCheck;
  267. TFilenameEdit *LogFileNameEdit3;
  268. TCheckBox *LogShowWindowCheck;
  269. TRadioButton *LogWindowCompleteButton;
  270. TRadioButton *LogWindowLinesButton;
  271. TUpDownEdit *LogWindowLinesEdit;
  272. TPanel *LogFilePanel;
  273. TRadioButton *LogFileAppendButton;
  274. TRadioButton *LogFileOverwriteButton;
  275. TComboBox *LogProtocolCombo;
  276. TStaticText *LogFileNameHintText;
  277. TCheckBox *EnableLoggingCheck;
  278. TGroupBox *ActionsLoggingGroup;
  279. TFilenameEdit *ActionsLogFileNameEdit;
  280. TStaticText *ActionsLogFileNameHintText;
  281. TCheckBox *EnableActionsLoggingCheck;
  282. TGroupBox *InterfaceGroup;
  283. TLabel *CommanderDescriptionLabel2;
  284. TLabel *ExplorerDescriptionLabel;
  285. TImage *CommanderInterfacePicture;
  286. TImage *ExplorerInterfacePicture;
  287. TRadioButton *CommanderInterfaceButton2;
  288. TRadioButton *ExplorerInterfaceButton2;
  289. void __fastcall FormShow(TObject *Sender);
  290. void __fastcall ControlChange(TObject *Sender);
  291. void __fastcall EditorFontButtonClick(TObject *Sender);
  292. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  293. void __fastcall IconButtonClick(TObject *Sender);
  294. void __fastcall CustomCommandsViewData(TObject *Sender, TListItem *Item);
  295. void __fastcall ListViewSelectItem(TObject *Sender,
  296. TListItem *Item, bool Selected);
  297. void __fastcall CustomCommandsViewKeyDown(TObject *Sender, WORD &Key,
  298. TShiftState Shift);
  299. void __fastcall AddEditCommandButtonClick(TObject *Sender);
  300. void __fastcall RemoveCommandButtonClick(TObject *Sender);
  301. void __fastcall UpDownCommandButtonClick(TObject *Sender);
  302. void __fastcall ListViewStartDrag(TObject *Sender,
  303. TDragObject *&DragObject);
  304. void __fastcall CustomCommandsViewDragDrop(TObject *Sender,
  305. TObject *Source, int X, int Y);
  306. void __fastcall ListViewDragOver(TObject *Sender,
  307. TObject *Source, int X, int Y, TDragState State, bool &Accept);
  308. void __fastcall NavigationTreeChange(TObject *Sender, TTreeNode *Node);
  309. void __fastcall PageControlChange(TObject *Sender);
  310. void __fastcall RegisterAsUrlHandlerButtonClick(TObject *Sender);
  311. void __fastcall DDExtLabelClick(TObject *Sender);
  312. void __fastcall CustomCommandsViewDblClick(TObject *Sender);
  313. void __fastcall AddSearchPathButtonClick(TObject *Sender);
  314. void __fastcall EditorFontLabelDblClick(TObject *Sender);
  315. void __fastcall CopyParamListViewData(TObject *Sender, TListItem *Item);
  316. void __fastcall CopyParamListViewDragDrop(TObject *Sender,
  317. TObject *Source, int X, int Y);
  318. void __fastcall UpDownCopyParamButtonClick(TObject *Sender);
  319. void __fastcall RemoveCopyParamButtonClick(TObject *Sender);
  320. void __fastcall CopyParamListViewKeyDown(TObject *Sender, WORD &Key,
  321. TShiftState Shift);
  322. void __fastcall AddCopyParamButtonClick(TObject *Sender);
  323. void __fastcall CopyParamListViewDblClick(TObject *Sender);
  324. void __fastcall HelpButtonClick(TObject *Sender);
  325. void __fastcall EditorListView3DragDrop(TObject *Sender, TObject *Source,
  326. int X, int Y);
  327. void __fastcall UpDownEditorButtonClick(TObject *Sender);
  328. void __fastcall RemoveEditorButtonClick(TObject *Sender);
  329. void __fastcall AddEditEditorButtonClick(TObject *Sender);
  330. void __fastcall EditorListView3DblClick(TObject *Sender);
  331. void __fastcall EditorListView3KeyDown(TObject *Sender, WORD &Key,
  332. TShiftState Shift);
  333. void __fastcall EditorListView3Data(TObject *Sender, TListItem *Item);
  334. void __fastcall PuttyPathBrowseButtonClick(TObject *Sender);
  335. void __fastcall PathEditBeforeDialog(TObject *Sender,
  336. UnicodeString &Name, bool &Action);
  337. void __fastcall PathEditAfterDialog(TObject *Sender,
  338. UnicodeString &Name, bool &Action);
  339. void __fastcall NavigationTreeCollapsing(TObject *Sender,
  340. TTreeNode *Node, bool &AllowCollapse);
  341. void __fastcall ListViewEndDrag(TObject *Sender,
  342. TObject *Target, int X, int Y);
  343. void __fastcall PathEditCreateEditDialog(TObject *Sender,
  344. TFileDialogKind DialogKind, TOpenDialog *&Dialog);
  345. void __fastcall SessionReopenTimeoutEditSetValue(TObject *Sender,
  346. Extended Value, UnicodeString &Text, bool &Handed);
  347. void __fastcall SessionReopenTimeoutEditGetValue(TObject *Sender,
  348. UnicodeString Text, Extended &Value, bool &Handed);
  349. void __fastcall UseMasterPasswordCheckClick(TObject *Sender);
  350. void __fastcall SetMasterPasswordButtonClick(TObject *Sender);
  351. void __fastcall UsageViewButtonClick(TObject *Sender);
  352. void __fastcall DuplicateCopyParamButtonClick(TObject *Sender);
  353. void __fastcall EditCopyParamButtonClick(TObject *Sender);
  354. void __fastcall CopyParamLabelClick(TObject *Sender);
  355. void __fastcall CopyParamListViewCustomDrawItem(TCustomListView *Sender, TListItem *Item,
  356. TCustomDrawState State, bool &DefaultDraw);
  357. void __fastcall PuttyPathEditChange(TObject *Sender);
  358. void __fastcall NavigationTreeChanging(TObject *Sender, TTreeNode *Node, bool &AllowChange);
  359. void __fastcall LanguagesGetMoreButtonClick(TObject *Sender);
  360. void __fastcall CommanderClick(TObject *Sender);
  361. void __fastcall ExplorerClick(TObject *Sender);
  362. private:
  363. TPreferencesMode FPreferencesMode;
  364. TFont * FEditorFont;
  365. TCustomCommandList * FCustomCommandList;
  366. TCopyParamList * FCopyParamList;
  367. TEditorList * FEditorList;
  368. bool FCustomCommandChanging;
  369. bool FAfterFilenameEditDialog;
  370. int FListViewDragSource;
  371. int FListViewDragDest;
  372. TPreferencesDialogData * FDialogData;
  373. UnicodeString FBeforeDialogPath;
  374. TCopyParamType FCopyParams;
  375. TListViewScrollOnDragOver * FCustomCommandsScrollOnDragOver;
  376. TListViewScrollOnDragOver * FCopyParamScrollOnDragOver;
  377. TListViewScrollOnDragOver * FEditorScrollOnDragOver;
  378. bool FNoUpdate;
  379. bool FLanguagesLoaded;
  380. void __fastcall CMDialogKey(TWMKeyDown & Message);
  381. void __fastcall WMHelp(TWMHelp & Message);
  382. UnicodeString __fastcall TabSample(UnicodeString Values);
  383. void __fastcall AddEditCopyParam(TCopyParamPresetMode Mode);
  384. const TCopyParamType * GetCopyParam(int Index);
  385. void __fastcall SelectPuttyRegistryStorageKey(const UnicodeString & Key);
  386. TInterface __fastcall GetInterface();
  387. public:
  388. virtual __fastcall ~TPreferencesDialog();
  389. bool __fastcall Execute(TPreferencesDialogData * DialogData);
  390. virtual __fastcall TPreferencesDialog(TComponent* AOwner, TPreferencesMode PreferencesMode);
  391. protected:
  392. void __fastcall LoadConfiguration();
  393. void __fastcall SaveConfiguration();
  394. void __fastcall UpdateControls();
  395. void __fastcall UpdateCustomCommandsView();
  396. void __fastcall UpdateCopyParamListView();
  397. void __fastcall UpdateEditorListView();
  398. void __fastcall CustomCommandMove(int Source, int Dest);
  399. void __fastcall CopyParamMove(int Source, int Dest);
  400. void __fastcall EditorMove(int Source, int Dest);
  401. bool __fastcall AllowListViewDrag(TObject * Sender, int X, int Y);
  402. void __fastcall PrepareNavigationTree(TTreeView * Tree);
  403. virtual void __fastcall Dispatch(void * Message);
  404. TListViewScrollOnDragOver * __fastcall ScrollOnDragOver(TObject * ListView);
  405. void __fastcall LoadLanguages();
  406. TTabSheet * __fastcall FindPageForTreeNode(TTreeNode * Node);
  407. bool __fastcall CanSetMasterPassword();
  408. void __fastcall ChangeMasterPassword(UnicodeString Message);
  409. void __fastcall MasterPasswordChanged(
  410. UnicodeString Message, TStrings * RecryptPasswordErrors);
  411. };
  412. //----------------------------------------------------------------------------
  413. #endif