1
0

ImportSessions.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. TButton *BrowseButton;
  28. void __fastcall SessionListView2InfoTip(TObject *Sender,
  29. TListItem *Item, UnicodeString &InfoTip);
  30. void __fastcall SessionListView2MouseDown(TObject *Sender,
  31. TMouseButton Button, TShiftState Shift, int X, int Y);
  32. void __fastcall SessionListView2KeyUp(TObject *Sender, WORD &Key,
  33. TShiftState Shift);
  34. void __fastcall FormShow(TObject *Sender);
  35. void __fastcall CheckAllButtonClick(TObject *Sender);
  36. void __fastcall HelpButtonClick(TObject *Sender);
  37. void __fastcall SourceComboBoxSelect(TObject *Sender);
  38. void __fastcall PasteButtonClick(TObject *Sender);
  39. void __fastcall BrowseButtonClick(TObject *Sender);
  40. private:
  41. TList * FSessionListsList;
  42. TStrings * FErrors;
  43. std::unique_ptr<TStoredSessionList> FPastedKnownHosts;
  44. std::unique_ptr<TStoredSessionList> FIniImportSessionList;
  45. UnicodeString FIniFileName;
  46. void __fastcall UpdateControls();
  47. void __fastcall LoadSessions();
  48. void __fastcall ClearSelections();
  49. void __fastcall SaveSelection();
  50. TStoredSessionList * __fastcall GetSessionList(int Index);
  51. TSessionData * GetSessionData(TListItem * Item);
  52. bool ConvertKeyFile(UnicodeString & KeyFile, TStrings * ConvertedKeyFiles, TStrings * NotConvertedKeyFiles);
  53. virtual void __fastcall CreateHandle();
  54. virtual void __fastcall DestroyHandle();
  55. virtual void __fastcall Dispatch(void * Message);
  56. INTERFACE_HOOK
  57. public:
  58. virtual __fastcall TImportSessionsDialog(TComponent * AOwner);
  59. void __fastcall Init(TList * SessionListsList, TStrings * Errors);
  60. TStoredSessionList * SelectSessionsForImport(UnicodeString & Error);
  61. bool __fastcall Execute();
  62. __property UnicodeString IniFileName = { read = FIniFileName };
  63. };
  64. //----------------------------------------------------------------------------
  65. #endif