OSDN Git Service

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