-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgreementUnit.pas
More file actions
97 lines (77 loc) · 2.16 KB
/
Copy pathAgreementUnit.pas
File metadata and controls
97 lines (77 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
unit AgreementUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, SpTBXControls, SpTBXItem,Misc,
TntStdCtrls, RichEdit2, ExRichEdit;
type
TAgreementForm = class(TForm)
SpTBXTitleBar1: TSpTBXTitleBar;
RadioButton1: TSpTBXRadioButton;
RadioButton2: TSpTBXRadioButton;
Button1: TSpTBXButton;
RichEdit1: TExRichEdit;
procedure CreateParams(var Params: TCreateParams); override;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AgreementForm: TAgreementForm;
implementation
uses
PreferencesFormUnit, MainUnit, gnugettext;
var
UserClickedContinue: Boolean = False;
{$R *.dfm}
procedure TAgreementForm.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
if not Preferences.TaskbarButtons then Exit;
with Params do begin
ExStyle := ExStyle or WS_EX_APPWINDOW;
WndParent := GetDesktopWindow;
end;
end;
procedure TAgreementForm.Button1Click(Sender: TObject);
begin
UserClickedContinue := True;
Close;
end;
procedure TAgreementForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
if not UserClickedContinue then Action := caNone;
if RadioButton1.Checked then
begin
if (Status.ConnectionState <> Connected) then
begin
MainForm.AddMainLog(_('Unable to send Agreement confirmation to server... Retry later!'), Colors.Info);
Exit;
end;
MainForm.TryToSendCommand('CONFIRMAGREEMENT');
MainForm.TryToLogin(Preferences.Username, Preferences.Password);
end
else
begin
MainForm.AddMainLog(_('User has rejected the Agreement ... Disconnecting'), Colors.Info);
MainForm.TryToDisconnect;
Exit;
end;
end;
procedure TAgreementForm.FormShow(Sender: TObject);
begin
UserClickedContinue := False;
RadioButton2.Checked := True;
RadioButton2.SetFocus;
end;
procedure TAgreementForm.FormCreate(Sender: TObject);
begin
TranslateComponent(self);
end;
end.