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

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