UWIZAddKey_ImportPubKey.pas 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. unit UWIZAddKey_ImportPubKey;
  2. { Copyright (c) 2018 by Herman Schoenfeld
  3. Distributed under the MIT software license, see the accompanying file LICENSE
  4. or visit http://www.opensource.org/licenses/mit-license.php.
  5. This unit is a part of the PascalCoin Project, an infinitely scalable
  6. cryptocurrency. Find us here:
  7. Web: https://www.pascalcoin.org
  8. Source: https://github.com/PascalCoin/PascalCoin
  9. THIS LICENSE HEADER MUST NOT BE REMOVED.
  10. }
  11. {$mode delphi}
  12. interface
  13. uses
  14. StdCtrls, UWizard, UWIZAddKey;
  15. type
  16. { TWIZAddKey_ImportPubKey }
  17. TWIZAddKey_ImportPubKey = class(TWizardForm<TWIZAddKeyModel>)
  18. Label1: TLabel;
  19. txtPublicKey: TMemo;
  20. public
  21. procedure OnPresent; override;
  22. procedure OnNext; override;
  23. function Validate(out message : AnsiString) : boolean; override;
  24. end;
  25. implementation
  26. {$R *.lfm}
  27. uses
  28. UAccounts,
  29. UPCDataTypes;
  30. { TWIZAddKey_ImportPubKey }
  31. procedure TWIZAddKey_ImportPubKey.OnPresent;
  32. begin
  33. txtPublicKey.Clear;
  34. txtPublicKey.SetFocus;
  35. end;
  36. procedure TWIZAddKey_ImportPubKey.OnNext;
  37. begin
  38. Model.KeyText := txtPublicKey.Text;
  39. end;
  40. function TWIZAddKey_ImportPubKey.Validate(out message : AnsiString) : boolean;
  41. var
  42. accountKey : TAccountKey;
  43. begin
  44. Result := TAccountComp.AccountPublicKeyImport(txtPublicKey.Text, accountKey, message);
  45. end;
  46. end.