ImportSessions.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //----------------------------------------------------------------------------
  2. #ifndef ImportSessionsH
  3. #define ImportSessionsH
  4. //----------------------------------------------------------------------------
  5. #include <System.Classes.hpp>
  6. #include <Vcl.ComCtrls.hpp>
  7. #include <Vcl.Controls.hpp>
  8. #include <Vcl.StdCtrls.hpp>
  9. #include <Vcl.ExtCtrls.hpp>
  10. //---------------------------------------------------------------------
  11. #include <SessionData.h>
  12. #include <GUITools.h>
  13. //---------------------------------------------------------------------
  14. class TImportSessionsDialog : public TForm
  15. {
  16. __published:
  17. TButton *OKButton;
  18. TButton *CancelButton;
  19. TListView *SessionListView2;
  20. TLabel *Label;
  21. TButton *CheckAllButton;
  22. TButton *HelpButton;
  23. TComboBox *SourceComboBox;
  24. TPanel *ErrorPanel;
  25. TLabel *ErrorLabel;
  26. TButton *PasteButton;
  27. void __fastcall SessionListView2InfoTip(TObject *Sender,
  28. TListItem *Item, UnicodeString &InfoTip);
  29. void __fastcall SessionListView2MouseDown(TObject *Sender,
  30. TMouseButton Button, TShiftState Shift, int X, int Y);
  31. void __fastcall SessionListView2KeyUp(TObject *Sender, WORD &Key,
  32. TShiftState Shift);
  33. void __fastcall FormShow(TObject *Sender);
  34. void __fastcall CheckAllButtonClick(TObject *Sender);
  35. void __fastcall HelpButtonClick(TObject *Sender);
  36. void __fastcall SourceComboBoxSelect(TObject *Sender);
  37. void __fastcall PasteButtonClick(TObject *Sender);
  38. private:
  39. TList * FSessionListsList;
  40. TStrings * FErrors;
  41. std::unique_ptr<TStoredSessionList> FPastedKnownHosts;
  42. int FKnownHostsIndex;
  43. void __fastcall UpdateControls();
  44. void __fastcall LoadSessions();
  45. void __fastcall ClearSelections();
  46. void __fastcall SaveSelection();
  47. TStoredSessionList * __fastcall GetSessionList(int Index);
  48. TSessionData * GetSessionData(TListItem * Item);
  49. bool ConvertKeyFile(UnicodeString & KeyFile, TStrings * ConvertedKeyFiles, TStrings * NotConvertedKeyFiles);
  50. virtual void __fastcall CreateHandle();
  51. virtual void __fastcall DestroyHandle();
  52. virtual void __fastcall Dispatch(void * Message);
  53. INTERFACE_HOOK;
  54. public:
  55. virtual __fastcall TImportSessionsDialog(TComponent * AOwner);
  56. void __fastcall Init(TList * SessionListsList, TStrings * Errors);
  57. bool __fastcall Execute();
  58. };
  59. //----------------------------------------------------------------------------
  60. #endif