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.41 - (show annotations) (download) (as text)
Sat Jun 5 14:34:11 2004 UTC (19 years, 10 months ago) by yoffy
Branch: MAIN
Changes since 1.40: +6 -2 lines
File MIME type: text/x-pascal
「&」を & に置換するようになった。

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

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