OSDN Git Service

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