Develop and Download Open Source Software

Browse CVS Repository

Annotation of /gikonavigoeson/gikonavi/Option.pas

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


Revision 1.88 - (hide annotations) (download) (as text)
Tue Jun 26 15:49:25 2007 UTC (16 years, 9 months ago) by h677
Branch: MAIN
CVS Tags: v1_56_0_715, v1_57_0_723, v1_57_0_720, v1_57_0_722, v1_57_0_719, v1_57_0_718, v1_56_0_716, v1_56_1_717, v1_56_1_716, v1_56_2_724, v1_56_2_722, v1_56_0_721
Branch point for: Bb56
Changes since 1.87: +1 -1 lines
File MIME type: text/x-pascal
直接Exeのファイルパスを参照している部分をGikoSystem経由に変更
パス取得関連の整理

1 hi_ 1.1 unit Option;
2    
3     interface
4    
5     uses
6     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7     ComCtrls, StdCtrls, ExtCtrls, Dialogs, FileCtrl, MMSystem,
8 yoffy 1.8 GikoSystem, GikoUtil, Buttons, UrlMon, Menus, ImgList, OleCtrls,
9 h677 1.59 {$IF Defined(DELPRO) }
10     SHDocVw,
11     MSHTML,
12     {$ELSE}
13     SHDocVw_TLB,
14     MSHTML_TLB,
15     {$IFEND}
16 h677 1.80 BoardGroup, BrowserRecord;
17 hi_ 1.1
18     type
19     TOptionDialog = class(TForm)
20     CancelBotton: TButton;
21 yoffy 1.22 ApplyButton: TButton;
22 hi_ 1.1 FontDialog: TFontDialog;
23     ColorDialog: TColorDialog;
24 yoffy 1.22 OpenDialog: TOpenDialog;
25 genyakun 1.71 Label26: TLabel;
26     CroutOption: TButton;
27     OptionTab: TPageControl;
28     ConnectSheet: TTabSheet;
29     ReadProxyGroupBox: TGroupBox;
30     ReadAddressLabel: TLabel;
31     ReadPortLabel: TLabel;
32     ReadUserIDLabel: TLabel;
33     ReadPasswordLabel: TLabel;
34     ReadProxyCheck: TCheckBox;
35     ReadProxyAddressEdit: TEdit;
36     ReadPortEdit: TEdit;
37     ReadProxyUserIDEdit: TEdit;
38     ReadProxyPasswordEdit: TEdit;
39     WriteProxyGroupBox: TGroupBox;
40     WriteAddressLabel: TLabel;
41     WritePortLabel: TLabel;
42     WriteUserIDLabel: TLabel;
43     WritePasswordLabel: TLabel;
44     WriteProxyCheck: TCheckBox;
45     WriteProxyAddressEdit: TEdit;
46     WritePortEdit: TEdit;
47 h677 1.79 WriteProxyUserIDEdit: TEdit;
48     WriteProxyPasswordEdit: TEdit;
49 genyakun 1.71 Font1Sheet: TTabSheet;
50     Bevel1: TBevel;
51     Bevel2: TBevel;
52     Label19: TLabel;
53 h677 1.79 Bevel5: TBevel;
54 genyakun 1.71 Label20: TLabel;
55     Label21: TLabel;
56     Label22: TLabel;
57     Label23: TLabel;
58     lblSFont: TLabel;
59     CabinetFontBotton: TButton;
60     CabinetColorBotton: TButton;
61     CabinetDefaultButton: TButton;
62     CabinetMemo: TMemo;
63     ListMemo: TMemo;
64     ListFontBotton: TButton;
65     ListColorBotton: TButton;
66     ListDefaultBotton: TButton;
67     HintFontButton: TButton;
68     HintBackButton: TButton;
69     HintDefaultButton: TButton;
70     HintMemo: TMemo;
71     EditorMemo: TMemo;
72     EditorFontBotton: TButton;
73     EditorColorBotton: TButton;
74     EditorDefaultBotton: TButton;
75     BrowserTabMemo: TMemo;
76     BruwserTabFontButton: TButton;
77     BrowserTabDefaultButton: TButton;
78     OddResNumCheckBox: TCheckBox;
79     OddResNumColorBox: TColorBox;
80     CSSTabSheet: TTabSheet;
81     GroupBox12: TGroupBox;
82     CSSListLabel: TLabel;
83     CSSCheckBox: TCheckBox;
84     CSSListView: TListView;
85     CSSBrowser: TWebBrowser;
86     CSSFontCheckBox: TCheckBox;
87     CSSBackColorCheckBox: TCheckBox;
88     CSSFontButton: TButton;
89     CSSBackColorButton: TButton;
90     TabSheet3: TTabSheet;
91     GroupBox9: TGroupBox;
92     ThreadListIconCheckBox: TCheckBox;
93     GroupBox16: TGroupBox;
94     CreationTimeLogsCheckBox: TCheckBox;
95     FutureThreadCheckBox: TCheckBox;
96     GroupBox5: TGroupBox;
97     BrowserMaxLabel: TLabel;
98     BrowserMaxCombo: TComboBox;
99     GroupBox17: TGroupBox;
100     SelectIntervalLabel: TLabel;
101     Label4: TLabel;
102     Label6: TLabel;
103     SelectIntervalEdit: TEdit;
104     GroupBox18: TGroupBox;
105     DatOchiSortCombo: TComboBox;
106     ThreadSheet: TTabSheet;
107     GroupBox1: TGroupBox;
108     ShowMailCheckBox: TCheckBox;
109     ResRangeHoldCheckBox: TCheckBox;
110     ResRangeHoldComboBox: TComboBox;
111     GroupBox2: TGroupBox;
112     AppFolderLabel: TLabel;
113     URLAppCheckBox: TCheckBox;
114     AppFolderEdit: TEdit;
115     AppFolderButton: TButton;
116     OpenMailerCheckBox: TCheckBox;
117     GroupBox6: TGroupBox;
118     LogDeleteMessageCheckBox: TCheckBox;
119     ResAnchorGroupBox: TGroupBox;
120     ResAnchorCheckBox: TCheckBox;
121     TabSheet1: TTabSheet;
122     TabAddRadioGroup: TRadioGroup;
123     GroupBox8: TGroupBox;
124     Label14: TLabel;
125     Label15: TLabel;
126     Label16: TLabel;
127     PreviewVisibleCheckBox: TCheckBox;
128     PreviewSizeComboBox: TComboBox;
129     PreviewWaitEdit: TEdit;
130     GroupBox10: TGroupBox;
131     UnActivePopupCheckBox: TCheckBox;
132     ResPopupBoldCheckBox: TCheckBox;
133     TabSheet2: TTabSheet;
134     GroupBox7: TGroupBox;
135     Label3: TLabel;
136     Label11: TLabel;
137     URLDisplayCheckBox: TCheckBox;
138     AddressHistoryCountEdit: TEdit;
139     TabStopAddressBarCheckBox: TCheckBox;
140     LinkAddCheckBox: TCheckBox;
141     GroupBox15: TGroupBox;
142     ShowDialogForEndCheckBox: TCheckBox;
143     AllTabCloseCheckBox: TCheckBox;
144     SambaGroupBox: TGroupBox;
145     UseSambaCheckBox: TCheckBox;
146     TabAutoSaveLoad: TGroupBox;
147     TabLoadSave: TCheckBox;
148     SoundSheet: TTabSheet;
149     SoundEventGroupBox: TGroupBox;
150     SoundListView: TListView;
151     SoundReferButton: TButton;
152     SoundFileEdit: TEdit;
153     SoundPlayButton: TBitBtn;
154     FolderSheet: TTabSheet;
155     FolderGroupBox: TGroupBox;
156     Label1: TLabel;
157     Label2: TLabel;
158     Label5: TLabel;
159     LogFolderEdit: TEdit;
160     LogFolderButton: TButton;
161     NGwordSheet: TTabSheet;
162     GroupBox14: TGroupBox;
163     RloCheckBox: TCheckBox;
164     ReplaceulCheckBox: TCheckBox;
165     PopUpAbonCheckBox: TCheckBox;
166     ShowNGLineCheckBox: TCheckBox;
167     AddResAnchorCheckBox: TCheckBox;
168     DeleteSyriaCheckBox: TCheckBox;
169     UserIDSheet: TTabSheet;
170     GroupBox3: TGroupBox;
171     Label9: TLabel;
172     Label10: TLabel;
173     ForcedLoginLabel: TLabel;
174     UserIDEdit: TEdit;
175     PasswordEdit: TEdit;
176     AutoLoginCheckBox: TCheckBox;
177     ForcedLoginCheckBox: TCheckBox;
178     GroupBox4: TGroupBox;
179     Label13: TLabel;
180     BoardURLComboBox: TComboBox;
181     AddURLButton: TButton;
182     RemoveURLButton: TButton;
183     OkBotton: TButton;
184     SpamFilterGroupBox: TGroupBox;
185     SpamFilterAlgorithmComboBox: TComboBox;
186     TabSheet4: TTabSheet;
187     GroupBox13: TGroupBox;
188     UseUndecidedCheckBox: TCheckBox;
189     Tora3URLLabel: TLabel;
190     Label12: TLabel;
191     GroupBox11: TGroupBox;
192     Label7: TLabel;
193     BeUserIDEdit: TEdit;
194     Label8: TLabel;
195 h677 1.73 BeCodeEdit: TEdit;
196 genyakun 1.71 BeAutoLoginCheckBox: TCheckBox;
197 h677 1.74 GroupBox19: TGroupBox;
198     Label17: TLabel;
199     MaxRecordCountEdit: TEdit;
200     Label18: TLabel;
201 h677 1.76 UnFocusedBoldCheckBox: TCheckBox;
202 h677 1.78 IgnoreKanaCheckBox: TCheckBox;
203 h677 1.79 UseKatjuTypeSkinCheckBox: TCheckBox;
204 h677 1.82 GroupBox20: TGroupBox;
205     AutoSortCheckBox: TCheckBox;
206     Label24: TLabel;
207 h677 1.84 GroupBox21: TGroupBox;
208     StoredTaskTrayCB: TCheckBox;
209 h677 1.85 GroupBox22: TGroupBox;
210     LoopBrowserTabsCB: TCheckBox;
211 h677 1.86 GroupBox23: TGroupBox;
212     IgnoreContextCheckBox: TCheckBox;
213 h677 1.87 GroupBox24: TGroupBox;
214     gppRightTopRB: TRadioButton;
215     gppTopRB: TRadioButton;
216     gppLeftTopRB: TRadioButton;
217     gppLeftRB: TRadioButton;
218     gppRightRB: TRadioButton;
219     gppLeftBottomRB: TRadioButton;
220     gppBottomRB: TRadioButton;
221     gppRighBottomRB: TRadioButton;
222 hi_ 1.1 procedure FormCreate(Sender: TObject);
223     procedure FormDestroy(Sender: TObject);
224     procedure ApplyButtonClick(Sender: TObject);
225     procedure CabinetFontBottonClick(Sender: TObject);
226     procedure CabinetColorBottonClick(Sender: TObject);
227     procedure EditorFontBottonClick(Sender: TObject);
228     procedure OkBottonClick(Sender: TObject);
229     procedure ReadProxyCheckClick(Sender: TObject);
230     procedure ListFontBottonClick(Sender: TObject);
231     procedure ListColorBottonClick(Sender: TObject);
232     procedure EditorColorBottonClick(Sender: TObject);
233     procedure CabinetDefaultButtonClick(Sender: TObject);
234     procedure ReadPortEditExit(Sender: TObject);
235     procedure ListDefaultBottonClick(Sender: TObject);
236     procedure EditorDefaultBottonClick(Sender: TObject);
237     procedure HintFontButtonClick(Sender: TObject);
238     procedure HintBackButtonClick(Sender: TObject);
239     procedure HintDefaultButtonClick(Sender: TObject);
240     procedure LogFolderButtonClick(Sender: TObject);
241     procedure FormClose(Sender: TObject; var Action: TCloseAction);
242     procedure SoundReferButtonClick(Sender: TObject);
243     procedure SoundPlayButtonClick(Sender: TObject);
244     procedure SoundListViewChanging(Sender: TObject; Item: TListItem;
245 yoffy 1.22 Change: TItemChange; var AllowChange: Boolean);
246 hi_ 1.1 procedure SoundFileEditChange(Sender: TObject);
247     procedure OptionTabChange(Sender: TObject);
248     procedure AppFolderButtonClick(Sender: TObject);
249     procedure WriteProxyCheckClick(Sender: TObject);
250     procedure WritePortEditExit(Sender: TObject);
251     procedure Tora3URLLabelClick(Sender: TObject);
252     procedure HotKeyEnter(Sender: TObject);
253     procedure HotKeyExit(Sender: TObject);
254     procedure URLAppCheckBoxClick(Sender: TObject);
255     procedure BruwserTabFontButtonClick(Sender: TObject);
256     procedure BrowserTabDefaultButtonClick(Sender: TObject);
257 yoffy 1.22 procedure AddressHistoryCountEditExit(Sender: TObject);
258     procedure PreviewWaitEditExit(Sender: TObject);
259 genyakun 1.57 procedure CSSCheckBoxClick(Sender: TObject); procedure CSSFontButtonClick(Sender: TObject);
260 yoffy 1.22 procedure CSSBackColorButtonClick(Sender: TObject);
261     procedure CSSFontCheckBoxClick(Sender: TObject);
262     procedure CSSBackColorCheckBoxClick(Sender: TObject);
263     procedure CSSListViewChange(Sender: TObject; Item: TListItem;
264     Change: TItemChange);
265     procedure AddURLButtonClick(Sender: TObject);
266     procedure RemoveURLButtonClick(Sender: TObject);
267 genyakun 1.71 procedure OddResNumCheckBoxClick(Sender: TObject);
268     procedure ResRangeHoldCheckBoxClick(Sender: TObject);
269     procedure CroutOptionClick(Sender: TObject);
270 h677 1.74 procedure MaxRecordCountEditExit(Sender: TObject);
271 hi_ 1.1 private
272     { Private 鐃緒申鐃緒申 }
273     FClose: Boolean;
274 q9_ 1.54 FRepaintList: Boolean;
275 h677 1.32 FRepaintThread: Boolean;
276 yoffy 1.22 FCSSFont: TFont;
277     FCSSBackColor: TColor;
278 h677 1.31 FCSSStrings: TStringList;
279 hi_ 1.1 function GetMemoText(font: TFont; text: string): string;
280     // function GetFontText(Font: TFont; Text: string): string;
281     procedure SetValue;
282 h677 1.60 procedure SaveSetting;
283 hi_ 1.1 procedure SettingApply;
284     function CheckFolder: Boolean;
285 yoffy 1.9 procedure SetAbonpropertys;
286     procedure CSSSetContent(Content: string);
287 yoffy 1.22 procedure CSSPreview;
288 h677 1.83 //! CSS鐃?鐃緒申鐃?鐃緒申鐃?鐃?HTMLBody鐃緒申鐃緒申
289     function CreatePreviewBody(Res: array of TResRec): string;
290     //! CSS/SKIN鐃?鐃緒申鐃?鐃緒申鐃?鐃?Style鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
291     function GetPreviewUserStyle(): string;
292 hi_ 1.1 public
293     { Public 鐃緒申鐃緒申 }
294     end;
295    
296     var
297     OptionDialog: TOptionDialog;
298    
299     implementation
300    
301     uses
302 h677 1.77 Giko, Editor, Setting, ActnList, KuroutSetting, Math, HTMLCreate;
303 hi_ 1.1
304     const
305     FONT_TEXT: string = '%s %d pt';
306     MEMO_CABINET: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?';
307     MEMO_THREAD: string = '鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?';
308     MEMO_BROWSERPOPUP: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?';
309     MEMO_BROWSERTAB: string = '鐃?鐃緒申鐃?鐃?鐃?鐃?';
310     MEMO_EDITOR: string = '鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?';
311     DEFAULT_FONT_NAME: string = '鐃?鐃? 鐃?鐃?鐃?鐃?鐃?';
312     DEFAULT_FONT_SIZE: Integer = 9;
313     DEFAULT_TABFONT_NAME: string = '鐃?鐃? 鐃?鐃?鐃?鐃?鐃?';
314     DEFAULT_TABFONT_SIZE: Integer = 9;
315     URL_TORA3: WideString = 'http://2ch.tora3.net/';
316 h677 1.83 DEFAULT_CSS_FILENAME = 'default.css';
317 hi_ 1.1
318     {$R *.DFM}
319    
320     procedure TOptionDialog.FormCreate(Sender: TObject);
321     begin
322 yoffy 1.14
323     CSSBrowser.Navigate('about:blank');
324 hi_ 1.1 FClose := True;
325    
326     OptionTab.ActivePage := ConnectSheet;
327     SetValue;
328    
329     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
330     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
331     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
332     BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
333     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
334    
335     Tora3URLLabel.Cursor := 5;
336     lblSFont.Caption := '鐃緒申鐃?鐃?鐃緒申'#13#10#13#10
337     + '鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?'#13#10
338 yoffy 1.9 + '鐃?CSS 鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申';
339 h677 1.23
340 genyakun 1.71 ForcedLoginLabel.Caption := '- 鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?' + #13#10
341     + '鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?';
342     CSSCheckBoxClick(Sender);
343 yoffy 1.35 BrowserMaxLabel.Caption :=
344     '鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?'#13#10 +
345     '鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?';
346 yoffy 1.9
347 yoffy 1.22 if OptionTab.PageCount > GikoSys.Setting.OptionDialogTabIndex then begin
348     OptionTab.ActivePageIndex := GikoSys.Setting.OptionDialogTabIndex;
349 yoffy 1.16 OptionTabChange( nil );
350 yoffy 1.22 end;
351    
352 hi_ 1.1 end;
353    
354     procedure TOptionDialog.FormDestroy(Sender: TObject);
355     begin
356 h677 1.31 CSSListView.OnChange := nil;
357     if FCSSStrings <> nil then
358     FCSSStrings.Free;
359     if FCSSFont <> nil then
360     FCSSFont.Free;
361 hi_ 1.1 sndPlaySound(nil, SND_ASYNC);
362 h677 1.31
363 hi_ 1.1 end;
364    
365     procedure TOptionDialog.OkBottonClick(Sender: TObject);
366     begin
367     FClose := True;
368     ReadPortEditExit(Sender);
369     WritePortEditExit(Sender);
370     AddressHistoryCountEditExit(Sender);
371 h677 1.74 MaxRecordCountEditExit(Sender);
372 hi_ 1.1 PreviewWaitEditExit(Sender);
373    
374     if not CheckFolder then begin
375     FClose := False;
376     Exit;
377     end;
378 h677 1.82 SetAbonpropertys;
379 hi_ 1.1 SaveSetting;
380     SettingApply;
381 h677 1.24
382 hi_ 1.1 end;
383    
384     procedure TOptionDialog.ApplyButtonClick(Sender: TObject);
385     begin
386     ReadPortEditExit(Sender);
387     WritePortEditExit(Sender);
388     AddressHistoryCountEditExit(Sender);
389 h677 1.74 MaxRecordCountEditExit(Sender);
390 hi_ 1.1 PreviewWaitEditExit(Sender);
391    
392     if not CheckFolder then begin
393     FClose := False;
394     Exit;
395     end;
396 genyakun 1.71 SetAbonpropertys;
397 hi_ 1.1 SaveSetting;
398     SettingApply;
399     FClose := False;
400     end;
401    
402     //function TOptionDialog.GetFontText(Font: TFont; Text: string): string;
403     //begin
404     // result := Format(Text, [Font.Name, Font.Size]);
405     //end;
406    
407     function TOptionDialog.GetMemoText(font: TFont; text: string): string;
408     var
409     s: string;
410     begin
411     s := '';
412     if font <> nil then
413     s := Format(FONT_TEXT, [Font.Name, Font.Size]) + #13#10;
414     Result := s + text;
415     end;
416    
417     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
418     procedure TOptionDialog.CabinetFontBottonClick(Sender: TObject);
419     begin
420     FontDialog.Options := [fdAnsiOnly, fdEffects];
421     FontDialog.Font.Assign(CabinetMemo.Font);
422     if FontDialog.Execute then begin
423     FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
424     CabinetMemo.Font.Assign(FontDialog.Font);
425     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
426     CabinetMemo.Font.Charset := SHIFTJIS_CHARSET;
427     end;
428     end;
429    
430     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
431     procedure TOptionDialog.CabinetColorBottonClick(Sender: TObject);
432     begin
433     ColorDialog.Color := CabinetMemo.Color;
434     if ColorDialog.Execute then begin
435     CabinetMemo.Color := ColorDialog.Color;
436     end;
437     end;
438    
439     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
440     procedure TOptionDialog.CabinetDefaultButtonClick(Sender: TObject);
441     begin
442     CabinetMemo.Font.Name := DEFAULT_FONT_NAME;
443     CabinetMemo.Font.Size := DEFAULT_FONT_SIZE;
444     CabinetMemo.Font.Color := clWindowText;
445     CabinetMemo.Font.Style := [];
446     CabinetMemo.Color := clWindow;
447     CabinetMemo.Text := GetMemoText(CabinetMemo.Font, MEMO_CABINET);
448     end;
449    
450     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
451     procedure TOptionDialog.ListFontBottonClick(Sender: TObject);
452     begin
453     FontDialog.Options := [fdAnsiOnly, fdEffects];
454     FontDialog.Font.Assign(ListMemo.Font);
455     if FontDialog.Execute then begin
456     ListMemo.Font.Assign(FontDialog.Font);
457     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
458     ListMemo.Font.Charset := SHIFTJIS_CHARSET;
459     end;
460     end;
461    
462     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
463     procedure TOptionDialog.ListColorBottonClick(Sender: TObject);
464     begin
465     ColorDialog.Color := ListMemo.Color;
466     if ColorDialog.Execute then begin
467     ListMemo.Color := ColorDialog.Color;
468     end;
469     end;
470    
471     //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
472     procedure TOptionDialog.ListDefaultBottonClick(Sender: TObject);
473     begin
474     ListMemo.Font.Name := DEFAULT_FONT_NAME;
475     ListMemo.Font.Size := DEFAULT_FONT_SIZE;
476     ListMemo.Font.Color := clWindowText;
477     ListMemo.Font.Style := [];
478     ListMemo.Color := clWindow;
479     ListMemo.Text := GetMemoText(ListMemo.Font, MEMO_THREAD);
480     end;
481    
482     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
483     procedure TOptionDialog.HintFontButtonClick(Sender: TObject);
484     begin
485     FontDialog.Options := [fdAnsiOnly, fdEffects];
486     FontDialog.Font.Assign(HintMemo.Font);
487     if FontDialog.Execute then begin
488     HintMemo.Font.Assign(FontDialog.Font);
489     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
490     HintMemo.Font.Charset := SHIFTJIS_CHARSET;
491     end;
492     end;
493    
494     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
495     procedure TOptionDialog.HintBackButtonClick(Sender: TObject);
496     begin
497     ColorDialog.Color := HintMemo.Color;
498     if ColorDialog.Execute then begin
499     HintMemo.Color := ColorDialog.Color;
500     end;
501     end;
502    
503     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
504     procedure TOptionDialog.HintDefaultButtonClick(Sender: TObject);
505     begin
506     HintMemo.Font.Name := DEFAULT_FONT_NAME;
507     HintMemo.Font.Size := DEFAULT_FONT_SIZE;
508     HintMemo.Font.Color := clWindowText;
509     HintMemo.Font.Style := [];
510     HintMemo.Color := clInfoBk;
511     HintMemo.Text := GetMemoText(HintMemo.Font, MEMO_BROWSERPOPUP);
512     end;
513    
514     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
515     procedure TOptionDialog.BruwserTabFontButtonClick(Sender: TObject);
516     begin
517     FontDialog.Options := [fdAnsiOnly];
518     FontDialog.Font.Assign(BrowserTabMemo.Font);
519     if FontDialog.Execute then begin
520     BrowserTabMemo.Font.Assign(FontDialog.Font);
521     BrowserTabMemo.Text := GetMemoText(FontDialog.Font, MEMO_BROWSERTAB);
522     BrowserTabMemo.Font.Charset := SHIFTJIS_CHARSET;
523     end;
524     end;
525    
526     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
527     procedure TOptionDialog.BrowserTabDefaultButtonClick(Sender: TObject);
528     begin
529     BrowserTabMemo.Font.Name := DEFAULT_TABFONT_NAME;
530     BrowserTabMemo.Font.Size := DEFAULT_TABFONT_SIZE;
531     BrowserTabMemo.Font.Color := clWindowText;
532     BrowserTabMemo.Font.Style := [];
533     BrowserTabMemo.Color := clBtnFace;
534     BrowserTabMemo.Text := GetMemoText(BrowserTabMemo.Font, MEMO_BROWSERTAB);
535     end;
536    
537     //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
538     procedure TOptionDialog.EditorFontBottonClick(Sender: TObject);
539     begin
540     FontDialog.Options := [fdAnsiOnly, fdEffects];
541     FontDialog.Font.Assign(EditorMemo.Font);
542     if FontDialog.Execute then begin
543     EditorMemo.Font.Assign(FontDialog.Font);
544     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
545     EditorMemo.Font.Charset := SHIFTJIS_CHARSET;
546     end;
547     end;
548    
549     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
550     procedure TOptionDialog.EditorColorBottonClick(Sender: TObject);
551     begin
552     ColorDialog.Color := EditorMemo.Font.Color;
553     if ColorDialog.Execute then begin
554     EditorMemo.Color := ColorDialog.Color;
555     end;
556     end;
557    
558     //鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申
559     procedure TOptionDialog.EditorDefaultBottonClick(Sender: TObject);
560     begin
561     EditorMemo.Font.Name := DEFAULT_FONT_NAME;
562     EditorMemo.Font.Size := DEFAULT_FONT_SIZE;
563     EditorMemo.Font.Color := clWindowText;
564     EditorMemo.Font.Style := [];
565     EditorMemo.Color := clWindow;
566     EditorMemo.Text := GetMemoText(EditorMemo.Font, MEMO_EDITOR);
567     end;
568    
569     procedure TOptionDialog.SetValue;
570     var
571     i: Integer;
572     Item: TListItem;
573 h677 1.5 // s: string;
574 yoffy 1.2 idx: Integer;
575 hi_ 1.1 FileList: TStringList;
576     begin
577    
578     //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
579     ReadProxyCheck.Checked := GikoSys.Setting.ReadProxy;
580     ReadProxyCheckClick(nil);
581     ReadProxyAddressEdit.Text := GikoSys.Setting.ReadProxyAddress;
582     ReadPortEdit.Text := IntToStr(GikoSys.Setting.ReadProxyPort);
583     ReadProxyUserIDEdit.Text := GikoSys.Setting.ReadProxyUserID;
584     ReadProxyPasswordEdit.Text := GikoSys.Setting.ReadProxyPassword;
585     //鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
586     WriteProxyCheck.Checked := GikoSys.Setting.WriteProxy;
587     WriteProxyCheckClick(nil);
588     WriteProxyAddressEdit.Text := GikoSys.Setting.WriteProxyAddress;
589     WritePortEdit.Text := IntToStr(GikoSys.Setting.WriteProxyPort);
590     WriteProxyUserIDEdit.Text := GikoSys.Setting.WriteProxyUserID;
591     WriteProxyPasswordEdit.Text := GikoSys.Setting.WriteProxyPassword;
592     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
593     CabinetMemo.Font.Name := GikoSys.Setting.CabinetFontName;
594     CabinetMemo.Font.Size := GikoSys.Setting.CabinetFontSize;
595     CabinetMemo.Font.Color := GikoSys.Setting.CabinetFontColor;
596 h677 1.66 CabinetMemo.Font.Style := [];
597     if GikoSys.Setting.CabinetFontBold then
598     CabinetMemo.Font.Style := [fsBold];
599     if GikoSys.Setting.CabinetFontItalic then
600     CabinetMemo.Font.Style := CabinetMemo.Font.Style + [fsItalic];
601 hi_ 1.1 CabinetMemo.Color := GikoSys.Setting.CabinetBackColor;
602 h677 1.66
603 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
604     ListMemo.Font.Name := GikoSys.Setting.ListFontName;
605     ListMemo.Font.Size := GikoSys.Setting.ListFontSize;
606     ListMemo.Font.Color := GikoSys.Setting.ListFontColor;
607 h677 1.66 ListMemo.Font.Style := [];
608     if GikoSys.Setting.ListFontBold then
609     ListMemo.Font.Style := ListMemo.Font.Style + [fsBold];
610     if GikoSys.Setting.ListFontItalic then
611     ListMemo.Font.Style := ListMemo.Font.Style + [fsItalic];
612    
613 hi_ 1.1 ListMemo.Color := GikoSys.Setting.ListBackColor;
614 h677 1.32 //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?
615     OddResNumCheckBox.Checked := GikoSys.Setting.UseOddColorOddResNum;
616     OddResNumColorBox.Selected := GikoSys.Setting.OddColor;
617     OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
618 h677 1.76 UnFocusedBoldCheckBox.Checked := GikoSys.Setting.UnFocusedBold;
619     UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
620 h677 1.32
621 hi_ 1.1 //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
622     HintMemo.Font.Name := GikoSys.Setting.HintFontName;
623     HintMemo.Font.Size := GikoSys.Setting.HintFontSize;
624     HintMemo.Font.Color := GikoSys.Setting.HintFontColor;
625     HintMemo.Color := GikoSys.Setting.HintBackColor;
626     //鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
627     BrowserTabMemo.Font.Name := GikoSys.Setting.BrowserTabFontName;
628     BrowserTabMemo.Font.Size := GikoSys.Setting.BrowserTabFontSize;
629     BrowserTabMemo.Font.Style := [];
630     if GikoSys.Setting.BrowserTabFontBold then
631     BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsBold];
632     if GikoSys.Setting.BrowserTabFontItalic then
633     BrowserTabMemo.Font.Style := BrowserTabMemo.Font.Style + [fsItalic];
634     //鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
635     EditorMemo.Font.Name := GikoSys.Setting.EditorFontName;
636     EditorMemo.Font.Size := GikoSys.Setting.EditorFontSize;
637     EditorMemo.Font.Color := GikoSys.Setting.EditorFontColor;
638     EditorMemo.Color := GikoSys.Setting.EditorBackColor;
639     //CSS鐃?鐃緒申
640     CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
641 h677 1.79 //鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?
642     UseKatjuTypeSkinCheckBox.Checked := GikoSys.Setting.UseKatjushaType;
643 h677 1.31 if FCSSFont <> nil then
644     FCSSFont.Free;
645 yoffy 1.22 FCSSFont := TFont.Create;
646     if (GikoSys.Setting.BrowserFontName <> '') or
647     (GikoSys.Setting.BrowserFontSize <> 0) or
648     (GikoSys.Setting.BrowserFontBold <> 0) or
649     (GikoSys.Setting.BrowserFontItalic <> 0) or
650     (GikoSys.Setting.BrowserFontColor <> -1 ) then begin
651     CSSFontCheckBox.Checked := True;
652 h677 1.32 FCSSFont.Name := GikoSys.Setting.BrowserFontName;
653 yoffy 1.22 FCSSFont.Size := GikoSys.Setting.BrowserFontSize;
654     FCSSFont.Style := [];
655     if GikoSys.Setting.BrowserFontBold = 1 then
656     FCSSFont.Style := FCSSFont.Style + [fsBold];
657     if GikoSys.Setting.BrowserFontItalic = 1 then
658     FCSSFont.Style := FCSSFont.Style + [fsItalic];
659     i := GikoSys.Setting.BrowserFontColor;
660     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
661     FCSSFont.Color := i;
662     end;
663     if GikoSys.Setting.BrowserBackColor <> -1 then begin
664     CSSBackColorCheckBox.Checked := True;
665    
666     i := GikoSys.Setting.BrowserBackColor;
667     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
668     FCSSBackColor := i;
669     end;
670 hi_ 1.1 //
671     //鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
672     FileList := TStringList.Create;
673     try
674 h677 1.72 FileList.BeginUpdate;
675 yoffy 1.2 GikoSys.GetFileList(GikoSys.GetStyleSheetDir, '*.css', FileList, True, True);
676 h677 1.72 FileList.EndUpdate;
677 yoffy 1.2 Idx := Length(GikoSys.GetStyleSheetDir);
678     for i := 0 to FileList.Count - 1 do
679     FileList[i] := Copy(FileList[i], Idx + 1, Length(FileList[i]));
680 hi_ 1.1 FileList.Sort;
681     for i := 0 to FileList.Count - 1 do begin
682 yoffy 1.2 //s := ExtractFileName(FileList[i]);
683 h677 1.83 if LowerCase(FileList[i]) = DEFAULT_CSS_FILENAME then
684 hi_ 1.1 Item := CSSListView.Items.Insert(0)
685     else
686     Item := CSSListView.Items.Add;
687 yoffy 1.2 Item.Caption := ChangeFileExt(FileList[i], '');
688     if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
689 hi_ 1.1 Item.Selected := True;
690     end;
691     finally
692     FileList.Free;
693     end;
694 yoffy 1.6 //鐃?鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
695 h677 1.31 //FileList := TStringList.Create;
696     if FCSSStrings <> nil then
697     FCSSStrings.Clear;
698     FCSSStrings := TStringList.Create;
699 yoffy 1.6 try
700 h677 1.31 GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FCSSStrings, False);
701 yoffy 1.6
702 yoffy 1.22 Idx := Length(GikoSys.GetSkinDir);
703 h677 1.31 FCSSStrings.Sort;
704     for i := 0 to FCSSStrings.Count - 1 do begin
705 yoffy 1.6 Item := CSSListView.Items.Add;
706 h677 1.31 Item.Data := PChar( FCSSStrings[i] );
707     Item.Caption := Copy( FCSSStrings[i], Idx + 1, Length(FCSSStrings[i]) );
708     if LowerCase(FCSSStrings[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
709     Item.Selected := True;
710 yoffy 1.6 end;
711     finally
712     end;
713    
714 hi_ 1.1 if (CSSListView.ItemIndex = -1) and (CSSListView.Items.Count > 0) then
715 h677 1.31 CSSListView.Items[0].Selected := True;
716 hi_ 1.1
717 q9_ 1.53 //Mail鐃緒申鐃?鐃緒申
718     ShowMailCheckBox.Checked := GikoSys.Setting.ShowMail;
719    
720 yoffy 1.49 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
721     ResRangeHoldCheckBox.Checked := GikoSys.Setting.ResRangeHold;
722     case GikoSys.Setting.ResRange of
723     Ord( grrAll ): ResRangeHoldComboBox.ItemIndex := 0;
724     Ord( grrKoko ): ResRangeHoldComboBox.ItemIndex := 2;
725     Ord( grrNew ): ResRangeHoldComboBox.ItemIndex := 3;
726     100: ResRangeHoldComboBox.ItemIndex := 1;
727     end;
728     ResRangeHoldComboBox.Enabled := GikoSys.Setting.ResRangeHold;
729 hi_ 1.1 //鐃?鐃?鐃緒申鐃緒申鐃緒申鐃?
730     TabAddRadioGroup.ItemIndex := Ord(GikoSys.Setting.BrowserTabAppend);
731     //鐃緒申鐃?鐃?URL
732 h677 1.19 //BoardURL2chEdit.Text := GikoSys.Setting.BoardURL2ch;
733 yoffy 1.22 BoardURLComboBox.Clear;
734     BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
735     try
736     BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
737     except
738     BoardURLComboBox.ItemIndex := 0;
739     end;
740 hi_ 1.1 //鐃?鐃緒申
741     UserIDEdit.Text := GikoSys.Setting.UserID;
742     PasswordEdit.Text := GikoSys.Setting.Password;
743     AutoLoginCheckBox.Checked := GikoSys.Setting.AutoLogin;
744 h677 1.32 ForcedLoginCheckBox.Checked := GikoSys.Setting.ForcedLogin;
745 hi_ 1.1 //鐃緒申鐃?鐃?鐃?鐃緒申鐃?
746     if GikoSys.Setting.NewLogFolder = '' then
747     LogFolderEdit.Text := GikoSys.Setting.LogFolder
748     else
749     LogFolderEdit.Text := GikoSys.Setting.NewLogFolder;
750     //鐃?鐃?鐃緒申鐃?
751     for i := 0 to GikoSys.Setting.GetSoundCount - 1 do begin
752     Item := SoundListView.Items.Add;
753     Item.Caption := GikoSys.Setting.SoundViewName[i];
754     if FileExists(GikoSys.Setting.SoundFileName[i]) then
755     Item.SubItems.Add(GikoSys.Setting.SoundFileName[i])
756     else
757     Item.SubItems.Add('');
758     end;
759     //URL鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
760     URLAppCheckBox.Checked := GikoSys.Setting.URLApp;
761     URLAppCheckBoxClick(nil);
762     AppFolderEdit.Text := GikoSys.Setting.URLAppFile;
763    
764     //mailto鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
765     OpenMailerCheckBox.Checked := GikoSys.Setting.OpenMailer;
766    
767     //鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?
768     LogDeleteMessageCheckBox.Checked := GikoSys.Setting.DeleteMsg;
769 h677 1.32
770 yoffy 1.22 //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
771     ShowDialogForEndCheckBox.Checked := GikoSys.Setting.ShowDialogForEnd;
772 h677 1.34 //AllTabClose
773     AllTabCloseCheckBox.Checked := GikoSys.Setting.ShowDialogForAllTabClose;
774 h677 1.32 //Samba
775     UseSambaCheckBox.Checked := GikoSys.Setting.UseSamba;
776 h677 1.34 ResAnchorCheckBox.Checked := GikoSys.Setting.ResAnchorJamp;
777 yoffy 1.35 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
778     BrowserMaxCombo.ItemIndex := Ord( GikoSys.Setting.BrowserAutoMaximize );
779 hi_ 1.1 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
780     case GikoSys.Setting.PopupPosition of
781 h677 1.87 gppRightTop: gppRightTopRB.Checked := True;
782     gppRight: gppRightRB.Checked := True;
783     gppRightBottom: gppRighBottomRB.Checked := True;
784     gppTop: gppTopRB.Checked := True;
785     gppCenter: gppTopRB.Checked := True; // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
786     gppBottom: gppBottomRB.Checked := True;
787     gppLeftTop: gppLeftTopRB.Checked := True;
788     gppLeft: gppLeftRB.Checked := True;
789     gppLeftBottom: gppLeftBottomRB.Checked := True;
790 hi_ 1.1 end;
791    
792     //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
793     UnActivePopupCheckBox.Checked := GikoSys.Setting.UnActivePopup;
794 yoffy 1.2 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
795     ResPopupBoldCheckBox.Checked := GikoSys.Setting.ResPopupHeaderBold;
796 hi_ 1.1
797     //鐃?鐃?鐃緒申鐃?鐃?鐃?
798     URLDisplayCheckBox.Checked := GikoSys.Setting.URLDisplay;
799     TabStopAddressBarCheckBox.Checked := GikoSys.Setting.AddressBarTabStop;
800     LinkAddCheckBox.Checked := GikoSys.Setting.LinkAddAddressBar;
801     AddressHistoryCountEdit.Text := IntToStr(GikoSys.Setting.AddressHistoryCount);
802    
803     //HTML鐃?鐃緒申鐃?鐃緒申鐃?
804     PreviewVisibleCheckBox.Checked := GikoSys.Setting.PreviewVisible;
805     PreviewWaitEdit.Text := IntToStr(GikoSys.Setting.PreviewWait);
806     PreviewSizeComboBox.ItemIndex := 2;
807     case GikoSys.Setting.PreviewSize of
808     gpsXLarge: PreviewSizeComboBox.ItemIndex := 4;
809     gpsLarge: PreviewSizeComboBox.ItemIndex := 3;
810     gpsMedium: PreviewSizeComboBox.ItemIndex := 2;
811     gpsSmall: PreviewSizeComboBox.ItemIndex := 1;
812     gpsXSmall: PreviewSizeComboBox.ItemIndex := 0;
813     end;
814    
815     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
816     ThreadListIconCheckBox.Checked := GikoSys.Setting.ListIconVisible;
817 h677 1.32 CreationTimeLogsCheckBox.Checked := GikoSys.Setting.CreationTimeLogs;
818     FutureThreadCheckBox.Checked := GikoSys.Setting.FutureThread;
819 h677 1.41 SelectIntervalEdit.Text := IntToStr(GikoSys.Setting.SelectInterval);
820 q9_ 1.51
821     //dat鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
822 yoffy 1.61 case TGikoBoardColumnID( GikoSys.Setting.DatOchiSortIndex ) of
823     gbcTitle:
824 q9_ 1.51 if GikoSys.Setting.DatOchiSortOrder then
825     DatOchiSortCombo.ItemIndex := 1
826     else
827     DatOchiSortCombo.ItemIndex := 2;
828 h677 1.62 gbcRoundDate://gbcLastModified:
829 q9_ 1.51 if GikoSys.Setting.DatOchiSortOrder then
830     DatOchiSortCombo.ItemIndex := 3
831     else
832     DatOchiSortCombo.ItemIndex := 4;
833 yoffy 1.61 gbcCreated:
834 q9_ 1.52 if GikoSys.Setting.DatOchiSortOrder then
835     DatOchiSortCombo.ItemIndex := 5
836     else
837     DatOchiSortCombo.ItemIndex := 6;
838 h677 1.63 gbcLastModified:
839     if GikoSys.Setting.DatOchiSortOrder then
840     DatOchiSortCombo.ItemIndex := 7
841     else
842     DatOchiSortCombo.ItemIndex := 8;
843 q9_ 1.51 else
844     DatOchiSortCombo.ItemIndex := 0;
845     end;
846 h677 1.82 AutoSortCheckBox.Checked := GikoSys.Setting.AutoSortThreadList;
847    
848 h677 1.78 //鐃緒申鐃緒申鐃?鐃緒申
849     RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
850     ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
851     PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
852     ShowNGLineCheckBox.Checked := GikoSys.Setting.ShowNGLinesNum;
853     AddResAnchorCheckBox.Checked := GikoSys.Setting.AddResAnchor;
854 yoffy 1.38 DeleteSyriaCheckBox.Checked := GikoSys.Setting.DeleteSyria;
855 h677 1.78 IgnoreKanaCheckBox.Checked := GikoSys.Setting.IgnoreKana;
856 yoffy 1.70 {$IFDEF SPAM_FILTER_ENABLED}
857     // 鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申
858     SpamFilterGroupBox.Visible := True;
859     {$ENDIF}
860 yoffy 1.67 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
861 yoffy 1.68 {$IFDEF DEBUG}
862     SpamFilterAlgorithmComboBox.Clear;
863     SpamFilterAlgorithmComboBox.AddItem( '鐃?鐃?鐃緒申鐃緒申鐃緒申', nil );
864     SpamFilterAlgorithmComboBox.AddItem( 'Paul Graham 鐃?', nil );
865     SpamFilterAlgorithmComboBox.AddItem( 'Gary Robinson 鐃?', nil );
866     SpamFilterAlgorithmComboBox.AddItem( 'Gary Robinson-Fisher 鐃?', nil );
867     {$ENDIF}
868 yoffy 1.67 SpamFilterAlgorithmComboBox.ItemIndex :=
869     Ord( GikoSys.Setting.SpamFilterAlgorithm );
870 yoffy 1.38
871 h677 1.69 //TabAutoLoad
872     TabLoadSave.Checked := Gikosys.Setting.TabAutoLoadSave;
873     UseUndecidedCheckBox.Checked := GikoSys.Setting.UseUndecided;
874 genyakun 1.71
875     //Be2ch鐃?鐃緒申
876     BeUserIDEdit.Text := GikoSys.Setting.BeUserID;
877 h677 1.73 BeCodeEdit.Text := GikoSys.Setting.BeCode;
878 genyakun 1.71 BeAutoLoginCheckBox.Checked := GikoSys.Setting.BeAutoLogin;
879 h677 1.74 //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
880     MaxRecordCountEdit.Text := IntToStr(GikoSys.Setting.MaxRecordCount);
881 h677 1.84 // 鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
882     StoredTaskTrayCB.Checked := GikoSys.Setting.StoredTaskTray;
883 h677 1.85 // 鐃?鐃緒申鐃?鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
884     LoopBrowserTabsCB.Checked := GikoSys.Setting.LoopBrowserTabs;
885 h677 1.86 //
886     IgnoreContextCheckBox.Checked := GikoSys.Setting.GestureIgnoreContext;
887 hi_ 1.1 end;
888    
889     procedure TOptionDialog.SaveSetting;
890     var
891     i: Integer;
892 h677 1.32 tmp: string;
893 hi_ 1.1 // Item: TListItem;
894     begin
895 yoffy 1.22 GikoSys.Setting.OptionDialogTabIndex := OptionTab.TabIndex;
896 yoffy 1.16
897 hi_ 1.1 GikoSys.Setting.ReadProxy := ReadProxyCheck.Checked;
898     GikoSys.Setting.ReadProxyAddress := ReadProxyAddressEdit.Text;
899     GikoSys.Setting.ReadProxyPort := StrToInt(ReadPortEdit.Text);
900     GikoSys.Setting.ReadProxyUserID := ReadProxyUserIDEdit.Text;
901     GikoSys.Setting.ReadProxyPassword := ReadProxyPasswordEdit.Text;
902    
903     GikoSys.Setting.WriteProxy := WriteProxyCheck.Checked;
904     GikoSys.Setting.WriteProxyAddress := WriteProxyAddressEdit.Text;
905     GikoSys.Setting.WriteProxyPort := StrToInt(WritePortEdit.Text);
906     GikoSys.Setting.WriteProxyUserID := WriteProxyUserIDEdit.Text;
907     GikoSys.Setting.WriteProxyPassword := WriteProxyPasswordEdit.Text;
908    
909     GikoSys.Setting.CabinetFontName := CabinetMemo.Font.Name;
910     GikoSys.Setting.CabinetFontSize := CabinetMemo.Font.Size;
911     GikoSys.Setting.CabinetFontColor := CabinetMemo.Font.Color;
912 h677 1.66 GikoSys.Setting.CabinetFontBold := fsBold in CabinetMemo.Font.Style;
913     GikoSys.Setting.CabinetFontItalic:= fsItalic in CabinetMemo.Font.Style;
914 hi_ 1.1 GikoSys.Setting.CabinetBackColor := CabinetMemo.Color;
915    
916 h677 1.66 GikoSys.Setting.ListFontName := ListMemo.Font.Name;
917     GikoSys.Setting.ListFontSize := ListMemo.Font.Size;
918     GikoSys.Setting.ListFontColor := ListMemo.Font.Color;
919     GikoSys.Setting.ListFontBold := fsBold in ListMemo.Font.Style;
920     GikoSys.Setting.ListFontItalic := fsItalic in ListMemo.Font.Style;
921 hi_ 1.1 GikoSys.Setting.ListBackColor := ListMemo.Color;
922 h677 1.32 GikoSys.Setting.UseOddColorOddResNum := OddResNumCheckBox.Checked;
923     GikoSys.Setting.OddColor := OddResNumColorBox.Selected;
924 h677 1.76 GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
925     (UnFocusedBoldCheckBox.Checked);
926 hi_ 1.1
927     GikoSys.Setting.HintFontName := HintMemo.Font.Name;
928     GikoSys.Setting.HintFontSize := HintMemo.Font.Size;
929     GikoSys.Setting.HintFontColor := HintMemo.Font.Color;
930     GikoSys.Setting.HintBackColor := HintMemo.Color;
931    
932     GikoSys.Setting.BrowserTabFontName := BrowserTabMemo.Font.Name;
933     GikoSys.Setting.BrowserTabFontSize := BrowserTabMemo.Font.Size;
934 h677 1.66 GikoSys.Setting.BrowserTabFontBold := fsBold in BrowserTabMemo.Font.Style;
935     GikoSys.Setting.BrowserTabFontItalic := fsItalic in BrowserTabMemo.Font.Style;
936 hi_ 1.1 GikoSys.Setting.EditorFontName := EditorMemo.Font.Name;
937     GikoSys.Setting.EditorFontSize := EditorMemo.Font.Size;
938     GikoSys.Setting.EditorFontColor := EditorMemo.Font.Color;
939     GikoSys.Setting.EditorBackColor := EditorMemo.Color;
940 h677 1.32 {FRepaintThread : 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申
941     鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?true鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申
942     鐃?鐃緒申鐃?鐃?鐃緒申Repaint鐃緒申true鐃緒申鐃緒申鐃緒申
943     }
944 hi_ 1.1 //CSS鐃?鐃緒申
945 h677 1.32 if GikoSys.Setting.UseCSS <> CSSCheckBox.Checked then FRepaintThread := true;
946 hi_ 1.1 GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
947 h677 1.79 GikoSys.Setting.UseKatjushaType := UseKatjuTypeSkinCheckBox.Checked;
948 hi_ 1.1 //CSS鐃?鐃?鐃?鐃緒申鐃緒申
949 h677 1.32 tmp := GikoSys.Setting.CSSFileName;
950 h677 1.83 GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
951 hi_ 1.1 if CSSListView.Items.Count > 0 then begin
952     try
953 yoffy 1.22 if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
954 yoffy 1.6 GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
955 yoffy 1.22 else
956 yoffy 1.6 GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
957 hi_ 1.1 except
958     end;
959     end;
960 h677 1.32 if tmp <> GikoSys.Setting.CSSFileName then FRepaintThread := true;
961 yoffy 1.22 // CSS 鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申
962     if CSSFontCheckBox.Checked then begin
963 h677 1.32 if GikoSys.Setting.BrowserFontName <> FCSSFont.Name then FRepaintThread := true;
964 yoffy 1.22 GikoSys.Setting.BrowserFontName := FCSSFont.Name;
965 h677 1.32 if GikoSys.Setting.BrowserFontSize <> FCSSFont.Size then FRepaintThread := true;
966 yoffy 1.22 GikoSys.Setting.BrowserFontSize := FCSSFont.Size;
967 h677 1.32 if fsBold in FCSSFont.Style then begin
968     if GikoSys.Setting.BrowserFontBold <> 1 then FRepaintThread := true;
969     GikoSys.Setting.BrowserFontBold := 1;
970     end else begin
971     if GikoSys.Setting.BrowserFontBold <> -1 then FRepaintThread := true;
972 yoffy 1.22 GikoSys.Setting.BrowserFontBold := -1;
973 h677 1.32 end;
974     if fsItalic in FCSSFont.Style then begin
975     if GikoSys.Setting.BrowserFontItalic <> 1 then FRepaintThread := true;
976     GikoSys.Setting.BrowserFontItalic := 1;
977     end else begin
978     if GikoSys.Setting.BrowserFontItalic <> -1 then FRepaintThread := true;
979 yoffy 1.22 GikoSys.Setting.BrowserFontItalic := -1;
980 h677 1.32 end;
981 yoffy 1.22 i := ColorToRGB( FCSSFont.Color );
982 h677 1.32 if (GikoSys.Setting.BrowserFontColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
983     FRepaintThread := true;
984 yoffy 1.22 GikoSys.Setting.BrowserFontColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
985     end else begin
986 h677 1.32 if GikoSys.Setting.BrowserFontName <> '' then FRepaintThread := true;
987 yoffy 1.22 GikoSys.Setting.BrowserFontName := '';
988 h677 1.32 if GikoSys.Setting.BrowserFontSize <> 0 then FRepaintThread := true;
989 yoffy 1.22 GikoSys.Setting.BrowserFontSize := 0;
990 h677 1.32 if GikoSys.Setting.BrowserFontBold <> 0 then FRepaintThread := true;
991 yoffy 1.22 GikoSys.Setting.BrowserFontBold := 0;
992 h677 1.32 if GikoSys.Setting.BrowserFontItalic <> 0 then FRepaintThread := true;
993 yoffy 1.22 GikoSys.Setting.BrowserFontItalic := 0;
994 h677 1.32 if GikoSys.Setting.BrowserFontColor <> -1 then FRepaintThread := true;
995 yoffy 1.22 GikoSys.Setting.BrowserFontColor := -1;
996     end;
997     if CSSBackColorCheckBox.Checked then begin
998     i := ColorToRGB( FCSSBackColor );
999 h677 1.32 if(GikoSys.Setting.BrowserBackColor <> (i shr 16) or (i and $ff00) or ((i and $ff) shl 16)) then
1000     FRepaintThread := true;
1001 yoffy 1.22 GikoSys.Setting.BrowserBackColor := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1002     end else begin
1003 h677 1.32 if GikoSys.Setting.BrowserBackColor <> -1 then FRepaintThread := true;
1004 yoffy 1.22 GikoSys.Setting.BrowserBackColor := -1;
1005     end;
1006 hi_ 1.1
1007     //Mail鐃緒申鐃?鐃緒申
1008 h677 1.32 if GikoSys.Setting.ShowMail <> ShowMailCheckBox.Checked then FRepaintThread := true;
1009 hi_ 1.1 GikoSys.Setting.ShowMail := ShowMailCheckBox.Checked;
1010 yoffy 1.49 // 鐃?鐃緒申鐃緒申鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1011     GikoSys.Setting.ResRangeHold := ResRangeHoldCheckBox.Checked;
1012     case ResRangeHoldComboBox.ItemIndex of
1013 genyakun 1.71 0: GikoSys.Setting.ResRange := Ord( grrAll );
1014     1: GikoSys.Setting.ResRange := 100;
1015     2: GikoSys.Setting.ResRange := Ord( grrKoko );
1016     3: GikoSys.Setting.ResRange := Ord( grrNew );
1017 yoffy 1.49 end;
1018 hi_ 1.1
1019     GikoSys.Setting.BrowserTabAppend := TGikoTabAppend(TabAddRadioGroup.ItemIndex);
1020    
1021 h677 1.19 // GikoSys.Setting.BoardURL2ch := BoardURL2chEdit.Text;
1022 yoffy 1.22 GikoSys.Setting.BoardURLs.Clear;
1023     GikoSys.Setting.BoardURLs.AddStrings(BoardURLComboBox.Items);
1024     GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
1025 hi_ 1.1 GikoSys.Setting.UserID := UserIDEdit.Text;
1026     GikoSys.Setting.Password := PasswordEdit.Text;
1027     GikoSys.Setting.AutoLogin := AutoLoginCheckBox.Checked;
1028 h677 1.32 GikoSys.Setting.ForcedLogin := ForcedLoginCheckBox.Checked;
1029 hi_ 1.1 GikoSys.Setting.URLApp := URLAppCheckBox.Checked;
1030     GikoSys.Setting.URLAppFile := AppFolderEdit.Text;
1031    
1032     GikoSys.Setting.OpenMailer := OpenMailerCheckBox.Checked;
1033     GikoSys.Setting.DeleteMsg := LogDeleteMessageCheckBox.Checked;
1034 yoffy 1.22 //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1035     GikoSys.Setting.ShowDialogForEnd := ShowDialogForEndCheckBox.Checked;
1036 h677 1.34 //AllTabClose
1037     GikoSys.Setting.ShowDialogForAllTabClose := AllTabCloseCheckBox.Checked;
1038 genyakun 1.71 //Samba
1039 h677 1.34 GikoSys.Setting.UseSamba := UseSambaCheckBox.Checked;
1040     GikoSys.Setting.ResAnchorJamp := ResAnchorCheckBox.Checked;
1041 yoffy 1.35 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃緒申
1042     GikoSys.Setting.BrowserAutoMaximize := TGikoBrowserAutoMaximize( BrowserMaxCombo.ItemIndex );
1043 hi_ 1.1 //鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?
1044 h677 1.87 if (gppRightTopRB.Checked) then GikoSys.Setting.PopupPosition := gppRightTop;
1045     if (gppRightRB.Checked) then GikoSys.Setting.PopupPosition := gppRight;
1046     if (gppRighBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppRightBottom;
1047     if (gppTopRB.Checked) then GikoSys.Setting.PopupPosition := gppTop;
1048     if (gppBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppBottom;
1049     if (gppLeftTopRB.Checked) then GikoSys.Setting.PopupPosition := gppLeftTop;
1050     if (gppLeftRB.Checked) then GikoSys.Setting.PopupPosition := gppLeft;
1051     if (gppLeftBottomRB.Checked) then GikoSys.Setting.PopupPosition := gppLeftBottom;
1052 hi_ 1.1 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申
1053     GikoSys.Setting.UnActivePopup := UnActivePopupCheckBox.Checked;
1054 yoffy 1.2 //鐃緒申鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申
1055     GikoSys.Setting.ResPopupHeaderBold := ResPopupBoldCheckBox.Checked;
1056 hi_ 1.1
1057     //鐃?鐃?鐃緒申鐃?鐃?鐃?
1058     GikoSys.Setting.URLDisplay := URLDisplayCheckBox.Checked;
1059     GikoSys.Setting.AddressBarTabStop := TabStopAddressBarCheckBox.Checked;
1060     GikoSys.Setting.LinkAddAddressBar := LinkAddCheckBox.Checked;
1061     if GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1062     GikoSys.Setting.AddressHistoryCount := StrToInt(AddressHistoryCountEdit.Text)
1063     else
1064     GikoSys.Setting.AddressHistoryCount := 100;
1065    
1066     //HTML鐃?鐃緒申鐃?鐃緒申鐃?
1067     GikoSys.Setting.PreviewVisible := PreviewVisibleCheckBox.Checked;
1068     if GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1069     GikoSys.Setting.PreviewWait := StrToInt(PreviewWaitEdit.Text)
1070     else
1071     GikoSys.Setting.PreviewWait := 500;
1072     case PreviewSizeComboBox.ItemIndex of
1073     0: GikoSys.Setting.PreviewSize := gpsXSmall;
1074     1: GikoSys.Setting.PreviewSize := gpsSmall;
1075     2: GikoSys.Setting.PreviewSize := gpsMedium;
1076     3: GikoSys.Setting.PreviewSize := gpsLarge;
1077     4: GikoSys.Setting.PreviewSize := gpsXLarge;
1078     end;
1079    
1080     //鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃?鐃?鐃緒申
1081     GikoSys.Setting.ListIconVisible := ThreadListIconCheckBox.Checked;
1082 q9_ 1.54
1083     GikoSys.Setting.CreationTimeLogs := CreationTimeLogsCheckBox.Checked;
1084 h677 1.41 GikoSys.Setting.FutureThread := FutureThreadCheckBox.Checked;
1085     if StrToIntDef(SelectIntervalEdit.Text, 110) > 55 then
1086     GikoSys.Setting.SelectInterval := StrToIntDef(SelectIntervalEdit.Text, 110)
1087     else
1088     GikoSys.Setting.SelectInterval := 55;
1089 q9_ 1.51
1090     //dat鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申
1091     case DatOchiSortCombo.ItemIndex of
1092     0: GikoSys.Setting.DatOchiSortIndex := -1; //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1093 q9_ 1.52 1: begin //鐃?鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1094     GikoSys.Setting.DatOchiSortOrder := true;
1095 yoffy 1.61 GikoSys.Setting.DatOchiSortIndex := Ord( gbcTitle );
1096 q9_ 1.52 end;
1097     2: begin //鐃?鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1098     GikoSys.Setting.DatOchiSortOrder := false;
1099 yoffy 1.61 GikoSys.Setting.DatOchiSortIndex := Ord( gbcTitle );
1100 q9_ 1.52 end;
1101     3: begin //鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1102 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := true;
1103 h677 1.62 GikoSys.Setting.DatOchiSortIndex := Ord( gbcRoundDate );{gbcLastModified}
1104 q9_ 1.51 end;
1105 q9_ 1.52 4: begin //鐃緒申鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1106 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := false;
1107 h677 1.62 GikoSys.Setting.DatOchiSortIndex := Ord( gbcRoundDate );{gbcLastModified}
1108 q9_ 1.51 end;
1109 q9_ 1.52 5: begin //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃緒申鐃緒申)
1110 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := true;
1111 yoffy 1.61 GikoSys.Setting.DatOchiSortIndex := Ord( gbcCreated );
1112 q9_ 1.51 end;
1113 q9_ 1.52 6: begin //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申(鐃?鐃緒申)
1114 q9_ 1.51 GikoSys.Setting.DatOchiSortOrder := false;
1115 yoffy 1.61 GikoSys.Setting.DatOchiSortIndex := Ord( gbcCreated );
1116 q9_ 1.51 end;
1117 h677 1.63 7: begin //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃?
1118     GikoSys.Setting.DatOchiSortOrder := true;
1119     GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
1120     end;
1121     8: begin //鐃?鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?
1122     GikoSys.Setting.DatOchiSortOrder := false;
1123     GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
1124     end;
1125 q9_ 1.51 end;
1126 h677 1.82 GikoSys.Setting.AutoSortThreadList := AutoSortCheckBox.Checked;
1127 q9_ 1.51
1128 hi_ 1.1 GikoSys.Setting.WriteSystemSettingFile;
1129 yoffy 1.22 GikoSys.Setting.WriteBoardURLSettingFile;
1130 hi_ 1.1 // GikoForm.SetBrowserTabState;
1131    
1132     if LogFolderEdit.Text <> '' then begin
1133     GikoSys.Setting.NewLogFolder := LogFolderEdit.Text;
1134     GikoSys.Setting.WriteFolderSettingFile;
1135     end;
1136    
1137     for i := 0 to SoundListView.Items.Count - 1 do begin
1138     if FileExists(SoundListView.Items[i].SubItems[0]) then
1139     GikoSys.Setting.SoundFileName[i] := SoundListView.Items[i].SubItems[0]
1140     else
1141     GikoSys.Setting.SoundFileName[i] := '';
1142     end;
1143 h677 1.3
1144 h677 1.17 //鐃緒申鐃緒申鐃?鐃緒申
1145     GikoSys.Setting.AbonDeleterlo := RloCheckBox.Checked;
1146     GikoSys.Setting.AbonReplaceul := ReplaceulCheckBox.Checked;
1147     GikoSys.Setting.PopUpAbon := PopUpAbonCheckBox.Checked;
1148     GikoSys.Setting.ShowNGLinesNum := ShowNGLineCheckBox.Checked;
1149 yoffy 1.22 GikoSys.Setting.AddResAnchor := AddResAnchorCheckBox.Checked;
1150 h677 1.78 GikoSys.Setting.DeleteSyria := DeleteSyriaCheckBox.Checked;
1151     GikoSys.Setting.IgnoreKana := IgnoreKanaCheckBox.Checked;
1152     GikoSys.FAbon.IgnoreKana := GikoSys.Setting.IgnoreKana;
1153 yoffy 1.67 // 鐃?鐃?鐃緒申鐃緒申鐃?鐃?鐃緒申鐃?鐃?鐃緒申鐃?
1154     if GikoSys.Setting.SpamFilterAlgorithm <> TGikoSpamFilterAlgorithm(
1155     SpamFilterAlgorithmComboBox.ItemIndex ) then begin
1156     GikoSys.Setting.SpamFilterAlgorithm := TGikoSpamFilterAlgorithm(
1157     SpamFilterAlgorithmComboBox.ItemIndex );
1158     FRepaintThread := True;
1159     end;
1160 genyakun 1.46
1161 h677 1.69 //Tab鐃緒申鐃緒申鐃緒申鐃緒申
1162     GikoSys.Setting.TabAutoLoadSave := TabLoadSave.Checked;
1163     GikoSys.Setting.UseUndecided := UseUndecidedCheckBox.Checked;
1164 genyakun 1.71 //Be2ch
1165     GikoSys.Setting.BeUserID := BeUserIDEdit.Text;
1166 h677 1.73 GikoSys.Setting.BeCode := BeCodeEdit.Text;
1167 h677 1.74 GikoSys.Setting.BeAutoLogin := BeAutoLoginCheckBox.Checked;
1168     //鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申
1169     GikoSys.Setting.MaxRecordCount := Max(StrToInt64Def(MaxRecordCountEdit.Text,100),1);
1170 h677 1.84 GikoSys.Setting.StoredTaskTray := StoredTaskTrayCB.Checked;
1171 h677 1.85 GikoSys.Setting.LoopBrowserTabs := LoopBrowserTabsCB.Checked;
1172    
1173 h677 1.86 GikoSys.Setting.GestureIgnoreContext := IgnoreContextCheckBox.Checked;
1174 hi_ 1.1 end;
1175    
1176     procedure TOptionDialog.SettingApply;
1177     var
1178     i: Integer;
1179     begin
1180     GikoForm.TreeView.Items.BeginUpdate;
1181 yoffy 1.22 GikoForm.FavoriteTreeView.Items.BeginUpdate;
1182 hi_ 1.1 GikoForm.ListView.Items.BeginUpdate;
1183     try
1184     GikoForm.TreeView.Font.Name := GikoSys.Setting.CabinetFontName;
1185     GikoForm.TreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
1186     GikoForm.TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
1187     GikoForm.TreeView.Color := GikoSys.Setting.CabinetBackColor;
1188    
1189 h677 1.66 GikoForm.FavoriteTreeView.Font.Assign(GikoForm.TreeView.Font);
1190 yoffy 1.16 GikoForm.FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
1191    
1192 hi_ 1.1 GikoForm.ListView.Font.Name := GikoSys.Setting.ListFontName;
1193     GikoForm.ListView.Font.Size := GikoSys.Setting.ListFontSize;
1194     GikoForm.ListView.Font.Color := GikoSys.Setting.ListFontColor;
1195 h677 1.66 GikoForm.ListView.Font.Style := [];
1196     if GikoSys.Setting.ListFontBold then
1197     GikoForm.ListView.Font.Style := [fsbold];
1198     if GikoSys.Setting.ListFontItalic then
1199     GikoForm.ListView.Font.Style := GikoForm.ListView.Font.Style + [fsitalic];
1200    
1201 h677 1.23 //GikoForm.ListView.Color := GikoSys.Setting.ListBackColor;
1202 h677 1.66 GikoForm.ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
1203 h677 1.76 GikoForm.UseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
1204     GikoForm.OddColor := GikoSys.Setting.OddColor;
1205     GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
1206     (UnFocusedBoldCheckBox.Checked);
1207 hi_ 1.1
1208     GikoForm.BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
1209     GikoForm.BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
1210 h677 1.66 GikoForm.BrowserTab.Font.Style := [];
1211     if GikoSys.Setting.BrowserTabFontBold then
1212     GikoForm.BrowserTab.Font.Style := [fsBold];
1213     if GikoSys.Setting.BrowserTabFontItalic then
1214     GikoForm.BrowserTab.Font.Style := GikoForm.BrowserTab.Font.Style + [fsItalic];
1215 hi_ 1.1 // GikoForm.BrowserTab.Height := (GikoSys.Setting.BrowserTabFontSize * 2) + 1;
1216     // GikoForm.BrowserBottomPanel.Height := GikoForm.BrowserTab.Height;
1217    
1218     for i := 0 to Screen.CustomFormCount - 1 do begin
1219     if TObject(Screen.CustomForms[i]) is TEditorForm then begin
1220     TEditorForm(Screen.CustomForms[i]).SetFont;
1221     end;
1222     end;
1223    
1224     finally
1225     GikoForm.TreeView.Items.EndUpdate;
1226 yoffy 1.22 GikoForm.FavoriteTreeView.Items.EndUpdate;
1227 hi_ 1.1 GikoForm.ListView.Items.EndUpdate;
1228     end;
1229    
1230     //鐃?鐃?鐃緒申鐃?鐃?鐃?
1231     for i := GikoForm.AddressComboBox.Items.Count - 1 downto 0 do begin
1232     if GikoSys.Setting.AddressHistoryCount >= GikoForm.AddressComboBox.Items.Count then
1233     Break;
1234     GikoForm.AddressComboBox.Items.Delete(i);
1235     end;
1236     GikoForm.AddressComboBox.TabStop := GikoSys.Setting.AddressBarTabStop;
1237 yoffy 1.15
1238 q9_ 1.54 //鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申
1239     if FRepaintList then begin
1240     // SetActiveList鐃緒申鐃緒申鐃?
1241     GikoForm.ActiveList := GikoForm.ActiveList;
1242     end;
1243    
1244 yoffy 1.22 // 鐃?鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃?鐃緒申
1245 h677 1.32 if FRepaintThread then begin
1246     for i := GikoForm.BrowserTab.Tabs.Count - 1 downto 0 do begin
1247     TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[i]).Repaint := true;
1248     end;
1249     GikoForm.BrowserTab.OnChange(nil);
1250     end;
1251 hi_ 1.1 end;
1252    
1253     procedure TOptionDialog.ReadProxyCheckClick(Sender: TObject);
1254     begin
1255     ReadProxyAddressEdit.Enabled := ReadProxyCheck.Checked;
1256     ReadPortEdit.Enabled := ReadProxyCheck.Checked;
1257     ReadProxyUserIDEdit.Enabled := ReadProxyCheck.Checked;
1258     ReadProxyPasswordEdit.Enabled := ReadProxyCheck.Checked;
1259    
1260     ReadAddressLabel.Enabled := ReadProxyCheck.Checked;
1261     ReadPortLabel.Enabled := ReadProxyCheck.Checked;
1262     ReadUserIDLabel.Enabled := ReadProxyCheck.Checked;
1263     ReadPasswordLabel.Enabled := ReadProxyCheck.Checked;
1264     end;
1265    
1266     procedure TOptionDialog.ReadPortEditExit(Sender: TObject);
1267     begin
1268     if not GikoSys.IsNumeric(ReadPortEdit.Text) then
1269     ReadPortEdit.Text := '0';
1270     end;
1271    
1272     procedure TOptionDialog.LogFolderButtonClick(Sender: TObject);
1273     var
1274     Root: WideString;
1275     Dir: string;
1276     begin
1277     Root := '';
1278     if SelectDirectory('鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃?鐃緒申', Root, Dir) then begin
1279     LogFolderEdit.Text := Dir;
1280     end;
1281     end;
1282    
1283     function TOptionDialog.CheckFolder: Boolean;
1284     begin
1285     if Trim(LogFolderEdit.Text) = '' then
1286 h677 1.88 LogFolderEdit.Text := GikoSys.GetAppDir + 'Log';
1287 hi_ 1.1
1288     if DirectoryExists(LogFolderEdit.Text) then begin
1289     Result := True;
1290     end else begin
1291     if MsgBox(Handle, '鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?', '鐃?鐃?鐃?鐃?', MB_YESNO or MB_ICONQUESTION) = IDYES then begin
1292     //鐃?鐃?鐃緒申鐃?鐃緒申鐃緒申鐃緒申
1293     try
1294     GikoSys.ForceDirectoriesEx(LogFolderEdit.Text);
1295     Result := True
1296     except
1297     MsgBox(Handle, '鐃緒申鐃?鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃緒申鐃?鐃緒申鐃緒申鐃緒申鐃?', '鐃?鐃緒申鐃?', MB_OK or MB_ICONSTOP);
1298     OptionTab.ActivePage := FolderSheet;
1299     LogFolderEdit.SetFocus;
1300     Result := False;
1301     end;
1302     end else
1303     Result := False;
1304     end;
1305     end;
1306    
1307     procedure TOptionDialog.FormClose(Sender: TObject; var Action: TCloseAction);
1308     begin
1309     if not FClose then
1310     Action := caNone;
1311     FClose := True;
1312     end;
1313    
1314     procedure TOptionDialog.SoundReferButtonClick(Sender: TObject);
1315     begin
1316     OpenDialog.Filter := '鐃?鐃?鐃緒申鐃? (*.wav)|*.wav|鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申 (*.*)|*.*';
1317     sndPlaySound(nil, SND_ASYNC);
1318     if OpenDialog.Execute then begin
1319     SoundFileEdit.Text := OpenDialog.FileName;
1320     end;
1321     end;
1322    
1323     procedure TOptionDialog.SoundPlayButtonClick(Sender: TObject);
1324     begin
1325     if not FileExists(SoundFileEdit.Text) then begin
1326     MsgBox(Handle, '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申', '鐃?鐃緒申鐃?', MB_ICONSTOP or MB_OK);
1327     SoundFileEdit.Text := '';
1328     Exit;
1329     end;
1330     if not sndPlaySound(PChar(SoundFileEdit.Text), SND_ASYNC or SND_NOSTOP) then begin
1331     sndPlaySound(nil, SND_ASYNC);
1332     end;
1333     end;
1334    
1335     procedure TOptionDialog.SoundListViewChanging(Sender: TObject;
1336 yoffy 1.22 Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
1337 hi_ 1.1 begin
1338     if Item.SubItems.Count > 0 then
1339     SoundFileEdit.Text := Item.SubItems[0];
1340     end;
1341    
1342     procedure TOptionDialog.SoundFileEditChange(Sender: TObject);
1343     var
1344     Item: TListItem;
1345     begin
1346     sndPlaySound(nil, SND_ASYNC);
1347     Item := SoundListView.Selected;
1348     if Item = nil then Exit;
1349    
1350     if FileExists(SoundFileEdit.Text) then
1351     Item.SubItems[0] := SoundFileEdit.Text;
1352     if Trim(SoundFileEdit.Text) = '' then
1353     Item.SubItems[0] := '';
1354     end;
1355    
1356     procedure TOptionDialog.OptionTabChange(Sender: TObject);
1357     begin
1358     sndPlaySound(nil, SND_ASYNC);
1359 yoffy 1.11
1360 yoffy 1.22 if OptionTab.ActivePage = CSSTabSheet then
1361     CSSPreview;
1362 hi_ 1.1 end;
1363    
1364     procedure TOptionDialog.AppFolderButtonClick(Sender: TObject);
1365     begin
1366     OpenDialog.Filter := '鐃緒申鐃?鐃?鐃?鐃?鐃緒申 (*.exe)|*.exe|鐃緒申鐃緒申鐃緒申鐃緒申鐃?鐃?鐃?鐃緒申 (*.*)|*.*';
1367     if OpenDialog.Execute then
1368     AppFolderEdit.Text := OpenDialog.FileName;
1369     end;
1370    
1371     procedure TOptionDialog.WriteProxyCheckClick(Sender: TObject);
1372     begin
1373     WriteProxyAddressEdit.Enabled := WriteProxyCheck.Checked;
1374     WritePortEdit.Enabled := WriteProxyCheck.Checked;
1375     WriteProxyUserIDEdit.Enabled := WriteProxyCheck.Checked;
1376     WriteProxyPasswordEdit.Enabled := WriteProxyCheck.Checked;
1377    
1378     WriteAddressLabel.Enabled := WriteProxyCheck.Checked;
1379     WritePortLabel.Enabled := WriteProxyCheck.Checked;
1380     WriteUserIDLabel.Enabled := WriteProxyCheck.Checked;
1381     WritePasswordLabel.Enabled := WriteProxyCheck.Checked;
1382     end;
1383    
1384     procedure TOptionDialog.WritePortEditExit(Sender: TObject);
1385     begin
1386     if not GikoSys.IsNumeric(WritePortEdit.Text) then
1387     WritePortEdit.Text := '0';
1388     end;
1389    
1390     procedure TOptionDialog.Tora3URLLabelClick(Sender: TObject);
1391     begin
1392     GikoSys.OpenBrowser(URL_TORA3, gbtAuto);
1393     end;
1394    
1395     procedure TOptionDialog.HotKeyEnter(Sender: TObject);
1396     begin
1397     OkBotton.Default := False;
1398     CancelBotton.Cancel := False;
1399     end;
1400    
1401     procedure TOptionDialog.HotKeyExit(Sender: TObject);
1402     begin
1403     OkBotton.Default := True;
1404     CancelBotton.Cancel := True;
1405     end;
1406    
1407     procedure TOptionDialog.URLAppCheckBoxClick(Sender: TObject);
1408     begin
1409     AppFolderLabel.Enabled := URLAppCheckBox.Checked;
1410     AppFolderEdit.Enabled := URLAppCheckBox.Checked;
1411     AppFolderButton.Enabled := URLAppCheckBox.Checked;
1412     end;
1413    
1414     procedure TOptionDialog.AddressHistoryCountEditExit(Sender: TObject);
1415     begin
1416     if not GikoSys.IsNumeric(AddressHistoryCountEdit.Text) then
1417     AddressHistoryCountEdit.Text := '100';
1418     end;
1419    
1420     procedure TOptionDialog.PreviewWaitEditExit(Sender: TObject);
1421     begin
1422     if not GikoSys.IsNumeric(PreviewWaitEdit.Text) then
1423     PreviewWaitEdit.Text := '500';
1424     if StrToInt(PreviewWaitEdit.Text) < 500 then
1425     PreviewWaitEdit.Text := '500';
1426     if StrToInt(PreviewWaitEdit.Text) > 9999 then
1427     PreviewWaitEdit.Text := '9999';
1428     end;
1429    
1430     procedure TOptionDialog.CSSCheckBoxClick(Sender: TObject);
1431     begin
1432     CSSListLabel.Enabled := CSSCheckBox.Checked;
1433     CSSListView.Enabled := CSSCheckBox.Checked;
1434     end;
1435    
1436 h677 1.3 procedure TOptionDialog.SetAbonpropertys;
1437     begin
1438 genyakun 1.71 //鐃緒申鐃緒申鐃?鐃緒申
1439     GikoSys.FAbon.Deleterlo := RloCheckBox.Checked;
1440     GikoSys.FAbon.Replaceul := ReplaceulCheckBox.Checked;
1441     GikoSys.FAbon.AbonPopupRes := PopUpAbonCheckBox.Checked;
1442 h677 1.17 GikoSys.FAbon.ReturnNGwordLineNum := ShowNGLineCheckBox.Checked;
1443 yoffy 1.22 GikoSys.FAbon.SetNGResAnchor := AddResAnchorCheckBox.Checked;
1444 h677 1.78 GikoSys.FAbon.DeleteSyria := DeleteSyriaCheckBox.Checked;
1445 h677 1.3 end;
1446 yoffy 1.8 procedure TOptionDialog.CSSFontButtonClick(Sender: TObject);
1447     begin
1448    
1449     FontDialog.Options := [fdAnsiOnly, fdEffects];
1450 yoffy 1.9 FontDialog.Font.Assign(FCSSFont);
1451 yoffy 1.8 if FontDialog.Execute then begin
1452     FontDialog.Font.Style := FontDialog.Font.Style - [fsUnderline] - [fsStrikeout];
1453 h677 1.31 FCSSFont.Assign(FontDialog.Font);
1454     //FCSSFont := FontDialog.Font;
1455 yoffy 1.8 end;
1456    
1457 yoffy 1.22 CSSPreview;
1458 yoffy 1.11
1459 yoffy 1.8 end;
1460    
1461     procedure TOptionDialog.CSSBackColorButtonClick(Sender: TObject);
1462     begin
1463    
1464 yoffy 1.9 ColorDialog.Color := FCSSBackColor;
1465 yoffy 1.8 if ColorDialog.Execute then begin
1466 yoffy 1.22 FCSSBackColor := ColorDialog.Color;
1467 yoffy 1.8 end;
1468    
1469 yoffy 1.22 CSSPreview;
1470 yoffy 1.11
1471 yoffy 1.8 end;
1472    
1473     procedure TOptionDialog.CSSFontCheckBoxClick(Sender: TObject);
1474     begin
1475    
1476     CSSFontButton.Enabled := CSSFontCheckBox.Checked;
1477 yoffy 1.22 CSSPreview;
1478 yoffy 1.8
1479     end;
1480    
1481     procedure TOptionDialog.CSSBackColorCheckBoxClick(Sender: TObject);
1482     begin
1483    
1484     CSSBackColorButton.Enabled := CSSBackColorCheckBox.Checked;
1485 yoffy 1.22 CSSPreview;
1486 yoffy 1.9
1487     end;
1488    
1489     procedure TOptionDialog.CSSSetContent(Content: string);
1490     var
1491     doc : Variant;
1492     begin
1493 h677 1.13 if CSSBrowser.Document <> nil then begin
1494     doc := CSSBrowser.Document;
1495     doc.open;
1496 yoffy 1.22 doc.Clear;
1497 h677 1.13 doc.charset := 'Shift_JIS';
1498     doc.Write(Content);
1499     doc.Close;
1500 yoffy 1.22 end;
1501 yoffy 1.9 end;
1502    
1503     procedure TOptionDialog.CSSPreview;
1504     var
1505 yoffy 1.15 Board: TBoard;
1506 yoffy 1.9 ThreadItem: TThreadItem;
1507     html: string;
1508 yoffy 1.22 Res: array [0..1] of TResRec;
1509     fileName: string;
1510 yoffy 1.11 begin
1511    
1512     fileName := GikoSys.Setting.CSSFileName;
1513    
1514 h677 1.83 GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
1515 yoffy 1.11 if CSSListView.Items.Count > 0 then begin
1516     try
1517 h677 1.13 if CSSListView.ItemIndex >= 0 then begin
1518     if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
1519     GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
1520     else
1521     GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
1522 h677 1.83 end;
1523 yoffy 1.11 except
1524     end;
1525     end;
1526 yoffy 1.10
1527 yoffy 1.25 Board := TBoard.Create( nil, 'about://sample/' );
1528 h677 1.75 ThreadItem := TThreadItem.Create( nil, Board, 'about://sample/test/read.cgi/sample/' );
1529 yoffy 1.9
1530 yoffy 1.22 try
1531     Board.Title := '鐃?鐃緒申鐃?鐃緒申鐃緒申';
1532     ThreadItem.ParentBoard := Board;
1533     ThreadItem.AllResCount := High( Res );
1534     ThreadItem.NewResCount := 1;
1535     ThreadItem.NewReceive := 2;
1536     ThreadItem.Title := '鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?鐃緒申鐃?';
1537    
1538     Res[0].FName := '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
1539     Res[0].FMailTo := 'sage';
1540     Res[0].FDateTime := 'ID:Sample';
1541     Res[0].FBody := 'CSS 鐃緒申鐃?鐃?鐃緒申鐃緒申鐃?鐃緒申鐃?鐃緒申';
1542     Res[1].FName := '鐃緒申鐃緒申鐃緒申鐃緒申鐃緒申';
1543     Res[1].FMailTo := 'age';
1544     Res[1].FDateTime := 'ID:Sample';
1545     Res[1].FBody := '鐃?鐃?鐃?鐃緒申鐃?鐃?';
1546    
1547    
1548     if FileExists( GikoSys.GetSkinHeaderFileName ) then begin
1549     html :=
1550 h677 1.77 HTMLCreater.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
1551 yoffy 1.22 '<a name="top"></a>' +
1552 h677 1.81 HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), @Res[0], '1' ) +
1553     HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), @Res[1], '2' ) +
1554 yoffy 1.22 '<a name="bottom"></a>' +
1555 h677 1.77 HTMLCreater.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
1556 yoffy 1.22
1557     html := StringReplace( html, '</head>',
1558 h677 1.83 '<style type="text/css">body {' + GetPreviewUserStyle + '}</style></head>', [rfReplaceAll] );
1559 yoffy 1.22 end else begin
1560     html :=
1561 h677 1.83 '<html><head><meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' +
1562 yoffy 1.22 '<title>' + ThreadItem.Title + '</title>' +
1563     '<link rel="stylesheet" href="' + GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName + '" type="text/css">' +
1564 h677 1.83 '<style type="text/css">body {' + GetPreviewUserStyle + '}</style>' +
1565     '</head><body><div class="title">' + ThreadItem.Title + '</div>';
1566 yoffy 1.22
1567 h677 1.83 html := html + CreatePreviewBody(Res) + '</body></html>';
1568 yoffy 1.22 end;
1569    
1570     try
1571     CSSSetContent( html );
1572     except
1573     end;
1574    
1575     finally
1576     ThreadItem.Free;
1577     Board.Free;
1578     GikoSys.Setting.CSSFileName := fileName;
1579     end;
1580 yoffy 1.11
1581     end;
1582 h677 1.83 function TOptionDialog.CreatePreviewBody(Res: array of TResRec): string;
1583     var
1584     i : Integer;
1585     begin
1586     Result := '';
1587     for i := 0 to High( Res ) do
1588     begin
1589     Result := Result +
1590     '<div class="header"><span class="no">' + IntToStr( i + 1 ) + '</span>' +
1591     '<span class="name_label"> 鐃緒申鐃?鐃? </span>' +
1592     '<a class="name_mail" href="mailto:' + Res[i].FMailTo + '">' +
1593     '<b>' + Res[i].FName + '</b></a><span class="mail"> [' + Res[i].FMailTo + ']</span>' +
1594     '<span class="date_label"> 鐃緒申鐃?鐃緒申鐃?</span>' +
1595     '<span class="date"> ' + Res[i].FDateTime+ '</span></div>' +
1596     '<div class="mes">' + Res[i].FBody + ' </div>';
1597     end;
1598     end;
1599 yoffy 1.11
1600 h677 1.83 function TOptionDialog.GetPreviewUserStyle(): string;
1601     var
1602     i : Integer;
1603    
1604     begin
1605     Result := '';
1606     // 鐃?鐃?鐃緒申鐃?鐃緒申鐃?鐃?鐃?鐃緒申鐃緒申鐃緒申
1607     if CSSFontCheckBox.Checked then begin
1608     i := ColorToRGB( FCSSFont.Color );
1609     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1610    
1611     Result := Result +
1612     'font-family:"' + FCSSFont.Name + '";' +
1613     'font-size:' + IntToStr( FCSSFont.Size ) + 'pt;' +
1614     'color:#' + IntToHex( i, 6 ) + ';';
1615     if fsBold in FCSSFont.Style then
1616     Result := Result + 'font-weight:bold;'
1617     else
1618     Result := Result + 'font-weight:normal;';
1619     if fsItalic in FCSSFont.Style then
1620     Result := Result + 'font-style:italic;'
1621     else
1622     Result := Result + 'font-style:normal;';
1623     end;
1624     if CSSBackColorCheckBox.Checked then begin
1625     i := ColorToRGB( FCSSBackColor );
1626     i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
1627    
1628     Result := Result +
1629     'background-color:#' + IntToHex( i, 6 ) + ';';
1630     end;
1631    
1632     end;
1633 yoffy 1.11 procedure TOptionDialog.CSSListViewChange(Sender: TObject; Item: TListItem;
1634 yoffy 1.22 Change: TItemChange);
1635 yoffy 1.11 begin
1636    
1637 yoffy 1.14 if OptionTab.ActivePage = CSSTabSheet then
1638     CSSPreview;
1639 yoffy 1.11
1640 h677 1.19 end;
1641    
1642     procedure TOptionDialog.AddURLButtonClick(Sender: TObject);
1643     begin
1644     BoardURLComboBox.Items.Append(BoardURLComboBox.Text);
1645 yoffy 1.22 BoardURLComboBox.ItemIndex := BoardURLComboBox.Items.Count - 1;
1646 h677 1.19 end;
1647    
1648     procedure TOptionDialog.RemoveURLButtonClick(Sender: TObject);
1649     begin
1650     BoardURLComboBox.DeleteSelected;
1651 h677 1.23 end;
1652    
1653     procedure TOptionDialog.OddResNumCheckBoxClick(Sender: TObject);
1654     begin
1655     OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
1656 h677 1.76 UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
1657 yoffy 1.8 end;
1658    
1659 yoffy 1.49 procedure TOptionDialog.ResRangeHoldCheckBoxClick(Sender: TObject);
1660     begin
1661     ResRangeHoldComboBox.Enabled := ResRangeHoldCheckBox.Checked;
1662     end;
1663    
1664 genyakun 1.58 procedure TOptionDialog.CroutOptionClick(Sender: TObject);
1665 h677 1.59 var
1666     KuroutOption: TKuroutOption;
1667 genyakun 1.58 begin
1668 h677 1.60 KuroutOption := TKuroutOption.Create(Self);
1669 h677 1.59 try
1670 h677 1.60 KuroutOption.ShowModal;
1671 h677 1.59 finally
1672 h677 1.60 KuroutOption.Release;
1673 h677 1.59 end;
1674 genyakun 1.58 end;
1675    
1676 h677 1.74 procedure TOptionDialog.MaxRecordCountEditExit(Sender: TObject);
1677     begin
1678     if not GikoSys.IsNumeric(MaxRecordCountEdit.Text) then
1679     MaxRecordCountEdit.Text := '100'
1680     else if StrToIntDef(MaxRecordCountEdit.Text, 100) <= 0 then
1681     MaxRecordCountEdit.Text := '1';
1682     end;
1683    
1684 hi_ 1.1 end.
1685    

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