| 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 |
ColumnTabSheet: TTabSheet; |
| 32 |
CategoryColumnGroupBox: TGroupBox; |
| 33 |
CUnVisibledListBox: TListBox; |
| 34 |
CVisibledListBox: TListBox; |
| 35 |
CAddButton: TButton; |
| 36 |
CDeleteButton: TButton; |
| 37 |
BoardColumnGroupBox: TGroupBox; |
| 38 |
BUnVisibledListBox: TListBox; |
| 39 |
BVisibledListBox: TListBox; |
| 40 |
BAddButton: TButton; |
| 41 |
BDeleteButton: TButton; |
| 42 |
Label1: TLabel; |
| 43 |
Label2: TLabel; |
| 44 |
Label3: TLabel; |
| 45 |
Label4: TLabel; |
| 46 |
CUpButton: TButton; |
| 47 |
CDownButton: TButton; |
| 48 |
BUpButton: TButton; |
| 49 |
BDownButton: TButton; |
| 50 |
GroupBox1: TGroupBox; |
| 51 |
GengoSupport: TCheckBox; |
| 52 |
Label5: TLabel; |
| 53 |
GroupBox2: TGroupBox; |
| 54 |
LocalTrapAtt: TCheckBox; |
| 55 |
RemoteTrapAtt: TCheckBox; |
| 56 |
Label6: TLabel; |
| 57 |
ReadTimeOut: TEdit; |
| 58 |
Label7: TLabel; |
| 59 |
KakikomiTabSheet: TTabSheet; |
| 60 |
CookieGroupBox: TGroupBox; |
| 61 |
Label8: TLabel; |
| 62 |
FixedCookieEdit: TEdit; |
| 63 |
Label9: TLabel; |
| 64 |
GroupBox3: TGroupBox; |
| 65 |
Label10: TLabel; |
| 66 |
MoveHistoryMaxEdit: TEdit; |
| 67 |
Label11: TLabel; |
| 68 |
procedure OkBottonClick(Sender: TObject); |
| 69 |
procedure FormCreate(Sender: TObject); |
| 70 |
procedure CDeleteButtonClick(Sender: TObject); |
| 71 |
procedure CAddButtonClick(Sender: TObject); |
| 72 |
procedure BAddButtonClick(Sender: TObject); |
| 73 |
procedure BDeleteButtonClick(Sender: TObject); |
| 74 |
procedure CUpButtonClick(Sender: TObject); |
| 75 |
procedure CDownButtonClick(Sender: TObject); |
| 76 |
procedure BUpButtonClick(Sender: TObject); |
| 77 |
procedure BDownButtonClick(Sender: TObject); |
| 78 |
private |
| 79 |
{ Private 鐃緒申鐃緒申 } |
| 80 |
procedure SetValue; |
| 81 |
procedure SaveSetting; |
| 82 |
procedure RecvBufferSizeExit(Sender: TObject); |
| 83 |
procedure PostTimeEditExit(Sender: TObject); |
| 84 |
procedure PostTimeCheckBoxClick(Sender: TObject); |
| 85 |
procedure SetColumnData(); |
| 86 |
procedure PostColumnData(); |
| 87 |
public |
| 88 |
{ Public 鐃緒申鐃緒申 } |
| 89 |
end; |
| 90 |
|
| 91 |
var |
| 92 |
KuroutOption: TKuroutOption; |
| 93 |
|
| 94 |
implementation |
| 95 |
|
| 96 |
uses |
| 97 |
Giko, Setting; |
| 98 |
|
| 99 |
{$R *.dfm} |
| 100 |
|
| 101 |
procedure TKuroutOption.SetValue; |
| 102 |
begin |
| 103 |
//鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? |
| 104 |
RecvBufferSize.Text := IntToStr(Gikosys.Setting.RecvBufferSize); |
| 105 |
//HTTP1.1鐃?鐃? |
| 106 |
ProtocolCheckBox.Checked := GikoSys.Setting.Protocol; |
| 107 |
//鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃? |
| 108 |
ProxyProtocolCheckBox.Checked := Gikosys.Setting.ProxyProtocol; |
| 109 |
ReadTimeOut.Text := IntToStr(GikoSys.Setting.ReadTimeOut); |
| 110 |
|
| 111 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 112 |
PostTimeCheckBox.Checked := GikoSys.Setting.UseMachineTime; |
| 113 |
PostTimeEdit.Text := IntToStr(GikoSys.Setting.TimeAdjustSec); |
| 114 |
if GikoSys.Setting.TimeAdjust then |
| 115 |
PutPostTimeRadioButton.Checked := True |
| 116 |
else |
| 117 |
BackPostTimeRadioButton.Checked := True; |
| 118 |
|
| 119 |
SetColumnData(); |
| 120 |
|
| 121 |
PageControl1.ActivePageIndex := GikoSys.Setting.KuroutSettingTabIndex; |
| 122 |
|
| 123 |
//2chAnnai |
| 124 |
GengoSupport.Checked := GikoSys.Setting.GengoSupport; |
| 125 |
//FusianaSet |
| 126 |
LocalTrapAtt.Checked := GikoSys.Setting.LocalTrapAtt; |
| 127 |
RemoteTrapAtt.Checked := GikoSys.Setting.RemoteTrapAtt; |
| 128 |
// Cookie |
| 129 |
FixedCookieEdit.Text := GikoSys.Setting.FixedCookie; |
| 130 |
// 鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 131 |
MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize ); |
| 132 |
end; |
| 133 |
|
| 134 |
procedure TKuroutOption.SaveSetting; |
| 135 |
begin |
| 136 |
//鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃? |
| 137 |
Gikosys.Setting.RecvBufferSize := StrToIntDef(RecvBufferSize.Text, Gikosys.Setting.RecvBufferSize); |
| 138 |
GikoSys.Setting.ReadTimeOut := StrToIntDef(ReadTimeOut.Text, GikoSys.Setting.ReadTimeOut); |
| 139 |
//HTTP1.1鐃?鐃? |
| 140 |
GikoSys.Setting.Protocol := ProtocolCheckBox.Checked; |
| 141 |
//鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申HTTP1.1鐃?鐃? |
| 142 |
Gikosys.Setting.ProxyProtocol := ProxyProtocolCheckBox.Checked; |
| 143 |
//鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申 |
| 144 |
GikoSys.Setting.UseMachineTime := PostTimeCheckBox.Checked; |
| 145 |
if GikoSys.IsNumeric(PostTimeEdit.Text) then |
| 146 |
GikoSys.Setting.TimeAdjustSec := StrToIntDef(PostTimeEdit.Text, GikoSys.Setting.TimeAdjustSec) |
| 147 |
else |
| 148 |
GikoSys.Setting.TimeAdjustSec := 0; |
| 149 |
GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked; |
| 150 |
//2ch鐃緒申鐃緒申鐃?鐃?鐃?鐃? |
| 151 |
GikoSys.Setting.GengoSupport := GengoSupport.Checked; |
| 152 |
GikoSys.SetGikoMessage; |
| 153 |
//鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申 |
| 154 |
GikoSys.Setting.LocalTrapAtt := LocalTrapAtt.Checked; |
| 155 |
GikoSys.Setting.RemoteTrapAtt := RemoteTrapAtt.Checked; |
| 156 |
// Cookie |
| 157 |
GikoSys.Setting.FixedCookie := FixedCookieEdit.Text; |
| 158 |
|
| 159 |
// 鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申 |
| 160 |
GikoSys.Setting.MoveHistorySize := |
| 161 |
StrToIntDef( MoveHistoryMaxEdit.Text, 20 ); |
| 162 |
|
| 163 |
GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex; |
| 164 |
end; |
| 165 |
|
| 166 |
procedure TKuroutOption.RecvBufferSizeExit(Sender: TObject); |
| 167 |
begin |
| 168 |
if not GikoSys.IsNumeric(RecvBufferSize.Text) then |
| 169 |
RecvBufferSize.Text := '4096'; |
| 170 |
if StrToInt(RecvBufferSize.Text) < 256 then |
| 171 |
RecvBufferSize.Text := '4096'; |
| 172 |
end; |
| 173 |
|
| 174 |
procedure TKuroutOption.PostTimeEditExit(Sender: TObject); |
| 175 |
begin |
| 176 |
if not GikoSys.IsNumeric(PostTimeEdit.Text) then |
| 177 |
PostTimeEdit.Text := '0'; |
| 178 |
end; |
| 179 |
|
| 180 |
procedure TKuroutOption.PostTimeCheckBoxClick(Sender: TObject); |
| 181 |
begin |
| 182 |
PostTimeLabel.Enabled := PostTimeCheckBox.Checked; |
| 183 |
PostTimeEdit.Enabled := PostTimeCheckBox.Checked; |
| 184 |
PutPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked; |
| 185 |
BackPostTimeRadioButton.Enabled := PostTimeCheckBox.Checked; |
| 186 |
end; |
| 187 |
|
| 188 |
procedure TKuroutOption.OkBottonClick(Sender: TObject); |
| 189 |
begin |
| 190 |
RecvBufferSizeExit(Sender); |
| 191 |
PostTimeEditExit(Sender); |
| 192 |
PostColumnData(); |
| 193 |
SaveSetting; |
| 194 |
end; |
| 195 |
|
| 196 |
procedure TKuroutOption.FormCreate(Sender: TObject); |
| 197 |
begin |
| 198 |
SetValue; |
| 199 |
PostTimeCheckBoxClick(Sender); |
| 200 |
|
| 201 |
end; |
| 202 |
procedure TKuroutOption.SetColumnData(); |
| 203 |
var |
| 204 |
i, j : Integer; |
| 205 |
flag : Boolean; |
| 206 |
begin |
| 207 |
|
| 208 |
//===== 鐃緒申鐃緒申鐃?鐃? ===== |
| 209 |
for i := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin |
| 210 |
for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin |
| 211 |
if GikoSys.Setting.CategoryColumnOrder[ i ] = TGikoCategoryColumnID( j ) then begin |
| 212 |
CVisibledListBox.AddItem(GikoCategoryColumnCaption[ j ], nil); |
| 213 |
break; |
| 214 |
end; |
| 215 |
end; |
| 216 |
end; |
| 217 |
|
| 218 |
for i := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin |
| 219 |
flag := false; |
| 220 |
for j := 0 to GikoSys.Setting.CategoryColumnOrder.Count - 1 do begin |
| 221 |
if GikoSys.Setting.CategoryColumnOrder[ j ] = TGikoCategoryColumnID( i ) then begin |
| 222 |
flag := true; |
| 223 |
break; |
| 224 |
end; |
| 225 |
end; |
| 226 |
if not flag then |
| 227 |
CUnVisibledListBox.AddItem(GikoCategoryColumnCaption[ i ], nil); |
| 228 |
end; |
| 229 |
|
| 230 |
//===== 鐃?鐃緒申鐃緒申鐃?鐃? ===== |
| 231 |
for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin |
| 232 |
for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin |
| 233 |
if GikoSys.Setting.BoardColumnOrder[ i ] = TGikoBoardColumnID( j ) then begin |
| 234 |
BVisibledListBox.AddItem(GikoBoardColumnCaption[ j ], nil); |
| 235 |
Break; |
| 236 |
end; |
| 237 |
end; |
| 238 |
end; |
| 239 |
|
| 240 |
for i := 1 to Length( GikoBoardColumnCaption ) - 1 do begin |
| 241 |
flag := false; |
| 242 |
for j := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 0 do begin |
| 243 |
if GikoSys.Setting.BoardColumnOrder[ j ] = TGikoBoardColumnID( i ) then begin |
| 244 |
flag := true; |
| 245 |
Break; |
| 246 |
end; |
| 247 |
end; |
| 248 |
if not flag then |
| 249 |
BUnVisibledListBox.AddItem(GikoBoardColumnCaption[ i ], nil); |
| 250 |
|
| 251 |
end; |
| 252 |
end; |
| 253 |
procedure TKuroutOption.CDeleteButtonClick(Sender: TObject); |
| 254 |
var |
| 255 |
i: Integer; |
| 256 |
begin |
| 257 |
for i := 0 to CVisibledListBox.Count - 1 do begin |
| 258 |
if CVisibledListBox.Selected[i] then begin |
| 259 |
CUnVisibledListBox.AddItem( CVisibledListBox.Items.Strings[ i ], nil); |
| 260 |
CVisibledListBox.DeleteSelected; |
| 261 |
break; |
| 262 |
end; |
| 263 |
end; |
| 264 |
end; |
| 265 |
|
| 266 |
procedure TKuroutOption.CAddButtonClick(Sender: TObject); |
| 267 |
var |
| 268 |
i: Integer; |
| 269 |
begin |
| 270 |
for i := 0 to CUnVisibledListBox.Count - 1 do begin |
| 271 |
if CUnVisibledListBox.Selected[i] then begin |
| 272 |
CVisibledListBox.AddItem( CUnVisibledListBox.Items.Strings[ i ], nil); |
| 273 |
CUnVisibledListBox.DeleteSelected; |
| 274 |
break; |
| 275 |
end; |
| 276 |
end; |
| 277 |
end; |
| 278 |
|
| 279 |
procedure TKuroutOption.BAddButtonClick(Sender: TObject); |
| 280 |
var |
| 281 |
i: Integer; |
| 282 |
begin |
| 283 |
for i := 0 to BUnVisibledListBox.Count - 1 do begin |
| 284 |
if BUnVisibledListBox.Selected[i] then begin |
| 285 |
BVisibledListBox.AddItem( BUnVisibledListBox.Items.Strings[ i ], nil); |
| 286 |
BUnVisibledListBox.DeleteSelected; |
| 287 |
break; |
| 288 |
end; |
| 289 |
end; |
| 290 |
end; |
| 291 |
|
| 292 |
procedure TKuroutOption.BDeleteButtonClick(Sender: TObject); |
| 293 |
var |
| 294 |
i: Integer; |
| 295 |
begin |
| 296 |
for i := 0 to BVisibledListBox.Count - 1 do begin |
| 297 |
if BVisibledListBox.Selected[i] then begin |
| 298 |
BUnVisibledListBox.AddItem( BVisibledListBox.Items.Strings[ i ], nil); |
| 299 |
BVisibledListBox.DeleteSelected; |
| 300 |
break; |
| 301 |
end; |
| 302 |
end; |
| 303 |
end; |
| 304 |
|
| 305 |
procedure TKuroutOption.CUpButtonClick(Sender: TObject); |
| 306 |
var |
| 307 |
i: Integer; |
| 308 |
begin |
| 309 |
for i := 1 to CVisibledListBox.Count - 1 do begin |
| 310 |
if CVisibledListBox.Selected[i] then begin |
| 311 |
CVisibledListBox.Items.Exchange(i, i -1); |
| 312 |
break; |
| 313 |
end; |
| 314 |
end; |
| 315 |
end; |
| 316 |
|
| 317 |
procedure TKuroutOption.CDownButtonClick(Sender: TObject); |
| 318 |
var |
| 319 |
i: Integer; |
| 320 |
begin |
| 321 |
for i := 0 to CVisibledListBox.Count - 2 do begin |
| 322 |
if CVisibledListBox.Selected[i] then begin |
| 323 |
CVisibledListBox.Items.Exchange(i, i + 1); |
| 324 |
break; |
| 325 |
end; |
| 326 |
end; |
| 327 |
end; |
| 328 |
|
| 329 |
procedure TKuroutOption.BUpButtonClick(Sender: TObject); |
| 330 |
var |
| 331 |
i: Integer; |
| 332 |
begin |
| 333 |
for i := 1 to BVisibledListBox.Count - 1 do begin |
| 334 |
if BVisibledListBox.Selected[i] then begin |
| 335 |
BVisibledListBox.Items.Exchange(i, i -1); |
| 336 |
break; |
| 337 |
end; |
| 338 |
end; |
| 339 |
end; |
| 340 |
|
| 341 |
procedure TKuroutOption.BDownButtonClick(Sender: TObject); |
| 342 |
var |
| 343 |
i: Integer; |
| 344 |
begin |
| 345 |
for i := 0 to BVisibledListBox.Count - 2 do begin |
| 346 |
if BVisibledListBox.Selected[i] then begin |
| 347 |
BVisibledListBox.Items.Exchange(i, i + 1); |
| 348 |
break; |
| 349 |
end; |
| 350 |
end; |
| 351 |
end; |
| 352 |
|
| 353 |
|
| 354 |
procedure TKuroutOption.PostColumnData(); |
| 355 |
var |
| 356 |
i, j : Integer; |
| 357 |
begin |
| 358 |
GikoForm.ActiveListColumnSave; |
| 359 |
|
| 360 |
//===== 鐃緒申鐃緒申鐃?鐃? ===== |
| 361 |
for i := GikoSys.Setting.CategoryColumnOrder.Count -1 downto 1 do |
| 362 |
GikoSys.Setting.CategoryColumnOrder.Delete(i); |
| 363 |
|
| 364 |
for i := 0 to CVisibledListBox.Count - 1 do begin |
| 365 |
for j := 1 to Length( GikoCategoryColumnCaption ) - 1 do begin |
| 366 |
if CVisibledListBox.Items.Strings[ i ] = GikoCategoryColumnCaption[ j ] then begin |
| 367 |
GikoSys.Setting.CategoryColumnOrder.Add( TGikoCategoryColumnID(j) ); |
| 368 |
break; |
| 369 |
end; |
| 370 |
end; |
| 371 |
end; |
| 372 |
|
| 373 |
//===== 鐃?鐃緒申鐃緒申鐃?鐃? ===== |
| 374 |
for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do |
| 375 |
GikoSys.Setting.BoardColumnOrder.Delete(i); |
| 376 |
|
| 377 |
for i := 0 to BVisibledListBox.Count - 1 do begin |
| 378 |
for j := 1 to Length( GikoBoardColumnCaption ) - 1 do begin |
| 379 |
if BVisibledListBox.Items.Strings[ i ] = GikoBoardColumnCaption[ j ] then begin |
| 380 |
GikoSys.Setting.BoardColumnOrder.Add( TGikoBoardColumnID(j) ); |
| 381 |
Break; |
| 382 |
end; |
| 383 |
end; |
| 384 |
end; |
| 385 |
//鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃? |
| 386 |
GikoForm.SetActiveList(GikoForm.ActiveList); |
| 387 |
end; |
| 388 |
|
| 389 |
end. |