home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / ArsClip / source.zip / UnitReportError.pas < prev    next >
Pascal/Delphi Source File  |  2003-07-01  |  1KB  |  55 lines

  1. unit UnitReportError;
  2. {
  3.     Purpose:
  4.         Show and allow the user to report an error to my website
  5.  
  6.     Updates:
  7.         Include ArsClip version in data string
  8. }
  9.  
  10. interface
  11.  
  12. uses
  13.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  14.   Dialogs, StdCtrls;
  15.  
  16. type
  17.   TFrmReportError = class(TForm)
  18.     Button1: TButton;
  19.     Button2: TButton;
  20.     GroupBox1: TGroupBox;
  21.     Label1: TLabel;
  22.     lblURL: TLabel;
  23.     GroupBox2: TGroupBox;
  24.     lblProgram: TLabel;
  25.     lblDesc: TLabel;
  26.     Label2: TLabel;
  27.   private
  28.     { Private declarations }
  29.   public
  30.     { Public declarations }
  31.     procedure ShowForm( ProblemProgram : string);
  32.   end;
  33.  
  34. var
  35.   FrmReportError: TFrmReportError;
  36.  
  37. implementation
  38. uses ShellAPI, StrUtils, UnitFrmAbout;
  39. {$R *.dfm}
  40.  
  41. { TFrmReportError }
  42.  
  43. procedure TFrmReportError.ShowForm(ProblemProgram : string);
  44. begin
  45.     lblProgram.caption := stringreplace(lblProgram.caption, '%s', ProblemProgram,[]);
  46.     lblURL.caption := 'error=ArsClip' + FrmAbout.lblVersion.Caption +  '-ClipboardBreak-' + ProblemProgram;
  47.     self.ShowModal;
  48.     if (self.ModalResult = mrYes) then begin
  49.         ShellAPI.ShellExecute(self.Handle, nil,
  50.         PChar('http://jackass.arsware.org/reporterror.php?' + lblURL.caption), nil, nil, SW_HIDE);
  51.     end;
  52. end;
  53.  
  54. end.
  55.