-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathupdatesetting.pas
More file actions
115 lines (93 loc) · 2.61 KB
/
updatesetting.pas
File metadata and controls
115 lines (93 loc) · 2.61 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
unit updatesetting;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Buttons, Spin, ButtonPanel, base64, resstr;
type
{ TUpdSettingForm }
TUpdSettingForm = class(TForm)
ButtonPanel1: TButtonPanel;
CheckBoxUseProxy: TCheckBox;
CoBoxOsIdent: TComboBox;
EditConfirmPass: TEdit;
EditProxyHost: TEdit;
EditProxyUser: TEdit;
EditProxyPass: TEdit;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
EditProxyPort: TSpinEdit;
procedure CheckBoxUseProxyChange(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormHide(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private
public
end;
function RunUpdSettingForm: Boolean;
var
UpdSettingForm: TUpdSettingForm;
implementation
uses mainunit;
function RunUpdSettingForm: Boolean;
begin
Result:= True;
if not Assigned(UpdSettingForm) then UpdSettingForm:= TUpdSettingForm.Create(Application);
try
UpdSettingForm.ShowModal;
except
UpdSettingForm.Free;
FreeAndNil(UpdSettingForm);
end;
end;
{$R *.frm}
{ TUpdSettingForm }
procedure TUpdSettingForm.CheckBoxUseProxyChange(Sender: TObject);
begin
GroupBox1.Enabled:= CheckBoxUseProxy.Checked;
end;
procedure TUpdSettingForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
CloseAction:= caFree;
FreeAndNil(UpdSettingForm);
end;
procedure TUpdSettingForm.FormHide(Sender: TObject);
begin
EditConfirmPass.Text:= '';
EditConfirmPass.Text:= '';
end;
procedure TUpdSettingForm.FormShow(Sender: TObject);
begin
DisableAutoSizing;
CoBoxOsIdent.ItemIndex:= CoBoxOsIdent.Items.IndexOf(OSIdent);
CheckBoxUseProxy.Checked:= UseProxyStatus;
EditProxyHost.Text:= ProxyHost;
EditProxyPort.Value:= ProxyPort;
EditProxyUser.Text:= ProxyUser;
EditProxyPass.Text:= DecodeStringBase64(ProxyPass);
EditConfirmPass.Text:= DecodeStringBase64(ProxyPass);
EnableAutoSizing;
end;
procedure TUpdSettingForm.OKButtonClick(Sender: TObject);
begin
OSIdent:= CoBoxOsIdent.Text;
UseProxyStatus:= CheckBoxUseProxy.Checked;
ProxyHost:= EditProxyHost.Text;
ProxyPort:= EditProxyPort.Value;
ProxyUser:= EditProxyUser.Text;
if UseProxyStatus then
if EditProxyPass.Text <> EditConfirmPass.Text then
begin
ModalResult:= mrNone;
MessageDlg('Gitea Panel', i18_Err_NoConfirmPass, mtError, [mbOK], 0);
end
else ProxyPass:= EncodeStringBase64(EditProxyPass.Text);
end;
end.