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.38 - (show annotations) (download) (as text)
Wed Jun 2 16:03:21 2004 UTC (19 years, 10 months ago) by h677
Branch: MAIN
Changes since 1.37: +24 -10 lines
File MIME type: text/x-pascal
全てのタブ閉じるの時に確認ダイアログを出すオプションと
レスアンカーでジャンプしないオプションの追加

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

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