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.39 - (show annotations) (download) (as text)
Thu Jun 3 11:54:51 2004 UTC (19 years, 10 months ago) by yoffy
Branch: MAIN
Changes since 1.38: +11 -0 lines
File MIME type: text/x-pascal
スレッド一覧からスレをクリックした際にブラウザを最大化するかどうかの設定を追加。

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

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