OSDN Git Service

9c485f1f5a0b6692a931f5aa10bc1ce649d31c4b
[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         EKEY_SETTING_FILE_NAME                          = 'Ekey.ini';
19         TEMP_FOLDER                                                                             = 'Temp';
20         OUTBOX_FILE_NAME                                                        = 'outbox.ini';
21         SENT_FILE_NAME                                                          = 'sent.ini';
22         CONFIG_DIR_NAME                                                         = 'config';
23         CSS_DIR_NAME                                                                    = 'css';
24         SKIN_DIR_NAME                                                                   = 'skin';
25         SKIN_HEADER_FILE_NAME                                   = 'Header.html';
26         SKIN_FOOTER_FILE_NAME                                   = 'Footer.html';
27         SKIN_NEWRES_FILE_NAME                                   = 'NewRes.html';
28         SKIN_RES_FILE_NAME                                              = 'Res.html';
29         SKIN_BOOKMARK_FILE_NAME                         = 'Bookmark.html';
30         SKIN_NEWMARK_FILE_NAME                          = 'Newmark.html';
31         NGWORDs_DIR_NAME : String               = 'NGwords';
32         BOARD_PLUGIN_DIR_NAME                                   = 'BoardPlugin';
33         SAMBATIME_FILE_NAME : String    = 'Samba.ini';
34         IGNORE_FILE_NAME : String               = 'Ignore.txt';
35 //      DOLIB_LOGIN_URL     = '/~tora3n2c/futen.cgi';
36         MAX_POPUP_RES : Integer = 10;
37 type
38         TGikoTabPosition = (gtpTop, gtpBottom);                                                         // \83^\83u\88Ê\92u
39         TGikoTabAppend = (gtaFirst, gtpLast);                                                                   // \83^\83u\92Ç\89Á\88Ê\92u
40         TGikoTabStyle = (gtsTab, gtsButton, gtsFlat);                                   // \83^\83u\83X\83^\83C\83\8b
41         TGikoListOrientation = (gloHorizontal, gloVertical);    // \83\8a\83X\83g\90\82\92¼\81E\90\85\95½
42         TGikoListState = (glsMax, glsNormal, glsMin);                                   // \83\8a\83X\83g\83T\83C\83Y\8fó\91Ô
43                                                                                                                                                                                                                                 // \83|\83b\83v\83A\83b\83v\95\\8e¦\88Ê\92u
44         TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
45                                                                                                 gppRight, gppCenter, gppLeft,
46                                                                                                 gppRightBottom, gppBottom, gppLeftBottom);
47                                                                                                                                                                                                                                 //\83v\83\8c\83r\83\85\81[\83T\83C\83Y
48         TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
49         TGikoBrowserAutoMaximize        = (gbmNone, gbmClick, gbmDoubleClick);
50                                                                                                                                                                                                                                 // \83u\83\89\83E\83U\82ð\8e©\93®\93I\82É\8dÅ\91å\89»\82·\82é\8fð\8c\8f
51         /// \83\8c\83X\95\\8e¦\94Í\88Í\81B10 \81` 65535 \82Í\8dÅ\90V n \83\8c\83X\88µ\82¢\81B
52         /// \8f«\97\88 201-300 \82Ì\82æ\82¤\82È\94Í\88Í\82ð\8e\9d\82½\82¹\82é\89Â\94\\90«\82à\8dl\82¦\82Ä\8fã\88Ê 2 byte \82Í\97\\96ñ\81B
53         TGikoResRange = (grrAll, grrSelect, grrKoko, grrNew);
54
55         /// \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
56         TGikoThreadRange = (gtrAll, gtrSelect, gtrLog, gtrNew);
57
58         /// \83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
59         type    TGikoBBSColumnID = (gbbscTitle);
60         /// \83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
61         const   GikoBBSColumnCaption : array[0..0] of string =
62                 ( '\83J\83e\83S\83\8a\96¼' );
63         /// \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
64         type    TGikoBBSColumnList = class( TList )
65         private
66                 function GetItem( index : integer ) : TGikoBBSColumnID;
67                 procedure SetItem( index : integer; value : TGikoBBSColumnID);
68         public
69                 constructor Create;
70                 destructor Destroy;     override;
71                 function Add( value : TGikoBBSColumnID ) : Integer;
72                 property Items[index : integer]: TGikoBBSColumnID read GetItem write SetItem; default;
73         end;
74         /// \94Â\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
75         type    TGikoCategoryColumnID = (gccTitle, gccRoundName, gccLastModified);
76         /// \94Â\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
77         const GikoCategoryColumnCaption : array[0..2] of string =
78                 ( '\94Â\96¼', '\8f\84\89ñ\97\\96ñ', '\8eæ\93¾\93ú\8e\9e' );
79         /// \94Â\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
80         type    TGikoCategoryColumnList = class( TList )
81         private
82                 function GetItem( index : integer ) : TGikoCategoryColumnID;
83                 procedure SetItem( index : integer; value : TGikoCategoryColumnID);
84         public
85                 constructor Create;
86                 destructor Destroy;     override;
87                 function Add( value : TGikoCategoryColumnID ) : Integer;
88                 property Items[index : integer]: TGikoCategoryColumnID read GetItem write SetItem; default;
89         end;
90         /// \83X\83\8c\83\8a\83X\83g\82Ì\83J\83\89\83\80 ID
91         type    TGikoBoardColumnID = (gbcTitle, gbcAllCount, gbcLocalCount, gbcNonAcqCount,
92                 gbcNewCount, gbcUnReadCount, gbcRoundName, gbcLastModified, gbcCreated );
93         /// \83X\83\8c\83\8a\83X\83g\82Ì\83J\83\89\83\80\96¼
94         const   GikoBoardColumnCaption : array[0..8] of string =
95                 ( '\83X\83\8c\83b\83h\96¼', '\83J\83E\83\93\83g', '\8eæ\93¾', '\96¢\8eæ\93¾', '\90V\92\85',
96                 '\96¢\93Ç', '\8f\84\89ñ\97\\96ñ', '\8eæ\93¾\93ú\8e\9e', '\83X\83\8c\8dì\90¬\93ú\8e\9e' );
97         const GikoBoardColumnAlignment : array[0..8] of TAlignment = (
98                 taLeftJustify, taRightJustify, taRightJustify, taRightJustify,
99                 taRightJustify, taRightJustify, taLeftJustify, taLeftJustify,
100                 taLeftJustify );
101         /// \83X\83\8c\83\8a\83X\83g\83J\83\89\83\80\94z\97ñ
102         type    TGikoBoardColumnList = class( TList )
103         private
104                 function GetItem( index : integer ) : TGikoBoardColumnID;
105                 procedure SetItem( index : integer; value : TGikoBoardColumnID);
106         public
107                 constructor Create;
108                 destructor Destroy;     override;
109                 function Add( value : TGikoBoardColumnID ) : Integer;
110                 property Items[index : integer]: TGikoBoardColumnID read GetItem write SetItem; default;
111         end;
112
113 type
114         //CoolBar\90Ý\92è\83\8c\83R\81[\83h
115         TCoolSet = record
116                 FCoolID: Integer;
117                 FCoolWidth: Integer;
118                 FCoolBreak: Boolean;
119         end;
120
121         TSetting = class(TObject)
122         private
123                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
124                 FRecvBufferSize: Integer;
125                 //HTTP1.1\8eg\97p
126                 FProtocol: Boolean;
127                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
128                 FProxyProtocol: Boolean;
129
130                 //\83v\83\8d\83L\83V\81i\93Ç\8d\9e\97p\81j
131                 FReadProxy: Boolean;
132                 FReadProxyAddress: string;
133                 FReadProxyPort: Integer;
134                 FReadProxyUserID: string;
135                 FReadProxyPassword: string;
136
137                 //\83v\83\8d\83L\83V\81i\8f\91\8d\9e\97p\81j
138                 FWriteProxy: Boolean;
139                 FWriteProxyAddress: string;
140                 FWriteProxyPort: Integer;
141                 FWriteProxyUserID: string;
142                 FWriteProxyPassword: string;
143
144                 //\83L\83\83\83r\83l\83b\83g
145                 FCabinetFontName: string;
146                 FCabinetFontSize: Integer;
147                 FCabinetFontBold: Boolean;
148                 FCabinetFontItalic: Boolean;
149                 FCabinetFontColor: TColor;
150                 FCabinetBackColor: TColor;
151
152                 //\83\8a\83X\83g
153                 FListFontName: string;
154                 FListFontSize: Integer;
155                 FListFontBold: Boolean;
156                 FListFontItalic: Boolean;
157                 FListFontColor: TColor;
158                 FListBackColor: TColor;
159
160                 //\83u\83\89\83E\83U
161                 FBrowserFontName: string;                       // ''...default
162                 FBrowserFontSize: Integer;              // 0...default
163                 FBrowserFontBold: Integer;              // 0...default, -1...False, 1...True
164                 FBrowserFontItalic: Integer;    // \8fã\82É\93¯\82
165                 FBrowserFontColor: Integer;             // -1...default
166                 FBrowserBackColor: Integer;             // \8fã\82É\93¯\82
167
168                 //\83G\83f\83B\83^
169                 FEditorFontName: string;
170                 FEditorFontSize: Integer;
171                 FEditorFontBold: Boolean;
172                 FEditorFontItalic: Boolean;
173                 FEditorFontColor: TColor;
174                 FEditorBackColor: TColor;
175
176                 //\83^\83u\83t\83H\83\93\83g
177                 FBrowserTabFontName: string;
178                 FBrowserTabFontSize: Integer;
179                 FBrowserTabFontBold: Boolean;
180                 FBrowserTabFontItalic: Boolean;
181
182                 //\83q\83\93\83g\83E\83B\83\93\83h\83E
183                 FHintFontName: string;
184                 FHintFontSize: Integer;
185                 //FHintFontBold: Boolean;
186                 //FHintFontItalic: Boolean;
187                 FHintFontColor: TColor;
188                 FHintBackColor: TColor;
189
190                 //\83E\83B\83\93\83h\83E\83T\83C\83Y
191                 FWindowTop: Integer;
192                 FWindowLeft: Integer;
193                 FWindowHeight: Integer;
194                 FWindowWidth: Integer;
195                 FWindowMax: Boolean;
196                 //\83\8a\83X\83g\83r\83\85\81[\83X\83^\83C\83\8b
197                 FListStyle: TViewStyle;
198
199                 //\83c\81[\83\8b\83o\81[\95\\8e¦
200                 FStdToolBarVisible: Boolean;
201                 FAddressBarVisible: Boolean;
202                 FLinkBarVisible: Boolean;
203                 FListToolBarVisible: Boolean;
204                 FListNameBarVisible: Boolean;
205                 FBrowserToolBarVisible: Boolean;
206                 FBrowserNameBarVisible: Boolean;
207
208                 //\83u\83\89\83E\83U\83^\83u
209                 FBrowserTabVisible: Boolean;
210                 FBrowserTabPosition: TGikoTabPosition;
211                 FBrowserTabAppend: TGikoTabAppend;
212                 FBrowserTabStyle: TGikoTabStyle;
213
214                 //\83\81\83b\83Z\81[\83W\83o\81[
215                 FMessageBarVisible: Boolean;
216                 FMessegeBarHeight: Integer;
217
218                 //\83X\83e\81[\83^\83X\83o\81[
219                 FStatusBarVisible: Boolean;
220
221                 //\83L\83\83\83r\83l\83b\83g\89Â\8e\8b\81E\83T\83C\83Y
222                 FCabinetVisible: Boolean;
223                 FCabinetWidth: Integer;
224
225                 //\83\8a\83X\83g\81E\83u\83\89\83E\83U\83T\83C\83Y
226                 FListOrientation: TGikoListOrientation;
227                 FListHeight: Integer;
228                 FListHeightState: TGikoListState;
229                 FListWidth: Integer;
230                 FListWidthState: TGikoListState;
231 //              FListHeightMax: Boolean;
232 //              FListWidthMax: Boolean;
233
234                 //\91\97\90M\97p\96¼\91O\81E\83\81\81[\83\8b
235                 FNameList: TStringList;
236                 FMailList: TStringList;
237
238                 //\83G\83f\83B\83^\81[\83E\83B\83\93\83h\83E\83T\83C\83Y
239                 FEditWindowTop: Integer;
240                 FEditWindowLeft: Integer;
241                 FEditWindowHeight: Integer;
242                 FEditWindowWidth: Integer;
243                 FEditWindowMax: Boolean;
244         FEditWindowStay: Boolean;
245         FEditWindowTranslucent: Boolean;
246
247                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
248                 FListViewNo: Boolean;
249                 //CSS\95\\8e¦
250                 FUseCSS: Boolean;
251                 //CSS\83t\83@\83C\83\8b\96¼
252                 FCSSFileName: string;
253                 // \83X\83L\83\93\95\\8e¦(\88ê\8e\9e\93I\82È\82à\82Ì\82Å ini \82É\95Û\91\82Í\82³\82ê\82È\82¢)
254                 FUseSkin: Boolean;
255                 //mail\97\93\95\\8e¦
256                 FShowMail: Boolean;
257                 /// \83\8c\83X\95\\8e¦\94Í\88Í
258                 FResRange                       : Longint;
259                 /// \8bN\93®\8e\9e\83\8c\83X\95\\8e¦\94Í\88Í\82Ì\8cÅ\92è
260                 FResRangeHold   : Boolean;
261                 /// \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
262                 FThreadRange    : TGikoThreadRange;
263                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
264                 FUnActivePopup: Boolean;
265                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
266                 FResPopupHeaderBold: Boolean;
267
268                 //\83\8d\83O\83t\83H\83\8b\83_
269                 FLogFolder: string;
270                 FNewLogFolder: string;
271
272                 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[\83T\83C\83Y
273                 FBBSColumnWidth: array[0..0] of Integer;
274                 FCategoryColumnWidth: array[0..2] of Integer;
275                 FBoardColumnWidth: array[0..8] of Integer;
276
277                 /// \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
278                 FBBSColumnOrder : TGikoBBSColumnList;
279                 /// \94Â\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
280                 FCategoryColumnOrder : TGikoCategoryColumnList;
281                 /// \83X\83\8c\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
282                 FBoardColumnOrder : TGikoBoardColumnList;
283
284                 //\83\\81[\83g\8f\87
285                 FBBSSortIndex: Integer;
286                 FBBSSortOrder: Boolean;
287                 FCategorySortIndex: Integer;
288                 FCategorySortOrder: Boolean;
289                 FBoardSortIndex: Integer;
290                 FBoardSortOrder: Boolean;
291
292                 //Dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
293                 FDatOchiSortIndex: Integer;
294                 FDatOchiSortOrder: Boolean;
295
296                 //\8di\8d\9e\82Ý\95\8e\9a\97ñ
297                 FSelectTextList: TStringList;
298
299                 //\94Â\88ê\97\97URL
300                 //FBoardURL2ch: string;
301                 FBoardURLs: TStringList;
302                 FBoardURLSelected: Integer;
303
304                 //\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
305                 FUserID: string;
306                 FPassword: string;
307                 FAutoLogin: Boolean;
308         FForcedLogin: Boolean;
309                 FDolibURL: string;
310
311                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
312                 FURLApp: Boolean;
313                 FURLAppFile: string;
314
315                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
316                 FOpenMailer: Boolean;
317
318                 //\8dí\8f\9c\8am\94F
319                 FDeleteMsg: Boolean;
320
321                 //CoolBar\81i\83\81\83C\83\93\81E\94Â\81E\83u\83\89\83E\83U\81j
322                 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
323                 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
324                 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
325
326                 //ToolBar Wrapable
327                 FListToolBarWrapable: Boolean;
328                 FBrowserToolBarWrapable: Boolean;
329
330                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
331                 FPopupPosition: TGikoPopupPosition;
332
333                 //\83A\83h\83\8c\83X\83o\81[
334                 FURLDisplay: Boolean;
335                 FAddressBarTabStop: Boolean;
336                 FLinkAddAddressBar: Boolean;
337                 FAddressHistoryCount: Integer;
338
339                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
340                 FPreviewVisible: Boolean;
341                 FPreviewSize: TGikoPreviewSize;
342                 FPreviewWait: Integer;
343
344                 // \83u\83\89\83E\83U
345                 FBrowserAutoMaximize: TGikoBrowserAutoMaximize;
346
347                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93\95\\8e¦
348                 FListIconVisible: Boolean;
349                 //\8eæ\93¾\90\94\82Å\82Í\82È\82­\96¢\8eæ\93¾\82ð\95\\8e¦\82·\82é
350                 FNonAcquiredCount: Boolean;
351
352                                 //\83X\83\8c\83b\83h\88ê\97\97\82ÅLog\82Ì\82 \82é\83X\83\8c\83b\83h\82Ì\82Ý\83X\83\8c\8dì\90¬\93ú\82ð\95\\8e¦\82·\82é\82©
353                                 FCreationTimeLogs: Boolean;
354         //\83X\83\8c\83b\83h\88ê\97\97\82Ì\83X\83\8c\90\90¬\93ú\82Å\96¢\97\88\82Ì\83X\83\8c\82Ì\90\90¬\93ú\82ð\95\\8e¦\82µ\82È\82¢
355                 FFutureThread: Boolean;
356
357                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8aÔ\8eg\97p\90Ý\92è
358                 FUseMachineTime: Boolean;
359                 FTimeAdjustSec: Integer;
360                 FTimeAdjust: Boolean;
361
362                 //\82 \82Ú\81`\82ñ
363                 FAbonDeleterlo : Boolean; //&rlo;\82ð\8dí\82é\82©
364                 FAbonReplaceul : Boolean; //<ul>\83^\83O\82ð<br>\83^\83O\82É\92u\8a·\82·\82é\82©
365                 FPopUpAbon               : Boolean; //\83\8c\83X\83|\83b\83v\83A\83b\83v\8e\9e\82Ì\82 \82Ú\81`\82ñ\97L\8cø
366                 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¦
367                 FAddResAnchor : Boolean; //NG\83\8c\83X\82Ö\82Ì\83\8c\83X\83A\83\93\83J\81[\82ð\92Ç\89Á\82·\82é
368         FDeleteSyria : Boolean; //\83V\83\8a\83A\8cê\83u\83\89\83N\83\89\91Î\8dô
369
370                 // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
371                 FSelectComboBoxWidth : Integer;
372
373                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
374                 FOptionDialogTabIndex: Integer;
375
376                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
377                 FCabinetIndex: Integer;
378
379                 //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
380                 FShowDialogForEnd : Boolean;
381                 //\91S\82Ä\82Ì\83^\83u\95Â\82\82é\82Ì\82Æ\82«\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é
382                 FShowDialogForAllTabClose: Boolean;
383                 //\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©
384                 FUseOddColorOddResNum: Boolean;
385                 FOddColor: TColor;
386
387         //Samba24\91Î\8dô\8b@\94\\82ð\8eg\82¤\82©
388         FUseSamba: Boolean;
389
390                 //\83\8c\83X\83A\83\93\83J\81[\82ð\83N\83\8a\83b\83N\82µ\82Ä\83W\83\83\83\93\83v\82·\82é\82©
391                 FResAnchorJamp: Boolean;
392
393                 //Tab\8e©\93®\95Û\91
394                 FTabAutoLoadSave : Boolean;
395                 // \83G\83f\83B\83^
396                 FSpaceToNBSP    : Boolean;      ///< \94¼\8ap\83X\83y\81[\83X\81ATab \82ð &nbsp; \82É\92u\8a·
397                 FAmpToCharRef   : Boolean;      ///< '&' \82ð &amp; \82É\92u\8a·
398
399                 //\83u\83\89\83E\83U\83^\83u\94ñ\95\\8e¦\82Ì\8e\9e\82Ì\83X\83\8c\88ê\97\97\82Å\82Ì\83J\81[\83\\83\8b\83L\81[\88Ú\93®\82Ì\96³\94½\89\9e\8e\9e\8aÔ
400                 FSelectInterval : Integer;
401
402                 //KuroutSettingTab \8fÚ\8d×\90Ý\92è\83^\83u\82ÌActiveTab
403                 FKuroutSettingTabIndex: Integer;
404                 
405                 function GetMainCoolSet(Index: Integer): TCoolSet;
406                 function GetBoardCoolSet(Index: Integer): TCoolSet;
407                 function GetBrowserCoolSet(Index: Integer): TCoolSet;
408                 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
409                 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
410                 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
411
412                 function GetBBSColumnWidth(index: Integer): Integer;
413                 function GetCategoryColumnWidth(index: Integer): Integer;
414                 function GetBoardColumnWidth(index: Integer): Integer;
415                 procedure SetBBSColumnWidth(index: Integer; value: Integer);
416                 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
417                 procedure SetBoardColumnWidth(index: Integer; value: Integer);
418
419                 function GetSoundName(Index: Integer): string;
420                 function GetSoundViewName(Index: Integer): string;
421                 function GetSoundFileName(Index: Integer): string;
422                 procedure SetSoundFileName(Index: Integer; value: string);
423                 function Encrypt(s: string): string;
424                 function Decrypt(s: string): string;
425
426                 procedure MakeURLIniFile();
427
428                 procedure SetUseCSS( value: Boolean );
429                 procedure SetCSSFileName( fileName: string );
430         protected
431
432         public
433                 constructor Create;
434                 destructor Destroy; override;
435                 function GetFileName: string;
436                 function GetBoardURLFileName: string;
437                 procedure ReadSettingFile;
438                 procedure ReadBoardURLsFile;
439                 procedure WriteSystemSettingFile;
440                 procedure WriteWindowSettingFile;
441                 procedure WriteNameMailSettingFile;
442                 procedure WriteFolderSettingFile();
443                 procedure WriteBoardURLSettingFile;
444                 function GetSoundCount: Integer;
445                 function FindSoundFileName(Name: string): string;
446
447                 function GetBoardFileName: string;
448                 function GetCustomBoardFileName: string;
449                 function GetBoardDir: string;
450                 function GetHtmlTempFileName: string;
451                 function GetAppDir: string;
452                 function GetTempFolder: string;
453                 function GetSentFileName: string;
454                 function GetConfigDir: string;
455                 function GetSkinDir: string;
456                 function GetSkinHeaderFileName: string;
457                 function GetSkinFooterFileName: string;
458                 function GetSkinResFileName: string;
459                 function GetSkinNewResFileName: string;
460                 function GetSkinBookmarkFileName: string;
461                 function GetSkinNewmarkFileName: string;
462                 function GetStyleSheetDir: string;
463                 function GetOutBoxFileName: string;
464                 function GetNGWordsDir: string;
465                 function GetBoardPlugInDir: string;
466                 function GetSambaFileName: string;
467                 function GetIgnoreFileName: string;
468
469                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
470                 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
471                 //HTTP1.1\8eg\97p
472                 property Protocol: Boolean read FProtocol write FProtocol;
473                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
474                 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
475
476                 property ReadProxy: Boolean read FReadProxy write FReadProxy;
477                 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
478                 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
479                 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
480                 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
481
482                 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
483                 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
484                 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
485                 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
486                 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
487
488                 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
489                 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
490                 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
491                 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
492                 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
493                 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
494
495                 property ListFontName: string read FListFontName write FListFontName;
496                 property ListFontSize: Integer read FListFontSize write FListFontSize;
497                 property ListFontBold: Boolean read FListFontBold write FListFontBold;
498                 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
499                 property ListFontColor: TColor read FListFontColor write FListFontColor;
500                 property ListBackColor: TColor read FListBackColor write FListBackColor;
501
502                 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
503                 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
504                 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
505                 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
506                 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
507                 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
508
509                 property EditorFontName: string read FEditorFontName write FEditorFontName;
510                 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
511                 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
512                 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
513                 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
514                 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
515
516                 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
517                 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
518                 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
519                 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
520
521                 property HintFontName: string read FHintFontName write FHintFontName;
522                 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
523                 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
524                 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
525                 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
526                 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
527
528                 property WindowTop: Integer read FWindowTop write FWindowTop;
529                 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
530                 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
531                 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
532                 property WindowMax: Boolean read FWindowMax write FWindowMax;
533                 property ListStyle: TViewStyle read FListStyle write FListStyle;
534
535                 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
536                 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
537                 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
538                 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
539                 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
540                 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
541                 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
542
543                 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
544                 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
545                 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
546                 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
547
548                 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
549                 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
550
551                 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
552
553                 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
554                 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
555
556                 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
557                 property ListHeight: Integer read FListHeight write FListHeight;
558                 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
559                 property ListWidth: Integer read FListWidth write FListWidth;
560                 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
561 //              property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
562 //              property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
563
564                 property NameList: TStringList read FNameList write FNameList;
565                 property MailList: TStringList read FMailList write FMailList;
566                 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
567
568                 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
569                 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
570                 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
571                 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
572                 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
573                 property EditWindowStay: Boolean read FEditWindowStay write FEditWindowStay;
574                 property EditWindowTranslucent: Boolean read FEditWindowTranslucent write FEditWindowTranslucent;
575
576                 property ListViewNo: Boolean read FListViewNo write FListViewNo;
577                 property UseCSS: Boolean read FUseCSS write SetUseCSS;
578                 property CSSFileName: string read FCSSFileName write SetCSSFileName;
579                 property UseSkin: Boolean read FUseSkin;
580
581                 property ShowMail: Boolean read FShowMail write FShowMail;
582                 property ResRange : Longint read FResRange write FResRange;
583                 property ResRangeHold : Boolean read FResRangeHold write FResRangeHold;
584                 property ThreadRange    : TGikoThreadRange read FThreadRange write FThreadRange;
585                 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
586                 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
587
588                 property LogFolder: string read FLogFolder write FLogFolder;
589                 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
590
591                 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
592                 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
593                 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
594
595                 property BBSColumnOrder : TGikoBBSColumnList read FBBSColumnOrder write FBBSColumnOrder;
596                 property CategoryColumnOrder : TGikoCategoryColumnList read FCategoryColumnOrder write FCategoryColumnOrder;
597                 property BoardColumnOrder : TGikoBoardColumnList read FBoardColumnOrder write FBoardColumnOrder;
598
599                 property SoundName[index: Integer]: string read GetSoundName;
600                 property SoundViewName[index: Integer]: string read GetSoundViewName;
601                 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
602
603                 property BBSSortIndex: Integer read FBBSSortIndex write FBBSSortIndex;
604                 property BBSSortOrder: Boolean read FBBSSortOrder write FBBSSortOrder;
605                 property CategorySortIndex: Integer read FCategorySortIndex write FCategorySortIndex;
606                 property CategorySortOrder: Boolean read FCategorySortOrder write FCategorySortOrder;
607                 property BoardSortIndex: Integer read FBoardSortIndex write FBoardSortIndex;
608                 property BoardSortOrder: Boolean read FBoardSortOrder write FBoardSortOrder;
609
610                 property DatOchiSortIndex: Integer read FDatOchiSortIndex write FDatOchiSortIndex;
611                 property DatOchiSortOrder: Boolean read FDatOchiSortOrder write FDatOchiSortOrder;
612
613                 //property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
614                 property BoardURLs: TStringList read FBoardURLs write FBoardURLs;
615                 property BoardURLSelected: Integer read FBoardURLSelected write FBoardURLSelected;
616                 property UserID: string read FUserID write FUserID;
617                 property Password: string read FPassword write FPassword;
618                 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
619                 property ForcedLogin: Boolean read FForcedLogin write FForcedLogin;
620                 property DolibURL: string read FDolibURL write FDolibURL;
621
622                 property URLApp: Boolean read FURLApp write FURLApp;
623                 property URLAppFile: string read FURLAppFile write FURLAppFile;
624
625                 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
626
627                 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
628
629                 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
630                 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
631                 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
632
633                 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
634                 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
635
636                 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
637
638                 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
639                 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
640                 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
641                 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
642
643                 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
644                 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
645                 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
646                 property BrowserAutoMaximize: TGikoBrowserAutoMaximize read FBrowserAutoMaximize write FBrowserAutoMaximize;
647
648                 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
649                 property NonAcquiredCount: Boolean read FNonAcquiredCount write FNonAcquiredCount;
650                 property CreationTimeLogs: Boolean read FCreationTimeLogs write FCreationTimeLogs;
651                 property FutureThread: Boolean read FFutureThread write FFutureThread;
652
653                 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
654                 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
655                 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
656
657                 //\82 \82Ú\81`\82ñ
658                 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
659                 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
660                 property PopUpAbon               : Boolean read FPopUpAbon write FPopUpAbon;
661                 property ShowNGLinesNum : Boolean read FShowNGLinesNum write FShowNGLinesNum;
662                 property AddResAnchor : Boolean read FAddResAnchor write FAddResAnchor;
663                 property DeleteSyria : Boolean read FDeleteSyria write FDeleteSyria;
664                 // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
665                 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
666
667                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
668                 property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
669
670                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
671                 property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
672
673                 //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
674                 property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
675                 property ShowDialogForAllTabClose: Boolean read FShowDialogForAllTabClose write FShowDialogForAllTabClose;
676                 //\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©
677                 property UseOddColorOddResNum: Boolean read FUseOddColorOddResNum write FUseOddColorOddResNum;
678                 property OddColor: TColor read FOddColor write FOddColor;
679                 property UseSamba: Boolean read FUseSamba write FUseSamba;
680                 property ResAnchorJamp: Boolean read FResAnchorJamp write FResAnchorJamp;
681
682                 // \83G\83f\83B\83^
683                 property SpaceToNBSP    : Boolean       read FSpaceToNBSP               write FSpaceToNBSP;
684                 property AmpToCharRef   : Boolean       read FAmpToCharRef      write FAmpToCharRef;
685
686                 property SelectInterval : Integer       read FSelectInterval    write FSelectInterval;
687                 //Tab\95Û\91
688                 property TabAutoLoadSave: Boolean           read FTabAutoLoadSave      write FTabAutoLoadSave;
689                 property KuroutSettingTabIndex: Integer read FKuroutSettingTabIndex write FKuroutSettingTabIndex;
690 end;
691
692
693
694 implementation
695
696 type
697         TSoundName = record
698                 Name: string;
699                 ViewName: string;
700                 FileName: string;
701         end;
702
703 const
704         INI_FILE_NAME: string                            = 'gikoNavi.ini';
705         BOARD_URL_INI_FILE_NAME: string = 'url.ini';
706         DEFAULT_FONT_NAME: string                = '\82l\82\82o\83S\83V\83b\83N';
707         DEFAULT_FONT_SIZE: Integer              = 9;
708         DEFAULT_FONT_COLOR: string              = 'clWindowText';
709         DEFAULT_WINDOW_COLOR: string    = 'clWindow';
710         DEFAULT_TAB_FONT_NAME: string            = '\82l\82\82o\83S\83V\83b\83N';
711         DEFAULT_TAB_FONT_SIZE: Integer          = 9;
712         DEFAULT_2CH_BOARD_URL1: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
713         DEFAULT_2CH_BOARD_URL2: string = 'http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html';
714                                      //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¤
715                                                                                                                                 //'http://www.2ch.net/newbbsmenu.html';
716         GIKO_ENCRYPT_TEXT: string                = 'gikoNaviEncryptText';
717
718 var
719         SOUND_NAME: array[0..4] of TSoundName = (
720                 (Name: 'New';                           ViewName: '\8eæ\93¾\90¬\8c÷';                                    FileName: ''),
721                 (Name: 'NewDiff';               ViewName: '\8eæ\93¾\90¬\8c÷(\8d·\95ª)';              FileName: ''),
722                 (Name: 'NoChange';       ViewName: '\96¢\8dX\90V';                                             FileName: ''),
723 //              (Name: 'RoundEnd';       ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82 \82è)'; FileName: ''),
724 //              (Name: 'RoundNone';     ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82È\82µ)'; FileName: ''),
725                 (Name: 'ResEnd';                 ViewName: '\83\8c\83X\91\97\90M\8a®\97¹';                       FileName: ''),
726                 (Name: 'Error';                 ViewName: '\83G\83\89\81[';                                              FileName: ''));
727
728 constructor TGikoBBSColumnList.Create;
729 begin
730         inherited;
731 end;
732
733 destructor TGikoBBSColumnList.Destroy;
734 begin
735         inherited;
736 end;
737
738 function TGikoBBSColumnList.GetItem( index : integer ) : TGikoBBSColumnID;
739 begin
740         Result := TGikoBBSColumnID( inherited Items[ index ] );
741 end;
742
743 procedure TGikoBBSColumnList.SetItem( index : integer; value : TGikoBBSColumnID);
744 begin
745         inherited Items[ index ] := Pointer( value );
746 end;
747
748 function TGikoBBSColumnList.Add( value : TGikoBBSColumnID ) : Integer;
749 begin
750         Result := inherited Add( Pointer( value ) );
751 end;
752
753 constructor TGikoCategoryColumnList.Create;
754 begin
755         inherited;
756 end;
757
758 destructor TGikoCategoryColumnList.Destroy;
759 begin
760         inherited;
761 end;
762
763 function TGikoCategoryColumnList.GetItem( index : integer ) : TGikoCategoryColumnID;
764 begin
765         Result := TGikoCategoryColumnID( inherited Items[ index ] );
766 end;
767
768 procedure TGikoCategoryColumnList.SetItem( index : integer; value : TGikoCategoryColumnID);
769 begin
770         inherited Items[ index ] := Pointer( value );
771 end;
772
773 function TGikoCategoryColumnList.Add( value : TGikoCategoryColumnID ) : Integer;
774 begin
775         Result := inherited Add( Pointer( value ) );
776 end;
777
778 constructor TGikoBoardColumnList.Create;
779 begin
780         inherited;
781 end;
782
783 destructor TGikoBoardColumnList.Destroy;
784 begin
785         inherited;
786 end;
787
788 function TGikoBoardColumnList.GetItem( index : integer ) : TGikoBoardColumnID;
789 begin
790         Result := TGikoBoardColumnID( inherited Items[ index ] );
791 end;
792
793 procedure TGikoBoardColumnList.SetItem( index : integer; value : TGikoBoardColumnID);
794 begin
795         inherited Items[ index ] := Pointer( value );
796 end;
797
798 function TGikoBoardColumnList.Add( value : TGikoBoardColumnID ) : Integer;
799 begin
800         Result := inherited Add( Pointer( value ) );
801 end;
802
803 //\83R\83\93\83X\83g\83\89\83N\83^
804 constructor TSetting.Create();
805 begin
806         FNameList := TStringList.Create;
807         FMailList := TStringList.Create;
808         FSelectTextList := TStringList.Create;
809         FBoardURLs := TStringList.Create;
810         FBBSColumnOrder := TGikoBBSColumnList.Create;
811         FCategoryColumnOrder := TGikoCategoryColumnList.Create;
812         FBoardColumnOrder := TGikoBoardColumnList.Create;
813         FNameList.Duplicates := dupIgnore;
814         FMailList.Duplicates := dupIgnore;
815         FBoardURLs.Duplicates := dupIgnore;
816         FSelectTextList.Duplicates := dupIgnore;
817         ReadSettingFile();
818         ReadBoardURLsFile();
819 end;
820
821 //\83f\83X\83g\83\89\83N\83^
822 destructor TSetting.Destroy();
823 begin
824         inherited;
825         FBoardColumnOrder.Free;
826         FCategoryColumnOrder.Free;
827         FBBSColumnOrder.Free;
828         FSelectTextList.Free;
829         FBoardURLs.Free;
830         FMailList.Free;
831         FNameList.Free;
832 end;
833
834 //\8f\89\8aú\89»\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
835 function TSetting.GetFileName(): string;
836 begin
837         Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
838 end;
839
840 //\94Â\8dX\90V\97pURL\90Ý\92è\83t\83@\83C\83\8b\96¼\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
841 function TSetting.GetBoardURLFileName(): string;
842 begin
843         Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
844 end;
845
846 //\90Ý\92è\83t\83@\83C\83\8b\93Ç\8d\9e
847 procedure TSetting.ReadSettingFile();
848 const
849         DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
850         DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
851         DEFAULT_BOARD_WIDTH: array[0..8] of Integer = (350, 60, 60, 60, 60, 60, 80, 130, 130);
852         MAX_WIDTH: Integer = 2000;
853 var
854         ini: TMemIniFile;
855         i: Integer;
856         id, code : Integer;
857         wkList: TStringList;
858         wkStr: string;
859         Exists: Boolean;
860         s: string;                                               
861 //      id: Integer;
862         CoolSet: TCoolSet;
863 begin
864         Exists := FileExists(GetFileName);
865         ini := TMemIniFile.Create(GetFileName);
866         try
867                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
868                 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
869                 //HTTP1.1\8eg\97p
870                 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
871                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
872                 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
873
874                 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
875                 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
876                 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
877                 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
878                 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
879
880                 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
881                 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
882                 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
883                 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
884                 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
885
886                 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
887                 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
888                 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
889                 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
890                 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
891                 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
892
893                 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
894                 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
895                 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
896                 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
897                 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
898                 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
899
900                 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
901                 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
902                 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
903                 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
904                 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
905                 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
906                 FUseOddColorOddResNum := ini.ReadBool('Window','UseOddColor', False);
907                 FOddColor := StringToColor(ini.ReadString('Window', 'OddColor', DEFAULT_WINDOW_COLOR));
908
909                 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
910                 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
911                 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
912                 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
913                 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
914                 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
915
916                 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
917                 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
918                 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
919                 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
920
921                 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
922                 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
923                 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
924                 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
925                 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
926                 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
927
928                 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
929                 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
930                 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
931                 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
932                 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
933
934                 if FWindowHeight <= 0 then      FWindowHeight := 400;
935                 if FWindowWidth <= 0 then FWindowWidth := 600;
936
937                 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
938
939                 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
940                 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
941                 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
942                 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
943                 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
944                 FEditWindowStay := ini.ReadBool('EditorWindowSize', 'Stay', False);
945                 FEditWindowTranslucent := ini.ReadBool('EditorWindowSize', 'Translucent', False);
946
947                 FOptionDialogTabIndex := ini.ReadInteger('OptionDialog', 'TabIndex', 0);
948
949                 //\83c\81[\83\8b\83o\81[
950                 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
951                 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
952                 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
953                 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
954                 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
955                 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
956                 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
957                 //\83c\81[\83\8b\83o\81[Wrapable
958                 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
959                 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
960
961                 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
962                 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
963                 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
964                 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
965
966                 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
967                 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
968
969                 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
970
971                 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
972                 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
973                 FCabinetIndex := ini.ReadInteger('Cabinet', 'Index', 0);
974
975                 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
976                 FListHeight := ini.ReadInteger('List', 'Height', 180);
977                 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
978                 FListWidth := ini.ReadInteger('List', 'Width', 180);
979                 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
980 //              FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
981 //              FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
982
983                 wkList := TStringList.Create;
984                 try
985                         ini.ReadSection('Name', wkList);
986                         for i := 0 to wkList.Count - 1 do begin
987                                 wkStr := ini.ReadString('Name', wkList[i], '');
988                                 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
989                                         FNameList.Add(wkStr);
990                         end;
991                         ini.ReadSection('Mail', wkList);
992                         for i := 0 to wkList.Count - 1 do begin
993                                 wkStr := ini.ReadString('Mail', wkList[i], '');
994                                 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
995                                         FMailList.Add(wkStr);
996                         end;
997                         ini.ReadSection('SelectText', wkList);
998                         for i := 0 to wkList.Count - 1 do begin
999                                 wkStr := ini.ReadString('SelectText', wkList[i], '');
1000                                 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
1001                                         FSelectTextList.Add(wkStr);
1002                         end;
1003                 finally
1004                         wkList.Free;
1005                 end;
1006
1007                 // \83\8a\83X\83g\83J\83\89\83\80\95\9d
1008                 wkList := TStringList.Create;
1009                 try
1010                         ini.ReadSection('BBSColumnWidth', wkList);
1011                         if Length(FBBSColumnWidth) <> wkList.Count then begin
1012                                 ini.EraseSection('BBSColumnWidth');
1013                         end;
1014                         for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1015                                 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
1016                                 if BBSColumnWidth[i] > MAX_WIDTH then
1017                                         BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i];
1018                         end;
1019                         ini.ReadSection('CategoryColumnWidth', wkList);
1020                         if Length(FCategoryColumnWidth) <> wkList.Count then begin
1021                                 ini.EraseSection('CategoryColumnWidth');
1022                         end;
1023                         for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1024                                 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
1025                                 if CategoryColumnWidth[i] > MAX_WIDTH then
1026                                         CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i];
1027                         end;
1028                         ini.ReadSection('BoardColumnWidth', wkList);
1029                         if Length(FBoardColumnWidth) <> wkList.Count then begin
1030                                 ini.EraseSection('BoardColumnWidth');
1031                         end;
1032                         for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1033                                 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
1034                                 if BoardColumnWidth[i] > MAX_WIDTH then
1035                                         BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i];
1036                         end;
1037                 finally
1038                         wkList.Free;
1039                 end;
1040
1041                 // \83J\83e\83S\83\8a\83\8a\83X\83g\83J\83\89\83\80\8f\87\8f\98
1042                 wkList := TStringList.Create;
1043                 try
1044                         ini.ReadSection( 'BBSColumnOrder', wkList );
1045                         for i := 0 to wkList.Count - 1 do begin
1046                                 wkStr := ini.ReadString( 'BBSColumnOrder', 'ID' + IntToStr( i ), '' );
1047                                 Val( wkStr, id, code );
1048                                 if code = 0 then
1049                                         FBBSColumnOrder.Add( TGikoBBSColumnID( id ) );
1050                         end;
1051                         if FBBSColumnOrder.Count = 0 then begin
1052                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1053                                 for i := 0 to Integer( High( TGikoBBSColumnID ) ) do
1054                                         FBBSColumnOrder.Add( TGikoBBSColumnID( i ) );
1055                         end;
1056
1057                         ini.ReadSection( 'CategoryColumnOrder', wkList );
1058                         for i := 0 to wkList.Count - 1 do begin
1059                                 wkStr := ini.ReadString( 'CategoryColumnOrder', 'ID' + IntToStr( i ), '' );
1060                                 Val( wkStr, id, code );
1061                                 if code = 0 then
1062                                         FCategoryColumnOrder.Add( TGikoCategoryColumnID( id ) );
1063                         end;
1064                         if FCategoryColumnOrder.Count = 0 then begin
1065                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1066                                 for i := 0 to Integer( High( TGikoCategoryColumnID ) ) do
1067                                         FCategoryColumnOrder.Add( TGikoCategoryColumnID( i ) );
1068                         end;
1069
1070                         ini.ReadSection( 'BoardColumnOrder', wkList );
1071                         for i := 0 to wkList.Count - 1 do begin
1072                                 wkStr := ini.ReadString( 'BoardColumnOrder', 'ID' + IntToStr( i ), '' );
1073                                 Val( wkStr, id, code );
1074                                 if code = 0 then
1075                                         FBoardColumnOrder.Add( TGikoBoardColumnID( id ) );
1076                         end;
1077                         if FBoardColumnOrder.Count = 0 then begin
1078                                 // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
1079                                 for i := 0 to Integer( High( TGikoBoardColumnID ) ) do
1080                                         FBoardColumnOrder.Add( TGikoBoardColumnID( i ) );
1081                         end;
1082                 finally
1083                         wkList.Free;
1084                 end;
1085
1086                 //\83\8a\83X\83g\94Ô\8d\86
1087                 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
1088                 //CSS
1089                 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
1090                 //CSS\83t\83@\83C\83\8b\96¼
1091                 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
1092
1093                 //Mail\97\93\95\\8e¦
1094                 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
1095                 // \83\8c\83X\95\\8e¦\94Í\88Í
1096                 if ini.ReadBool('Thread', 'OnlyAHundredRes',false) then
1097                         FResRange := 100        // \8cÃ\82¢\90Ý\92è\82Ì\8cÝ\8a·\97p
1098                 else
1099                         FResRange := ini.ReadInteger( 'Thread', 'ResRange', Ord( grrAll ) );
1100                 FResRangeHold := ini.ReadBool( 'Thread', 'ResRangeHold', False );
1101                 // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
1102                 FThreadRange := TGikoThreadRange( ini.ReadInteger('ThreadList', 'ThreadRange', Ord( gtrAll )) );
1103                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
1104                 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
1105                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
1106                 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
1107                 //\8dí\8f\9c\8am\94F
1108                 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
1109                 //\8fI\97¹\8am\94F
1110                 FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
1111                 //AllTabClose
1112                 FShowDialogForAllTabClose := ini.ReadBool('Function','ShowDialogForAllTabClose',false);
1113                 //Samba
1114                 FUseSamba := ini.ReadBool('Function','UseSamba', True);
1115                 //ResAnchorjamp
1116                 ResAnchorJamp := ini.ReadBool('Function', 'ResAnchoJamp', True);
1117                 //\83\8d\83O\83t\83H\83\8b\83_
1118                 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
1119                 NewLogFolder := '';
1120
1121                 //\94ÂURL
1122                 //\95¡\90\94\93o\98^\82Å\82«\82é\82æ\82¤\82É\82µ\82ÄFBoardURLs\82É\82µ\82½\81@2003/10/05
1123                 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
1124
1125                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
1126                 FUserID := ini.ReadString('Attestation', 'UserID', '');
1127                 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
1128                 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
1129                 FForcedLogin := ini.ReadBool('Attestation', 'FForcedLogin', False);
1130 //              FDolibURL       := ini.ReadString('Attestation', 'FDolibURL', DOLIB_LOGIN_URL);
1131
1132                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
1133                 FURLApp := ini.ReadBool('URLApp', 'Select', False);
1134                 FURLAppFile := ini.ReadString('URLApp', 'File', '');
1135
1136                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
1137                 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
1138
1139                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
1140                 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
1141
1142                 //\83A\83h\83\8c\83X\83o\81[
1143                 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
1144                 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
1145                 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
1146                 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
1147
1148                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
1149                 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
1150                 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
1151                 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
1152
1153                 // \83u\83\89\83E\83U
1154                 FBrowserAutoMaximize := TGikoBrowserAutoMaximize(
1155                         ini.ReadInteger('Window', 'BrowserAutoMaximize', Ord(gbmDoubleClick)) );
1156
1157                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1158                 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
1159                 FNonAcquiredCount := ini.ReadBool('ThreadList', 'NonAcquiredCount', False);
1160                 FCreationTimeLogs := ini.ReadBool('ThreadList', 'CreationTimeLogs', True);
1161                 FFutureThread := ini.ReadBool('ThreadList', 'FutureThread', True);
1162                 FSelectInterval := ini.ReadInteger('ThreadList', 'SelectInterval', 110);
1163                 //\83\\81[\83g\8f\87
1164                 FBBSSortIndex := ini.ReadInteger('ThreadList', 'BBSSortIndex', 0);
1165                 FBBSSortOrder := ini.ReadBool('ThreadList', 'BBSSortOrder', True);
1166                 FCategorySortIndex := ini.ReadInteger('ThreadList', 'CategorySortIndex', 0);
1167                 FCategorySortOrder := ini.ReadBool('ThreadList', 'CategorySortOrder', True);
1168                 FBoardSortIndex := ini.ReadInteger('ThreadList', 'BoardSortIndex', 0);
1169                 FBoardSortOrder := ini.ReadBool('ThreadList', 'BoardSortOrder', True);
1170                 //Dat\97\8e\82¿\83X\83\8c\83\\81[\83g\8f\87
1171                 FDatOchiSortIndex := ini.ReadInteger('ThreadList', 'DatOchiSortIndex', -1);
1172                 FDatOchiSortOrder := ini.ReadBool('ThreadList', 'DatOchiSortOrder', False);
1173
1174                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
1175                 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
1176                 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
1177                 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
1178
1179                 //\83T\83E\83\93\83h
1180                 if Exists then begin
1181                         for i := 0 to GetSoundCount - 1 do begin
1182                                 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
1183                                 if not FileExists(SoundFileName[i]) then
1184                                         SoundFileName[i] := '';
1185                         end;
1186                 end else begin
1187                         s := ExtractFileDir(Application.ExeName) + '\sound\';
1188                         SoundFileName[0] := s + '\8eæ\93¾\90¬\8c÷.wav';
1189                         SoundFileName[1] := s + '\8eæ\93¾\90¬\8c÷(\8d·\95ª).wav';
1190                         SoundFileName[2] := s + '\96¢\8dX\90V.wav';
1191                         SoundFileName[3] := '';
1192                         SoundFileName[4] := s + '\83G\83\89\81[.wav';
1193                 end;
1194
1195                 //\83N\81[\83\8b\83o\81[
1196                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1197                         CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
1198                         CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
1199                         CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
1200                         MainCoolSet[i] := CoolSet;
1201                 end;
1202                 FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
1203                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1204                         CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
1205                         CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
1206                         CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
1207                         ListCoolSet[i] := CoolSet;
1208                 end;
1209                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1210                         CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
1211                         CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
1212                         CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
1213                         BrowserCoolSet[i] := CoolSet;
1214                 end;
1215
1216                 //\82 \82Ú\81`\82ñ
1217                 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
1218                 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
1219                 FPopUpAbon               := ini.ReadBool('Abon','Popup',false);
1220                 FShowNGLinesNum := ini.ReadBool('Abon','ShowNGLines',false);
1221                 FAddResAnchor := ini.ReadBool('Abon','AddResAnchor',false);
1222                 FDeleteSyria :=  ini.ReadBool('Abon','DeleteSyria',false);
1223
1224                 // \83G\83f\83B\83^
1225                 FSpaceToNBSP    := ini.ReadBool( 'Editor', 'SpaceToNBSP', True );
1226                 FAmpToCharRef   := ini.ReadBool( 'Editor', 'AmpToCharRef', False );
1227
1228                 //Tab\8e©\93®\95Û\91\81A\93Ç\82Ý\8d\9e\82Ý
1229                 FTabAutoLoadSave    := ini.ReadBool('TabAuto', 'TabAutoLoadSave', False);
1230
1231                 FKuroutSettingTabIndex := ini.ReadInteger('OptionDialog', 'KuroutTabIndex' , 0);
1232
1233
1234         finally
1235                 ini.Free;
1236         end;
1237 end;
1238 //\94Â\8dX\90V\97pURL\93Ç\82Ý\8d\9e\82Ý
1239 procedure TSetting.ReadBoardURLsFile();
1240 var
1241         ini: TMemIniFile;
1242         urlNum: Integer;
1243         i : Integer;
1244 begin
1245         if not FileExists(GetBoardURLFileName()) then
1246         MakeURLIniFile();
1247         ini := TMemIniFile.Create(GetBoardURLFileName());
1248         try
1249                 urlNum := ini.ReadInteger('URL','count',0);
1250                 BoardURLSelected := ini.ReadInteger('URL','selected',0);
1251                 for i := 0 to urlNum - 1 do begin
1252                         FBoardURLs.Append(ini.ReadString('URL',IntToStr(i+1),''));
1253                 end;
1254         finally
1255                 ini.Free;
1256         end;
1257
1258 end;
1259 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(system)
1260 procedure TSetting.WriteSystemSettingFile();
1261 var
1262         ini: TMemIniFile;
1263 begin
1264         ini := TMemIniFile.Create(GetFileName());
1265         try
1266                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
1267                 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
1268                 //HTTP1.1\8eg\97p
1269                 ini.WriteBool('HTTP', 'Protocol', FProtocol);
1270                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
1271                 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
1272
1273                 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
1274                 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
1275                 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
1276                 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
1277                 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
1278
1279                 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
1280                 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
1281                 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
1282                 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
1283                 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
1284
1285                 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
1286                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1287                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1288                 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
1289                 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
1290                 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
1291                 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
1292
1293                 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
1294                 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
1295                 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
1296                 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
1297
1298                 ini.WriteString('Window', 'ListFontName', FListFontName);
1299                 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
1300                 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
1301                 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
1302                 ini.WriteBool('Window','UseOddColor',FUseOddColorOddResNum);
1303                 ini.WriteString('Window', 'OddColor',ColorToString(FOddColor));
1304
1305                 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
1306                 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
1307                 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
1308                 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
1309
1310                 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
1311                 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
1312                 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
1313                 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
1314
1315                 ini.WriteString('Window', 'HintFontName', FHintFontName);
1316                 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
1317                 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
1318                 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
1319
1320                 ini.UpdateFile;
1321         finally
1322                 ini.Free;
1323         end;
1324 end;
1325
1326 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(window)
1327 procedure TSetting.WriteWindowSettingFile();
1328 var
1329         i: Integer;
1330         ini: TMemIniFile;
1331         CoolSet: TCoolSet;
1332         wkList  : TStringList;
1333 begin
1334         ini := TMemIniFile.Create(GetFileName());
1335         try
1336                 ini.WriteInteger('WindowSize', 'Top', WindowTop);
1337                 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
1338                 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
1339                 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
1340                 ini.WriteBool('WindowSize', 'Max', WindowMax);
1341
1342                 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
1343
1344                 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
1345                 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
1346                 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
1347                 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
1348                 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
1349                 ini.WriteBool('EditorWindowSize', 'Stay', EditWindowStay);
1350                 ini.WriteBool('EditorWindowSize', 'Translucent', EditWindowTranslucent);
1351
1352                 ini.WriteInteger('OptionDialog', 'TabIndex', FOptionDialogTabIndex);
1353
1354                 //\83c\81[\83\8b\83o\81[
1355                 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
1356                 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
1357                 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
1358                 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
1359                 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
1360                 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
1361                 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
1362                 //\83c\81[\83\8b\83o\81[Wrapable
1363                 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
1364                 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
1365
1366                 //\83^\83u
1367                 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
1368                 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
1369                 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
1370                 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
1371
1372                 //\83\81\83b\83Z\81[\83W\83o\81[
1373                 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
1374                 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
1375
1376                 //\83X\83e\81[\83^\83X\83o\81[
1377                 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
1378
1379                 //\83L\83\83\83r\83l\83b\83g
1380                 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
1381                 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
1382                 ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
1383
1384                 //\83\8a\83X\83g\82Ì\83T\83C\83Y\82Æ\90\82\92¼\90\85\95½
1385                 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
1386                 ini.WriteInteger('List', 'Height', FListHeight);
1387                 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
1388                 ini.WriteInteger('List', 'Width', FListWidth);
1389                 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
1390 //              ini.WriteBool('List', 'HeightMax', FListHeightMax);
1391 //              ini.WriteBool('List', 'WidthMax', FListWidthMax);
1392
1393
1394 //              ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
1395
1396                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
1397                 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1398                 //CSS\8eg\97p
1399                 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1400                 //CSS\83t\83@\83C\83\8b\96¼
1401                 ini.WriteString('CSS', 'FileName', FCSSFileName);
1402                 //Mail\97\93\95\\8e¦
1403                 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1404                 // \83\8c\83X\95\\8e¦\94Í\88Í
1405                 ini.DeleteKey( 'Thread', 'OnlyAHundredRes' );   // \8cÃ\82¢\90Ý\92è\82Ì\8dí\8f\9c
1406                 ini.WriteInteger('Thread', 'ResRange', FResRange);
1407                 ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
1408                 // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
1409                 ini.WriteInteger('ThreadList', 'ThreadRange', Ord( FThreadRange ));
1410                 //\83\8d\83O\8dí\8f\9c\8am\94F
1411                 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1412                 //\8fI\97¹\8am\94F
1413                 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1414                 //AllTabClose
1415                 ini.WriteBool('Function','ShowDialogForAllTabClose', FShowDialogForAllTabClose);
1416                 //Samba
1417                 ini.WriteBool('Function','UseSamba', FUseSamba);
1418                 //ResAnchorjamp
1419                 ini.WriteBool('Function', 'ResAnchoJamp', ResAnchorJamp);
1420
1421                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
1422                 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1423                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
1424                 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1425                 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1426
1427                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
1428                 ini.WriteString('Attestation', 'UserID', FUserID);
1429                 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1430                 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1431                 ini.WriteBool('Attestation', 'FForcedLogin', FForcedLogin);
1432                 ini.WriteString('Attestation', 'FDolibURL', FDolibURL);
1433
1434                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
1435                 ini.WriteBool('URLApp', 'Select', FURLApp);
1436                 ini.WriteString('URLApp', 'File', FURLAppFile);
1437
1438                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
1439                 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1440
1441                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
1442                 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1443
1444                 //\83A\83h\83\8c\83X\83o\81[
1445                 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1446                 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1447                 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1448                 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1449
1450                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
1451                 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1452                 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1453                 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1454
1455                 ini.WriteInteger('Window', 'BrowserAutoMaximize', Ord( BrowserAutoMaximize ) );
1456
1457                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1458                 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1459                 ini.WriteBool('ThreadList', 'NonAcquiredCount', FNonAcquiredCount);
1460                 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1461                 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1462                 ini.WriteInteger('ThreadList', 'SelectInterval', FSelectInterval);
1463                 //\83\\81[\83g\8f\87
1464                 ini.WriteInteger('ThreadList', 'BBSSortIndex', FBBSSortIndex);
1465                 ini.WriteBool('ThreadList', 'BBSSortOrder', FBBSSortOrder);
1466                 ini.WriteInteger('ThreadList', 'CategorySortIndex', FCategorySortIndex);
1467                 ini.WriteBool('ThreadList', 'CategorySortOrder', FCategorySortOrder);
1468                 ini.WriteInteger('ThreadList', 'BoardSortIndex', FBoardSortIndex);
1469                 ini.WriteBool('ThreadList', 'BoardSortOrder', FBoardSortOrder);
1470                 ini.WriteInteger('ThreadList', 'DatOchiSortIndex', FDatOchiSortIndex);
1471                 ini.WriteBool('ThreadList', 'DatOchiSortOrder', FDatOchiSortOrder);
1472
1473                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
1474                 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1475                 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1476                 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1477
1478                 // \83\8a\83X\83g\83J\83\89\83\80\95\9d
1479                 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1480                         ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1481                 end;
1482                 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1483                         ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1484                 end;
1485                 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1486                         ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1487                 end;
1488
1489                 wkList := TStringList.Create;
1490                 try
1491                         // \83J\83e\83S\83\8a\83\8a\83X\83g\8f\87\8f\98
1492                         ini.ReadSection( 'BBSColumnOrder', wkList );
1493                         for i := wkList.Count - 1 downto 0 do
1494                                 ini.DeleteKey( 'BBSColumnOrder', wkList[ i ] );
1495                         for i := 0 to FBBSColumnOrder.Count - 1 do
1496                                 ini.WriteInteger( 'BBSColumnOrder', 'ID' + IntToStr( i ), Ord( FBBSColumnOrder[ i ] ) );
1497
1498                         // \94Â\83\8a\83X\83g\8f\87\8f\98
1499                         ini.ReadSection( 'CategoryColumnOrder', wkList );
1500                         for i := wkList.Count - 1 downto 0 do
1501                                 ini.DeleteKey( 'CategoryColumnOrder', wkList[ i ] );
1502                         for i := 0 to FCategoryColumnOrder.Count - 1 do
1503                                 ini.WriteInteger( 'CategoryColumnOrder', 'ID' + IntToStr( i ), Ord( FCategoryColumnOrder[ i ] ) );
1504
1505                         // \83X\83\8c\83\8a\83X\83g\8f\87\8f\98
1506                         ini.ReadSection( 'BoardColumnOrder', wkList );
1507                         for i := wkList.Count - 1 downto 0 do
1508                                 ini.DeleteKey( 'BoardColumnOrder', wkList[ i ] );
1509                         for i := 0 to FBoardColumnOrder.Count - 1 do
1510                                 ini.WriteInteger( 'BoardColumnOrder', 'ID' + IntToStr( i ), Ord( FBoardColumnOrder[ i ] ) );
1511                 finally
1512                         wkList.Free;
1513                 end;
1514
1515                 //\83T\83E\83\93\83h
1516                 for i := 0 to GetSoundCount - 1 do begin
1517                         if not FileExists(SoundFileName[i]) then
1518                                 SoundFileName[i] := '';
1519                         ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1520                 end;
1521
1522                 //CoolBar
1523                 ini.EraseSection('MainCoolBar');
1524                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1525                         CoolSet := MainCoolSet[i];
1526                         ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1527                         ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1528                         ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1529                 end;
1530                 ini.EraseSection('ListCoolBar');
1531                 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1532                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1533                         CoolSet := ListCoolSet[i];
1534                         ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1535                         ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1536                         ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1537                 end;
1538                 ini.EraseSection('BrowserCoolBar');
1539                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1540                         CoolSet := BrowserCoolSet[i];
1541                         ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1542                         ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1543                         ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1544                 end;
1545
1546                 //\82 \82Ú\81`\82ñ
1547                 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1548                 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1549                                 ini.WriteBool('Abon','Popup',FPopUpAbon);
1550                 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1551                 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1552                                 ini.WriteBool('Abon','DeleteSyria',FDeleteSyria);
1553
1554                 // \83G\83f\83B\83^
1555                 ini.WriteBool( 'Editor', 'SpaceToNBSP', FSpaceToNBSP );
1556                 ini.WriteBool( 'Editor', 'AmpToCharRef', FAmpToCharRef );
1557
1558                 ini.WriteBool('TabAuto', 'TabAutoLoadSave', FTabAutoLoadSave);
1559
1560                 ini.WriteInteger('OptionDialog', 'KuroutTabIndex', FKuroutSettingTabIndex);
1561
1562                 ini.UpdateFile;
1563         finally
1564                 ini.Free;
1565         end;
1566 end;
1567
1568 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(name & mail)
1569 procedure TSetting.WriteNameMailSettingFile();
1570 var
1571         i: Integer;
1572         ini: TMemIniFile;
1573 begin
1574         ini := TMemIniFile.Create(GetFileName());
1575         try
1576                 ini.EraseSection('Name');
1577                 ini.EraseSection('Mail');
1578                 ini.EraseSection('SelectText');
1579                 for i := 0 to FNameList.Count - 1 do begin
1580                         ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1581                         if i >= 39 then
1582                                 Break;
1583                 end;
1584                 for i := 0 to FMailList.Count - 1 do begin
1585                         ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1586                         if i >= 39 then
1587                                 Break;
1588                 end;
1589                 for i := 0 to FSelectTextList.Count - 1 do begin
1590                         ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1591                         if i >= 39 then
1592                                 Break;
1593                 end;
1594                 ini.UpdateFile;
1595         finally
1596                 ini.Free;
1597         end;
1598 end;
1599
1600 procedure TSetting.WriteFolderSettingFile();
1601 var
1602         ini: TMemIniFile;
1603 begin
1604         ini := TMemIniFile.Create(GetFileName());
1605         try
1606                 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1607                         ini.DeleteKey('Folder', 'LogFolder')
1608                 else
1609                         ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1610                 ini.UpdateFile;
1611         finally
1612                 ini.Free;
1613         end;
1614 end;
1615 //\94Â\8dX\90V\97pBoardURL\82ð\95Û\91
1616 procedure TSetting.WriteBoardURLSettingFile();
1617 var
1618         ini: TMemIniFile;
1619                 i : Integer;
1620                 oldcount : Integer;
1621 begin
1622         ini := TMemIniFile.Create(GetBoardURLFileName());
1623         try
1624                 oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1625                 ini.WriteInteger('URL','count',FBoardURLs.Count);
1626                 ini.WriteInteger('URL','selected',BoardURLSelected);
1627                 for i := 0 to FBoardURLs.Count -1 do begin
1628                                         ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1629                 end;
1630                 if oldcount > FBoardURLs.Count then begin
1631                         for i := FBoardURLs.Count to oldcount do begin
1632                                 ini.DeleteKey('URL',IntToStr(i+1));
1633                         end;
1634                 end;
1635                 ini.UpdateFile;
1636         finally
1637                 ini.Free;
1638         end;
1639 end;
1640
1641 {$R-}
1642 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[
1643 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1644 begin
1645         Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1646 end;
1647
1648 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1649 begin
1650         Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1651 end;
1652
1653 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1654 begin
1655         Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1656 end;
1657 {$IFDEF DEBUG}
1658 {$R+}
1659 {$ENDIF}
1660
1661 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1662 begin
1663         if index in [0..Length(FBBSColumnWidth) - 1] then
1664                 FBBSColumnWidth[index] := value;
1665 end;
1666
1667 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1668 begin
1669         if index in [0..Length(FCategoryColumnWidth) - 1] then
1670                 FCategoryColumnWidth[index] := value;
1671 end;
1672
1673 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1674 begin
1675         if index in [0..Length(FBoardColumnWidth) - 1] then
1676                 FBoardColumnWidth[index] := value;
1677 end;
1678
1679 function TSetting.GetSoundCount: Integer;
1680 begin
1681         Result := Length(SOUND_NAME);
1682 end;
1683
1684 function TSetting.GetSoundName(Index: Integer): string;
1685 begin
1686         if (Index < GetSoundCount) and (Index >= 0) then
1687                 Result := SOUND_NAME[Index].Name
1688         else
1689                 Result := '';
1690 end;
1691
1692 function TSetting.GetSoundViewName(Index: Integer): string;
1693 begin
1694         if (Index < GetSoundCount) and (Index >= 0) then
1695                 Result := SOUND_NAME[Index].ViewName
1696         else
1697                 Result := '';
1698 end;
1699
1700 function TSetting.GetSoundFileName(Index: Integer): string;
1701 begin
1702         if (Index < GetSoundCount) and (Index >= 0) then
1703                 Result := SOUND_NAME[Index].FileName
1704         else
1705                 Result := '';
1706 end;
1707
1708 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1709 begin
1710         if (Index < GetSoundCount) and (Index >= 0) then
1711                 SOUND_NAME[Index].FileName := value;
1712 end;
1713
1714 function TSetting.FindSoundFileName(Name: string): string;
1715 var
1716         i: Integer;
1717 begin
1718         for i := 0 to GetSoundCount - 1 do begin
1719                 if SoundName[i] = Name then begin
1720                         Result := SoundFileName[i];
1721                         Exit;
1722                 end;
1723         end;
1724         Result := '';
1725 end;
1726
1727 function TSetting.Encrypt(s: string): string;
1728 var
1729         cryptObj: THogeCryptAuto;
1730         inputStream, outputStream: TStringStream;
1731 begin
1732         inputStream := TStringStream.Create(s);
1733         outputStream := TStringStream.Create('');
1734         cryptObj := THogeCryptAuto.Create;
1735         try
1736                 // \88Ã\8d\86\89»
1737                 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1738
1739                 // \83o\83C\83i\83\8a\82È\82Ì\82Å\95K\97v\82É\89\9e\82\82Ä\83e\83L\83X\83g\82É\95Ï\8a·
1740                 Result := HogeBase64Encode(outputStream.DataString);
1741         finally
1742                 cryptObj.Free;
1743                 outputStream.Free;
1744                 inputStream.Free;
1745         end;
1746 end;
1747
1748 function TSetting.Decrypt(s: string): string;
1749 var
1750         cryptObj: THogeCryptAuto;
1751         inputStream, outputStream: TStringStream;
1752 begin
1753         try
1754                 inputStream := TStringStream.Create(HogeBase64Decode(s));
1755         except
1756                 Result := '';
1757                 Exit;
1758         end;
1759         outputStream := TStringStream.Create('');
1760         cryptObj := THogeCryptAuto.Create;
1761         try
1762                 // \95\9c\8d\86
1763                 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1764                 Result := outputStream.DataString;
1765         finally
1766                 cryptObj.Free;
1767                 outputStream.Free;
1768                 inputStream.Free;
1769         end;
1770 end;
1771
1772 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1773 begin
1774         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1775                 Result := FMainCoolBar[Index]
1776         else begin
1777                 Result.FCoolID := -1;
1778                 Result.FCoolWidth := -1;
1779                 Result.FCoolBreak := False;
1780         end;
1781 end;
1782
1783 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1784 begin
1785         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1786                 Result := FListCoolBar[Index]
1787         else begin
1788                 Result.FCoolID := -1;
1789                 Result.FCoolWidth := -1;
1790                 Result.FCoolBreak := False;
1791         end;
1792 end;
1793
1794 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1795 begin
1796         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1797                 Result := FBrowserCoolBar[Index]
1798         else begin
1799                 Result.FCoolID := -1;
1800                 Result.FCoolWidth := -1;
1801                 Result.FCoolBreak := False;
1802         end;
1803 end;
1804
1805 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1806 begin
1807         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1808                 FMainCoolBar[Index] := CoolSet;
1809 end;
1810
1811 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1812 begin
1813         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1814                 FListCoolBar[Index] := CoolSet;
1815 end;
1816
1817 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1818 begin
1819         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1820                 FBrowserCoolBar[Index] := CoolSet;
1821 end;
1822
1823 //url.ini\82ª\82È\82¢\82Æ\82«\82É\90\90¬\82·\82é
1824 procedure TSetting.MakeURLIniFile();
1825 var
1826         ini: TMemIniFile;
1827 begin
1828         ini := TMemIniFile.Create(GetBoardURLFileName());
1829         try
1830                 ini.WriteInteger('URL','count',2);
1831                 ini.WriteInteger('URL','selected',2);
1832                 ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1833                 ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1834                 ini.UpdateFile;
1835         finally
1836                 ini.Free;
1837         end;
1838 end;
1839
1840 (*************************************************************************
1841  *\83{\81[\83h\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1842  *************************************************************************)
1843 function TSetting.GetBoardFileName: string;
1844 begin
1845         Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1846 end;
1847
1848 (*************************************************************************
1849  *\83{\81[\83h\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1850  *************************************************************************)
1851 function TSetting.GetCustomBoardFileName: string;
1852 begin
1853         Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1854 end;
1855
1856 (*************************************************************************
1857  *\83{\81[\83h\83f\83B\83\8c\83N\83g\83\8a\8eæ\93¾
1858  *************************************************************************)
1859 function TSetting.GetBoardDir: string;
1860 begin
1861         Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1862 end;
1863
1864 (*************************************************************************
1865  *\83e\83\93\83|\83\89\83\8a\83t\83H\83\8b\83_\81[\96¼\8eæ\93¾
1866  *************************************************************************)
1867 function TSetting.GetHtmlTempFileName: string;
1868 begin
1869         Result := TEMP_FOLDER;
1870 end;
1871
1872
1873 (*************************************************************************
1874  *\8eÀ\8ds\83t\83@\83C\83\8b\83t\83H\83\8b\83_\8eæ\93¾
1875  *************************************************************************)
1876 function TSetting.GetAppDir: string;
1877 begin
1878         Result := ExtractFilePath(Application.ExeName);
1879 end;
1880
1881 (*************************************************************************
1882  *TempHtml\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1883  *************************************************************************)
1884 function TSetting.GetTempFolder: string;
1885 begin
1886         Result := GetAppDir + TEMP_FOLDER;
1887 end;
1888
1889 (*************************************************************************
1890  *sent.ini\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1891  *************************************************************************)
1892 function TSetting.GetSentFileName: string;
1893 begin
1894         Result := GetAppDir + SENT_FILE_NAME;
1895 end;
1896
1897 (*************************************************************************
1898  *outbox.ini\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
1899  *************************************************************************)
1900 function TSetting.GetOutBoxFileName: string;
1901 begin
1902         Result := GetAppDir + OUTBOX_FILE_NAME;
1903 end;
1904
1905 (*************************************************************************
1906  *Config\83t\83H\83\8b\83_\8eæ\93¾
1907  *************************************************************************)
1908 function TSetting.GetConfigDir: string;
1909 begin
1910         Result := IncludeTrailingPathDelimiter(GetAppDir + CONFIG_DIR_NAME);
1911 end;
1912
1913 function TSetting.GetStyleSheetDir: string;
1914 begin
1915         Result := IncludeTrailingPathDelimiter(GetConfigDir + CSS_DIR_NAME);
1916 end;
1917
1918 function TSetting.GetSkinDir: string;
1919 begin
1920         Result := IncludeTrailingPathDelimiter(GetConfigDir + SKIN_DIR_NAME);
1921 end;
1922
1923 function TSetting.GetSkinHeaderFileName: string;
1924 begin
1925         Result := CSSFileName + SKIN_HEADER_FILE_NAME;
1926 end;
1927
1928 function TSetting.GetSkinFooterFileName: string;
1929 begin
1930         Result := CSSFileName + SKIN_FOOTER_FILE_NAME;
1931 end;
1932
1933 function TSetting.GetSkinNewResFileName: string;
1934 begin
1935         Result := CSSFileName + SKIN_NEWRES_FILE_NAME;
1936 end;
1937
1938 function TSetting.GetSkinResFileName: string;
1939 begin
1940         Result := CSSFileName + SKIN_RES_FILE_NAME;
1941 end;
1942
1943 function TSetting.GetSkinBookmarkFileName: string;
1944 begin
1945         Result := CSSFileName + SKIN_BOOKMARK_FILE_NAME;
1946 end;
1947
1948 function TSetting.GetSkinNewmarkFileName: string;
1949 begin
1950         Result := CSSFileName + SKIN_NEWMARK_FILE_NAME;
1951 end;
1952
1953 function TSetting.GetNGWordsDir: string;
1954 begin
1955         Result := IncludeTrailingPathDelimiter(GetConfigDir + NGWORDs_DIR_NAME);
1956 end;
1957
1958 function TSetting.GetBoardPlugInDir: string;
1959 begin
1960         Result := IncludeTrailingPathDelimiter(GetConfigDir + BOARD_PLUGIN_DIR_NAME);
1961 end;
1962
1963 procedure TSetting.SetUseCSS( value: Boolean );
1964 begin
1965
1966         FUseCSS := value;
1967
1968         FUseSkin :=
1969                 UseCSS and
1970                 (Pos( GetSkinDir, CSSFileName ) > 0) and
1971                 FileExists( GetSkinHeaderFileName );
1972
1973 end;
1974
1975 procedure TSetting.SetCSSFileName( fileName: string );
1976 begin
1977
1978         FCSSFileName := fileName;
1979
1980         FUseSkin :=
1981                 UseCSS and
1982                 (Pos( GetSkinDir, CSSFileName ) > 0) and
1983                 FileExists( GetSkinHeaderFileName );
1984
1985 end;
1986
1987 function TSetting.GetSambaFileName: string;
1988 begin
1989         Result := GetAppDir + SAMBATIME_FILE_NAME;
1990 end;
1991 //\94Â\8dX\90V\8f\9c\8aO\83J\83e\83S\83\8a\83\8a\83X\83g\95Û\91\83t\83@\83C\83\8b
1992 function TSetting.GetIgnoreFileName: string;
1993 begin
1994         Result := GetConfigDir + IGNORE_FILE_NAME;
1995 end;
1996
1997 end.
1998
1999