Login.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. //----------------------------------------------------------------------------
  2. #ifndef LoginH
  3. #define LoginH
  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 <Mask.hpp>
  17. #include <ComboEdit.hpp>
  18. #include <ActnList.hpp>
  19. #include <UpDownEdit.hpp>
  20. #include <XPThemes.hpp>
  21. #include <PasswordEdit.hpp>
  22. #include <Menus.hpp>
  23. //----------------------------------------------------------------------------
  24. #include <Configuration.h>
  25. #include <SessionData.h>
  26. #include "LogSettings.h"
  27. #include "GeneralSettings.h"
  28. //----------------------------------------------------------------------------
  29. class TLoginDialog : public TForm
  30. {
  31. __published:
  32. TButton *LoginButton;
  33. TButton *CloseButton;
  34. TButton *AboutButton;
  35. TActionList *ActionList;
  36. TAction *LoadSessionAction;
  37. TAction *SaveSessionAction;
  38. TAction *DeleteSessionAction;
  39. TAction *ImportSessionsAction;
  40. TAction *LoginAction;
  41. TAction *AboutAction;
  42. TAction *CleanUpAction;
  43. TAction *NewSessionAction;
  44. TPanel *MainPanel;
  45. TPageControl *PageControl;
  46. TTabSheet *SessionListSheet;
  47. TButton *LoadButton;
  48. TButton *DeleteButton;
  49. TListView *SessionListView;
  50. TButton *NewButton;
  51. TTabSheet *BasicSheet;
  52. TTabSheet *AdvancedSheet;
  53. TXPGroupBox *ProtocolGroup;
  54. TLabel *Label7;
  55. TRadioButton *SshProt1Button;
  56. TRadioButton *SshProt2Button;
  57. TCheckBox *CompressionCheck;
  58. TTabSheet *EnvironmentSheet;
  59. TTabSheet *ScpSheet;
  60. TXPGroupBox *OtherShellOptionsGroup;
  61. TCheckBox *LookupUserGroupsCheck;
  62. TCheckBox *ClearAliasesCheck;
  63. TCheckBox *UnsetNationalVarsCheck;
  64. TCheckBox *Scp1CompatibilityCheck;
  65. TXPGroupBox *ReturnVarGroup;
  66. TRadioButton *ReturnVarAutodetectButton;
  67. TRadioButton *ReturnVarEnterButton;
  68. TComboBox *ReturnVarEdit;
  69. TXPGroupBox *ShellGroup;
  70. TRadioButton *DefaultShellButton;
  71. TRadioButton *ShellEnterButton;
  72. TComboBox *ShellEdit;
  73. TTabSheet *LogSheet;
  74. TLoggingFrame *LoggingFrame;
  75. TTabSheet *GeneralSheet;
  76. TLabel *Label13;
  77. TButton *PreferencesButton;
  78. TGeneralSettingsFrame *GeneralSettingsFrame;
  79. TPanel *LeftPanel;
  80. TTreeView *AdvancedNavigationTree;
  81. TCheckBox *ShowAdvancedLoginOptionsCheck;
  82. TXPGroupBox *BasicGroup;
  83. TLabel *Label1;
  84. TLabel *Label2;
  85. TLabel *Label3;
  86. TLabel *Label4;
  87. TLabel *Label5;
  88. TEdit *HostNameEdit;
  89. TEdit *UserNameEdit;
  90. TPasswordEdit *PasswordEdit;
  91. TUpDownEdit *PortNumberEdit;
  92. TFilenameEdit *PrivateKeyEdit;
  93. TTreeView *SimpleNavigationTree;
  94. TTabSheet *ConnSheet;
  95. TXPGroupBox *TimeoutGroup;
  96. TLabel *Label11;
  97. TLabel *Label12;
  98. TUpDownEdit *TimeoutEdit;
  99. TTabSheet *ProxySheet;
  100. TXPGroupBox *ProxyTypeGroup;
  101. TRadioButton *ProxyNoneButton;
  102. TRadioButton *ProxyHTTPButton;
  103. TRadioButton *ProxySocks4Button;
  104. TRadioButton *ProxyTelnetButton;
  105. TLabel *Label15;
  106. TLabel *Label18;
  107. TUpDownEdit *ProxyPortEdit;
  108. TEdit *ProxyHostEdit;
  109. TEdit *ProxyUsernameEdit;
  110. TLabel *Label19;
  111. TLabel *Label20;
  112. TPasswordEdit *ProxyPasswordEdit;
  113. TXPGroupBox *ProxySettingsGroup;
  114. TLabel *Label21;
  115. TEdit *ProxyTelnetCommandEdit;
  116. TTabSheet *BugsSheet;
  117. TXPGroupBox *BugsGroupBox;
  118. TLabel *Label22;
  119. TComboBox *BugIgnore1Combo;
  120. TLabel *Label23;
  121. TComboBox *BugPlainPW1Combo;
  122. TLabel *Label24;
  123. TComboBox *BugRSA1Combo;
  124. TLabel *Label25;
  125. TComboBox *BugHMAC2Combo;
  126. TLabel *Label26;
  127. TComboBox *BugDeriveKey2Combo;
  128. TLabel *Label27;
  129. TComboBox *BugRSAPad2Combo;
  130. TRadioButton *SshProt1onlyButton;
  131. TRadioButton *SshProt2onlyButton;
  132. TTabSheet *AuthSheet;
  133. TXPGroupBox *AuthenticationGroup;
  134. TCheckBox *AuthTISCheck;
  135. TCheckBox *AgentFwdCheck;
  136. TCheckBox *AuthKICheck;
  137. TXPGroupBox *EncryptionGroup;
  138. TListBox *CipherListBox;
  139. TLabel *Label8;
  140. TCheckBox *Ssh2LegacyDESCheck;
  141. TButton *CipherUpButton;
  142. TButton *CipherDownButton;
  143. TButton *SetDefaultSessionButton;
  144. TAction *SetDefaultSessionAction;
  145. TButton *ToolsMenuButton;
  146. TPopupMenu *ToolsPopupMenu;
  147. TMenuItem *Import1;
  148. TMenuItem *Cleanup1;
  149. TButton *ShellIconsButton;
  150. TAction *DesktopIconAction;
  151. TXPGroupBox *EOLTypeGroup;
  152. TRadioButton *EOLTypeLFButton;
  153. TRadioButton *EOLTypeCRLFButton;
  154. TXPGroupBox *TransferProtocolGroup;
  155. TRadioButton *SFTPButton;
  156. TRadioButton *SCPonlyButton;
  157. TRadioButton *SFTPonlyButton;
  158. TPopupMenu *IconsPopupMenu;
  159. TMenuItem *Desktopicon1;
  160. TAction *SendToHookAction;
  161. TMenuItem *ExplorersSendtoshortcut1;
  162. TLabel *Label14;
  163. TComboBox *BugPKSessID2Combo;
  164. TRadioButton *ProxySocks5Button;
  165. TCheckBox *ProxyLocalhostCheck;
  166. TLabel *Label17;
  167. TRadioButton *ProxyDNSOffButton;
  168. TRadioButton *ProxyDNSAutoButton;
  169. TRadioButton *ProxyDNSOnButton;
  170. TUpDownEdit *TimeDifferenceEdit;
  171. TLabel *Label29;
  172. TLabel *Label30;
  173. TAction *CheckForUpdatesAction;
  174. TMenuItem *CheckForUpdates1;
  175. TButton *SaveButton;
  176. TButton *LanguagesButton;
  177. TXPGroupBox *PingGroup;
  178. TLabel *Label6;
  179. TUpDownEdit *PingIntervalSecEdit;
  180. TRadioButton *PingOffButton;
  181. TRadioButton *PingNullPacketButton;
  182. TRadioButton *PingDummyCommandButton;
  183. TUpDownEdit *TimeDifferenceMinutesEdit;
  184. TLabel *Label9;
  185. TCheckBox *AuthKIPasswordCheck;
  186. TTabSheet *DirectoriesSheet;
  187. TXPGroupBox *DirectoriesGroup;
  188. TLabel *LocalDirectoryLabel;
  189. TLabel *RemoteDirectoryLabel;
  190. TLabel *LocalDirectoryDescLabel;
  191. TDirectoryEdit *LocalDirectoryEdit;
  192. TEdit *RemoteDirectoryEdit;
  193. TCheckBox *UpdateDirectoriesCheck;
  194. TCheckBox *CacheDirectoriesCheck;
  195. TCheckBox *ResolveSymlinksCheck;
  196. TCheckBox *CacheDirectoryChangesCheck;
  197. TCheckBox *PreserveDirectoryChangesCheck;
  198. TXPGroupBox *ConsiderDSTGroup;
  199. TRadioButton *ConsiderDSTOnCheck;
  200. TRadioButton *ConsiderDSTOffCheck;
  201. TCheckBox *AuthGSSAPICheck;
  202. TXPGroupBox *RecycleBinGroup;
  203. TCheckBox *DeleteToRecycleBinCheck;
  204. TCheckBox *OverwrittenToRecycleBinCheck;
  205. TLabel *RecycleBinPathLabel;
  206. TEdit *RecycleBinPathEdit;
  207. TXPGroupBox *ScpLsOptionsGroup;
  208. TCheckBox *IgnoreLsWarningsCheck;
  209. TCheckBox *AliasGroupListCheck;
  210. TCheckBox *SCPLsFullTimeAutoCheck;
  211. TTabSheet *SftpSheet;
  212. TXPGroupBox *SFTPBugsGroupBox;
  213. TLabel *Label10;
  214. TLabel *Label36;
  215. TComboBox *SFTPBugSymlinkCombo;
  216. TTabSheet *KexSheet;
  217. TXPGroupBox *KexOptionsGroup;
  218. TLabel *Label28;
  219. TListBox *KexListBox;
  220. TButton *KexUpButton;
  221. TButton *KexDownButton;
  222. TXPGroupBox *KexReexchangeGroup;
  223. TLabel *Label31;
  224. TUpDownEdit *RekeyTimeEdit;
  225. TLabel *Label32;
  226. TEdit *RekeyDataEdit;
  227. TXPGroupBox *IPvGroup;
  228. TRadioButton *IPAutoButton;
  229. TRadioButton *IPv4Button;
  230. TRadioButton *IPv6Button;
  231. TLabel *Label33;
  232. TComboBox *BugRekey2Combo;
  233. TXPGroupBox *SFTPProtocolGroup;
  234. TLabel *Label34;
  235. TLabel *Label35;
  236. TComboBox *SFTPMaxVersionCombo;
  237. TComboBox *SFTPBugUtfCombo;
  238. TComboBox *SFTPBugSignedTSCombo;
  239. TButton *HelpButton;
  240. void __fastcall DataChange(TObject *Sender);
  241. void __fastcall FormShow(TObject *Sender);
  242. void __fastcall SessionListViewSelectItem(TObject *Sender,
  243. TListItem *Item, bool Selected);
  244. void __fastcall SessionListViewDblClick(TObject *Sender);
  245. void __fastcall SessionListViewInfoTip(TObject *Sender,
  246. TListItem *Item, AnsiString &InfoTip);
  247. void __fastcall SessionListViewKeyDown(TObject *Sender, WORD &Key,
  248. TShiftState Shift);
  249. void __fastcall LoadSessionActionExecute(TObject *Sender);
  250. void __fastcall SaveSessionActionExecute(TObject *Sender);
  251. void __fastcall DeleteSessionActionExecute(TObject *Sender);
  252. void __fastcall ImportSessionsActionExecute(TObject *Sender);
  253. void __fastcall CleanUpActionExecute(TObject *Sender);
  254. void __fastcall AboutActionExecute(TObject *Sender);
  255. void __fastcall ActionListUpdate(TBasicAction *Action,
  256. bool &Handled);
  257. void __fastcall PreferencesButtonClick(TObject *Sender);
  258. void __fastcall NewSessionActionExecute(TObject *Sender);
  259. void __fastcall NavigationTreeChange(TObject *Sender, TTreeNode *Node);
  260. void __fastcall PageControlChange(TObject *Sender);
  261. void __fastcall AlgListBoxStartDrag(TObject *Sender,
  262. TDragObject *&DragObject);
  263. void __fastcall AlgListBoxDragOver(TObject *Sender, TObject *Source,
  264. int X, int Y, TDragState State, bool &Accept);
  265. void __fastcall AlgListBoxDragDrop(TObject *Sender, TObject *Source,
  266. int X, int Y);
  267. void __fastcall CipherButtonClick(TObject *Sender);
  268. void __fastcall SetDefaultSessionActionExecute(TObject *Sender);
  269. void __fastcall ToolsMenuButtonClick(TObject *Sender);
  270. void __fastcall DesktopIconActionExecute(TObject *Sender);
  271. void __fastcall SessionListViewCustomDrawItem(TCustomListView *Sender,
  272. TListItem *Item, TCustomDrawState State, bool &DefaultDraw);
  273. void __fastcall ShellIconsButtonClick(TObject *Sender);
  274. void __fastcall SendToHookActionExecute(TObject *Sender);
  275. void __fastcall CheckForUpdatesActionExecute(TObject *Sender);
  276. void __fastcall LanguagesButtonClick(TObject *Sender);
  277. void __fastcall AuthGSSAPICheckClick(TObject *Sender);
  278. void __fastcall KexButtonClick(TObject *Sender);
  279. void __fastcall HelpButtonClick(TObject *Sender);
  280. void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
  281. TShiftState Shift);
  282. void __fastcall PrivateKeyEditAfterDialog(TObject *Sender,
  283. AnsiString &Name, bool &Action);
  284. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  285. private:
  286. int NoUpdate;
  287. TSessionData * FSessionData;
  288. TStoredSessionList * FStoredSessions;
  289. int FAlgDragSource, FAlgDragDest;
  290. int FOptions;
  291. TPopupMenu * FLanguagesPopupMenu;
  292. AnsiString FOrigCaption;
  293. bool FInitialized;
  294. TTabSheet * FSavedTab;
  295. int FSavedSession;
  296. bool FLocaleChanging;
  297. void * FSystemSettings;
  298. AnsiString FCurrentSessionName;
  299. void __fastcall LoadSession(TSessionData * aSessionData);
  300. void __fastcall UpdateControls();
  301. void __fastcall SetSessionData(TSessionData * value);
  302. TSessionData * __fastcall GetSessionData();
  303. void __fastcall StoreSessions();
  304. void __fastcall SaveSession(TSessionData * aStoredSession);
  305. void __fastcall SetStoredSessions(TStoredSessionList * value);
  306. void __fastcall LoadSessions();
  307. void __fastcall LoadSessionItem(TListItem * Item);
  308. void __fastcall SetSelectedSession(TSessionData * value);
  309. TSessionData * __fastcall GetSelectedSession();
  310. TTreeView * __fastcall GetNavigationTree();
  311. void __fastcall CMDialogKey(TWMKeyDown & Message);
  312. void __fastcall InitializeBugsCombo(TComboBox * BugsCombo);
  313. protected:
  314. void __fastcall Default();
  315. void __fastcall LoadConfiguration();
  316. void __fastcall LoggingGetDefaultLogFileName(System::TObject* Sender,
  317. AnsiString & DefaultLogFileName);
  318. void __fastcall SaveConfiguration();
  319. void __fastcall ShowPreferencesDialog();
  320. void __fastcall ChangePage(TTabSheet * Tab);
  321. virtual void __fastcall Dispatch(void * Message);
  322. bool __fastcall AllowAlgDrag(TListBox * AlgListBox, int X, int Y);
  323. void __fastcall AlgMove(TListBox * AlgListBox, int Source, int Dest);
  324. void __fastcall PrepareNavigationTree(TTreeView * Tree, bool ClearHints);
  325. void __fastcall SetOptions(int value);
  326. void __fastcall LocaleClick(TObject * Sender);
  327. void __fastcall LocaleGetClick(TObject * Sender);
  328. void __fastcall Init();
  329. void __fastcall InitControls();
  330. void __fastcall ShowTabs(bool Show);
  331. void __fastcall VerifyKey(AnsiString FileName, bool TypeOnly);
  332. __property TTreeView * NavigationTree = { read=GetNavigationTree };
  333. public:
  334. virtual __fastcall TLoginDialog(TComponent* AOwner);
  335. __fastcall ~TLoginDialog();
  336. bool __fastcall Execute();
  337. __property TSessionData * SessionData = { read=GetSessionData, write=SetSessionData };
  338. __property TStoredSessionList * StoredSessions = { read=FStoredSessions, write=SetStoredSessions };
  339. __property TSessionData * SelectedSession = { read=GetSelectedSession, write=SetSelectedSession };
  340. __property int Options = { read=FOptions, write=SetOptions };
  341. };
  342. //----------------------------------------------------------------------------
  343. #endif