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

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