OSDN Git Service

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