Preferences.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. //----------------------------------------------------------------------------
  2. #ifndef PreferencesH
  3. #define PreferencesH
  4. //----------------------------------------------------------------------------
  5. #include <vcl\System.hpp>
  6. #include <vcl\Windows.hpp>
  7. #include <vcl\SysUtils.hpp>
  8. #include <vcl\Classes.hpp>
  9. #include <vcl\Graphics.hpp>
  10. #include <vcl\StdCtrls.hpp>
  11. #include <vcl\Forms.hpp>
  12. #include <vcl\Controls.hpp>
  13. #include <vcl\Buttons.hpp>
  14. #include <vcl\ExtCtrls.hpp>
  15. #include <ComCtrls.hpp>
  16. #include <Comboedit.hpp>
  17. #include <Mask.hpp>
  18. #include <ComboEdit.hpp>
  19. #include "CopyParams.h"
  20. #include "GeneralSettings.h"
  21. #include "LogSettings.h"
  22. #include "UpDownEdit.hpp"
  23. #include "IEComboBox.hpp"
  24. #include "HistoryComboBox.hpp"
  25. #include "PasswordEdit.hpp"
  26. #include <Dialogs.hpp>
  27. #include <PasTools.hpp>
  28. //----------------------------------------------------------------------------
  29. class TCustomCommands;
  30. class TEditorList;
  31. //----------------------------------------------------------------------------
  32. class TPreferencesDialog : public TForm
  33. {
  34. __published:
  35. TButton *OKButton;
  36. TButton *CloseButton;
  37. TPanel *MainPanel;
  38. TPageControl *PageControl;
  39. TTabSheet *PreferencesSheet;
  40. TGroupBox *CommonPreferencesGroup;
  41. TCheckBox *ConfirmOverwritingCheck;
  42. TCheckBox *ConfirmDeletingCheck;
  43. TCheckBox *ConfirmClosingSessionCheck;
  44. TCheckBox *DDTransferConfirmationCheck;
  45. TCheckBox *ContinueOnErrorCheck;
  46. TTabSheet *LogSheet;
  47. TLoggingFrame *LoggingFrame;
  48. TTabSheet *GeneralSheet;
  49. TLabel *Label1;
  50. TGeneralSettingsFrame *GeneralSettingsFrame;
  51. TTabSheet *PanelsSheet;
  52. TGroupBox *PanelsRemoteDirectoryGroup;
  53. TCheckBox *ShowInaccesibleDirectoriesCheck;
  54. TGroupBox *PanelsCommonGroup;
  55. TCheckBox *ShowHiddenFilesCheck;
  56. TCheckBox *DefaultDirIsHomeCheck;
  57. TTabSheet *CommanderSheet;
  58. TLabel *Label3;
  59. TGroupBox *PanelsGroup;
  60. TCheckBox *PreserveLocalDirectoryCheck;
  61. TGroupBox *CommanderMiscGroup;
  62. TCheckBox *UseLocationProfilesCheck;
  63. TGroupBox *CompareCriterionsGroup;
  64. TCheckBox *CompareByTimeCheck;
  65. TCheckBox *CompareBySizeCheck;
  66. TTabSheet *ExplorerSheet;
  67. TLabel *Label4;
  68. TGroupBox *GroupBox2;
  69. TCheckBox *ShowFullAddressCheck;
  70. TTabSheet *TransferSheet;
  71. TCopyParamsFrame *CopyParamsFrame;
  72. TTabSheet *EditorSheet;
  73. TGroupBox *EditorPreferenceGroup;
  74. TGroupBox *InternalEditorGroup;
  75. TLabel *EditorFontLabel;
  76. TButton *EditorFontButton;
  77. TTabSheet *IntegrationSheet;
  78. TGroupBox *ShellIconsGroup;
  79. TButton *DesktopIconButton;
  80. TButton *QuickLaunchIconButton;
  81. TButton *SendToHookButton;
  82. TTabSheet *CustomCommandsSheet;
  83. TGroupBox *CustomCommandsGroup;
  84. TListView *CustomCommandsView;
  85. TButton *AddCommandButton;
  86. TButton *RemoveCommandButton;
  87. TButton *UpCommandButton;
  88. TButton *DownCommandButton;
  89. TButton *EditCommandButton;
  90. TPanel *LeftPanel;
  91. TTreeView *NavigationTree;
  92. TCheckBox *DeleteToRecycleBinCheck;
  93. TButton *RegisterAsUrlHandlerButton;
  94. TTabSheet *DragDropSheet;
  95. TGroupBox *DragDropDownloadsGroup;
  96. TLabel *DDExtEnabledLabel;
  97. TLabel *DDExtDisabledLabel;
  98. TRadioButton *DDExtEnabledButton;
  99. TRadioButton *DDExtDisabledButton;
  100. TPanel *DDExtDisabledPanel;
  101. TCheckBox *DDWarnLackOfTempSpaceCheck;
  102. TCheckBox *DDWarnOnMoveCheck;
  103. TCheckBox *ConfirmExitOnCompletionCheck;
  104. TTabSheet *QueueSheet;
  105. TGroupBox *QueueGroup;
  106. TUpDownEdit *QueueTransferLimitEdit;
  107. TLabel *Label5;
  108. TGroupBox *QueueViewGroup;
  109. TRadioButton *QueueViewShowButton;
  110. TRadioButton *QueueViewHideWhenEmptyButton;
  111. TRadioButton *QueueViewHideButton;
  112. TCheckBox *QueueAutoPopupCheck;
  113. TCheckBox *QueueCheck;
  114. TCheckBox *DDAllowMoveInitCheck;
  115. TCheckBox *RememberPasswordCheck;
  116. TCheckBox *ConfirmResumeCheck;
  117. TTabSheet *StorageSheet;
  118. TGroupBox *StorageGroup;
  119. TRadioButton *RegistryStorageButton;
  120. TRadioButton *IniFileStorageButton2;
  121. TGroupBox *NotificationsGroup;
  122. TCheckBox *BeepOnFinishCheck;
  123. TUpDownEdit *BeepOnFinishAfterEdit;
  124. TLabel *BeepOnFinishAfterText;
  125. TTabSheet *TransferEnduranceSheet;
  126. TGroupBox *ResumeBox;
  127. TLabel *ResumeThresholdUnitLabel;
  128. TRadioButton *ResumeOnButton;
  129. TRadioButton *ResumeSmartButton;
  130. TRadioButton *ResumeOffButton;
  131. TUpDownEdit *ResumeThresholdEdit;
  132. TCheckBox *ConfirmCommandSessionCheck;
  133. TGroupBox *TemporaryDirectoryGrouo;
  134. TRadioButton *DDSystemTemporaryDirectoryButton;
  135. TRadioButton *DDCustomTemporaryDirectoryButton;
  136. TDirectoryEdit *DDTemporaryDirectoryEdit;
  137. TLabel *Label6;
  138. TCheckBox *TemporaryDirectoryCleanupCheck;
  139. TCheckBox *ConfirmTemporaryDirectoryCleanupCheck;
  140. TGroupBox *OtherStorageGroup;
  141. TLabel *RandomSeedFileLabel;
  142. TFilenameEdit *RandomSeedFileEdit;
  143. TCheckBox *SwappedPanelsCheck;
  144. TCheckBox *PreservePanelStateCheck;
  145. TButton *AddSearchPathButton;
  146. TCheckBox *QueueNoConfirmationCheck;
  147. TCheckBox *EditorWordWrapCheck;
  148. TGroupBox *PathInCaptionGroup;
  149. TRadioButton *PathInCaptionFullButton;
  150. TRadioButton *PathInCaptionShortButton;
  151. TRadioButton *PathInCaptionNoneButton;
  152. TTabSheet *UpdatesSheet;
  153. TGroupBox *UpdatesGroup;
  154. TRadioButton *UpdatesNeverButton;
  155. TRadioButton *UpdatesDailyButton;
  156. TRadioButton *UpdatesWeeklyButton;
  157. TRadioButton *UpdatesMonthlyButton;
  158. TGroupBox *UpdatesProxyGroup;
  159. TLabel *UpdatesProxyHostLabel;
  160. TLabel *UpdatesProxyPortLabel;
  161. TUpDownEdit *UpdatesProxyPortEdit;
  162. TEdit *UpdatesProxyHostEdit;
  163. TRadioButton *UpdatesProxyCheck;
  164. TTabSheet *CopyParamListSheet;
  165. TGroupBox *CopyParamListGroup;
  166. TListView *CopyParamListView;
  167. TButton *AddCopyParamButton;
  168. TButton *RemoveCopyParamButton;
  169. TButton *UpCopyParamButton;
  170. TButton *DownCopyParamButton;
  171. TButton *EditCopyParamButton;
  172. TButton *DuplicateCopyParamButton;
  173. TGroupBox *CopyParamListOptionsGroup;
  174. TCheckBox *CopyParamAutoSelectNoticeCheck;
  175. TButton *HelpButton;
  176. TGroupBox *ThemeGroup;
  177. TLabel *Label7;
  178. TComboBox *ThemeCombo;
  179. TListView *EditorListView2;
  180. TButton *AddEditorButton;
  181. TButton *EditEditorButton;
  182. TButton *UpEditorButton;
  183. TButton *DownEditorButton;
  184. TButton *RemoveEditorButton;
  185. TGroupBox *DoubleClickGroup;
  186. TCheckBox *CopyOnDoubleClickConfirmationCheck;
  187. TLabel *DoubleClickActionLabel;
  188. TComboBox *DoubleClickActionCombo;
  189. TLabel *Label8;
  190. TComboBox *NortonLikeModeCombo;
  191. TStaticText *ShellIconsText;
  192. TCheckBox *FullRowSelectCheck;
  193. TGroupBox *SessionReopenGroup;
  194. TLabel *SessionReopenAutoLabel;
  195. TCheckBox *SessionReopenAutoCheck;
  196. TLabel *SessionReopenAutoSecLabel;
  197. TUpDownEdit *SessionReopenAutoEdit;
  198. TTabSheet *WindowSheet;
  199. TCheckBox *AutoReadDirectoryAfterOpCheck;
  200. TCheckBox *ConfirmRecyclingCheck;
  201. TGroupBox *WindowMiscellaneousGroup;
  202. TCheckBox *MinimizeToTrayCheck;
  203. TCheckBox *BalloonNotificationsCheck;
  204. TButton *ExportButton;
  205. TTabSheet *IntegrationAppSheet;
  206. TGroupBox *ExternalAppsGroup;
  207. TLabel *Label2;
  208. TEdit *PuttyPathEdit;
  209. TCheckBox *PuttyPasswordCheck2;
  210. TCheckBox *AutoOpenInPuttyCheck;
  211. TButton *PuttyPathBrowseButton;
  212. TButton *PuttyPathResetButton;
  213. TCheckBox *TelnetForFtpInPuttyCheck;
  214. TRadioButton *UpdatesDirectCheck;
  215. TRadioButton *UpdatesAutoCheck;
  216. TLabel *Label9;
  217. TUpDownEdit *EditorTabSizeEdit;
  218. TCheckBox *ConfirmTransferringCheck;
  219. TGroupBox *UpdatesOptionsGroup;
  220. TLabel *Label10;
  221. TComboBox *UpdatesBetaVersionsCombo;
  222. TCheckBox *QueueIndividuallyCheck;
  223. TCheckBox *SessionReopenAutoIdleCheck;
  224. TCheckBox *RenameWholeNameCheck;
  225. TCheckBox *TreeOnLeftCheck;
  226. void __fastcall FormShow(TObject *Sender);
  227. void __fastcall ControlChange(TObject *Sender);
  228. void __fastcall EditorFontButtonClick(TObject *Sender);
  229. void __fastcall FilenameEditExit(TObject *Sender);
  230. void __fastcall FilenameEditChange(TObject *Sender);
  231. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  232. void __fastcall IconButtonClick(TObject *Sender);
  233. void __fastcall CustomCommandsViewData(TObject *Sender, TListItem *Item);
  234. void __fastcall ListViewSelectItem(TObject *Sender,
  235. TListItem *Item, bool Selected);
  236. void __fastcall CustomCommandsViewKeyDown(TObject *Sender, WORD &Key,
  237. TShiftState Shift);
  238. void __fastcall AddEditCommandButtonClick(TObject *Sender);
  239. void __fastcall RemoveCommandButtonClick(TObject *Sender);
  240. void __fastcall UpDownCommandButtonClick(TObject *Sender);
  241. void __fastcall ListViewStartDrag(TObject *Sender,
  242. TDragObject *&DragObject);
  243. void __fastcall CustomCommandsViewDragDrop(TObject *Sender,
  244. TObject *Source, int X, int Y);
  245. void __fastcall ListViewDragOver(TObject *Sender,
  246. TObject *Source, int X, int Y, TDragState State, bool &Accept);
  247. void __fastcall NavigationTreeChange(TObject *Sender, TTreeNode *Node);
  248. void __fastcall PageControlChange(TObject *Sender);
  249. void __fastcall RegisterAsUrlHandlerButtonClick(TObject *Sender);
  250. void __fastcall DDExtLabelClick(TObject *Sender);
  251. void __fastcall CustomCommandsViewDblClick(TObject *Sender);
  252. void __fastcall AddSearchPathButtonClick(TObject *Sender);
  253. void __fastcall EditorFontLabelDblClick(TObject *Sender);
  254. void __fastcall CopyParamListViewData(TObject *Sender, TListItem *Item);
  255. void __fastcall CopyParamListViewInfoTip(TObject *Sender,
  256. TListItem *Item, AnsiString &InfoTip);
  257. void __fastcall CopyParamListViewDragDrop(TObject *Sender,
  258. TObject *Source, int X, int Y);
  259. void __fastcall UpDownCopyParamButtonClick(TObject *Sender);
  260. void __fastcall RemoveCopyParamButtonClick(TObject *Sender);
  261. void __fastcall CopyParamListViewKeyDown(TObject *Sender, WORD &Key,
  262. TShiftState Shift);
  263. void __fastcall AddEditCopyParamButtonClick(TObject *Sender);
  264. void __fastcall CopyParamListViewDblClick(TObject *Sender);
  265. void __fastcall HelpButtonClick(TObject *Sender);
  266. void __fastcall EditorListView2DragDrop(TObject *Sender, TObject *Source,
  267. int X, int Y);
  268. void __fastcall UpDownEditorButtonClick(TObject *Sender);
  269. void __fastcall RemoveEditorButtonClick(TObject *Sender);
  270. void __fastcall AddEditEditorButtonClick(TObject *Sender);
  271. void __fastcall EditorListView2DblClick(TObject *Sender);
  272. void __fastcall EditorListView2KeyDown(TObject *Sender, WORD &Key,
  273. TShiftState Shift);
  274. void __fastcall EditorListView2Data(TObject *Sender, TListItem *Item);
  275. void __fastcall PuttyPathBrowseButtonClick(TObject *Sender);
  276. void __fastcall PuttyPathResetButtonClick(TObject *Sender);
  277. void __fastcall ExportButtonClick(TObject *Sender);
  278. void __fastcall PathEditBeforeDialog(TObject *Sender,
  279. AnsiString &Name, bool &Action);
  280. void __fastcall PathEditAfterDialog(TObject *Sender,
  281. AnsiString &Name, bool &Action);
  282. void __fastcall NavigationTreeCollapsing(TObject *Sender,
  283. TTreeNode *Node, bool &AllowCollapse);
  284. void __fastcall ListViewEndDrag(TObject *Sender,
  285. TObject *Target, int X, int Y);
  286. void __fastcall RandomSeedFileEditCreateEditDialog(TObject *Sender,
  287. TFileDialogKind DialogKind, TOpenDialog *&Dialog);
  288. private:
  289. TPreferencesMode FPreferencesMode;
  290. TFont * FEditorFont;
  291. TCustomCommands * FCustomCommands;
  292. TCopyParamList * FCopyParamList;
  293. TEditorList * FEditorList;
  294. bool FCustomCommandChanging;
  295. bool FAfterFilenameEditDialog;
  296. int FListViewDragSource;
  297. int FListViewDragDest;
  298. TPreferencesDialogData * FDialogData;
  299. AnsiString FBeforeDialogPath;
  300. TListViewScrollOnDragOver * FCustomCommandsScrollOnDragOver;
  301. TListViewScrollOnDragOver * FCopyParamScrollOnDragOver;
  302. TListViewScrollOnDragOver * FEditorScrollOnDragOver;
  303. bool FNoUpdate;
  304. void __fastcall SetPreferencesMode(TPreferencesMode value);
  305. void __fastcall CMDialogKey(TWMKeyDown & Message);
  306. void __fastcall WMHelp(TWMHelp & Message);
  307. AnsiString __fastcall TabSample(AnsiString Values);
  308. public:
  309. virtual __fastcall ~TPreferencesDialog();
  310. bool __fastcall Execute(TPreferencesDialogData * DialogData);
  311. virtual __fastcall TPreferencesDialog(TComponent* AOwner);
  312. __property TPreferencesMode PreferencesMode = { read = FPreferencesMode, write = SetPreferencesMode };
  313. protected:
  314. void __fastcall LoadConfiguration();
  315. void __fastcall SaveConfiguration();
  316. void __fastcall UpdateControls();
  317. void __fastcall UpdateCustomCommandsView();
  318. void __fastcall UpdateCopyParamListView();
  319. void __fastcall UpdateEditorListView();
  320. void __fastcall CustomCommandMove(int Source, int Dest);
  321. void __fastcall CopyParamMove(int Source, int Dest);
  322. void __fastcall EditorMove(int Source, int Dest);
  323. bool __fastcall AllowListViewDrag(TObject * Sender, int X, int Y);
  324. void __fastcall PrepareNavigationTree(TTreeView * Tree);
  325. virtual void __fastcall Dispatch(void * Message);
  326. TListViewScrollOnDragOver * __fastcall ScrollOnDragOver(TObject * ListView);
  327. };
  328. //----------------------------------------------------------------------------
  329. #endif