OSDN Git Service

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