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.30 - (show annotations) (download) (as text)
Thu Mar 11 14:54:43 2004 UTC (20 years, 1 month ago) by q9_
Branch: MAIN
Changes since 1.29: +7 -0 lines
File MIME type: text/x-pascal
スレ一覧等のカラム幅を2000に制限した

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 BOARD_FILE_NAME = 'board.2ch';
15 CUSTOMBOARD_FILE_NAME = 'custom.2ch';
16 BOARD_DIR_NAME = 'Board';
17 KEY_SETTING_FILE_NAME = 'key.ini';
18 EKEY_SETTING_FILE_NAME = 'Ekey.ini';
19 TEMP_FOLDER = 'Temp';
20 OUTBOX_FILE_NAME = 'outbox.ini';
21 SENT_FILE_NAME = 'sent.ini';
22 CONFIG_DIR_NAME = 'config';
23 CSS_DIR_NAME = 'css';
24 SKIN_DIR_NAME = 'skin';
25 SKIN_HEADER_FILE_NAME = 'Header.html';
26 SKIN_FOOTER_FILE_NAME = 'Footer.html';
27 SKIN_NEWRES_FILE_NAME = 'NewRes.html';
28 SKIN_RES_FILE_NAME = 'Res.html';
29 SKIN_BOOKMARK_FILE_NAME = 'Bookmark.html';
30 SKIN_NEWMARK_FILE_NAME = 'Newmark.html';
31 NGWORDs_DIR_NAME : String = 'NGwords';
32 BOARD_PLUGIN_DIR_NAME = 'BoardPlugin';
33
34 type
35 TGikoTabPosition = (gtpTop, gtpBottom); // ?帥??篏?臀?/span>
36 TGikoTabAppend = (gtaFirst, gtpLast); // ?帥??菴遵??篏?臀?/span>
37 TGikoTabStyle = (gtsTab, gtsButton, gtsFlat); // ?帥???鴻?帥?ゃ??/span>
38 TGikoListOrientation = (gloHorizontal, gloVertical); // ???鴻?????眼?紙梓綛?/span>
39 TGikoListState = (glsMax, glsNormal, glsMin); // ???鴻???泣?ゃ?榊?倶??
40 // ???????≪????茵?ず篏?臀?/span>
41 TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
42 gppRight, gppCenter, gppLeft,
43 gppRightBottom, gppBottom, gppLeftBottom);
44 //???????ャ?若?泣?ゃ??/span>
45 TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
46
47 //CoolBar荐?????潟?若??
48 TCoolSet = record
49 FCoolID: Integer;
50 FCoolWidth: Integer;
51 FCoolBreak: Boolean;
52 end;
53
54 TSetting = class(TObject)
55 private
56 //??篆<???????<?泣?ゃ??/span>
57 FRecvBufferSize: Integer;
58 //HTTP1.1篏睡??/span>
59 FProtocol: Boolean;
60 //???????傑・膓?HTTP1.1篏睡??/span>
61 FProxyProtocol: Boolean;
62
63 //???????件?茯?昭???
64 FReadProxy: Boolean;
65 FReadProxyAddress: string;
66 FReadProxyPort: Integer;
67 FReadProxyUserID: string;
68 FReadProxyPassword: string;
69
70 //???????件??梧昭???
71 FWriteProxy: Boolean;
72 FWriteProxyAddress: string;
73 FWriteProxyPort: Integer;
74 FWriteProxyUserID: string;
75 FWriteProxyPassword: string;
76
77 //???c????????
78 FCabinetFontName: string;
79 FCabinetFontSize: Integer;
80 FCabinetFontBold: Boolean;
81 FCabinetFontItalic: Boolean;
82 FCabinetFontColor: TColor;
83 FCabinetBackColor: TColor;
84
85 //???鴻??
86 FListFontName: string;
87 FListFontSize: Integer;
88 FListFontBold: Boolean;
89 FListFontItalic: Boolean;
90 FListFontColor: TColor;
91 FListBackColor: TColor;
92
93 //????????/span>
94 FBrowserFontName: string; // ''...default
95 FBrowserFontSize: Integer; // 0...default
96 FBrowserFontBold: Integer; // 0...default, -1...False, 1...True
97 FBrowserFontItalic: Integer; // 筝???????
98 FBrowserFontColor: Integer; // -1...default
99 FBrowserBackColor: Integer; // 筝???????
100
101 //?????c??/span>
102 FEditorFontName: string;
103 FEditorFontSize: Integer;
104 FEditorFontBold: Boolean;
105 FEditorFontItalic: Boolean;
106 FEditorFontColor: TColor;
107 FEditorBackColor: TColor;
108
109 //?帥???????潟??
110 FBrowserTabFontName: string;
111 FBrowserTabFontSize: Integer;
112 FBrowserTabFontBold: Boolean;
113 FBrowserTabFontItalic: Boolean;
114
115 //???潟?????c?潟????/span>
116 FHintFontName: string;
117 FHintFontSize: Integer;
118 //FHintFontBold: Boolean;
119 //FHintFontItalic: Boolean;
120 FHintFontColor: TColor;
121 FHintBackColor: TColor;
122
123 //???c?潟?????泣?ゃ??/span>
124 FWindowTop: Integer;
125 FWindowLeft: Integer;
126 FWindowHeight: Integer;
127 FWindowWidth: Integer;
128 FWindowMax: Boolean;
129 //???鴻?????ャ?若?鴻?帥?ゃ??/span>
130 FListStyle: TViewStyle;
131
132 //???若?????取;腓?/span>
133 FStdToolBarVisible: Boolean;
134 FAddressBarVisible: Boolean;
135 FLinkBarVisible: Boolean;
136 FListToolBarVisible: Boolean;
137 FListNameBarVisible: Boolean;
138 FBrowserToolBarVisible: Boolean;
139 FBrowserNameBarVisible: Boolean;
140
141 //???????吟?帥??
142 FBrowserTabVisible: Boolean;
143 FBrowserTabPosition: TGikoTabPosition;
144 FBrowserTabAppend: TGikoTabAppend;
145 FBrowserTabStyle: TGikoTabStyle;
146
147 //?<???祉?若?吾????/span>
148 FMessageBarVisible: Boolean;
149 FMessegeBarHeight: Integer;
150
151 //?鴻???若?帥?鴻????/span>
152 FStatusBarVisible: Boolean;
153
154 //???c????????????祉?泣?ゃ??/span>
155 FCabinetVisible: Boolean;
156 FCabinetWidth: Integer;
157
158 //???鴻???祉???????吟?泣?ゃ??/span>
159 FListOrientation: TGikoListOrientation;
160 FListHeight: Integer;
161 FListHeightState: TGikoListState;
162 FListWidth: Integer;
163 FListWidthState: TGikoListState;
164 // FListHeightMax: Boolean;
165 // FListWidthMax: Boolean;
166
167 //??篆∞???????祉?<?若??/span>
168 FNameList: TStringList;
169 FMailList: TStringList;
170
171 //?????c?帥?若???c?潟?????泣?ゃ??/span>
172 FEditWindowTop: Integer;
173 FEditWindowLeft: Integer;
174 FEditWindowHeight: Integer;
175 FEditWindowWidth: Integer;
176 FEditWindowMax: Boolean;
177 FEditWindowStay: Boolean;
178 FEditWindowTranslucent: Boolean;
179
180 //???鴻????埈;腓?/span>
181 FListViewNo: Boolean;
182 //CSS茵?ず
183 FUseCSS: Boolean;
184 //CSS???<?ゃ????
185 FCSSFileName: string;
186 // ?鴻???活;腓?筝???????????? ini ???絖???????????)
187 FUseSkin: Boolean;
188 //mail罨?茵?ず
189 FShowMail: Boolean;
190 //莎桁????????00???壕;腓?/span>
191 FOnlyAHundredRes : Boolean;
192 //???≪?????c???????鴻???????≪????茵?ず
193 FUnActivePopup: Boolean;
194 //???鴻???????≪???????????若???若????
195 FResPopupHeaderBold: Boolean;
196
197 //???違????????
198 FLogFolder: string;
199 FNewLogFolder: string;
200
201 //???鴻???????????????若?泣?ゃ??/span>
202 FBBSColumnWidth: array[0..0] of Integer;
203 FCategoryColumnWidth: array[0..3] of Integer;
204 FBoardColumnWidth: array[0..7] of Integer;
205
206 //腟?莨若?炊??絖???
207 FSelectTextList: TStringList;
208
209 //?推?荀?RL
210 //FBoardURL2ch: string;
211 FBoardURLs: TStringList;
212 FBoardURLSelected: Integer;
213
214 //???若??D?祉???鴻???若??
215 FUserID: string;
216 FPassword: string;
217 FAutoLogin: Boolean;
218 FForcedLogin: Boolean;
219
220 //URL??????????莎桁???≪????/span>
221 FURLApp: Boolean;
222 FURLAppFile: string;
223
224 //mailto????????????篏?
225 FOpenMailer: Boolean;
226
227 //???ょ∈茯?
228 FDeleteMsg: Boolean;
229
230 //CoolBar鐚??<?ゃ?潟?紙?帥?祉???????駈?
231 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
232 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
233 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
234
235 //ToolBar Wrapable
236 FListToolBarWrapable: Boolean;
237 FBrowserToolBarWrapable: Boolean;
238
239 //???????≪????篏?臀?/span>
240 FPopupPosition: TGikoPopupPosition;
241
242 //?≪?????鴻????/span>
243 FURLDisplay: Boolean;
244 FAddressBarTabStop: Boolean;
245 FLinkAddAddressBar: Boolean;
246 FAddressHistoryCount: Integer;
247
248 //?糸????????ャ??/span>
249 FPreviewVisible: Boolean;
250 FPreviewSize: TGikoPreviewSize;
251 FPreviewWait: Integer;
252
253 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟?活;腓?/span>
254 FListIconVisible: Boolean;
255
256 //?鴻??????筝?荀с??og???????鴻?????????帥?鴻??????ャ??茵?ず??????
257 FCreationTimeLogs: Boolean;
258 //?鴻??????筝?荀с???鴻???????ャ?ф???ャ???鴻?????????ャ??茵?ず??????
259 FFutureThread: Boolean;
260
261 //?吾??莨若?炊?????激?恰????篏睡??┃絎?
262 FUseMachineTime: Boolean;
263 FTimeAdjustSec: Integer;
264 FTimeAdjust: Boolean;
265
266 //???若????
267 FAbonDeleterlo : Boolean; //&rlo;????????
268 FAbonReplaceul : Boolean; //<ul>?帥?違??<br>?帥?違??舟????????
269 FPopUpAbon : Boolean; //???鴻???????≪???????????若????????/span>
270 FShowNGLinesNum : Boolean; //荅峨?????鐚?磁???若?????<?ゃ??????違??茵?ず
271 FAddResAnchor : Boolean; //NG???鴻?吾?????鴻?≪?潟???若??菴遵??????
272
273 // ?鴻??????腟?莨若???c?若???????
274 FSelectComboBoxWidth : Integer;
275
276 // ??緇????御?????????????激?с?潟???ゃ?≪???違???帥??
277 FOptionDialogTabIndex: Integer;
278
279 // ??緇????御???????????c????????
280 FCabinetIndex: Integer;
281
282 //腟?篋?????∈茯????ゃ?≪???違??茵?ず??????
283 FShowDialogForEnd : Boolean;
284 //??緇????号?違???鴻???????????号?違???違???c??????????絽梧?????蚊?????c???蚊???????蚊??篏睡????????
285 FUseOddColorOddResNum: Boolean;
286 FOddColor: TColor;
287
288 function GetMainCoolSet(Index: Integer): TCoolSet;
289 function GetBoardCoolSet(Index: Integer): TCoolSet;
290 function GetBrowserCoolSet(Index: Integer): TCoolSet;
291 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
292 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
293 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
294
295 function GetBBSColumnWidth(index: Integer): Integer;
296 function GetCategoryColumnWidth(index: Integer): Integer;
297 function GetBoardColumnWidth(index: Integer): Integer;
298 procedure SetBBSColumnWidth(index: Integer; value: Integer);
299 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
300 procedure SetBoardColumnWidth(index: Integer; value: Integer);
301
302 function GetSoundName(Index: Integer): string;
303 function GetSoundViewName(Index: Integer): string;
304 function GetSoundFileName(Index: Integer): string;
305 procedure SetSoundFileName(Index: Integer; value: string);
306 function Encrypt(s: string): string;
307 function Decrypt(s: string): string;
308
309 procedure MakeURLIniFile();
310
311 procedure SetUseCSS( value: Boolean );
312 procedure SetCSSFileName( fileName: string );
313 protected
314
315 public
316 constructor Create;
317 destructor Destroy; override;
318 function GetFileName: string;
319 function GetBoardURLFileName: string;
320 procedure ReadSettingFile;
321 procedure ReadBoardURLsFile;
322 procedure WriteSystemSettingFile;
323 procedure WriteWindowSettingFile;
324 procedure WriteNameMailSettingFile;
325 procedure WriteFolderSettingFile();
326 procedure WriteBoardURLSettingFile;
327 function GetSoundCount: Integer;
328 function FindSoundFileName(Name: string): string;
329
330 function GetBoardFileName: string;
331 function GetCustomBoardFileName: string;
332 function GetBoardDir: string;
333 function GetHtmlTempFileName: string;
334 function GetAppDir: string;
335 function GetTempFolder: string;
336 function GetSentFileName: string;
337 function GetConfigDir: string;
338 function GetSkinDir: string;
339 function GetSkinHeaderFileName: string;
340 function GetSkinFooterFileName: string;
341 function GetSkinResFileName: string;
342 function GetSkinNewResFileName: string;
343 function GetSkinBookmarkFileName: string;
344 function GetSkinNewmarkFileName: string;
345 function GetStyleSheetDir: string;
346 function GetOutBoxFileName: string;
347 function GetNGWordsDir: string;
348 function GetBoardPlugInDir: string;
349
350 //??篆<???????<?泣?ゃ??/span>
351 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
352 //HTTP1.1篏睡??/span>
353 property Protocol: Boolean read FProtocol write FProtocol;
354 //???????傑・膓?HTTP1.1篏睡??/span>
355 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
356
357 property ReadProxy: Boolean read FReadProxy write FReadProxy;
358 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
359 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
360 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
361 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
362
363 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
364 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
365 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
366 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
367 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
368
369 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
370 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
371 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
372 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
373 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
374 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
375
376 property ListFontName: string read FListFontName write FListFontName;
377 property ListFontSize: Integer read FListFontSize write FListFontSize;
378 property ListFontBold: Boolean read FListFontBold write FListFontBold;
379 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
380 property ListFontColor: TColor read FListFontColor write FListFontColor;
381 property ListBackColor: TColor read FListBackColor write FListBackColor;
382
383 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
384 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
385 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
386 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
387 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
388 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
389
390 property EditorFontName: string read FEditorFontName write FEditorFontName;
391 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
392 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
393 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
394 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
395 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
396
397 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
398 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
399 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
400 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
401
402 property HintFontName: string read FHintFontName write FHintFontName;
403 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
404 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
405 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
406 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
407 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
408
409 property WindowTop: Integer read FWindowTop write FWindowTop;
410 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
411 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
412 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
413 property WindowMax: Boolean read FWindowMax write FWindowMax;
414 property ListStyle: TViewStyle read FListStyle write FListStyle;
415
416 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
417 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
418 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
419 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
420 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
421 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
422 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
423
424 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
425 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
426 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
427 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
428
429 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
430 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
431
432 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
433
434 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
435 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
436
437 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
438 property ListHeight: Integer read FListHeight write FListHeight;
439 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
440 property ListWidth: Integer read FListWidth write FListWidth;
441 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
442 // property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
443 // property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
444
445 property NameList: TStringList read FNameList write FNameList;
446 property MailList: TStringList read FMailList write FMailList;
447 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
448
449 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
450 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
451 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
452 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
453 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
454 property EditWindowStay: Boolean read FEditWindowStay write FEditWindowStay;
455 property EditWindowTranslucent: Boolean read FEditWindowTranslucent write FEditWindowTranslucent;
456
457 property ListViewNo: Boolean read FListViewNo write FListViewNo;
458 property UseCSS: Boolean read FUseCSS write SetUseCSS;
459 property CSSFileName: string read FCSSFileName write SetCSSFileName;
460 property UseSkin: Boolean read FUseSkin;
461
462 property ShowMail: Boolean read FShowMail write FShowMail;
463 property OnlyAHundredRes : Boolean read FOnlyAHundredRes write FOnlyAHundredRes;
464 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
465 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
466
467 property LogFolder: string read FLogFolder write FLogFolder;
468 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
469
470 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
471 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
472 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
473
474 property SoundName[index: Integer]: string read GetSoundName;
475 property SoundViewName[index: Integer]: string read GetSoundViewName;
476 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
477
478 //property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
479 property BoardURLs: TStringList read FBoardURLs write FBoardURLs;
480 property BoardURLSelected: Integer read FBoardURLSelected write FBoardURLSelected;
481 property UserID: string read FUserID write FUserID;
482 property Password: string read FPassword write FPassword;
483 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
484 property ForcedLogin: Boolean read FForcedLogin write FForcedLogin;
485
486 property URLApp: Boolean read FURLApp write FURLApp;
487 property URLAppFile: string read FURLAppFile write FURLAppFile;
488
489 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
490
491 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
492
493 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
494 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
495 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
496
497 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
498 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
499
500 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
501
502 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
503 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
504 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
505 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
506
507 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
508 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
509 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
510
511 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
512 property CreationTimeLogs: Boolean read FCreationTimeLogs write FCreationTimeLogs;
513 property FutureThread: Boolean read FFutureThread write FFutureThread;
514
515 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
516 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
517 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
518
519 //???若????
520 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
521 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
522 property PopUpAbon : Boolean read FPopUpAbon write FPopUpAbon;
523 property ShowNGLinesNum : Boolean read FShowNGLinesNum write FShowNGLinesNum;
524 property AddResAnchor : Boolean read FAddResAnchor write FAddResAnchor;
525
526 // ?鴻??????腟?莨若???c?若???????
527 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
528
529 // ??緇????御?????????????激?с?潟???ゃ?≪???違???帥??
530 property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
531
532 // ??緇????御???????????c????????
533 property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
534
535 //腟?篋?????∈茯????ゃ?≪???違??茵?ず??????
536 property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
537 //??緇????号?違???鴻???????????号?違???違???c??????????絽梧?????蚊?????c???蚊???????蚊??篏睡????????
538 property UseOddColorOddResNum: Boolean read FUseOddColorOddResNum write FUseOddColorOddResNum;
539 property OddColor: TColor read FOddColor write FOddColor;
540
541 end;
542
543
544
545 implementation
546
547 type
548 TSoundName = record
549 Name: string;
550 ViewName: string;
551 FileName: string;
552 end;
553
554 const
555 INI_FILE_NAME: string = 'gikoNavi.ini';
556 BOARD_URL_INI_FILE_NAME: string = 'url.ini';
557 DEFAULT_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
558 DEFAULT_FONT_SIZE: Integer = 9;
559 DEFAULT_FONT_COLOR: string = 'clWindowText';
560 DEFAULT_WINDOW_COLOR: string = 'clWindow';
561 DEFAULT_TAB_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
562 DEFAULT_TAB_FONT_SIZE: Integer = 9;
563 DEFAULT_2CH_BOARD_URL1: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
564 DEFAULT_2CH_BOARD_URL2: string = 'http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html';
565 //http://menu.2ch.net/bbsmenu.html //??????????????罩e????推?荀с??????????
566 //'http://www.2ch.net/newbbsmenu.html';
567 GIKO_ENCRYPT_TEXT: string = 'gikoNaviEncryptText';
568
569 var
570 SOUND_NAME: array[0..4] of TSoundName = (
571 (Name: 'New'; ViewName: '??緇?????'; FileName: ''),
572 (Name: 'NewDiff'; ViewName: '??緇?????(綏???)'; FileName: ''),
573 (Name: 'NoChange'; ViewName: '???贋??#39;; FileName: ''),
574 // (Name: 'RoundEnd'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
575 // (Name: 'RoundNone'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
576 (Name: 'ResEnd'; ViewName: '???拷??篆≦?篋?'; FileName: ''),
577 (Name: 'Error'; ViewName: '??????#39;; FileName: ''));
578
579 //?潟?潟?鴻????????/span>
580 constructor TSetting.Create();
581 begin
582 FNameList := TStringList.Create;
583 FMailList := TStringList.Create;
584 FSelectTextList := TStringList.Create;
585 FBoardURLs := TStringList.Create;
586 FNameList.Duplicates := dupIgnore;
587 FMailList.Duplicates := dupIgnore;
588 FBoardURLs.Duplicates := dupIgnore;
589 FSelectTextList.Duplicates := dupIgnore;
590 ReadSettingFile();
591 ReadBoardURLsFile();
592 end;
593
594 //???鴻????????/span>
595 destructor TSetting.Destroy();
596 begin
597 inherited;
598 FSelectTextList.Free;
599 FBoardURLs.Free;
600 FMailList.Free;
601 FNameList.Free;
602 end;
603
604 //?????????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
605 function TSetting.GetFileName(): string;
606 begin
607 Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
608 end;
609
610 //?炊?贋?亥??RL荐?????<?ゃ????鐚????刻????<?ゃ????鐚?
611 function TSetting.GetBoardURLFileName(): string;
612 begin
613 Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
614 end;
615
616 //荐?????<?ゃ???莨?/span>
617 procedure TSetting.ReadSettingFile();
618 const
619 DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
620 DEFAULT_CATEGORY_WIDTH: array[0..3] of Integer = (150, 80, 130, 130);
621 DEFAULT_BOARD_WIDTH: array[0..7] of Integer = (350, 60, 60, 60, 60, 80, 130, 130);
622 MAX_WIDTH: Integer = 2000;
623 var
624 ini: TMemIniFile;
625 i: Integer;
626 wkList: TStringList;
627 wkStr: string;
628 Exists: Boolean;
629 s: string;
630 // id: Integer;
631 CoolSet: TCoolSet;
632 begin
633 Exists := FileExists(GetFileName);
634 ini := TMemIniFile.Create(GetFileName);
635 try
636 //??篆<???????<?泣?ゃ??/span>
637 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
638 //HTTP1.1篏睡??/span>
639 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
640 //???????傑・膓?HTTP1.1篏睡??/span>
641 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
642
643 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
644 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
645 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
646 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
647 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
648
649 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
650 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
651 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
652 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
653 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
654
655 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
656 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
657 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
658 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
659 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
660 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
661
662 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
663 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
664 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
665 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
666 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
667 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
668
669 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
670 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
671 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
672 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
673 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
674 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
675 FUseOddColorOddResNum := ini.ReadBool('Window','UseOddColor', False);
676 FOddColor := StringToColor(ini.ReadString('Window', 'OddColor', DEFAULT_WINDOW_COLOR));
677
678 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
679 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
680 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
681 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
682 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
683 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
684
685 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
686 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
687 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
688 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
689
690 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
691 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
692 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
693 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
694 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
695 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
696
697 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
698 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
699 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
700 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
701 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
702
703 if FWindowHeight <= 0 then FWindowHeight := 400;
704 if FWindowWidth <= 0 then FWindowWidth := 600;
705
706 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
707
708 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
709 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
710 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
711 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
712 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
713 FEditWindowStay := ini.ReadBool('EditorWindowSize', 'Stay', False);
714 FEditWindowTranslucent := ini.ReadBool('EditorWindowSize', 'Translucent', False);
715
716 FOptionDialogTabIndex := ini.ReadInteger('OptionDialog', 'TabIndex', 0);
717
718 //???若??????/span>
719 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
720 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
721 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
722 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
723 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
724 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
725 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
726 //???若??????rapable
727 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
728 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
729
730 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
731 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
732 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
733 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
734
735 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
736 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
737
738 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
739
740 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
741 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
742 FCabinetIndex := ini.ReadInteger('Cabinet', 'Index', 0);
743
744 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
745 FListHeight := ini.ReadInteger('List', 'Height', 180);
746 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
747 FListWidth := ini.ReadInteger('List', 'Width', 180);
748 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
749 // FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
750 // FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
751
752 wkList := TStringList.Create;
753 try
754 ini.ReadSection('Name', wkList);
755 for i := 0 to wkList.Count - 1 do begin
756 wkStr := ini.ReadString('Name', wkList[i], '');
757 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
758 FNameList.Add(wkStr);
759 end;
760 ini.ReadSection('Mail', wkList);
761 for i := 0 to wkList.Count - 1 do begin
762 wkStr := ini.ReadString('Mail', wkList[i], '');
763 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
764 FMailList.Add(wkStr);
765 end;
766 ini.ReadSection('SelectText', wkList);
767 for i := 0 to wkList.Count - 1 do begin
768 wkStr := ini.ReadString('SelectText', wkList[i], '');
769 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
770 FSelectTextList.Add(wkStr);
771 end;
772 finally
773 wkList.Free;
774 end;
775
776 //???鴻????????
777 wkList := TStringList.Create;
778 try
779 ini.ReadSection('BBSColumnWidth', wkList);
780 if Length(FBBSColumnWidth) <> wkList.Count then begin
781 ini.EraseSection('BBSColumnWidth');
782 end;
783 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
784 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
785 if BBSColumnWidth[i] > MAX_WIDTH then
786 BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i];
787 end;
788 ini.ReadSection('CategoryColumnWidth', wkList);
789 if Length(FCategoryColumnWidth) <> wkList.Count then begin
790 ini.EraseSection('CategoryColumnWidth');
791 end;
792 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
793 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
794 if CategoryColumnWidth[i] > MAX_WIDTH then
795 CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i];
796 end;
797 ini.ReadSection('BoardColumnWidth', wkList);
798 if Length(FBoardColumnWidth) <> wkList.Count then begin
799 ini.EraseSection('BoardColumnWidth');
800 end;
801 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
802 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
803 if BoardColumnWidth[i] > MAX_WIDTH then
804 BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i];
805 end;
806 finally
807 wkList.Free;
808 end;
809
810
811 //???鴻?????/span>
812 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
813 //CSS
814 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
815 //CSS???<?ゃ????
816 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
817
818 //Mail罨?茵?ず
819 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
820 //????00???壕;腓?/span>
821 FOnlyAHundredRes := ini.ReadBool('Thread', 'OnlyAHundredRes',false);
822 //???≪?????c???????鴻???????≪????茵?ず
823 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
824 //???鴻???????≪???????????若???若????
825 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
826
827 //???ょ∈茯?
828 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
829 //腟?篋?腆肴?
830 FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
831
832 //???違????????
833 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
834 NewLogFolder := '';
835
836 //??RL
837 //茲??亥?脂?蚊?с??????????????BoardURLs????????2003/10/05
838 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
839
840 //茯?荐主?????若??D?祉???鴻???若??
841 FUserID := ini.ReadString('Attestation', 'UserID', '');
842 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
843 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
844 FForcedLogin := ini.ReadBool('Attestation', 'FForcedLogin', False);
845
846 //URL??????????莎桁???≪????/span>
847 FURLApp := ini.ReadBool('URLApp', 'Select', False);
848 FURLAppFile := ini.ReadString('URLApp', 'File', '');
849
850 //mailto????????????篏?
851 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
852
853 //???????≪????篏?臀?/span>
854 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
855
856 //?≪?????鴻????/span>
857 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
858 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
859 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
860 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
861
862 //?糸????????ャ??/span>
863 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
864 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
865 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
866
867 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
868 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
869 FCreationTimeLogs := ini.ReadBool('ThreadList', 'CreationTimeLogs', True);
870 FFutureThread := ini.ReadBool('ThreadList', 'FutureThread', True);
871
872 //?吾??莨若?炊?????激?恰???私戎??┃絎?
873 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
874 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
875 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
876
877 //?泣???潟??
878 if Exists then begin
879 for i := 0 to GetSoundCount - 1 do begin
880 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
881 if not FileExists(SoundFileName[i]) then
882 SoundFileName[i] := '';
883 end;
884 end else begin
885 s := ExtractFileDir(Application.ExeName) + '\sound\';
886 SoundFileName[0] := s + '??緇?????.wav';
887 SoundFileName[1] := s + '??緇?????(綏???).wav';
888 SoundFileName[2] := s + '???贋??wav';
889 SoundFileName[3] := '';
890 SoundFileName[4] := s + '??????wav';
891 end;
892
893 //???若??????/span>
894 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
895 CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
896 CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
897 CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
898 MainCoolSet[i] := CoolSet;
899 end;
900 FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
901 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
902 CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
903 CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
904 CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
905 ListCoolSet[i] := CoolSet;
906 end;
907 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
908 CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
909 CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
910 CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
911 BrowserCoolSet[i] := CoolSet;
912 end;
913
914 //???若????
915 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
916 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
917 FPopUpAbon := ini.ReadBool('Abon','Popup',false);
918 FShowNGLinesNum := ini.ReadBool('Abon','ShowNGLines',false);
919 FAddResAnchor := ini.ReadBool('Abon','AddResAnchor',false);
920
921 finally
922 ini.Free;
923 end;
924 end;
925 //?炊?贋?亥??RL茯??粋昭??/span>
926 procedure TSetting.ReadBoardURLsFile();
927 var
928 ini: TMemIniFile;
929 urlNum: Integer;
930 i : Integer;
931 begin
932 if not FileExists(GetBoardURLFileName()) then
933 MakeURLIniFile();
934 ini := TMemIniFile.Create(GetBoardURLFileName());
935 try
936 urlNum := ini.ReadInteger('URL','count',0);
937 BoardURLSelected := ini.ReadInteger('URL','selected',0);
938 for i := 0 to urlNum - 1 do begin
939 FBoardURLs.Append(ini.ReadString('URL',IntToStr(i+1),''));
940 end;
941 finally
942 ini.Free;
943 end;
944
945 end;
946 //荐?????<?ゃ???絖?(system)
947 procedure TSetting.WriteSystemSettingFile();
948 var
949 ini: TMemIniFile;
950 begin
951 ini := TMemIniFile.Create(GetFileName());
952 try
953 //??篆<???????<?泣?ゃ??/span>
954 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
955 //HTTP1.1篏睡??/span>
956 ini.WriteBool('HTTP', 'Protocol', FProtocol);
957 //???????傑・膓?HTTP1.1篏睡??/span>
958 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
959
960 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
961 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
962 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
963 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
964 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
965
966 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
967 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
968 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
969 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
970 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
971
972 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
973 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
974 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
975 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
976 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
977 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
978 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
979
980 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
981 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
982 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
983 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
984
985 ini.WriteString('Window', 'ListFontName', FListFontName);
986 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
987 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
988 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
989 ini.WriteBool('Window','UseOddColor',FUseOddColorOddResNum);
990 ini.WriteString('Window', 'OddColor',ColorToString(FOddColor));
991
992 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
993 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
994 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
995 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
996
997 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
998 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
999 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
1000 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
1001
1002 ini.WriteString('Window', 'HintFontName', FHintFontName);
1003 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
1004 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
1005 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
1006
1007 ini.UpdateFile;
1008 finally
1009 ini.Free;
1010 end;
1011 end;
1012
1013 //荐?????<?ゃ???絖?(window)
1014 procedure TSetting.WriteWindowSettingFile();
1015 var
1016 i: Integer;
1017 ini: TMemIniFile;
1018 CoolSet: TCoolSet;
1019 begin
1020 ini := TMemIniFile.Create(GetFileName());
1021 try
1022 ini.WriteInteger('WindowSize', 'Top', WindowTop);
1023 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
1024 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
1025 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
1026 ini.WriteBool('WindowSize', 'Max', WindowMax);
1027
1028 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
1029
1030 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
1031 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
1032 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
1033 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
1034 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
1035 ini.WriteBool('EditorWindowSize', 'Stay', EditWindowStay);
1036 ini.WriteBool('EditorWindowSize', 'Translucent', EditWindowTranslucent);
1037
1038 ini.WriteInteger('OptionDialog', 'TabIndex', FOptionDialogTabIndex);
1039
1040 //???若??????/span>
1041 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
1042 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
1043 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
1044 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
1045 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
1046 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
1047 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
1048 //???若??????rapable
1049 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
1050 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
1051
1052 //?帥??
1053 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
1054 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
1055 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
1056 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
1057
1058 //?<???祉?若?吾????/span>
1059 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
1060 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
1061
1062 //?鴻???若?帥?鴻????/span>
1063 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
1064
1065 //???c????????
1066 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
1067 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
1068 ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
1069
1070 //???鴻?????泣?ゃ?冴?????贋梓綛?/span>
1071 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
1072 ini.WriteInteger('List', 'Height', FListHeight);
1073 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
1074 ini.WriteInteger('List', 'Width', FListWidth);
1075 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
1076 // ini.WriteBool('List', 'HeightMax', FListHeightMax);
1077 // ini.WriteBool('List', 'WidthMax', FListWidthMax);
1078
1079
1080 // ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
1081
1082 //???鴻????埈;腓?/span>
1083 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1084 //CSS篏睡??/span>
1085 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1086 //CSS???<?ゃ????
1087 ini.WriteString('CSS', 'FileName', FCSSFileName);
1088 //Mail罨?茵?ず
1089 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1090 //????00???壕;腓?/span>
1091 ini.WriteBool('Thread', 'OnlyAHundredRes', FOnlyAHundredRes);
1092 //???医???ょ∈茯?
1093 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1094 //腟?篋?腆肴?
1095 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1096 //???≪?????c???????????≪????茵?ず
1097 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1098 //???鴻???????≪???????????若???若????
1099 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1100
1101 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1102
1103 //茯?荐主?????若??D?祉???鴻???若??
1104 ini.WriteString('Attestation', 'UserID', FUserID);
1105 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1106 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1107 ini.WriteBool('Attestation', 'FForcedLogin', FForcedLogin);
1108
1109 //URL??????????莎桁???≪????/span>
1110 ini.WriteBool('URLApp', 'Select', FURLApp);
1111 ini.WriteString('URLApp', 'File', FURLAppFile);
1112
1113 //mailto????????????篏?
1114 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1115
1116 //???????≪????篏?臀?/span>
1117 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1118
1119 //?≪?????鴻????/span>
1120 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1121 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1122 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1123 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1124
1125 //?糸????????ャ??/span>
1126 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1127 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1128 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1129
1130 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
1131 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1132 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1133 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1134
1135 //?吾??莨若?炊?????激?恰???私戎??┃絎?
1136 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1137 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1138 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1139
1140 //???鴻????????
1141 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1142 ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1143 end;
1144 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1145 ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1146 end;
1147 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1148 ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1149 end;
1150
1151 //?泣???潟??
1152 for i := 0 to GetSoundCount - 1 do begin
1153 if not FileExists(SoundFileName[i]) then
1154 SoundFileName[i] := '';
1155 ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1156 end;
1157
1158 //CoolBar
1159 ini.EraseSection('MainCoolBar');
1160 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1161 CoolSet := MainCoolSet[i];
1162 ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1163 ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1164 ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1165 end;
1166 ini.EraseSection('ListCoolBar');
1167 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1168 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1169 CoolSet := ListCoolSet[i];
1170 ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1171 ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1172 ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1173 end;
1174 ini.EraseSection('BrowserCoolBar');
1175 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1176 CoolSet := BrowserCoolSet[i];
1177 ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1178 ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1179 ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1180 end;
1181
1182 //???若????
1183 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1184 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1185 ini.WriteBool('Abon','Popup',FPopUpAbon);
1186 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1187 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1188
1189 ini.UpdateFile;
1190 finally
1191 ini.Free;
1192 end;
1193 end;
1194
1195 //荐?????<?ゃ???絖?(name & mail)
1196 procedure TSetting.WriteNameMailSettingFile();
1197 var
1198 i: Integer;
1199 ini: TMemIniFile;
1200 begin
1201 ini := TMemIniFile.Create(GetFileName());
1202 try
1203 ini.EraseSection('Name');
1204 ini.EraseSection('Mail');
1205 ini.EraseSection('SelectText');
1206 for i := 0 to FNameList.Count - 1 do begin
1207 ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1208 if i >= 39 then
1209 Break;
1210 end;
1211 for i := 0 to FMailList.Count - 1 do begin
1212 ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1213 if i >= 39 then
1214 Break;
1215 end;
1216 for i := 0 to FSelectTextList.Count - 1 do begin
1217 ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1218 if i >= 39 then
1219 Break;
1220 end;
1221 ini.UpdateFile;
1222 finally
1223 ini.Free;
1224 end;
1225 end;
1226
1227 procedure TSetting.WriteFolderSettingFile();
1228 var
1229 ini: TMemIniFile;
1230 begin
1231 ini := TMemIniFile.Create(GetFileName());
1232 try
1233 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1234 ini.DeleteKey('Folder', 'LogFolder')
1235 else
1236 ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1237 ini.UpdateFile;
1238 finally
1239 ini.Free;
1240 end;
1241 end;
1242 //?炊?贋?亥??oardURL??篆?絖?
1243 procedure TSetting.WriteBoardURLSettingFile();
1244 var
1245 ini: TMemIniFile;
1246 i : Integer;
1247 oldcount : Integer;
1248 begin
1249 ini := TMemIniFile.Create(GetBoardURLFileName());
1250 try
1251 oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1252 ini.WriteInteger('URL','count',FBoardURLs.Count);
1253 ini.WriteInteger('URL','selected',BoardURLSelected);
1254 for i := 0 to FBoardURLs.Count -1 do begin
1255 ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1256 end;
1257 if oldcount > FBoardURLs.Count then begin
1258 for i := FBoardURLs.Count to oldcount do begin
1259 ini.DeleteKey('URL',IntToStr(i+1));
1260 end;
1261 end;
1262 ini.UpdateFile;
1263 finally
1264 ini.Free;
1265 end;
1266 end;
1267
1268 {$R-}
1269 //???鴻????????????????/span>
1270 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1271 begin
1272 Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1273 end;
1274
1275 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1276 begin
1277 Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1278 end;
1279
1280 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1281 begin
1282 Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1283 end;
1284 {$IFDEF DEBUG}
1285 {$R+}
1286 {$ENDIF}
1287
1288 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1289 begin
1290 if index in [0..Length(FBBSColumnWidth) - 1] then
1291 FBBSColumnWidth[index] := value;
1292 end;
1293
1294 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1295 begin
1296 if index in [0..Length(FCategoryColumnWidth) - 1] then
1297 FCategoryColumnWidth[index] := value;
1298 end;
1299
1300 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1301 begin
1302 if index in [0..Length(FBoardColumnWidth) - 1] then
1303 FBoardColumnWidth[index] := value;
1304 end;
1305
1306 function TSetting.GetSoundCount: Integer;
1307 begin
1308 Result := Length(SOUND_NAME);
1309 end;
1310
1311 function TSetting.GetSoundName(Index: Integer): string;
1312 begin
1313 if (Index < GetSoundCount) and (Index >= 0) then
1314 Result := SOUND_NAME[Index].Name
1315 else
1316 Result := '';
1317 end;
1318
1319 function TSetting.GetSoundViewName(Index: Integer): string;
1320 begin
1321 if (Index < GetSoundCount) and (Index >= 0) then
1322 Result := SOUND_NAME[Index].ViewName
1323 else
1324 Result := '';
1325 end;
1326
1327 function TSetting.GetSoundFileName(Index: Integer): string;
1328 begin
1329 if (Index < GetSoundCount) and (Index >= 0) then
1330 Result := SOUND_NAME[Index].FileName
1331 else
1332 Result := '';
1333 end;
1334
1335 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1336 begin
1337 if (Index < GetSoundCount) and (Index >= 0) then
1338 SOUND_NAME[Index].FileName := value;
1339 end;
1340
1341 function TSetting.FindSoundFileName(Name: string): string;
1342 var
1343 i: Integer;
1344 begin
1345 for i := 0 to GetSoundCount - 1 do begin
1346 if SoundName[i] = Name then begin
1347 Result := SoundFileName[i];
1348 Exit;
1349 end;
1350 end;
1351 Result := '';
1352 end;
1353
1354 function TSetting.Encrypt(s: string): string;
1355 var
1356 cryptObj: THogeCryptAuto;
1357 inputStream, outputStream: TStringStream;
1358 begin
1359 inputStream := TStringStream.Create(s);
1360 outputStream := TStringStream.Create('');
1361 cryptObj := THogeCryptAuto.Create;
1362 try
1363 // ???桁??
1364 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1365
1366 // ???ゃ?????????у?荀?????????????鴻???????
1367 Result := HogeBase64Encode(outputStream.DataString);
1368 finally
1369 cryptObj.Free;
1370 outputStream.Free;
1371 inputStream.Free;
1372 end;
1373 end;
1374
1375 function TSetting.Decrypt(s: string): string;
1376 var
1377 cryptObj: THogeCryptAuto;
1378 inputStream, outputStream: TStringStream;
1379 begin
1380 try
1381 inputStream := TStringStream.Create(HogeBase64Decode(s));
1382 except
1383 Result := '';
1384 Exit;
1385 end;
1386 outputStream := TStringStream.Create('');
1387 cryptObj := THogeCryptAuto.Create;
1388 try
1389 // 緇??/span>
1390 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1391 Result := outputStream.DataString;
1392 finally
1393 cryptObj.Free;
1394 outputStream.Free;
1395 inputStream.Free;
1396 end;
1397 end;
1398
1399 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1400 begin
1401 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1402 Result := FMainCoolBar[Index]
1403 else begin
1404 Result.FCoolID := -1;
1405 Result.FCoolWidth := -1;
1406 Result.FCoolBreak := False;
1407 end;
1408 end;
1409
1410 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1411 begin
1412 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1413 Result := FListCoolBar[Index]
1414 else begin
1415 Result.FCoolID := -1;
1416 Result.FCoolWidth := -1;
1417 Result.FCoolBreak := False;
1418 end;
1419 end;
1420
1421 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1422 begin
1423 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1424 Result := FBrowserCoolBar[Index]
1425 else begin
1426 Result.FCoolID := -1;
1427 Result.FCoolWidth := -1;
1428 Result.FCoolBreak := False;
1429 end;
1430 end;
1431
1432 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1433 begin
1434 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1435 FMainCoolBar[Index] := CoolSet;
1436 end;
1437
1438 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1439 begin
1440 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1441 FListCoolBar[Index] := CoolSet;
1442 end;
1443
1444 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1445 begin
1446 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1447 FBrowserCoolBar[Index] := CoolSet;
1448 end;
1449
1450 //url.ini????????????????????
1451 procedure TSetting.MakeURLIniFile();
1452 var
1453 ini: TMemIniFile;
1454 begin
1455 ini := TMemIniFile.Create(GetBoardURLFileName());
1456 try
1457 ini.WriteInteger('URL','count',2);
1458 ini.WriteInteger('URL','selected',2);
1459 ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1460 ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1461 ini.UpdateFile;
1462 finally
1463 ini.Free;
1464 end;
1465 end;
1466
1467 (*************************************************************************
1468 *???若?????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1469 *************************************************************************)
1470 function TSetting.GetBoardFileName: string;
1471 begin
1472 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1473 end;
1474
1475 (*************************************************************************
1476 *???若?????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1477 *************************************************************************)
1478 function TSetting.GetCustomBoardFileName: string;
1479 begin
1480 Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1481 end;
1482
1483 (*************************************************************************
1484 *???若?????c??????????
1485 *************************************************************************)
1486 function TSetting.GetBoardDir: string;
1487 begin
1488 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1489 end;
1490
1491 (*************************************************************************
1492 *???潟???????????????弱????緇?
1493 *************************************************************************)
1494 function TSetting.GetHtmlTempFileName: string;
1495 begin
1496 Result := TEMP_FOLDER;
1497 end;
1498
1499
1500 (*************************************************************************
1501 *絎?茵????<?ゃ????????????緇?
1502 *************************************************************************)
1503 function TSetting.GetAppDir: string;
1504 begin
1505 Result := ExtractFilePath(Application.ExeName);
1506 end;
1507
1508 (*************************************************************************
1509 *TempHtml???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1510 *************************************************************************)
1511 function TSetting.GetTempFolder: string;
1512 begin
1513 Result := GetAppDir + TEMP_FOLDER;
1514 end;
1515
1516 (*************************************************************************
1517 *sent.ini???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1518 *************************************************************************)
1519 function TSetting.GetSentFileName: string;
1520 begin
1521 Result := GetAppDir + SENT_FILE_NAME;
1522 end;
1523
1524 (*************************************************************************
1525 *outbox.ini???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1526 *************************************************************************)
1527 function TSetting.GetOutBoxFileName: string;
1528 begin
1529 Result := GetAppDir + OUTBOX_FILE_NAME;
1530 end;
1531
1532 (*************************************************************************
1533 *Config??????????緇?
1534 *************************************************************************)
1535 function TSetting.GetConfigDir: string;
1536 begin
1537 Result := IncludeTrailingPathDelimiter(GetAppDir + CONFIG_DIR_NAME);
1538 end;
1539
1540 function TSetting.GetStyleSheetDir: string;
1541 begin
1542 Result := IncludeTrailingPathDelimiter(GetConfigDir + CSS_DIR_NAME);
1543 end;
1544
1545 function TSetting.GetSkinDir: string;
1546 begin
1547 Result := IncludeTrailingPathDelimiter(GetConfigDir + SKIN_DIR_NAME);
1548 end;
1549
1550 function TSetting.GetSkinHeaderFileName: string;
1551 begin
1552 Result := CSSFileName + SKIN_HEADER_FILE_NAME;
1553 end;
1554
1555 function TSetting.GetSkinFooterFileName: string;
1556 begin
1557 Result := CSSFileName + SKIN_FOOTER_FILE_NAME;
1558 end;
1559
1560 function TSetting.GetSkinNewResFileName: string;
1561 begin
1562 Result := CSSFileName + SKIN_NEWRES_FILE_NAME;
1563 end;
1564
1565 function TSetting.GetSkinResFileName: string;
1566 begin
1567 Result := CSSFileName + SKIN_RES_FILE_NAME;
1568 end;
1569
1570 function TSetting.GetSkinBookmarkFileName: string;
1571 begin
1572 Result := CSSFileName + SKIN_BOOKMARK_FILE_NAME;
1573 end;
1574
1575 function TSetting.GetSkinNewmarkFileName: string;
1576 begin
1577 Result := CSSFileName + SKIN_NEWMARK_FILE_NAME;
1578 end;
1579
1580 function TSetting.GetNGWordsDir: string;
1581 begin
1582 Result := IncludeTrailingPathDelimiter(GetConfigDir + NGWORDs_DIR_NAME);
1583 end;
1584
1585 function TSetting.GetBoardPlugInDir: string;
1586 begin
1587 Result := IncludeTrailingPathDelimiter(GetConfigDir + BOARD_PLUGIN_DIR_NAME);
1588 end;
1589
1590 procedure TSetting.SetUseCSS( value: Boolean );
1591 begin
1592
1593 FUseCSS := value;
1594
1595 FUseSkin :=
1596 UseCSS and
1597 (Pos( GetSkinDir, CSSFileName ) > 0) and
1598 FileExists( GetSkinHeaderFileName );
1599
1600 end;
1601
1602 procedure TSetting.SetCSSFileName( fileName: string );
1603 begin
1604
1605 FCSSFileName := fileName;
1606
1607 FUseSkin :=
1608 UseCSS and
1609 (Pos( GetSkinDir, CSSFileName ) > 0) and
1610 FileExists( GetSkinHeaderFileName );
1611
1612 end;
1613
1614 end.
1615

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