-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathF_ConfigureSSH.pas
68 lines (56 loc) · 1.71 KB
/
F_ConfigureSSH.pas
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
unit F_ConfigureSSH;
interface
uses
Winapi.Windows, Winapi.Messages,
System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
U_gnugettext;
type
TFrm_ConfigureSSH = class(TForm)
Lbl_RecalLogin: TLabel;
Lbl_RecalPwd: TLabel;
Lbl_RetroPwd: TLabel;
Lbl_RetroLogin: TLabel;
Edt_RecalLogin: TEdit;
Edt_RecalPwd: TEdit;
Edt_RetroLogin: TEdit;
Edt_RetroPwd: TEdit;
Btn_Save: TButton;
Btn_Cancel: TButton;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
function Execute( var aRecalLogin, aRecalPwd, aRetroLogin, aRetroPwd: string ): Boolean;
end;
implementation
{$R *.dfm}
//On passe les paramètres en var pour récupérer les changements directement
function TFrm_ConfigureSSH.Execute( var aRecalLogin, aRecalPwd, aRetroLogin, aRetroPwd: string ): Boolean;
begin
Edt_RecalLogin.Text:= aRecalLogin;
Edt_RecalPwd.Text:= aRecalPwd;
Edt_RetroLogin.Text:= aRetroLogin;
Edt_RetroPwd.Text:= aRetroPwd;
ShowModal;
Result:= ( ModalResult = mrOk );
//si on a cliqué sur Ok, on change les valeurs des paramètres
//pour renvoyer dans la fenêtre principale
if Result then begin
aRecalLogin:= Edt_RecalLogin.Text;
aRecalPwd:= Edt_RecalPwd.Text;
aRetroLogin:= Edt_RetroLogin.Text;
aRetroPwd:= Edt_RetroPwd.Text;
end;
end;
procedure TFrm_ConfigureSSH.FormCreate(Sender: TObject);
begin
TranslateComponent( Self );
end;
//à lapparition de la fenêtre on met le focus sur cancel
procedure TFrm_ConfigureSSH.FormShow(Sender: TObject);
begin
Btn_Cancel.SetFocus;
end;
end.