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

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