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

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