UFRMAbout.pas 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. unit UFRMAbout;
  2. { Copyright (c) 2016 by Albert Molina
  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. If you like it, consider a donation using Bitcoin:
  10. 16K3HCZRhFUtM8GdWRcfKeaa6KsuyxZaYk
  11. THIS LICENSE HEADER MUST NOT BE REMOVED.
  12. }
  13. {$IFDEF FPC}
  14. {$MODE Delphi}
  15. {$ENDIF}
  16. interface
  17. {$I ../config.inc}
  18. uses
  19. {$IFnDEF FPC}
  20. pngimage, Windows,
  21. {$ELSE}
  22. LCLIntf, LCLType, LMessages,
  23. {$ENDIF}
  24. Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  25. Dialogs, ExtCtrls, StdCtrls, Buttons;
  26. type
  27. { TFRMAbout }
  28. TFRMAbout = class(TForm)
  29. Image1: TImage;
  30. Label1: TLabel;
  31. Memo1: TMemo;
  32. bbClose: TBitBtn;
  33. lblBuild: TLabel;
  34. lblProtocolVersion: TLabel;
  35. Label2: TLabel;
  36. Label3: TLabel;
  37. Label4: TLabel;
  38. Label5: TLabel;
  39. procedure FormCreate(Sender: TObject);
  40. procedure Label4Click(Sender: TObject);
  41. procedure Label5Click(Sender: TObject);
  42. private
  43. { Private declarations }
  44. Procedure OpenURL(Url : String);
  45. public
  46. { Public declarations }
  47. end;
  48. implementation
  49. uses
  50. {$IFnDEF FPC}
  51. ShellApi,
  52. {$ELSE}
  53. {$ENDIF}
  54. UFolderHelper, UConst,
  55. {$IFDEF Use_OpenSSL}
  56. UOpenSSL,
  57. {$ENDIF}
  58. {$IFDEF USE_GNUGETTEXT}
  59. gnugettext,
  60. {$ENDIF}
  61. UNode;
  62. {$IFnDEF FPC}
  63. {$R *.dfm}
  64. {$ELSE}
  65. {$R *.lfm}
  66. {$ENDIF}
  67. procedure TFRMAbout.FormCreate(Sender: TObject);
  68. begin
  69. {$IFDEF USE_GNUGETTEXT}TranslateComponent(self);{$ENDIF}
  70. //
  71. lblBuild.Caption := 'Build: '+CT_ClientAppVersion+' OpenSSL: '+{$IFDEF Use_OpenSSL}IntToHex(OpenSSLVersion,8){$ELSE}'NONE'{$ENDIF}+' Compiler: '{$IFDEF FPC}+'FPC'{$IFDEF CPU32}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ELSE}+'Delphi'{$IFDEF CPU32BITS}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ENDIF};
  72. lblProtocolVersion.Caption := Format('BlockChain Protocol: %d (%d) - Net Protocol: %d (%d)',[TNode.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available,
  73. CT_NetProtocol_Version, CT_NetProtocol_Available]);
  74. end;
  75. procedure TFRMAbout.Label4Click(Sender: TObject);
  76. begin
  77. OpenURL(TLabel(Sender).Caption);
  78. end;
  79. procedure TFRMAbout.Label5Click(Sender: TObject);
  80. begin
  81. OpenURL(TLabel(Sender).Caption);
  82. end;
  83. procedure TFRMAbout.OpenURL(Url: String);
  84. begin
  85. {$IFDEF FPC}
  86. OpenDocument(pchar(URL))
  87. {$ELSE}
  88. shellexecute(0, 'open', pchar(URL), nil, nil, SW_SHOW)
  89. {$ENDIF}
  90. end;
  91. end.