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.4 - (show annotations) (download) (as text)
Mon Aug 18 08:13:38 2003 UTC (20 years, 8 months ago) by h677
Branch: MAIN
CVS Tags: b35
Changes since 1.3: +0 -4 lines
File MIME type: text/x-pascal
連続する同英字をNGにする機能の有効性が低いので削除した

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 type
15 TGikoTabPosition = (gtpTop, gtpBottom); // ?帥??篏?臀?/span>
16 TGikoTabAppend = (gtaFirst, gtpLast); // ?帥??菴遵??篏?臀?/span>
17 TGikoTabStyle = (gtsTab, gtsButton, gtsFlat); // ?帥???鴻?帥?ゃ??/span>
18 TGikoListOrientation = (gloHorizontal, gloVertical); // ???鴻?????眼?紙梓綛?/span>
19 TGikoListState = (glsMax, glsNormal, glsMin); // ???鴻???泣?ゃ?榊?倶??
20 // ???????≪????茵?ず篏?臀?/span>
21 TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
22 gppRight, gppCenter, gppLeft,
23 gppRightBottom, gppBottom, gppLeftBottom);
24 //???????ャ?若?泣?ゃ??/span>
25 TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
26
27 //CoolBar荐?????潟?若??
28 TCoolSet = record
29 FCoolID: Integer;
30 FCoolWidth: Integer;
31 FCoolBreak: Boolean;
32 end;
33
34 TSetting = class(TObject)
35 private
36 //??篆<???????<?泣?ゃ??/span>
37 FRecvBufferSize: Integer;
38 //HTTP1.1篏睡??/span>
39 FProtocol: Boolean;
40 //???????傑・膓?HTTP1.1篏睡??/span>
41 FProxyProtocol: Boolean;
42
43 //???????件?茯?昭???
44 FReadProxy: Boolean;
45 FReadProxyAddress: string;
46 FReadProxyPort: Integer;
47 FReadProxyUserID: string;
48 FReadProxyPassword: string;
49
50 //???????件??梧昭???
51 FWriteProxy: Boolean;
52 FWriteProxyAddress: string;
53 FWriteProxyPort: Integer;
54 FWriteProxyUserID: string;
55 FWriteProxyPassword: string;
56
57 //???c????????
58 FCabinetFontName: string;
59 FCabinetFontSize: Integer;
60 FCabinetFontBold: Boolean;
61 FCabinetFontItalic: Boolean;
62 FCabinetFontColor: TColor;
63 FCabinetBackColor: TColor;
64
65 //???鴻??
66 FListFontName: string;
67 FListFontSize: Integer;
68 FListFontBold: Boolean;
69 FListFontItalic: Boolean;
70 FListFontColor: TColor;
71 FListBackColor: TColor;
72
73 //????????/span>
74 //FBrowserFontColor: TColor;
75 //FBrowserBackColor: TColor;
76 //FBrowserFontSize: Integer;
77
78 //?????c??/span>
79 FEditorFontName: string;
80 FEditorFontSize: Integer;
81 FEditorFontBold: Boolean;
82 FEditorFontItalic: Boolean;
83 FEditorFontColor: TColor;
84 FEditorBackColor: TColor;
85
86 //?帥???????潟??
87 FBrowserTabFontName: string;
88 FBrowserTabFontSize: Integer;
89 FBrowserTabFontBold: Boolean;
90 FBrowserTabFontItalic: Boolean;
91
92 //???潟?????c?潟????/span>
93 FHintFontName: string;
94 FHintFontSize: Integer;
95 //FHintFontBold: Boolean;
96 //FHintFontItalic: Boolean;
97 FHintFontColor: TColor;
98 FHintBackColor: TColor;
99
100 //???c?潟?????泣?ゃ??/span>
101 FWindowTop: Integer;
102 FWindowLeft: Integer;
103 FWindowHeight: Integer;
104 FWindowWidth: Integer;
105 FWindowMax: Boolean;
106 //???鴻?????ャ?若?鴻?帥?ゃ??/span>
107 FListStyle: TViewStyle;
108
109 //???若?????取;腓?/span>
110 FStdToolBarVisible: Boolean;
111 FAddressBarVisible: Boolean;
112 FLinkBarVisible: Boolean;
113 FListToolBarVisible: Boolean;
114 FListNameBarVisible: Boolean;
115 FBrowserToolBarVisible: Boolean;
116 FBrowserNameBarVisible: Boolean;
117
118 //???????吟?帥??
119 FBrowserTabVisible: Boolean;
120 FBrowserTabPosition: TGikoTabPosition;
121 FBrowserTabAppend: TGikoTabAppend;
122 FBrowserTabStyle: TGikoTabStyle;
123
124 //?<???祉?若?吾????/span>
125 FMessageBarVisible: Boolean;
126 FMessegeBarHeight: Integer;
127
128 //?鴻???若?帥?鴻????/span>
129 FStatusBarVisible: Boolean;
130
131 //???c????????????祉?泣?ゃ??/span>
132 FCabinetVisible: Boolean;
133 FCabinetWidth: Integer;
134
135 //???鴻???祉???????吟?泣?ゃ??/span>
136 FListOrientation: TGikoListOrientation;
137 FListHeight: Integer;
138 FListHeightState: TGikoListState;
139 FListWidth: Integer;
140 FListWidthState: TGikoListState;
141 // FListHeightMax: Boolean;
142 // FListWidthMax: Boolean;
143
144 //??篆∞???????祉?<?若??/span>
145 FNameList: TStringList;
146 FMailList: TStringList;
147
148 //?????c?帥?若???c?潟?????泣?ゃ??/span>
149 FEditWindowTop: Integer;
150 FEditWindowLeft: Integer;
151 FEditWindowHeight: Integer;
152 FEditWindowWidth: Integer;
153 FEditWindowMax: Boolean;
154
155 //???鴻????埈;腓?/span>
156 FListViewNo: Boolean;
157 //CSS茵?ず
158 FUseCSS: Boolean;
159 //CSS???<?ゃ????
160 FCSSFileName: string;
161 //mail罨?茵?ず
162 FShowMail: Boolean;
163 //???≪?????c???????鴻???????≪????茵?ず
164 FUnActivePopup: Boolean;
165 //???鴻???????≪???????????若???若????
166 FResPopupHeaderBold: Boolean;
167
168 //???違????????
169 FLogFolder: string;
170 FNewLogFolder: string;
171
172 //???鴻???????????????若?泣?ゃ??/span>
173 FBBSColumnWidth: array[0..0] of Integer;
174 FCategoryColumnWidth: array[0..3] of Integer;
175 FBoardColumnWidth: array[0..6] of Integer;
176
177 //腟?莨若?炊??絖???
178 FSelectTextList: TStringList;
179
180 //?推?荀?RL
181 FBoardURL2ch: string;
182
183 //???若??D?祉???鴻???若??
184 FUserID: string;
185 FPassword: string;
186 FAutoLogin: Boolean;
187
188 //URL??????????莎桁???≪????/span>
189 FURLApp: Boolean;
190 FURLAppFile: string;
191
192 //mailto????????????篏?
193 FOpenMailer: Boolean;
194
195 //???ょ∈茯?
196 FDeleteMsg: Boolean;
197
198 //CoolBar鐚??<?ゃ?潟?紙?帥?祉???????駈?
199 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
200 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
201 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
202
203 //ToolBar Wrapable
204 FListToolBarWrapable: Boolean;
205 FBrowserToolBarWrapable: Boolean;
206
207 //???????≪????篏?臀?/span>
208 FPopupPosition: TGikoPopupPosition;
209
210 //?≪?????鴻????/span>
211 FURLDisplay: Boolean;
212 FAddressBarTabStop: Boolean;
213 FLinkAddAddressBar: Boolean;
214 FAddressHistoryCount: Integer;
215
216 //?糸????????ャ??/span>
217 FPreviewVisible: Boolean;
218 FPreviewSize: TGikoPreviewSize;
219 FPreviewWait: Integer;
220
221 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟?活;腓?/span>
222 FListIconVisible: Boolean;
223
224 //?吾??莨若?炊?????激?恰????篏睡??┃絎?
225 FUseMachineTime: Boolean;
226 FTimeAdjustSec: Integer;
227 FTimeAdjust: Boolean;
228
229 //???若????
230 FAbonDeleterlo : Boolean; //&rlo;????????
231 FAbonReplaceul : Boolean; //<ul>?帥?違??<br>?帥?違??舟????????
232 FPopUpAbon : Boolean; //???鴻???????≪???????????若????????/span>
233
234 function GetMainCoolSet(Index: Integer): TCoolSet;
235 function GetBoardCoolSet(Index: Integer): TCoolSet;
236 function GetBrowserCoolSet(Index: Integer): TCoolSet;
237 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
238 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
239 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
240
241 function GetBBSColumnWidth(index: Integer): Integer;
242 function GetCategoryColumnWidth(index: Integer): Integer;
243 function GetBoardColumnWidth(index: Integer): Integer;
244 procedure SetBBSColumnWidth(index: Integer; value: Integer);
245 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
246 procedure SetBoardColumnWidth(index: Integer; value: Integer);
247
248 function GetSoundName(Index: Integer): string;
249 function GetSoundViewName(Index: Integer): string;
250 function GetSoundFileName(Index: Integer): string;
251 procedure SetSoundFileName(Index: Integer; value: string);
252 function Encrypt(s: string): string;
253 function Decrypt(s: string): string;
254 protected
255
256 public
257 constructor Create;
258 destructor Destroy; override;
259 function GetFileName: string;
260 procedure ReadSettingFile;
261 procedure WriteSystemSettingFile;
262 procedure WriteWindowSettingFile;
263 procedure WriteNameMailSettingFile;
264 procedure WriteFolderSettingFile();
265 function GetSoundCount: Integer;
266 function FindSoundFileName(Name: string): string;
267
268 //??篆<???????<?泣?ゃ??/span>
269 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
270 //HTTP1.1篏睡??/span>
271 property Protocol: Boolean read FProtocol write FProtocol;
272 //???????傑・膓?HTTP1.1篏睡??/span>
273 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
274
275 property ReadProxy: Boolean read FReadProxy write FReadProxy;
276 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
277 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
278 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
279 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
280
281 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
282 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
283 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
284 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
285 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
286
287 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
288 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
289 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
290 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
291 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
292 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
293
294 property ListFontName: string read FListFontName write FListFontName;
295 property ListFontSize: Integer read FListFontSize write FListFontSize;
296 property ListFontBold: Boolean read FListFontBold write FListFontBold;
297 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
298 property ListFontColor: TColor read FListFontColor write FListFontColor;
299 property ListBackColor: TColor read FListBackColor write FListBackColor;
300
301 // property BrowserFontColor: TColor read FBrowserFontColor write FBrowserFontColor;
302 // property BrowserBackColor: TColor read FBrowserBackColor write FBrowserBackColor;
303 // property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
304
305 property EditorFontName: string read FEditorFontName write FEditorFontName;
306 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
307 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
308 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
309 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
310 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
311
312 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
313 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
314 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
315 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
316
317 property HintFontName: string read FHintFontName write FHintFontName;
318 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
319 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
320 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
321 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
322 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
323
324 property WindowTop: Integer read FWindowTop write FWindowTop;
325 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
326 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
327 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
328 property WindowMax: Boolean read FWindowMax write FWindowMax;
329 property ListStyle: TViewStyle read FListStyle write FListStyle;
330
331 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
332 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
333 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
334 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
335 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
336 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
337 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
338
339 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
340 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
341 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
342 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
343
344 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
345 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
346
347 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
348
349 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
350 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
351
352 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
353 property ListHeight: Integer read FListHeight write FListHeight;
354 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
355 property ListWidth: Integer read FListWidth write FListWidth;
356 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
357 // property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
358 // property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
359
360 property NameList: TStringList read FNameList write FNameList;
361 property MailList: TStringList read FMailList write FMailList;
362 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
363
364 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
365 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
366 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
367 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
368 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
369
370 property ListViewNo: Boolean read FListViewNo write FListViewNo;
371 property UseCSS: Boolean read FUseCSS write FUseCSS;
372 property CSSFileName: string read FCSSFileName write FCSSFileName;
373
374 property ShowMail: Boolean read FShowMail write FShowMail;
375 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
376 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
377
378 property LogFolder: string read FLogFolder write FLogFolder;
379 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
380
381 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
382 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
383 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
384
385 property SoundName[index: Integer]: string read GetSoundName;
386 property SoundViewName[index: Integer]: string read GetSoundViewName;
387 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
388
389 property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
390
391 property UserID: string read FUserID write FUserID;
392 property Password: string read FPassword write FPassword;
393 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
394
395 property URLApp: Boolean read FURLApp write FURLApp;
396 property URLAppFile: string read FURLAppFile write FURLAppFile;
397
398 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
399
400 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
401
402 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
403 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
404 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
405
406 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
407 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
408
409 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
410
411 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
412 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
413 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
414 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
415
416 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
417 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
418 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
419
420 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
421
422 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
423 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
424 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
425
426 //???若????
427 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
428 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
429 property PopUpAbon : Boolean read FPopUpAbon write FPopUpAbon;
430
431 end;
432
433
434
435 implementation
436
437 type
438 TSoundName = record
439 Name: string;
440 ViewName: string;
441 FileName: string;
442 end;
443
444 const
445 INI_FILE_NAME: string = 'gikoNavi.ini';
446 DEFAULT_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
447 DEFAULT_FONT_SIZE: Integer = 9;
448 DEFAULT_FONT_COLOR: string = 'clWindowText';
449 DEFAULT_WINDOW_COLOR: string = 'clWindow';
450 DEFAULT_TAB_FONT_NAME: string = '鐚?竺 鐚違?眼?激????#39;;
451 DEFAULT_TAB_FONT_SIZE: Integer = 9;
452 DEFAULT_2CH_BOARD_URL: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
453 //'http://www.2ch.net/newbbsmenu.html';
454 GIKO_ENCRYPT_TEXT: string = 'gikoNaviEncryptText';
455
456 var
457 SOUND_NAME: array[0..4] of TSoundName = (
458 (Name: 'New'; ViewName: '??緇?????'; FileName: ''),
459 (Name: 'NewDiff'; ViewName: '??緇?????(綏???)'; FileName: ''),
460 (Name: 'NoChange'; ViewName: '???贋??#39;; FileName: ''),
461 // (Name: 'RoundEnd'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
462 // (Name: 'RoundNone'; ViewName: '綏≦??腟?篋?(??緇?????)'; FileName: ''),
463 (Name: 'ResEnd'; ViewName: '???拷??篆≦?篋?'; FileName: ''),
464 (Name: 'Error'; ViewName: '??????#39;; FileName: ''));
465
466 //?潟?潟?鴻????????/span>
467 constructor TSetting.Create();
468 begin
469 FNameList := TStringList.Create;
470 FMailList := TStringList.Create;
471 FSelectTextList := TStringList.Create;
472
473 FNameList.Duplicates := dupIgnore;
474 FMailList.Duplicates := dupIgnore;
475 FSelectTextList.Duplicates := dupIgnore;
476 ReadSettingFile();
477 end;
478
479 //???鴻????????/span>
480 destructor TSetting.Destroy();
481 begin
482 inherited;
483 FSelectTextList.Free;
484 FMailList.Free;
485 FNameList.Free;
486 end;
487
488 //?????????<?ゃ??????緇?鐚????刻????<?ゃ????鐚?
489 function TSetting.GetFileName(): string;
490 begin
491 Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
492 end;
493
494 //荐?????<?ゃ???莨?/span>
495 procedure TSetting.ReadSettingFile();
496 const
497 DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
498 DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
499 DEFAULT_BOARD_WIDTH: array[0..6] of Integer = (350, 60, 60, 60, 60, 80, 130);
500 var
501 ini: TMemIniFile;
502 i: Integer;
503 wkList: TStringList;
504 wkStr: string;
505 Exists: Boolean;
506 s: string;
507 // id: Integer;
508 CoolSet: TCoolSet;
509 begin
510 Exists := FileExists(GetFileName);
511 ini := TMemIniFile.Create(GetFileName);
512 try
513 //??篆<???????<?泣?ゃ??/span>
514 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
515 //HTTP1.1篏睡??/span>
516 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
517 //???????傑・膓?HTTP1.1篏睡??/span>
518 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
519
520 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
521 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
522 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
523 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
524 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
525
526 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
527 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
528 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
529 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
530 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
531
532 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
533 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
534 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
535 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
536 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
537 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
538
539 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
540 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
541 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
542 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
543 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
544 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
545
546 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
547 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
548 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
549 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
550 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
551 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
552
553 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
554 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
555 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
556 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
557
558 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
559 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
560 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
561 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
562 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
563 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
564
565 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
566 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
567 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
568 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
569 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
570
571 if FWindowHeight <= 0 then FWindowHeight := 400;
572 if FWindowWidth <= 0 then FWindowWidth := 600;
573
574 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
575
576 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
577 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
578 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
579 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
580 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
581
582 //???若??????/span>
583 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
584 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
585 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
586 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
587 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
588 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
589 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
590 //???若??????rapable
591 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
592 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
593
594 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
595 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
596 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
597 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
598
599 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
600 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
601
602 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
603
604 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
605 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
606
607 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
608 FListHeight := ini.ReadInteger('List', 'Height', 180);
609 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
610 FListWidth := ini.ReadInteger('List', 'Width', 180);
611 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
612 // FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
613 // FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
614
615 wkList := TStringList.Create;
616 try
617 ini.ReadSection('Name', wkList);
618 for i := 0 to wkList.Count - 1 do begin
619 wkStr := ini.ReadString('Name', wkList[i], '');
620 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
621 FNameList.Add(wkStr);
622 end;
623 ini.ReadSection('Mail', wkList);
624 for i := 0 to wkList.Count - 1 do begin
625 wkStr := ini.ReadString('Mail', wkList[i], '');
626 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
627 FMailList.Add(wkStr);
628 end;
629 ini.ReadSection('SelectText', wkList);
630 for i := 0 to wkList.Count - 1 do begin
631 wkStr := ini.ReadString('SelectText', wkList[i], '');
632 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
633 FSelectTextList.Add(wkStr);
634 end;
635 finally
636 wkList.Free;
637 end;
638
639 //???鴻????????
640 wkList := TStringList.Create;
641 try
642 ini.ReadSection('BBSColumnWidth', wkList);
643 if Length(FBBSColumnWidth) <> wkList.Count then begin
644 ini.EraseSection('BBSColumnWidth');
645 end;
646 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
647 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
648 end;
649 ini.ReadSection('CategoryColumnWidth', wkList);
650 if Length(FCategoryColumnWidth) <> wkList.Count then begin
651 ini.EraseSection('CategoryColumnWidth');
652 end;
653 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
654 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
655 end;
656 ini.ReadSection('BoardColumnWidth', wkList);
657 if Length(FBoardColumnWidth) <> wkList.Count then begin
658 ini.EraseSection('BoardColumnWidth');
659 end;
660 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
661 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
662 end;
663 finally
664 wkList.Free;
665 end;
666
667
668 //???鴻?????/span>
669 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
670 //CSS
671 FUseCSS := ini.ReadBool('CSS', 'UseCSS', True);
672 //CSS???<?ゃ????
673 FCSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
674
675 //Mail罨?茵?ず
676 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
677 //???≪?????c???????鴻???????≪????茵?ず
678 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
679 //???鴻???????≪???????????若???若????
680 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
681
682 //???ょ∈茯?
683 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
684
685 //???違????????
686 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
687 NewLogFolder := '';
688
689 //??RL
690 FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
691
692 //茯?荐主?????若??D?祉???鴻???若??
693 FUserID := ini.ReadString('Attestation', 'UserID', '');
694 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
695 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
696
697 //URL??????????莎桁???≪????/span>
698 FURLApp := ini.ReadBool('URLApp', 'Select', False);
699 FURLAppFile := ini.ReadString('URLApp', 'File', '');
700
701 //mailto????????????篏?
702 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
703
704 //???????≪????篏?臀?/span>
705 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
706
707 //?≪?????鴻????/span>
708 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
709 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
710 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
711 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
712
713 //?糸????????ャ??/span>
714 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
715 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
716 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
717
718 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
719 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
720
721 //?吾??莨若?炊?????激?恰???私戎??┃絎?
722 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
723 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
724 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
725
726 //?泣???潟??
727 if Exists then begin
728 for i := 0 to GetSoundCount - 1 do begin
729 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
730 if not FileExists(SoundFileName[i]) then
731 SoundFileName[i] := '';
732 end;
733 end else begin
734 s := ExtractFileDir(Application.ExeName) + '\sound\';
735 SoundFileName[0] := s + '??緇?????.wav';
736 SoundFileName[1] := s + '??緇?????(綏???).wav';
737 SoundFileName[2] := s + '???贋??wav';
738 SoundFileName[3] := '';
739 SoundFileName[4] := s + '??????wav';
740 end;
741
742 //???若??????/span>
743 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
744 CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
745 CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
746 CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
747 MainCoolSet[i] := CoolSet;
748 end;
749 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
750 CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
751 CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
752 CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
753 ListCoolSet[i] := CoolSet;
754 end;
755 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
756 CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
757 CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
758 CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
759 BrowserCoolSet[i] := CoolSet;
760 end;
761
762 //???若????
763 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
764 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
765 FPopUpAbon := ini.ReadBool('abon','Popup',false);
766 finally
767 ini.Free;
768 end;
769 end;
770
771 //荐?????<?ゃ???絖?(system)
772 procedure TSetting.WriteSystemSettingFile();
773 var
774 ini: TMemIniFile;
775 begin
776 ini := TMemIniFile.Create(GetFileName());
777 try
778 //??篆<???????<?泣?ゃ??/span>
779 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
780 //HTTP1.1篏睡??/span>
781 ini.WriteBool('HTTP', 'Protocol', FProtocol);
782 //???????傑・膓?HTTP1.1篏睡??/span>
783 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
784
785 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
786 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
787 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
788 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
789 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
790
791 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
792 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
793 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
794 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
795 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
796
797 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
798 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
799 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
800 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
801
802 ini.WriteString('Window', 'ListFontName', FListFontName);
803 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
804 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
805 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
806
807 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
808 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
809 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
810 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
811
812 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
813 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
814 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
815 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
816
817 ini.WriteString('Window', 'HintFontName', FHintFontName);
818 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
819 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
820 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
821
822 ini.UpdateFile;
823 finally
824 ini.Free;
825 end;
826 end;
827
828 //荐?????<?ゃ???絖?(window)
829 procedure TSetting.WriteWindowSettingFile();
830 var
831 i: Integer;
832 ini: TMemIniFile;
833 CoolSet: TCoolSet;
834 begin
835 ini := TMemIniFile.Create(GetFileName());
836 try
837 ini.WriteInteger('WindowSize', 'Top', WindowTop);
838 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
839 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
840 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
841 ini.WriteBool('WindowSize', 'Max', WindowMax);
842
843 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
844
845 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
846 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
847 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
848 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
849 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
850
851 //???若??????/span>
852 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
853 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
854 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
855 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
856 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
857 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
858 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
859 //???若??????rapable
860 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
861 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
862
863 //?帥??
864 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
865 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
866 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
867 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
868
869 //?<???祉?若?吾????/span>
870 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
871 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
872
873 //?鴻???若?帥?鴻????/span>
874 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
875
876 //???c????????
877 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
878 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
879
880 //???鴻?????泣?ゃ?冴?????贋梓綛?/span>
881 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
882 ini.WriteInteger('List', 'Height', FListHeight);
883 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
884 ini.WriteInteger('List', 'Width', FListWidth);
885 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
886 // ini.WriteBool('List', 'HeightMax', FListHeightMax);
887 // ini.WriteBool('List', 'WidthMax', FListWidthMax);
888
889
890 // ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
891
892 //???鴻????埈;腓?/span>
893 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
894 //CSS篏睡??/span>
895 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
896 //CSS???<?ゃ????
897 ini.WriteString('CSS', 'FileName', FCSSFileName);
898 //Mail罨?茵?ず
899 ini.WriteBool('Thread', 'ShowMail', FShowMail);
900 //???医???ょ∈茯?
901 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
902 //???≪?????c???????????≪????茵?ず
903 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
904 //???鴻???????≪???????????若???若????
905 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
906
907 ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
908
909 //茯?荐主?????若??D?祉???鴻???若??
910 ini.WriteString('Attestation', 'UserID', FUserID);
911 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
912 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
913
914 //URL??????????莎桁???≪????/span>
915 ini.WriteBool('URLApp', 'Select', FURLApp);
916 ini.WriteString('URLApp', 'File', FURLAppFile);
917
918 //mailto????????????篏?
919 ini.WriteBool('Mailto', 'Open', FOpenMailer);
920
921 //???????≪????篏?臀?/span>
922 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
923
924 //?≪?????鴻????/span>
925 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
926 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
927 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
928 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
929
930 //?糸????????ャ??/span>
931 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
932 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
933 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
934
935 //?鴻??????筝?荀ф?贋?違?≪?ゃ?潟??/span>
936 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
937
938 //?吾??莨若?炊?????激?恰???私戎??┃絎?
939 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
940 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
941 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
942
943 //???鴻????????
944 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
945 ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
946 end;
947 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
948 ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
949 end;
950 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
951 ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
952 end;
953
954 //?泣???潟??
955 for i := 0 to GetSoundCount - 1 do begin
956 if not FileExists(SoundFileName[i]) then
957 SoundFileName[i] := '';
958 ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
959 end;
960
961 //CoolBar
962 ini.EraseSection('MainCoolBar');
963 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
964 CoolSet := MainCoolSet[i];
965 ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
966 ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
967 ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
968 end;
969 ini.EraseSection('ListCoolBar');
970 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
971 CoolSet := ListCoolSet[i];
972 ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
973 ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
974 ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
975 end;
976 ini.EraseSection('BrowserCoolBar');
977 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
978 CoolSet := BrowserCoolSet[i];
979 ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
980 ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
981 ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
982 end;
983
984 //???若????
985 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
986 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
987 ini.WriteBool('abon','Popup',FPopUpAbon);
988
989 ini.UpdateFile;
990 finally
991 ini.Free;
992 end;
993 end;
994
995 //荐?????<?ゃ???絖?(name & mail)
996 procedure TSetting.WriteNameMailSettingFile();
997 var
998 i: Integer;
999 ini: TMemIniFile;
1000 begin
1001 ini := TMemIniFile.Create(GetFileName());
1002 try
1003 ini.EraseSection('Name');
1004 ini.EraseSection('Mail');
1005 ini.EraseSection('SelectText');
1006 for i := 0 to FNameList.Count - 1 do begin
1007 ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1008 if i >= 39 then
1009 Break;
1010 end;
1011 for i := 0 to FMailList.Count - 1 do begin
1012 ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1013 if i >= 39 then
1014 Break;
1015 end;
1016 for i := 0 to FSelectTextList.Count - 1 do begin
1017 ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1018 if i >= 39 then
1019 Break;
1020 end;
1021 ini.UpdateFile;
1022 finally
1023 ini.Free;
1024 end;
1025 end;
1026
1027 procedure TSetting.WriteFolderSettingFile();
1028 var
1029 ini: TMemIniFile;
1030 begin
1031 ini := TMemIniFile.Create(GetFileName());
1032 try
1033 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1034 ini.DeleteKey('Folder', 'LogFolder')
1035 else
1036 ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1037 ini.UpdateFile;
1038 finally
1039 ini.Free;
1040 end;
1041 end;
1042
1043 //???鴻????????????????/span>
1044 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1045 begin
1046 Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1047 end;
1048
1049 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1050 begin
1051 Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1052 end;
1053
1054 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1055 begin
1056 Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1057 end;
1058
1059 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1060 begin
1061 if index in [0..Length(FBBSColumnWidth) - 1] then
1062 FBBSColumnWidth[index] := value;
1063 end;
1064
1065 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1066 begin
1067 if index in [0..Length(FCategoryColumnWidth) - 1] then
1068 FCategoryColumnWidth[index] := value;
1069 end;
1070
1071 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1072 begin
1073 if index in [0..Length(FBoardColumnWidth) - 1] then
1074 FBoardColumnWidth[index] := value;
1075 end;
1076
1077 function TSetting.GetSoundCount: Integer;
1078 begin
1079 Result := Length(SOUND_NAME);
1080 end;
1081
1082 function TSetting.GetSoundName(Index: Integer): string;
1083 begin
1084 if (Index < GetSoundCount) and (Index >= 0) then
1085 Result := SOUND_NAME[Index].Name
1086 else
1087 Result := '';
1088 end;
1089
1090 function TSetting.GetSoundViewName(Index: Integer): string;
1091 begin
1092 if (Index < GetSoundCount) and (Index >= 0) then
1093 Result := SOUND_NAME[Index].ViewName
1094 else
1095 Result := '';
1096 end;
1097
1098 function TSetting.GetSoundFileName(Index: Integer): string;
1099 begin
1100 if (Index < GetSoundCount) and (Index >= 0) then
1101 Result := SOUND_NAME[Index].FileName
1102 else
1103 Result := '';
1104 end;
1105
1106 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1107 begin
1108 if (Index < GetSoundCount) and (Index >= 0) then
1109 SOUND_NAME[Index].FileName := value;
1110 end;
1111
1112 function TSetting.FindSoundFileName(Name: string): string;
1113 var
1114 i: Integer;
1115 begin
1116 for i := 0 to GetSoundCount - 1 do begin
1117 if SoundName[i] = Name then begin
1118 Result := SoundFileName[i];
1119 Exit;
1120 end;
1121 end;
1122 Result := '';
1123 end;
1124
1125 function TSetting.Encrypt(s: string): string;
1126 var
1127 cryptObj: THogeCryptAuto;
1128 inputStream, outputStream: TStringStream;
1129 begin
1130 inputStream := TStringStream.Create(s);
1131 outputStream := TStringStream.Create('');
1132 cryptObj := THogeCryptAuto.Create;
1133 try
1134 // ???桁??
1135 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1136
1137 // ???ゃ?????????у?荀?????????????鴻???????
1138 Result := HogeBase64Encode(outputStream.DataString);
1139 finally
1140 cryptObj.Free;
1141 outputStream.Free;
1142 inputStream.Free;
1143 end;
1144 end;
1145
1146 function TSetting.Decrypt(s: string): string;
1147 var
1148 cryptObj: THogeCryptAuto;
1149 inputStream, outputStream: TStringStream;
1150 begin
1151 try
1152 inputStream := TStringStream.Create(HogeBase64Decode(s));
1153 except
1154 Result := '';
1155 Exit;
1156 end;
1157 outputStream := TStringStream.Create('');
1158 cryptObj := THogeCryptAuto.Create;
1159 try
1160 // 緇??/span>
1161 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1162 Result := outputStream.DataString;
1163 finally
1164 cryptObj.Free;
1165 outputStream.Free;
1166 inputStream.Free;
1167 end;
1168 end;
1169
1170 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1171 begin
1172 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1173 Result := FMainCoolBar[Index]
1174 else begin
1175 Result.FCoolID := -1;
1176 Result.FCoolWidth := -1;
1177 Result.FCoolBreak := False;
1178 end;
1179 end;
1180
1181 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1182 begin
1183 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1184 Result := FListCoolBar[Index]
1185 else begin
1186 Result.FCoolID := -1;
1187 Result.FCoolWidth := -1;
1188 Result.FCoolBreak := False;
1189 end;
1190 end;
1191
1192 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1193 begin
1194 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1195 Result := FBrowserCoolBar[Index]
1196 else begin
1197 Result.FCoolID := -1;
1198 Result.FCoolWidth := -1;
1199 Result.FCoolBreak := False;
1200 end;
1201 end;
1202
1203 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1204 begin
1205 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1206 FMainCoolBar[Index] := CoolSet;
1207 end;
1208
1209 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1210 begin
1211 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1212 FListCoolBar[Index] := CoolSet;
1213 end;
1214
1215 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1216 begin
1217 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1218 FBrowserCoolBar[Index] := CoolSet;
1219 end;
1220
1221
1222 end.
1223

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