Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/KuroutSetting.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9 - (hide annotations) (download) (as text)
Mon May 29 14:54:52 2006 UTC (17 years, 10 months ago) by h677
Branch: MAIN
CVS Tags: v1_53_0_671, v1_52_1_658, v1_53_0_664, v1_53_0_661, v1_53_0_663, v1_53_0_662, v1_53_0_665, v1_53_0_667, v1_53_0_666, v1_53_0_669, v1_53_0_668, v1_52_0_654, v1_53_0_672, v1_53_0_670, root-of-Bb53, v1_52_1_657, v1_52_0_660, v1_52_0_655, v1_52_0_656, v1_53_1_673
Branch point for: Bb53, Bb52
Changes since 1.8: +16 -6 lines
File MIME type: text/x-pascal
Cookieの仕様変更を容易にしておいた

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

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26