| 1 |
unit KuroutSetting; |
| 2 |
|
| 3 |
interface |
| 4 |
|
| 5 |
uses |
| 6 |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
| 7 |
Dialogs, StdCtrls, ComCtrls, GikoSystem, GikoUtil; |
| 8 |
|
| 9 |
type |
| 10 |
TKuroutOption = class(TForm) |
| 11 |
PageControl1: TPageControl; |
| 12 |
TabSheet1: TTabSheet; |
| 13 |
GroupBox11: TGroupBox; |
| 14 |
Label17: TLabel; |
| 15 |
Label18: TLabel; |
| 16 |
RecvBufferSize: TEdit; |
| 17 |
ProxyProtocolCheckBox: TCheckBox; |
| 18 |
ProtocolCheckBox: TCheckBox; |
| 19 |
GroupBox13: TGroupBox; |
| 20 |
Label24: TLabel; |
| 21 |
Label25: TLabel; |
| 22 |
PostTimeLabel: TLabel; |
| 23 |
Label27: TLabel; |
| 24 |
PostTimeCheckBox: TCheckBox; |
| 25 |
PostTimeEdit: TEdit; |
| 26 |
PutPostTimeRadioButton: TRadioButton; |
| 27 |
BackPostTimeRadioButton: TRadioButton; |
| 28 |
OkBotton: TButton; |
| 29 |
CancelBotton: TButton; |
| 30 |
ApplyButton: TButton; |
| 31 |
procedure OkBottonClick(Sender: TObject); |
| 32 |
procedure FormCreate(Sender: TObject); |
| 33 |
private |
| 34 |
{ Private ?辿?転 } |
| 35 |
procedure SetValue; |
| 36 |
procedure SaveSetting; |
| 37 |
procedure RecvBufferSizeExit(Sender: TObject); |
| 38 |
procedure PostTimeEditExit(Sender: TObject); |
| 39 |
procedure PostTimeCheckBoxClick(Sender: TObject); |
| 40 |
public |
| 41 |
{ Public ?辿?転 } |
| 42 |
end; |
| 43 |
|
| 44 |
var |
| 45 |
KuroutOption: TKuroutOption; |
| 46 |
|
| 47 |
implementation |
| 48 |
|
| 49 |
{$R *.dfm} |
| 50 |
|
| 51 |
procedure TKuroutOption.SetValue; |
| 52 |
begin |
| 53 |
//?坦?M?o?b?t?@?T?C?Y |
| 54 |
RecvBufferSize.Text := IntToStr(Gikosys.Setting.RecvBufferSize); |
| 55 |
//HTTP1.1?g?p |
| 56 |
ProtocolCheckBox.Checked := GikoSys.Setting.Protocol; |
| 57 |
//?v???L?V????HTTP1.1?g?p |
| 58 |
ProxyProtocolCheckBox.Checked := Gikosys.Setting.ProxyProtocol; |
| 59 |
|
| 60 |
//???鼎???????}?V???????g?p???? |
| 61 |
PostTimeCheckBox.Checked := GikoSys.Setting.UseMachineTime; |
| 62 |
PostTimeEdit.Text := IntToStr(GikoSys.Setting.TimeAdjustSec); |
| 63 |
if GikoSys.Setting.TimeAdjust then |
| 64 |
PutPostTimeRadioButton.Checked := True |
| 65 |
else |
| 66 |
BackPostTimeRadioButton.Checked := True; |
| 67 |
end; |
| 68 |
|
| 69 |
procedure TKuroutOption.SaveSetting; |
| 70 |
begin |
| 71 |
//?坦?M?o?b?t?@?T?C?Y |
| 72 |
Gikosys.Setting.RecvBufferSize := StrToInt(RecvBufferSize.Text); |
| 73 |
//HTTP1.1?g?p |
| 74 |
GikoSys.Setting.Protocol := ProtocolCheckBox.Checked; |
| 75 |
//?v???L?V????HTTP1.1?g?p |
| 76 |
Gikosys.Setting.ProxyProtocol := ProxyProtocolCheckBox.Checked; |
| 77 |
//???鼎???????}?V???????g?p???? |
| 78 |
GikoSys.Setting.UseMachineTime := PostTimeCheckBox.Checked; |
| 79 |
if GikoSys.IsNumeric(PostTimeEdit.Text) then |
| 80 |
GikoSys.Setting.TimeAdjustSec := StrToInt(PostTimeEdit.Text) |
| 81 |
else |
| 82 |
GikoSys.Setting.TimeAdjustSec := 0; |
| 83 |
GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked; |
| 84 |
end; |
| 85 |
|
| 86 |
procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject); |
| 87 |
begin |
| 88 |
if not GikoSys.IsNumeric(RecvBufferSize.Text) then |
| 89 |
RecvBufferSize.Text := '4096'; |
| 90 |
if StrToInt(RecvBufferSize.Text) < 256 then |
| 91 |
RecvBufferSize.Text := '4096'; |
| 92 |
end; |
| 93 |
|
| 94 |
procedure TKuroutOption.PostTimeEditExit(Sender: TObject); |
| 95 |
begin |
| 96 |
if not GikoSys.IsNumeric(PostTimeEdit.Text) then |
| 97 |
PostTimeEdit.Text := '0'; |
| 98 |
end; |
| 99 |
|
| 100 |
procedure TKuroutOption.PostTimeCheckBoxClick(Sender: TObject); |
| 101 |
begin |
| 102 |
PostTimeLabel.Enabled := PostTimeCheckBox.Checked; |
| 103 |
PostTimeEdit.Enabled := PostTimeCheckBox.Checked; |
| 104 |
PutPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked; |
| 105 |
BackPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked; |
| 106 |
end; |
| 107 |
|
| 108 |
procedure TKuroutOption.OkBottonClick(Sender: TObject); |
| 109 |
begin |
| 110 |
RecvBufferSizeExit(Sender); |
| 111 |
PostTimeEditExit(Sender); |
| 112 |
SaveSetting; |
| 113 |
end; |
| 114 |
|
| 115 |
procedure TKuroutOption.FormCreate(Sender: TObject); |
| 116 |
begin |
| 117 |
SetValue; |
| 118 |
PostTimeCheckBoxClick(Sender); |
| 119 |
|
| 120 |
end; |
| 121 |
|
| 122 |
end. |