Login.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 <XPGroupBox.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 *AliasGroupListCheck;
  65. TCheckBox *Scp1CompatibilityCheck;
  66. TCheckBox *IgnoreLsWarningsCheck;
  67. TXPGroupBox *ReturnVarGroup;
  68. TRadioButton *ReturnVarAutodetectButton;
  69. TRadioButton *ReturnVarEnterButton;
  70. TComboBox *ReturnVarEdit;
  71. TXPGroupBox *ShellGroup;
  72. TRadioButton *DefaultShellButton;
  73. TRadioButton *ShellEnterButton;
  74. TComboBox *ShellEdit;
  75. TTabSheet *LogSheet;
  76. TLoggingFrame *LoggingFrame;
  77. TTabSheet *GeneralSheet;
  78. TLabel *Label13;
  79. TButton *PreferencesButton;
  80. TGeneralSettingsFrame *GeneralSettingsFrame;
  81. TPanel *LeftPanel;
  82. TTreeView *AdvancedNavigationTree;
  83. TCheckBox *ShowAdvancedLoginOptionsCheck;
  84. TXPGroupBox *BasicGroup;
  85. TLabel *Label1;
  86. TLabel *Label2;
  87. TLabel *Label3;
  88. TLabel *Label4;
  89. TLabel *Label5;
  90. TEdit *HostNameEdit;
  91. TEdit *UserNameEdit;
  92. TPasswordEdit *PasswordEdit;
  93. TUpDownEdit *PortNumberEdit;
  94. TFilenameEdit *PrivateKeyEdit;
  95. TXPGroupBox *DirectoriesGroup;
  96. TLabel *LocalDirectoryLabel;
  97. TLabel *RemoteDirectoryLabel;
  98. TLabel *LocalDirectoryDescLabel;
  99. TDirectoryEdit *LocalDirectoryEdit;
  100. TEdit *RemoteDirectoryEdit;
  101. TCheckBox *UpdateDirectoriesCheck;
  102. TTreeView *SimpleNavigationTree;
  103. TTabSheet *ConnSheet;
  104. TXPGroupBox *TimeoutGroup;
  105. TLabel *Label11;
  106. TLabel *Label12;
  107. TUpDownEdit *TimeoutEdit;
  108. TTabSheet *ProxySheet;
  109. TXPGroupBox *ProxyTypeGroup;
  110. TRadioButton *ProxyNoneButton;
  111. TRadioButton *ProxyHTTPButton;
  112. TRadioButton *ProxySocks4Button;
  113. TRadioButton *ProxyTelnetButton;
  114. TLabel *Label15;
  115. TLabel *Label18;
  116. TUpDownEdit *ProxyPortEdit;
  117. TEdit *ProxyHostEdit;
  118. TEdit *ProxyUsernameEdit;
  119. TLabel *Label19;
  120. TLabel *Label20;
  121. TPasswordEdit *ProxyPasswordEdit;
  122. TXPGroupBox *ProxySettingsGroup;
  123. TLabel *Label21;
  124. TEdit *ProxyTelnetCommandEdit;
  125. TTabSheet *BugsSheet;
  126. TXPGroupBox *BugsGroupBox;
  127. TLabel *Label22;
  128. TComboBox *BugIgnore1Combo;
  129. TLabel *Label23;
  130. TComboBox *BugPlainPW1Combo;
  131. TLabel *Label24;
  132. TComboBox *BugRSA1Combo;
  133. TLabel *Label25;
  134. TComboBox *BugHMAC2Combo;
  135. TLabel *Label26;
  136. TComboBox *BugDeriveKey2Combo;
  137. TLabel *Label27;
  138. TComboBox *BugRSAPad2Combo;
  139. TLabel *Label28;
  140. TComboBox *BugDHGEx2Combo;
  141. TRadioButton *SshProt1onlyButton;
  142. TRadioButton *SshProt2onlyButton;
  143. TTabSheet *AuthSheet;
  144. TXPGroupBox *AuthenticationGroup;
  145. TCheckBox *AuthTISCheck;
  146. TCheckBox *AgentFwdCheck;
  147. TCheckBox *AuthKICheck;
  148. TXPGroupBox *EncryptionGroup;
  149. TListBox *CipherListBox;
  150. TLabel *Label8;
  151. TCheckBox *Ssh2LegacyDESCheck;
  152. TButton *CipherUpButton;
  153. TButton *CipherDownButton;
  154. TButton *SetDefaultSessionButton;
  155. TAction *SetDefaultSessionAction;
  156. TButton *ToolsMenuButton;
  157. TPopupMenu *ToolsPopupMenu;
  158. TMenuItem *Import1;
  159. TMenuItem *Cleanup1;
  160. TButton *ShellIconsButton;
  161. TAction *DesktopIconAction;
  162. TCheckBox *CacheDirectoriesCheck;
  163. TXPGroupBox *EOLTypeGroup;
  164. TRadioButton *EOLTypeLFButton;
  165. TRadioButton *EOLTypeCRLFButton;
  166. TXPGroupBox *TransferProtocolGroup;
  167. TRadioButton *SFTPButton;
  168. TRadioButton *SCPonlyButton;
  169. TRadioButton *SFTPonlyButton;
  170. TCheckBox *ResolveSymlinksCheck;
  171. TPopupMenu *IconsPopupMenu;
  172. TMenuItem *Desktopicon1;
  173. TAction *SendToHookAction;
  174. TMenuItem *ExplorersSendtoshortcut1;
  175. TLabel *Label14;
  176. TComboBox *BugPKSessID2Combo;
  177. TRadioButton *ProxySocks5Button;
  178. TCheckBox *ProxyLocalhostCheck;
  179. TLabel *Label17;
  180. TRadioButton *ProxyDNSOffButton;
  181. TRadioButton *ProxyDNSAutoButton;
  182. TRadioButton *ProxyDNSOnButton;
  183. TUpDownEdit *TimeDifferenceEdit;
  184. TLabel *Label29;
  185. TLabel *Label30;
  186. TAction *CheckForUpdatesAction;
  187. TMenuItem *CheckForUpdates1;
  188. TButton *SaveButton;
  189. TButton *LanguagesButton;
  190. TCheckBox *CacheDirectoryChangesCheck;
  191. TCheckBox *PreserveDirectoryChangesCheck;
  192. TXPGroupBox *PingGroup;
  193. TLabel *Label6;
  194. TUpDownEdit *PingIntervalSecEdit;
  195. TRadioButton *PingOffButton;
  196. TRadioButton *PingNullPacketButton;
  197. TRadioButton *PingDummyCommandButton;
  198. TUpDownEdit *TimeDifferenceMinutesEdit;
  199. TLabel *Label9;
  200. void __fastcall DataChange(TObject *Sender);
  201. void __fastcall FormShow(TObject *Sender);
  202. void __fastcall SessionListViewSelectItem(TObject *Sender,
  203. TListItem *Item, bool Selected);
  204. void __fastcall SessionListViewDblClick(TObject *Sender);
  205. void __fastcall SessionListViewInfoTip(TObject *Sender,
  206. TListItem *Item, AnsiString &InfoTip);
  207. void __fastcall SessionListViewKeyDown(TObject *Sender, WORD &Key,
  208. TShiftState Shift);
  209. void __fastcall LoadSessionActionExecute(TObject *Sender);
  210. void __fastcall SaveSessionActionExecute(TObject *Sender);
  211. void __fastcall DeleteSessionActionExecute(TObject *Sender);
  212. void __fastcall ImportSessionsActionExecute(TObject *Sender);
  213. void __fastcall CleanUpActionExecute(TObject *Sender);
  214. void __fastcall AboutActionExecute(TObject *Sender);
  215. void __fastcall ActionListUpdate(TBasicAction *Action,
  216. bool &Handled);
  217. void __fastcall PreferencesButtonClick(TObject *Sender);
  218. void __fastcall NewSessionActionExecute(TObject *Sender);
  219. void __fastcall NavigationTreeChange(TObject *Sender, TTreeNode *Node);
  220. void __fastcall PageControlChange(TObject *Sender);
  221. void __fastcall CipherListBoxStartDrag(TObject *Sender,
  222. TDragObject *&DragObject);
  223. void __fastcall CipherListBoxDragOver(TObject *Sender, TObject *Source,
  224. int X, int Y, TDragState State, bool &Accept);
  225. void __fastcall CipherListBoxDragDrop(TObject *Sender, TObject *Source,
  226. int X, int Y);
  227. void __fastcall CipherButtonClick(TObject *Sender);
  228. void __fastcall SetDefaultSessionActionExecute(TObject *Sender);
  229. void __fastcall ToolsMenuButtonClick(TObject *Sender);
  230. void __fastcall DesktopIconActionExecute(TObject *Sender);
  231. void __fastcall SessionListViewCustomDrawItem(TCustomListView *Sender,
  232. TListItem *Item, TCustomDrawState State, bool &DefaultDraw);
  233. void __fastcall ShellIconsButtonClick(TObject *Sender);
  234. void __fastcall SendToHookActionExecute(TObject *Sender);
  235. void __fastcall CheckForUpdatesActionExecute(TObject *Sender);
  236. void __fastcall LanguagesButtonClick(TObject *Sender);
  237. private:
  238. int NoUpdate;
  239. TSessionData * FSessionData;
  240. TStoredSessionList * FStoredSessions;
  241. int FCipherDragSource, FCipherDragDest;
  242. int FOptions;
  243. TPopupMenu * FLanguagesPopupMenu;
  244. AnsiString FOrigCaption;
  245. bool FInitialized;
  246. TTabSheet * FSavedTab;
  247. int FSavedSession;
  248. bool FLocaleChanging;
  249. void * FSystemSettings;
  250. AnsiString FCurrentSessionName;
  251. void __fastcall LoadSession(TSessionData * aSessionData);
  252. void __fastcall UpdateControls();
  253. void __fastcall SetSessionData(TSessionData * value);
  254. TSessionData * __fastcall GetSessionData();
  255. void __fastcall StoreSessions();
  256. void __fastcall SaveSession(TSessionData * aStoredSession);
  257. void __fastcall SetStoredSessions(TStoredSessionList * value);
  258. void __fastcall LoadSessions();
  259. void __fastcall LoadSessionItem(TListItem * Item);
  260. void __fastcall SetSelectedSession(TSessionData * value);
  261. TSessionData * __fastcall GetSelectedSession();
  262. TTreeView * __fastcall GetNavigationTree();
  263. void __fastcall CMDialogKey(TWMKeyDown & Message);
  264. void __fastcall InitializeBugsCombo(TComboBox * BugsCombo);
  265. protected:
  266. void __fastcall Default();
  267. void __fastcall LoadConfiguration();
  268. void __fastcall LoggingGetDefaultLogFileName(System::TObject* Sender,
  269. AnsiString & DefaultLogFileName);
  270. void __fastcall SaveConfiguration();
  271. void __fastcall ShowPreferencesDialog();
  272. void __fastcall ChangePage(TTabSheet * Tab);
  273. virtual void __fastcall Dispatch(void * Message);
  274. bool __fastcall AllowCipherDrag(int X, int Y);
  275. void __fastcall CipherMove(int Source, int Dest);
  276. void __fastcall PrepareNavigationTree(TTreeView * Tree);
  277. void __fastcall SetOptions(int value);
  278. void __fastcall LocaleClick(TObject * Sender);
  279. void __fastcall Init();
  280. void __fastcall ShowTabs(bool Show);
  281. __property TTreeView * NavigationTree = { read=GetNavigationTree };
  282. public:
  283. virtual __fastcall TLoginDialog(TComponent* AOwner);
  284. __fastcall ~TLoginDialog();
  285. bool __fastcall Execute();
  286. __property TSessionData * SessionData = { read=GetSessionData, write=SetSessionData };
  287. __property TStoredSessionList * StoredSessions = { read=FStoredSessions, write=SetStoredSessions };
  288. __property TSessionData * SelectedSession = { read=GetSelectedSession, write=SetSelectedSession };
  289. __property int Options = { read=FOptions, write=SetOptions };
  290. };
  291. //----------------------------------------------------------------------------
  292. #endif