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

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