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

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