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.5 - (show annotations) (download) (as text)
Wed Aug 27 17:23:49 2003 UTC (20 years, 7 months ago) by yoffy
Branch: MAIN
CVS Tags: b37, b36, b40
Changes since 1.4: +8 -0 lines
File MIME type: text/x-pascal
・スレッド絞込フィールドの幅を保存するための変更。

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

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