Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/Setting.pas

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


Revision 1.7 - (show annotations) (download) (as text)
Sat Sep 27 06:35:19 2003 UTC (20 years, 6 months ago) by yoffy
Branch: MAIN
Changes since 1.6: +6 -0 lines
File MIME type: text/x-pascal
・[スキンでもポップアップ] を追加。

1 unit Setting;
2
3 interface
4
5 uses
6 SysUtils, Classes, Graphics, Forms, Math, IniFiles, UCryptAuto, UBase64,
7 ComCtrls;
8
9 const
10 MAIN_COOLBAND_COUNT = 4; //?<?ゃ??oolBand????/span>
11 LIST_COOLBAND_COUNT = 2; //??oolBand????/span>
12 BROWSER_COOLBAND_COUNT = 3; //????????oolBand????/span>
13
14 type
15 TGikoTabPosition = (gtpTop, gtpBottom); // ?帥??篏?臀?/span>
16 TGikoTabAppend = (gtaFirst, gtpLast); // ?帥??菴遵??篏?臀?/span>
17 TGikoTabStyle = (gtsTab, gtsButton, gtsFlat); // ?帥???鴻?帥?ゃ??/span>
18 TGikoListOrientation = (gloHorizontal, gloVertical); // ???鴻?????眼?紙梓綛?/span>
19 TGikoListState = (glsMax, glsNormal, glsMin); // ???鴻???泣?ゃ?榊?倶??
20 // ???????≪????茵?ず篏?臀?/span>
21 TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
22 gppRight, gppCenter, gppLeft,
23 gppRightBottom, gppBottom, gppLeftBottom);
24 //???????ャ?若?泣?ゃ??/span>
25 TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
26
27 //CoolBar荐?????潟?若??
28 TCoolSet = record
29 FCoolID: Integer;
30 FCoolWidth: Integer;
31 FCoolBreak: Boolean;
32 end;
33
34 TSetting = class(TObject)
35 private
36 //??篆<???????<?泣?ゃ??/span>
37 FRecvBufferSize: Integer;
38 //HTTP1.1篏睡??/span>
39 FProtocol: Boolean;
40 //???????傑・膓?HTTP1.1篏睡??/span>
41 FProxyProtocol: Boolean;
42
43 //???????件?茯?昭???
44 FReadProxy: Boolean;
45 FReadProxyAddress: string;
46 FReadProxyPort: Integer;
47 FReadProxyUserID: string;
48 FReadProxyPassword: string;
49
50 //???????件??梧昭???
51 FWriteProxy: Boolean;
52 FWriteProxyAddress: string;
53 FWriteProxyPort: Integer;
54 FWriteProxyUserID: string;
55 FWriteProxyPassword: string;
56
57 //???c????????
58 FCabinetFontName: string;
59 FCabinetFontSize: Integer;
60 FCabinetFontBold: Boolean;
61 FCabinetFontItalic: Boolean;
62 FCabinetFontColor: TColor;
63 FCabinetBackColor: TColor;
64
65 //???鴻??
66 FListFontName: string;
67 FListFontSize: Integer;
68 FListFontBold: Boolean;
69 FListFontItalic: Boolean;
70 FListFontColor: TColor;
71 FListBackColor: TColor;
72
73 //????????/span>
74 FBrowserFontName: string; // ''...default
75 FBrowserFontSize: Integer; // 0...default
76 FBrowserFontBold: Integer; // 0...default, -1...False, 1...True
77 FBrowserFontItalic: Integer; // 筝???????
78 FBrowserFontColor: Integer; // -1...default
79 FBrowserBackColor: Integer; // 筝???????
80 FSkinPopup: Boolean; // ?鴻???潟?с?????????≪????
81
82 //?????c??/span>
83 FEditorFontName: string;
84 FEditorFontSize: Integer;
85 FEditorFontBold: Boolean;
86 FEditorFontItalic: Boolean;
87 FEditorFontColor: TColor;
88 FEditorBackColor: TColor;
89
90 //?帥???????潟??
91 FBrowserTabFontName: string;
92 FBrowserTabFontSize: Integer;
93 FBrowserTabFontBold: Boolean;
94 FBrowserTabFontItalic: Boolean;
95
96 //???潟?????c?潟????/span>
97 FHintFontName: string;
98 FHintFontSize: Integer;
99 //FHintFontBold: Boolean;
100 //FHintFontItalic: Boolean;
101 FHintFontColor: TColor;
102 FHintBackColor: TColor;
103
104
105 //???c?潟?????泣?ゃ??/span>
106 FWindowTop: Integer;
107 FWindowLeft: Integer;
108 FWindowHeight: Integer;
109 FWindowWidth: Integer;
110 FWindowMax: Boolean;
111 //???鴻?????ャ?若?鴻?帥?ゃ??/span>
112 FListStyle: TViewStyle;
113
114 //???若?????取;腓?/span>
115 FStdToolBarVisible: Boolean;
116 FAddressBarVisible: Boolean;
117 FLinkBarVisible: Boolean;
118 FListToolBarVisible: Boolean;
119 FListNameBarVisible: Boolean;
120 FBrowserToolBarVisible: Boolean;
121 FBrowserNameBarVisible: Boolean;
122
123 //???????吟?帥??
124 FBrowserTabVisible: Boolean;
125 FBrowserTabPosition: TGikoTabPosition;
126 FBrowserTabAppend: TGikoTabAppend;
127 FBrowserTabStyle: TGikoTabStyle;
128
129 //?<???祉?若?吾????/span>
130 FMessageBarVisible: Boolean;
131 FMessegeBarHeight: Integer;
132
133 //?鴻???若?帥?鴻????/span>
134 FStatusBarVisible: Boolean;
135
136 //???c????????????祉?泣?ゃ??/span>
137 FCabinetVisible: Boolean;
138 FCabinetWidth: Integer;
139
140 //???鴻???祉???????吟?泣?ゃ??/span>
141 FListOrientation: TGikoListOrientation;
142 FListHeight: Integer;
143 FListHeightState: TGikoListState;
144 FListWidth: Integer;
145 FListWidthState: TGikoListState;
146 // FListHeightMax: Boolean;
147 // FListWidthMax: Boolean;
148
149 //??篆∞???????祉?<?若??/span>
150 FNameList: TStringList;
151 FMailList: TStringList;
152
153 //?????c?帥?若???c?潟?????泣?ゃ??/span>
154 FEditWindowTop: Integer;
155 FEditWindowLeft: Integer;
156 FEditWindowHeight: Integer;
157 FEditWindowWidth: Integer;
158 FEditWindowMax: Boolean;
159
160 //???鴻????埈;腓?/span>
161 FListViewNo: Boolean;
162 //CSS茵?ず
163 FUseCSS: Boolean;
164 //CSS???<?ゃ????
165 FCSSFileName: string;
166 //mail罨?茵?ず
167 FShowMail: Boolean;
168 //???≪?????c???????鴻???????≪????茵?ず
169 FUnActivePopup: Boolean;
170 //???鴻???????≪???????????若???若????
171 FResPopupHeaderBold: Boolean;
172
173 //???違????????
174 FLogFolder: string;
175 FNewLogFolder: string;
176
177 //???鴻???????????????若?泣?ゃ??/span>
178 FBBSColumnWidth: array[0..0] of Integer;
179 FCategoryColumnWidth: array[0..3] of Integer;
180 FBoardColumnWidth: array[0..6] of Integer;
181
182 //腟?莨若?炊??絖???
183 FSelectTextList: TStringList;
184
185 //?推?荀?RL
186 FBoardURL2ch: string;
187
188 //???若??D?祉???鴻???若??
189 FUserID: string;
190 FPassword: string;
191 FAutoLogin: Boolean;
192
193 //URL??????????莎桁???≪????/span>
194 FURLApp: Boolean;
195 FURLAppFile: string;
196
197 //mailto????????????篏?
198 FOpenMailer: Boolean;
199
200 //???ょ∈茯?
201 FDeleteMsg: Boolean;
202
203 //CoolBar鐚??<?ゃ?潟?紙?帥?祉???????駈?
204 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
205 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
206 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
207
208 //ToolBar Wrapable
209 FListToolBarWrapable: Boolean;
210 FBrowserToolBarWrapable: Boolean;
211
212 //???????≪????篏?臀?/span>
213 FPopupPosition: TGikoPopupPosition;
214
215 //?≪?????鴻????/span>
216 FURLDisplay: Boolean;
217 FAddressBarTabStop: Boolean;
218 FLinkAddAddressBar: Boolean;
219 FAddressHistoryCount: Integer;
220
221 //?糸????????ャ??/span>
222 FPreviewVisible: Boolean;
223 FPreviewSize: TGikoPreviewSize;
224 FPreviewWait: Integer;
225
226 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟?活;腓?/span>
227 FListIconVisible: Boolean;
228
229 //?吾??莨若?炊?????激?恰????篏睡??┃絎?
230 FUseMachineTime: Boolean;
231 FTimeAdjustSec: Integer;
232 FTimeAdjust: Boolean;
233
234 //???若????
235 FAbonDeleterlo : Boolean; //&rlo;????????
236 FAbonReplaceul : Boolean; //<ul>?帥?違??<br>?帥?違??舟????????
237 FPopUpAbon : Boolean; //???鴻???????≪???????????若????????/span>
238
239 // ?鴻??????腟?莨若???c?若???????
240 FSelectComboBoxWidth : Integer;
241
242 function GetMainCoolSet(Index: Integer): TCoolSet;
243 function GetBoardCoolSet(Index: Integer): TCoolSet;
244 function GetBrowserCoolSet(Index: Integer): TCoolSet;
245 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
246 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
247 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
248
249 function GetBBSColumnWidth(index: Integer): Integer;
250 function GetCategoryColumnWidth(index: Integer): Integer;
251 function GetBoardColumnWidth(index: Integer): Integer;
252 procedure SetBBSColumnWidth(index: Integer; value: Integer);
253 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
254 procedure SetBoardColumnWidth(index: Integer; value: Integer);
255
256 function GetSoundName(Index: Integer): string;
257 function GetSoundViewName(Index: Integer): string;
258 function GetSoundFileName(Index: Integer): string;
259 procedure SetSoundFileName(Index: Integer; value: string);
260 function Encrypt(s: string): string;
261 function Decrypt(s: string): string;
262 protected
263
264 public
265 constructor Create;
266 destructor Destroy; override;
267 function GetFileName: string;
268 procedure ReadSettingFile;
269 procedure WriteSystemSettingFile;
270 procedure WriteWindowSettingFile;
271 procedure WriteNameMailSettingFile;
272 procedure WriteFolderSettingFile();
273 function GetSoundCount: Integer;
274 function FindSoundFileName(Name: string): string;
275
276 //??篆<???????<?泣?ゃ??/span>
277 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
278 //HTTP1.1篏睡??/span>
279 property Protocol: Boolean read FProtocol write FProtocol;
280 //???????傑・膓?HTTP1.1篏睡??/span>
281 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
282
283 property ReadProxy: Boolean read FReadProxy write FReadProxy;
284 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
285 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
286 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
287 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
288
289 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
290 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
291 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
292 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
293 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
294
295 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
296 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
297 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
298 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
299 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
300 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
301
302 property ListFontName: string read FListFontName write FListFontName;
303 property ListFontSize: Integer read FListFontSize write FListFontSize;
304 property ListFontBold: Boolean read FListFontBold write FListFontBold;
305 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
306 property ListFontColor: TColor read FListFontColor write FListFontColor;
307 property ListBackColor: TColor read FListBackColor write FListBackColor;
308
309 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
310 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
311 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
312 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
313 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
314 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
315 property SkinPopup: Boolean read FSkinPopup write FSkinPopup;
316
317 property EditorFontName: string read FEditorFontName write FEditorFontName;
318 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
319 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
320 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
321 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
322 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
323
324 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
325 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
326 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
327 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
328
329 property HintFontName: string read FHintFontName write FHintFontName;
330 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
331 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
332 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
333 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
334 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
335
336 property WindowTop: Integer read FWindowTop write FWindowTop;
337 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
338 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
339 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
340 property WindowMax: Boolean read FWindowMax write FWindowMax;
341 property ListStyle: TViewStyle read FListStyle write FListStyle;
342
343 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
344 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
345 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
346 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
347 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
348 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
349 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
350
351 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
352 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
353 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
354 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
355
356 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
357 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
358
359 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
360
361 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
362 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
363
364 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
365 property ListHeight: Integer read FListHeight write FListHeight;
366 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
367 property ListWidth: Integer read FListWidth write FListWidth;
368 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
369 // property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
370 // property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
371
372 property NameList: TStringList read FNameList write FNameList;
373 property MailList: TStringList read FMailList write FMailList;
374 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
375
376 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
377 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
378 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
379 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
380 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
381
382 property ListViewNo: Boolean read FListViewNo write FListViewNo;
383 property UseCSS: Boolean read FUseCSS write FUseCSS;
384 property CSSFileName: string read FCSSFileName write FCSSFileName;
385
386 property ShowMail: Boolean read FShowMail write FShowMail;
387 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
388 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
389
390 property LogFolder: string read FLogFolder write FLogFolder;
391 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
392
393 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
394 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
395 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
396
397 property SoundName[index: Integer]: string read GetSoundName;
398 property SoundViewName[index: Integer]: string read GetSoundViewName;
399 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
400
401 property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
402
403 property UserID: string read FUserID write FUserID;
404 property Password: string read FPassword write FPassword;
405 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
406
407 property URLApp: Boolean read FURLApp write FURLApp;
408 property URLAppFile: string read FURLAppFile write FURLAppFile;
409
410 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
411
412 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
413
414 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
415 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
416 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
417
418 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
419 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
420
421 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
422
423 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
424 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
425 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
426 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
427
428 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
429 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
430 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
431
432 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
433
434 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
435 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
436 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
437
438 //???若????
439 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
440 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
441 property PopUpAbon : Boolean read FPopUpAbon write FPopUpAbon;
442
443 // ?鴻??????腟?莨若???c?若???????
444 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
445
446 end;
447
448
449
450 implementation
451
452 type
453 TSoundName = record
454 Name: string;
455 ViewName: string;
456 FileName: string;
457 end;
458
459 const
460 INI_FILE_NAME: string = 'gikoNavi.ini';
461 DEFAULT_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
462 DEFAULT_FONT_SIZE: Integer = 9;
463 DEFAULT_FONT_COLOR: string = 'clWindowText';
464 DEFAULT_WINDOW_COLOR: string = 'clWindow';
465 DEFAULT_TAB_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
466 DEFAULT_TAB_FONT_SIZE: Integer = 9;
467 DEFAULT_2CH_BOARD_URL: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
468 //'http://www.2ch.net/newbbsmenu.html';
469 GIKO_ENCRYPT_TEXT: string = 'gikoNaviEncryptText';
470
471 var
472 SOUND_NAME: array[0..4] of TSoundName = (
473 (Name: 'New'; ViewName: '??緇?????'; FileName: ''),
474 (Name: 'NewDiff'; ViewName: '??緇?????(綏???)'; FileName: ''),
475 (Name: 'NoChange'; ViewName: '???贋??#39;; FileName: ''),
476 // (Name: 'RoundEnd'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
477 // (Name: 'RoundNone'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
478 (Name: 'ResEnd'; ViewName: '???拷??篆≦?篋?'; FileName: ''),
479 (Name: 'Error'; ViewName: '??????#39;; FileName: ''));
480
481 //?潟?潟?鴻????????/span>
482 constructor TSetting.Create();
483 begin
484 FNameList := TStringList.Create;
485 FMailList := TStringList.Create;
486 FSelectTextList := TStringList.Create;
487
488 FNameList.Duplicates := dupIgnore;
489 FMailList.Duplicates := dupIgnore;
490 FSelectTextList.Duplicates := dupIgnore;
491 ReadSettingFile();
492 end;
493
494 //???鴻????????/span>
495 destructor TSetting.Destroy();
496 begin
497 inherited;
498 FSelectTextList.Free;
499 FMailList.Free;
500 FNameList.Free;
501 end;
502
503 //?????????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
504 function TSetting.GetFileName(): string;
505 begin
506 Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
507 end;
508
509 //荐?????<?ゃ???莨?/span>
510 procedure TSetting.ReadSettingFile();
511 const
512 DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
513 DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
514 DEFAULT_BOARD_WIDTH: array[0..6] of Integer = (350, 60, 60, 60, 60, 80, 130);
515 var
516 ini: TMemIniFile;
517 i: Integer;
518 wkList: TStringList;
519 wkStr: string;
520 Exists: Boolean;
521 s: string;
522 // id: Integer;
523 CoolSet: TCoolSet;
524 begin
525 Exists := FileExists(GetFileName);
526 ini := TMemIniFile.Create(GetFileName);
527 try
528 //??篆<???????<?泣?ゃ??/span>
529 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
530 //HTTP1.1篏睡??/span>
531 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
532 //???????傑・膓?HTTP1.1篏睡??/span>
533 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
534
535 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
536 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
537 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
538 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
539 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
540
541 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
542 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
543 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
544 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
545 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
546
547 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
548 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
549 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
550 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
551 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
552 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
553
554 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
555 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
556 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
557 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
558 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
559 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
560
561 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
562 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
563 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
564 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
565 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
566 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
567
568 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
569 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
570 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
571 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
572 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
573 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
574
575 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
576 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
577 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
578 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
579
580 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
581 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
582 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
583 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
584 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
585 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
586
587 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
588 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
589 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
590 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
591 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
592
593 if FWindowHeight <= 0 then FWindowHeight := 400;
594 if FWindowWidth <= 0 then FWindowWidth := 600;
595
596 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
597
598 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
599 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
600 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
601 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
602 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
603
604 //???若??????/span>
605 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
606 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
607 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
608 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
609 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
610 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
611 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
612 //???若??????rapable
613 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
614 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
615
616 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
617 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
618 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
619 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
620
621 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
622 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
623
624 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
625
626 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
627 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
628
629 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
630 FListHeight := ini.ReadInteger('List', 'Height', 180);
631 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
632 FListWidth := ini.ReadInteger('List', 'Width', 180);
633 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
634 // FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
635 // FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
636
637 wkList := TStringList.Create;
638 try
639 ini.ReadSection('Name', wkList);
640 for i := 0 to wkList.Count - 1 do begin
641 wkStr := ini.ReadString('Name', wkList[i], '');
642 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
643 FNameList.Add(wkStr);
644 end;
645 ini.ReadSection('Mail', wkList);
646 for i := 0 to wkList.Count - 1 do begin
647 wkStr := ini.ReadString('Mail', wkList[i], '');
648 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
649 FMailList.Add(wkStr);
650 end;
651 ini.ReadSection('SelectText', wkList);
652 for i := 0 to wkList.Count - 1 do begin
653 wkStr := ini.ReadString('SelectText', wkList[i], '');
654 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
655 FSelectTextList.Add(wkStr);
656 end;
657 finally
658 wkList.Free;
659 end;
660
661 //???鴻????????
662 wkList := TStringList.Create;
663 try
664 ini.ReadSection('BBSColumnWidth', wkList);
665 if Length(FBBSColumnWidth) <> wkList.Count then begin
666 ini.EraseSection('BBSColumnWidth');
667 end;
668 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
669 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
670 end;
671 ini.ReadSection('CategoryColumnWidth', wkList);
672 if Length(FCategoryColumnWidth) <> wkList.Count then begin
673 ini.EraseSection('CategoryColumnWidth');
674 end;
675 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
676 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
677 end;
678 ini.ReadSection('BoardColumnWidth', wkList);
679 if Length(FBoardColumnWidth) <> wkList.Count then begin
680 ini.EraseSection('BoardColumnWidth');
681 end;
682 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
683 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
684 end;
685 finally
686 wkList.Free;
687 end;
688
689
690 //???鴻?????/span>
691 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
692 //CSS
693 FUseCSS := ini.ReadBool('CSS', 'UseCSS', True);
694 //CSS???<?ゃ????
695 FCSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
696 //?鴻???潟?с?????????≪????
697 FSkinPopup := ini.ReadBool('CSS', 'SkinPopup', False);
698
699 //Mail罨?茵?ず
700 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
701 //???≪?????c???????鴻???????≪????茵?ず
702 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
703 //???鴻???????≪???????????若???若????
704 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
705
706 //???ょ∈茯?
707 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
708
709 //???違????????
710 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
711 NewLogFolder := '';
712
713 //??RL
714 FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
715
716 //茯?荐主?????若??D?祉???鴻???若??
717 FUserID := ini.ReadString('Attestation', 'UserID', '');
718 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
719 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
720
721 //URL??????????莎桁???≪????/span>
722 FURLApp := ini.ReadBool('URLApp', 'Select', False);
723 FURLAppFile := ini.ReadString('URLApp', 'File', '');
724
725 //mailto????????????篏?
726 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
727
728 //???????≪????篏?臀?/span>
729 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
730
731 //?≪?????鴻????/span>
732 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
733 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
734 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
735 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
736
737 //?糸????????ャ??/span>
738 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
739 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
740 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
741
742 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
743 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
744
745 //?吾??莨若?炊?????激?恰???私戎??┃絎?
746 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
747 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
748 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
749
750 //?泣???潟??
751 if Exists then begin
752 for i := 0 to GetSoundCount - 1 do begin
753 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
754 if not FileExists(SoundFileName[i]) then
755 SoundFileName[i] := '';
756 end;
757 end else begin
758 s := ExtractFileDir(Application.ExeName) + '\sound\';
759 SoundFileName[0] := s + '??緇?????.wav';
760 SoundFileName[1] := s + '??緇?????(綏???).wav';
761 SoundFileName[2] := s + '???贋??wav';
762 SoundFileName[3] := '';
763 SoundFileName[4] := s + '??????wav';
764 end;
765
766 //???若??????/span>
767 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
768 CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
769 CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
770 CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
771 MainCoolSet[i] := CoolSet;
772 end;
773 FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
774 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
775 CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
776 CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
777 CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
778 ListCoolSet[i] := CoolSet;
779 end;
780 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
781 CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
782 CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
783 CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
784 BrowserCoolSet[i] := CoolSet;
785 end;
786
787 //???若????
788 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
789 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
790 FPopUpAbon := ini.ReadBool('abon','Popup',false);
791 finally
792 ini.Free;
793 end;
794 end;
795
796 //荐?????<?ゃ???絖?(system)
797 procedure TSetting.WriteSystemSettingFile();
798 var
799 ini: TMemIniFile;
800 begin
801 ini := TMemIniFile.Create(GetFileName());
802 try
803 //??篆<???????<?泣?ゃ??/span>
804 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
805 //HTTP1.1篏睡??/span>
806 ini.WriteBool('HTTP', 'Protocol', FProtocol);
807 //???????傑・膓?HTTP1.1篏睡??/span>
808 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
809
810 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
811 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
812 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
813 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
814 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
815
816 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
817 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
818 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
819 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
820 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
821
822 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
823 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
824 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
825 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
826 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
827 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
828 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
829
830 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
831 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
832 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
833 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
834
835 ini.WriteString('Window', 'ListFontName', FListFontName);
836 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
837 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
838 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
839
840 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
841 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
842 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
843 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
844
845 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
846 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
847 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
848 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
849
850 ini.WriteString('Window', 'HintFontName', FHintFontName);
851 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
852 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
853 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
854
855 ini.UpdateFile;
856 finally
857 ini.Free;
858 end;
859 end;
860
861 //荐?????<?ゃ???絖?(window)
862 procedure TSetting.WriteWindowSettingFile();
863 var
864 i: Integer;
865 ini: TMemIniFile;
866 CoolSet: TCoolSet;
867 begin
868 ini := TMemIniFile.Create(GetFileName());
869 try
870 ini.WriteInteger('WindowSize', 'Top', WindowTop);
871 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
872 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
873 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
874 ini.WriteBool('WindowSize', 'Max', WindowMax);
875
876 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
877
878 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
879 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
880 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
881 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
882 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
883
884 //???若??????/span>
885 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
886 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
887 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
888 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
889 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
890 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
891 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
892 //???若??????rapable
893 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
894 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
895
896 //?帥??
897 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
898 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
899 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
900 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
901
902 //?<???祉?若?吾????/span>
903 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
904 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
905
906 //?鴻???若?帥?鴻????/span>
907 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
908
909 //???c????????
910 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
911 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
912
913 //???鴻?????泣?ゃ?冴?????贋梓綛?/span>
914 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
915 ini.WriteInteger('List', 'Height', FListHeight);
916 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
917 ini.WriteInteger('List', 'Width', FListWidth);
918 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
919 // ini.WriteBool('List', 'HeightMax', FListHeightMax);
920 // ini.WriteBool('List', 'WidthMax', FListWidthMax);
921
922
923 // ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
924
925 //???鴻????埈;腓?/span>
926 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
927 //CSS篏睡??/span>
928 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
929 //CSS???<?ゃ????
930 ini.WriteString('CSS', 'FileName', FCSSFileName);
931 //?鴻???潟?с?????????≪????
932 ini.WriteBool('CSS', 'SkinPopup', FSkinPopup);
933 //Mail罨?茵?ず
934 ini.WriteBool('Thread', 'ShowMail', FShowMail);
935 //???医???ょ∈茯?
936 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
937 //???≪?????c???????????≪????茵?ず
938 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
939 //???鴻???????≪???????????若???若????
940 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
941
942 ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
943
944 //茯?荐主?????若??D?祉???鴻???若??
945 ini.WriteString('Attestation', 'UserID', FUserID);
946 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
947 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
948
949 //URL??????????莎桁???≪????/span>
950 ini.WriteBool('URLApp', 'Select', FURLApp);
951 ini.WriteString('URLApp', 'File', FURLAppFile);
952
953 //mailto????????????篏?
954 ini.WriteBool('Mailto', 'Open', FOpenMailer);
955
956 //???????≪????篏?臀?/span>
957 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
958
959 //?≪?????鴻????/span>
960 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
961 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
962 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
963 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
964
965 //?糸????????ャ??/span>
966 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
967 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
968 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
969
970 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
971 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
972
973 //?吾??莨若?炊?????激?恰???私戎??┃絎?
974 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
975 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
976 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
977
978 //???鴻????????
979 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
980 ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
981 end;
982 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
983 ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
984 end;
985 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
986 ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
987 end;
988
989 //?泣???潟??
990 for i := 0 to GetSoundCount - 1 do begin
991 if not FileExists(SoundFileName[i]) then
992 SoundFileName[i] := '';
993 ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
994 end;
995
996 //CoolBar
997 ini.EraseSection('MainCoolBar');
998 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
999 CoolSet := MainCoolSet[i];
1000 ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1001 ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1002 ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1003 end;
1004 ini.EraseSection('ListCoolBar');
1005 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1006 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1007 CoolSet := ListCoolSet[i];
1008 ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1009 ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1010 ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1011 end;
1012 ini.EraseSection('BrowserCoolBar');
1013 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1014 CoolSet := BrowserCoolSet[i];
1015 ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1016 ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1017 ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1018 end;
1019
1020 //???若????
1021 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1022 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1023 ini.WriteBool('abon','Popup',FPopUpAbon);
1024
1025 ini.UpdateFile;
1026 finally
1027 ini.Free;
1028 end;
1029 end;
1030
1031 //荐?????<?ゃ???絖?(name & mail)
1032 procedure TSetting.WriteNameMailSettingFile();
1033 var
1034 i: Integer;
1035 ini: TMemIniFile;
1036 begin
1037 ini := TMemIniFile.Create(GetFileName());
1038 try
1039 ini.EraseSection('Name');
1040 ini.EraseSection('Mail');
1041 ini.EraseSection('SelectText');
1042 for i := 0 to FNameList.Count - 1 do begin
1043 ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1044 if i >= 39 then
1045 Break;
1046 end;
1047 for i := 0 to FMailList.Count - 1 do begin
1048 ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1049 if i >= 39 then
1050 Break;
1051 end;
1052 for i := 0 to FSelectTextList.Count - 1 do begin
1053 ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1054 if i >= 39 then
1055 Break;
1056 end;
1057 ini.UpdateFile;
1058 finally
1059 ini.Free;
1060 end;
1061 end;
1062
1063 procedure TSetting.WriteFolderSettingFile();
1064 var
1065 ini: TMemIniFile;
1066 begin
1067 ini := TMemIniFile.Create(GetFileName());
1068 try
1069 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1070 ini.DeleteKey('Folder', 'LogFolder')
1071 else
1072 ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1073 ini.UpdateFile;
1074 finally
1075 ini.Free;
1076 end;
1077 end;
1078
1079 //???鴻????????????????/span>
1080 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1081 begin
1082 Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1083 end;
1084
1085 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1086 begin
1087 Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1088 end;
1089
1090 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1091 begin
1092 Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1093 end;
1094
1095 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1096 begin
1097 if index in [0..Length(FBBSColumnWidth) - 1] then
1098 FBBSColumnWidth[index] := value;
1099 end;
1100
1101 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1102 begin
1103 if index in [0..Length(FCategoryColumnWidth) - 1] then
1104 FCategoryColumnWidth[index] := value;
1105 end;
1106
1107 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1108 begin
1109 if index in [0..Length(FBoardColumnWidth) - 1] then
1110 FBoardColumnWidth[index] := value;
1111 end;
1112
1113 function TSetting.GetSoundCount: Integer;
1114 begin
1115 Result := Length(SOUND_NAME);
1116 end;
1117
1118 function TSetting.GetSoundName(Index: Integer): string;
1119 begin
1120 if (Index < GetSoundCount) and (Index >= 0) then
1121 Result := SOUND_NAME[Index].Name
1122 else
1123 Result := '';
1124 end;
1125
1126 function TSetting.GetSoundViewName(Index: Integer): string;
1127 begin
1128 if (Index < GetSoundCount) and (Index >= 0) then
1129 Result := SOUND_NAME[Index].ViewName
1130 else
1131 Result := '';
1132 end;
1133
1134 function TSetting.GetSoundFileName(Index: Integer): string;
1135 begin
1136 if (Index < GetSoundCount) and (Index >= 0) then
1137 Result := SOUND_NAME[Index].FileName
1138 else
1139 Result := '';
1140 end;
1141
1142 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1143 begin
1144 if (Index < GetSoundCount) and (Index >= 0) then
1145 SOUND_NAME[Index].FileName := value;
1146 end;
1147
1148 function TSetting.FindSoundFileName(Name: string): string;
1149 var
1150 i: Integer;
1151 begin
1152 for i := 0 to GetSoundCount - 1 do begin
1153 if SoundName[i] = Name then begin
1154 Result := SoundFileName[i];
1155 Exit;
1156 end;
1157 end;
1158 Result := '';
1159 end;
1160
1161 function TSetting.Encrypt(s: string): string;
1162 var
1163 cryptObj: THogeCryptAuto;
1164 inputStream, outputStream: TStringStream;
1165 begin
1166 inputStream := TStringStream.Create(s);
1167 outputStream := TStringStream.Create('');
1168 cryptObj := THogeCryptAuto.Create;
1169 try
1170 // ???桁??
1171 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1172
1173 // ???ゃ?????????у?荀?????????????鴻???????
1174 Result := HogeBase64Encode(outputStream.DataString);
1175 finally
1176 cryptObj.Free;
1177 outputStream.Free;
1178 inputStream.Free;
1179 end;
1180 end;
1181
1182 function TSetting.Decrypt(s: string): string;
1183 var
1184 cryptObj: THogeCryptAuto;
1185 inputStream, outputStream: TStringStream;
1186 begin
1187 try
1188 inputStream := TStringStream.Create(HogeBase64Decode(s));
1189 except
1190 Result := '';
1191 Exit;
1192 end;
1193 outputStream := TStringStream.Create('');
1194 cryptObj := THogeCryptAuto.Create;
1195 try
1196 // 緇??/span>
1197 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1198 Result := outputStream.DataString;
1199 finally
1200 cryptObj.Free;
1201 outputStream.Free;
1202 inputStream.Free;
1203 end;
1204 end;
1205
1206 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1207 begin
1208 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1209 Result := FMainCoolBar[Index]
1210 else begin
1211 Result.FCoolID := -1;
1212 Result.FCoolWidth := -1;
1213 Result.FCoolBreak := False;
1214 end;
1215 end;
1216
1217 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1218 begin
1219 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1220 Result := FListCoolBar[Index]
1221 else begin
1222 Result.FCoolID := -1;
1223 Result.FCoolWidth := -1;
1224 Result.FCoolBreak := False;
1225 end;
1226 end;
1227
1228 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1229 begin
1230 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1231 Result := FBrowserCoolBar[Index]
1232 else begin
1233 Result.FCoolID := -1;
1234 Result.FCoolWidth := -1;
1235 Result.FCoolBreak := False;
1236 end;
1237 end;
1238
1239 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1240 begin
1241 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1242 FMainCoolBar[Index] := CoolSet;
1243 end;
1244
1245 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1246 begin
1247 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1248 FListCoolBar[Index] := CoolSet;
1249 end;
1250
1251 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1252 begin
1253 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1254 FBrowserCoolBar[Index] := CoolSet;
1255 end;
1256
1257
1258 end.
1259

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