PageRenderTime 16ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/components/lazsvnpkg/svncommitform.pas

http://github.com/graemeg/lazarus
Pascal | 87 lines | 58 code | 23 blank | 6 comment | 1 complexity | 5c69020b4bb0273a46f84116e974b6c0 MD5 | raw file
 1unit SVNCommitForm;
 2
 3{$mode objfpc}{$H+}
 4
 5interface
 6
 7uses
 8  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
 9  ButtonPanel, StdCtrls, Process, LCLProc;
10
11type
12
13  { TSVNCommitFrm }
14
15  TSVNCommitFrm = class(TForm)
16    ButtonPanel: TButtonPanel;
17    SVNCommitMemo: TMemo;
18    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
19    procedure FormCreate(Sender: TObject);
20    procedure FormDestroy(Sender: TObject);
21    procedure FormShow(Sender: TObject);
22    procedure OKButtonClick(Sender: TObject);
23  private
24    { private declarations }
25    FSVNCommandLine: string;
26  public
27    { public declarations }
28    procedure Execute({%H-}Data: PtrInt);
29    property SVNCommandLine: string read FSVNCommandLine write FSVNCommandLine;
30  end; 
31
32procedure ShowSVNCommitFrm(ACmdLine: string);
33
34var
35  SVNCommitFrm: TSVNCommitFrm;
36
37implementation
38
39{$R *.lfm}
40
41uses
42  SVNClasses;
43
44procedure ShowSVNCommitFrm(ACmdLine: string);
45begin
46  if not Assigned(SVNCommitFrm) then
47    SVNCommitFrm := TSVNCommitFrm.Create(nil);
48
49  SVNCommitFrm.SVNCommandLine:=ACmdLine;
50  SVNCommitFrm.ShowModal;
51end;
52
53{ TSVNCommitFrm }
54
55procedure TSVNCommitFrm.FormShow(Sender: TObject);
56begin
57  Application.QueueAsyncCall(@Execute, 0);
58end;
59
60procedure TSVNCommitFrm.OKButtonClick(Sender: TObject);
61begin
62  Close;
63end;
64
65procedure TSVNCommitFrm.Execute(Data: PtrInt);
66begin
67  CmdLineToMemo(SVNCommandLine, SVNCommitMemo);
68end;
69
70procedure TSVNCommitFrm.FormCreate(Sender: TObject);
71begin
72  Caption := rsLazarusSVNCommit;
73end;
74
75procedure TSVNCommitFrm.FormDestroy(Sender: TObject);
76begin
77  SVNCommitFrm := nil;
78end;
79
80procedure TSVNCommitFrm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
81begin
82  CloseAction := caFree;
83end;
84
85
86end.
87