OSDN Git Service

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