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.51 - (show annotations) (download) (as text)
Wed Aug 4 03:36:53 2004 UTC (19 years, 8 months ago) by yoffy
Branch: MAIN
Changes since 1.50: +8 -3 lines
File MIME type: text/x-pascal
起動時に最新100レスのみ表示に設定するオプションが、
他の表示範囲も選べるようになった。

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

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