OSDN Git Service

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