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.18 - (show annotations) (download) (as text)
Sun Nov 16 16:33:31 2003 UTC (20 years, 5 months ago) by yoffy
Branch: MAIN
Changes since 1.17: +10 -0 lines
File MIME type: text/x-pascal
・GetBoardDir を追加。

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

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