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.53 - (show annotations) (download) (as text)
Sat Aug 7 18:02:49 2004 UTC (19 years, 8 months ago) by q9_
Branch: MAIN
Changes since 1.52: +12 -0 lines
File MIME type: text/x-pascal
Dat落ちしたスレのソート順を指定できるようにした

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.DeleteKey( 'Thread', 'OnlyAHundredRes' ); // ?ゃ??荐????????/span>
1204 ini.WriteInteger('Thread', 'ResRange', FResRange);
1205 ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
1206 //???医???ょ∈茯?
1207 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1208 //腟?篋?腆肴?
1209 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1210 //AllTabClose
1211 ini.WriteBool('Function','ShowDialogForAllTabClose', FShowDialogForAllTabClose);
1212 //Samba
1213 ini.WriteBool('Function','UseSamba', FUseSamba);
1214 //ResAnchorjamp
1215 ini.WriteBool('Function', 'ResAnchoJamp', ResAnchorJamp);
1216
1217 //???≪?????c???????????≪????茵?ず
1218 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1219 //???鴻???????≪???????????若???若????
1220 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1221 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1222
1223 //茯?荐主?????若??D?祉???鴻???若??
1224 ini.WriteString('Attestation', 'UserID', FUserID);
1225 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1226 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1227 ini.WriteBool('Attestation', 'FForcedLogin', FForcedLogin);
1228 ini.WriteString('Attestation', 'FDolibURL', FDolibURL);
1229
1230 //URL??????????莎桁???≪????/span>
1231 ini.WriteBool('URLApp', 'Select', FURLApp);
1232 ini.WriteString('URLApp', 'File', FURLAppFile);
1233
1234 //mailto????????????篏?
1235 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1236
1237 //???????≪????篏?臀?/span>
1238 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1239
1240 //?≪?????鴻????/span>
1241 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1242 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1243 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1244 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1245
1246 //?糸????????ャ??/span>
1247 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1248 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1249 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1250 ini.WriteInteger('Browser', 'AutoMaximize', Ord( FBrowserAutoMaximize ) );
1251
1252 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
1253 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1254 ini.WriteBool('ThreadList', 'NonAcquiredCount', FNonAcquiredCount);
1255 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1256 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1257 ini.WriteInteger('ThreadList', 'SelectInterval', FSelectInterval);
1258 //?純?若????
1259 ini.WriteInteger('ThreadList', 'BBSSortIndex', FBBSSortIndex);
1260 ini.WriteBool('ThreadList', 'BBSSortOrder', FBBSSortOrder);
1261 ini.WriteInteger('ThreadList', 'CategorySortIndex', FCategorySortIndex);
1262 ini.WriteBool('ThreadList', 'CategorySortOrder', FCategorySortOrder);
1263 ini.WriteInteger('ThreadList', 'BoardSortIndex', FBoardSortIndex);
1264 ini.WriteBool('ThreadList', 'BoardSortOrder', FBoardSortOrder);
1265 ini.WriteInteger('ThreadList', 'DatOchiSortIndex', FDatOchiSortIndex);
1266 ini.WriteBool('ThreadList', 'DatOchiSortOrder', FDatOchiSortOrder);
1267
1268 //?吾??莨若?炊?????激?恰???私戎??┃絎?
1269 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1270 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1271 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1272
1273 //???鴻????????
1274 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1275 ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1276 end;
1277 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1278 ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1279 end;
1280 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1281 ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1282 end;
1283
1284 //?泣???潟??
1285 for i := 0 to GetSoundCount - 1 do begin
1286 if not FileExists(SoundFileName[i]) then
1287 SoundFileName[i] := '';
1288 ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1289 end;
1290
1291 //CoolBar
1292 ini.EraseSection('MainCoolBar');
1293 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1294 CoolSet := MainCoolSet[i];
1295 ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1296 ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1297 ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1298 end;
1299 ini.EraseSection('ListCoolBar');
1300 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1301 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1302 CoolSet := ListCoolSet[i];
1303 ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1304 ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1305 ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1306 end;
1307 ini.EraseSection('BrowserCoolBar');
1308 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1309 CoolSet := BrowserCoolSet[i];
1310 ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1311 ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1312 ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1313 end;
1314
1315 //???若????
1316 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1317 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1318 ini.WriteBool('Abon','Popup',FPopUpAbon);
1319 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1320 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1321 ini.WriteBool('Abon','DeleteSyria',FDeleteSyria);
1322
1323 // ?????c??/span>
1324 ini.WriteBool( 'Editor', 'SpaceToNBSP', FSpaceToNBSP );
1325 ini.WriteBool( 'Editor', 'AmpToCharRef', FAmpToCharRef );
1326
1327 ini.WriteBool('TabAuto', 'TabAutoSave', FTabAutoSave);
1328 ini.WriteBool('TabAuto', 'TabAutoLoad', FTabAutoLoad);
1329
1330 ini.UpdateFile;
1331 finally
1332 ini.Free;
1333 end;
1334 end;
1335
1336 //荐?????<?ゃ???絖?(name & mail)
1337 procedure TSetting.WriteNameMailSettingFile();
1338 var
1339 i: Integer;
1340 ini: TMemIniFile;
1341 begin
1342 ini := TMemIniFile.Create(GetFileName());
1343 try
1344 ini.EraseSection('Name');
1345 ini.EraseSection('Mail');
1346 ini.EraseSection('SelectText');
1347 for i := 0 to FNameList.Count - 1 do begin
1348 ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1349 if i >= 39 then
1350 Break;
1351 end;
1352 for i := 0 to FMailList.Count - 1 do begin
1353 ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1354 if i >= 39 then
1355 Break;
1356 end;
1357 for i := 0 to FSelectTextList.Count - 1 do begin
1358 ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1359 if i >= 39 then
1360 Break;
1361 end;
1362 ini.UpdateFile;
1363 finally
1364 ini.Free;
1365 end;
1366 end;
1367
1368 procedure TSetting.WriteFolderSettingFile();
1369 var
1370 ini: TMemIniFile;
1371 begin
1372 ini := TMemIniFile.Create(GetFileName());
1373 try
1374 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1375 ini.DeleteKey('Folder', 'LogFolder')
1376 else
1377 ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1378 ini.UpdateFile;
1379 finally
1380 ini.Free;
1381 end;
1382 end;
1383 //?炊?贋?亥??oardURL??篆?絖?
1384 procedure TSetting.WriteBoardURLSettingFile();
1385 var
1386 ini: TMemIniFile;
1387 i : Integer;
1388 oldcount : Integer;
1389 begin
1390 ini := TMemIniFile.Create(GetBoardURLFileName());
1391 try
1392 oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1393 ini.WriteInteger('URL','count',FBoardURLs.Count);
1394 ini.WriteInteger('URL','selected',BoardURLSelected);
1395 for i := 0 to FBoardURLs.Count -1 do begin
1396 ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1397 end;
1398 if oldcount > FBoardURLs.Count then begin
1399 for i := FBoardURLs.Count to oldcount do begin
1400 ini.DeleteKey('URL',IntToStr(i+1));
1401 end;
1402 end;
1403 ini.UpdateFile;
1404 finally
1405 ini.Free;
1406 end;
1407 end;
1408
1409 {$R-}
1410 //???鴻????????????????/span>
1411 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1412 begin
1413 Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1414 end;
1415
1416 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1417 begin
1418 Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1419 end;
1420
1421 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1422 begin
1423 Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1424 end;
1425 {$IFDEF DEBUG}
1426 {$R+}
1427 {$ENDIF}
1428
1429 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1430 begin
1431 if index in [0..Length(FBBSColumnWidth) - 1] then
1432 FBBSColumnWidth[index] := value;
1433 end;
1434
1435 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1436 begin
1437 if index in [0..Length(FCategoryColumnWidth) - 1] then
1438 FCategoryColumnWidth[index] := value;
1439 end;
1440
1441 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1442 begin
1443 if index in [0..Length(FBoardColumnWidth) - 1] then
1444 FBoardColumnWidth[index] := value;
1445 end;
1446
1447 function TSetting.GetSoundCount: Integer;
1448 begin
1449 Result := Length(SOUND_NAME);
1450 end;
1451
1452 function TSetting.GetSoundName(Index: Integer): string;
1453 begin
1454 if (Index < GetSoundCount) and (Index >= 0) then
1455 Result := SOUND_NAME[Index].Name
1456 else
1457 Result := '';
1458 end;
1459
1460 function TSetting.GetSoundViewName(Index: Integer): string;
1461 begin
1462 if (Index < GetSoundCount) and (Index >= 0) then
1463 Result := SOUND_NAME[Index].ViewName
1464 else
1465 Result := '';
1466 end;
1467
1468 function TSetting.GetSoundFileName(Index: Integer): string;
1469 begin
1470 if (Index < GetSoundCount) and (Index >= 0) then
1471 Result := SOUND_NAME[Index].FileName
1472 else
1473 Result := '';
1474 end;
1475
1476 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1477 begin
1478 if (Index < GetSoundCount) and (Index >= 0) then
1479 SOUND_NAME[Index].FileName := value;
1480 end;
1481
1482 function TSetting.FindSoundFileName(Name: string): string;
1483 var
1484 i: Integer;
1485 begin
1486 for i := 0 to GetSoundCount - 1 do begin
1487 if SoundName[i] = Name then begin
1488 Result := SoundFileName[i];
1489 Exit;
1490 end;
1491 end;
1492 Result := '';
1493 end;
1494
1495 function TSetting.Encrypt(s: string): string;
1496 var
1497 cryptObj: THogeCryptAuto;
1498 inputStream, outputStream: TStringStream;
1499 begin
1500 inputStream := TStringStream.Create(s);
1501 outputStream := TStringStream.Create('');
1502 cryptObj := THogeCryptAuto.Create;
1503 try
1504 // ???桁??
1505 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1506
1507 // ???ゃ?????????у?荀?????????????鴻???????
1508 Result := HogeBase64Encode(outputStream.DataString);
1509 finally
1510 cryptObj.Free;
1511 outputStream.Free;
1512 inputStream.Free;
1513 end;
1514 end;
1515
1516 function TSetting.Decrypt(s: string): string;
1517 var
1518 cryptObj: THogeCryptAuto;
1519 inputStream, outputStream: TStringStream;
1520 begin
1521 try
1522 inputStream := TStringStream.Create(HogeBase64Decode(s));
1523 except
1524 Result := '';
1525 Exit;
1526 end;
1527 outputStream := TStringStream.Create('');
1528 cryptObj := THogeCryptAuto.Create;
1529 try
1530 // 緇??/span>
1531 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1532 Result := outputStream.DataString;
1533 finally
1534 cryptObj.Free;
1535 outputStream.Free;
1536 inputStream.Free;
1537 end;
1538 end;
1539
1540 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1541 begin
1542 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1543 Result := FMainCoolBar[Index]
1544 else begin
1545 Result.FCoolID := -1;
1546 Result.FCoolWidth := -1;
1547 Result.FCoolBreak := False;
1548 end;
1549 end;
1550
1551 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1552 begin
1553 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1554 Result := FListCoolBar[Index]
1555 else begin
1556 Result.FCoolID := -1;
1557 Result.FCoolWidth := -1;
1558 Result.FCoolBreak := False;
1559 end;
1560 end;
1561
1562 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1563 begin
1564 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1565 Result := FBrowserCoolBar[Index]
1566 else begin
1567 Result.FCoolID := -1;
1568 Result.FCoolWidth := -1;
1569 Result.FCoolBreak := False;
1570 end;
1571 end;
1572
1573 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1574 begin
1575 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1576 FMainCoolBar[Index] := CoolSet;
1577 end;
1578
1579 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1580 begin
1581 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1582 FListCoolBar[Index] := CoolSet;
1583 end;
1584
1585 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1586 begin
1587 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1588 FBrowserCoolBar[Index] := CoolSet;
1589 end;
1590
1591 //url.ini????????????????????
1592 procedure TSetting.MakeURLIniFile();
1593 var
1594 ini: TMemIniFile;
1595 begin
1596 ini := TMemIniFile.Create(GetBoardURLFileName());
1597 try
1598 ini.WriteInteger('URL','count',2);
1599 ini.WriteInteger('URL','selected',2);
1600 ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1601 ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1602 ini.UpdateFile;
1603 finally
1604 ini.Free;
1605 end;
1606 end;
1607
1608 (*************************************************************************
1609 *???若?????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1610 *************************************************************************)
1611 function TSetting.GetBoardFileName: string;
1612 begin
1613 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1614 end;
1615
1616 (*************************************************************************
1617 *???若?????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1618 *************************************************************************)
1619 function TSetting.GetCustomBoardFileName: string;
1620 begin
1621 Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1622 end;
1623
1624 (*************************************************************************
1625 *???若?????c??????????
1626 *************************************************************************)
1627 function TSetting.GetBoardDir: string;
1628 begin
1629 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1630 end;
1631
1632 (*************************************************************************
1633 *???潟???????????????弱????緇?
1634 *************************************************************************)
1635 function TSetting.GetHtmlTempFileName: string;
1636 begin
1637 Result := TEMP_FOLDER;
1638 end;
1639
1640
1641 (*************************************************************************
1642 *絎?茵????<?ゃ????????????緇?
1643 *************************************************************************)
1644 function TSetting.GetAppDir: string;
1645 begin
1646 Result := ExtractFilePath(Application.ExeName);
1647 end;
1648
1649 (*************************************************************************
1650 *TempHtml???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1651 *************************************************************************)
1652 function TSetting.GetTempFolder: string;
1653 begin
1654 Result := GetAppDir + TEMP_FOLDER;
1655 end;
1656
1657 (*************************************************************************
1658 *sent.ini???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1659 *************************************************************************)
1660 function TSetting.GetSentFileName: string;
1661 begin
1662 Result := GetAppDir + SENT_FILE_NAME;
1663 end;
1664
1665 (*************************************************************************
1666 *outbox.ini???<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
1667 *************************************************************************)
1668 function TSetting.GetOutBoxFileName: string;
1669 begin
1670 Result := GetAppDir + OUTBOX_FILE_NAME;
1671 end;
1672
1673 (*************************************************************************
1674 *Config??????????緇?
1675 *************************************************************************)
1676 function TSetting.GetConfigDir: string;
1677 begin
1678 Result := IncludeTrailingPathDelimiter(GetAppDir + CONFIG_DIR_NAME);
1679 end;
1680
1681 function TSetting.GetStyleSheetDir: string;
1682 begin
1683 Result := IncludeTrailingPathDelimiter(GetConfigDir + CSS_DIR_NAME);
1684 end;
1685
1686 function TSetting.GetSkinDir: string;
1687 begin
1688 Result := IncludeTrailingPathDelimiter(GetConfigDir + SKIN_DIR_NAME);
1689 end;
1690
1691 function TSetting.GetSkinHeaderFileName: string;
1692 begin
1693 Result := CSSFileName + SKIN_HEADER_FILE_NAME;
1694 end;
1695
1696 function TSetting.GetSkinFooterFileName: string;
1697 begin
1698 Result := CSSFileName + SKIN_FOOTER_FILE_NAME;
1699 end;
1700
1701 function TSetting.GetSkinNewResFileName: string;
1702 begin
1703 Result := CSSFileName + SKIN_NEWRES_FILE_NAME;
1704 end;
1705
1706 function TSetting.GetSkinResFileName: string;
1707 begin
1708 Result := CSSFileName + SKIN_RES_FILE_NAME;
1709 end;
1710
1711 function TSetting.GetSkinBookmarkFileName: string;
1712 begin
1713 Result := CSSFileName + SKIN_BOOKMARK_FILE_NAME;
1714 end;
1715
1716 function TSetting.GetSkinNewmarkFileName: string;
1717 begin
1718 Result := CSSFileName + SKIN_NEWMARK_FILE_NAME;
1719 end;
1720
1721 function TSetting.GetNGWordsDir: string;
1722 begin
1723 Result := IncludeTrailingPathDelimiter(GetConfigDir + NGWORDs_DIR_NAME);
1724 end;
1725
1726 function TSetting.GetBoardPlugInDir: string;
1727 begin
1728 Result := IncludeTrailingPathDelimiter(GetConfigDir + BOARD_PLUGIN_DIR_NAME);
1729 end;
1730
1731 procedure TSetting.SetUseCSS( value: Boolean );
1732 begin
1733
1734 FUseCSS := value;
1735
1736 FUseSkin :=
1737 UseCSS and
1738 (Pos( GetSkinDir, CSSFileName ) > 0) and
1739 FileExists( GetSkinHeaderFileName );
1740
1741 end;
1742
1743 procedure TSetting.SetCSSFileName( fileName: string );
1744 begin
1745
1746 FCSSFileName := fileName;
1747
1748 FUseSkin :=
1749 UseCSS and
1750 (Pos( GetSkinDir, CSSFileName ) > 0) and
1751 FileExists( GetSkinHeaderFileName );
1752
1753 end;
1754
1755 function TSetting.GetSambaFileName: string;
1756 begin
1757 Result := GetAppDir + SAMBATIME_FILE_NAME;
1758 end;
1759 //?炊?贋?育?ゅ??????眼?????鴻??篆?絖????<?ゃ??/span>
1760 function TSetting.GetIgnoreFileName: string;
1761 begin
1762 Result := GetConfigDir + IGNORE_FILE_NAME;
1763 end;
1764
1765 end.
1766
1767

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