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.54 - (show annotations) (download) (as text)
Thu Aug 12 06:56:59 2004 UTC (19 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.53: +0 -1 lines
File MIME type: text/x-pascal
[最新100レスのみ表示] を [レスの表示範囲を設定] に置き換えるようにした。

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

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