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.10 - (show annotations) (download) (as text)
Thu Oct 2 10:48:22 2003 UTC (20 years, 6 months ago) by h677
Branch: MAIN
Changes since 1.9: +7 -0 lines
File MIME type: text/x-pascal
起動時に最新100レス表示をONにできるようにした。

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

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