Develop and Download Open Source Software

Browse CVS Repository

Contents of /gikonavigoeson/gikonavi/Setting.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.33 - (show annotations) (download) (as text)
Tue Mar 30 12:45:25 2004 UTC (20 years ago) by h677
Branch: MAIN
Changes since 1.32: +8 -2 lines
File MIME type: text/x-pascal
Samba24エリマ「、ホケケソキ

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; //繝。繧、繝ウCoolBand縺ョ謨ー
11 LIST_COOLBAND_COUNT = 2; //譚ソCoolBand縺ョ謨ー
12 BROWSER_COOLBAND_COUNT = 3; //繝悶Λ繧ヲ繧カCoolBand縺ョ謨ー
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); // 繧ソ繝紋ス咲スョ
36 TGikoTabAppend = (gtaFirst, gtpLast); // 繧ソ繝冶ソス蜉?菴咲スョ
37 TGikoTabStyle = (gtsTab, gtsButton, gtsFlat); // 繧ソ繝悶せ繧ソ繧、繝ォ
38 TGikoListOrientation = (gloHorizontal, gloVertical); // 繝ェ繧ケ繝亥桙逶エ繝サ豌エ蟷ウ
39 TGikoListState = (glsMax, glsNormal, glsMin); // 繝ェ繧ケ繝医し繧、繧コ迥カ諷?/span>
40 // 繝昴ャ繝励い繝??陦ィ遉コ菴咲スョ
41 TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
42 gppRight, gppCenter, gppLeft,
43 gppRightBottom, gppBottom, gppLeftBottom);
44 //繝励Ξ繝薙Η繝シ繧オ繧、繧コ
45 TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
46
47 //CoolBar險ュ螳壹Ξ繧ウ繝シ繝?/span>
48 TCoolSet = record
49 FCoolID: Integer;
50 FCoolWidth: Integer;
51 FCoolBreak: Boolean;
52 end;
53
54 TSetting = class(TObject)
55 private
56 //蜿嶺ソ。繝舌ャ繝輔ぃ繧オ繧、繧コ
57 FRecvBufferSize: Integer;
58 //HTTP1.1菴ソ逕ィ
59 FProtocol: Boolean;
60 //繝励Ο繧ュ繧キ謗・邯唏TTP1.1菴ソ逕ィ
61 FProxyProtocol: Boolean;
62
63 //繝励Ο繧ュ繧キ?郁ェュ霎シ逕ィ??/span>
64 FReadProxy: Boolean;
65 FReadProxyAddress: string;
66 FReadProxyPort: Integer;
67 FReadProxyUserID: string;
68 FReadProxyPassword: string;
69
70 //繝励Ο繧ュ繧キ?域嶌霎シ逕ィ??/span>
71 FWriteProxy: Boolean;
72 FWriteProxyAddress: string;
73 FWriteProxyPort: Integer;
74 FWriteProxyUserID: string;
75 FWriteProxyPassword: string;
76
77 //繧ュ繝」繝薙ロ繝?ヨ
78 FCabinetFontName: string;
79 FCabinetFontSize: Integer;
80 FCabinetFontBold: Boolean;
81 FCabinetFontItalic: Boolean;
82 FCabinetFontColor: TColor;
83 FCabinetBackColor: TColor;
84
85 //繝ェ繧ケ繝?/span>
86 FListFontName: string;
87 FListFontSize: Integer;
88 FListFontBold: Boolean;
89 FListFontItalic: Boolean;
90 FListFontColor: TColor;
91 FListBackColor: TColor;
92
93 //繝悶Λ繧ヲ繧カ
94 FBrowserFontName: string; // ''...default
95 FBrowserFontSize: Integer; // 0...default
96 FBrowserFontBold: Integer; // 0...default, -1...False, 1...True
97 FBrowserFontItalic: Integer; // 荳翫↓蜷後§
98 FBrowserFontColor: Integer; // -1...default
99 FBrowserBackColor: Integer; // 荳翫↓蜷後§
100
101 //繧ィ繝?ぅ繧ソ
102 FEditorFontName: string;
103 FEditorFontSize: Integer;
104 FEditorFontBold: Boolean;
105 FEditorFontItalic: Boolean;
106 FEditorFontColor: TColor;
107 FEditorBackColor: TColor;
108
109 //繧ソ繝悶ヵ繧ゥ繝ウ繝?/span>
110 FBrowserTabFontName: string;
111 FBrowserTabFontSize: Integer;
112 FBrowserTabFontBold: Boolean;
113 FBrowserTabFontItalic: Boolean;
114
115 //繝偵Φ繝医え繧」繝ウ繝峨え
116 FHintFontName: string;
117 FHintFontSize: Integer;
118 //FHintFontBold: Boolean;
119 //FHintFontItalic: Boolean;
120 FHintFontColor: TColor;
121 FHintBackColor: TColor;
122
123 //繧ヲ繧」繝ウ繝峨え繧オ繧、繧コ
124 FWindowTop: Integer;
125 FWindowLeft: Integer;
126 FWindowHeight: Integer;
127 FWindowWidth: Integer;
128 FWindowMax: Boolean;
129 //繝ェ繧ケ繝医ン繝・繝シ繧ケ繧ソ繧、繝ォ
130 FListStyle: TViewStyle;
131
132 //繝??繝ォ繝舌?陦ィ遉コ
133 FStdToolBarVisible: Boolean;
134 FAddressBarVisible: Boolean;
135 FLinkBarVisible: Boolean;
136 FListToolBarVisible: Boolean;
137 FListNameBarVisible: Boolean;
138 FBrowserToolBarVisible: Boolean;
139 FBrowserNameBarVisible: Boolean;
140
141 //繝悶Λ繧ヲ繧カ繧ソ繝?/span>
142 FBrowserTabVisible: Boolean;
143 FBrowserTabPosition: TGikoTabPosition;
144 FBrowserTabAppend: TGikoTabAppend;
145 FBrowserTabStyle: TGikoTabStyle;
146
147 //繝。繝?そ繝シ繧ク繝舌?
148 FMessageBarVisible: Boolean;
149 FMessegeBarHeight: Integer;
150
151 //繧ケ繝??繧ソ繧ケ繝舌?
152 FStatusBarVisible: Boolean;
153
154 //繧ュ繝」繝薙ロ繝?ヨ蜿ッ隕悶?繧オ繧、繧コ
155 FCabinetVisible: Boolean;
156 FCabinetWidth: Integer;
157
158 //繝ェ繧ケ繝医?繝悶Λ繧ヲ繧カ繧オ繧、繧コ
159 FListOrientation: TGikoListOrientation;
160 FListHeight: Integer;
161 FListHeightState: TGikoListState;
162 FListWidth: Integer;
163 FListWidthState: TGikoListState;
164 // FListHeightMax: Boolean;
165 // FListWidthMax: Boolean;
166
167 //騾∽ソ。逕ィ蜷榊燕繝サ繝。繝シ繝ォ
168 FNameList: TStringList;
169 FMailList: TStringList;
170
171 //繧ィ繝?ぅ繧ソ繝シ繧ヲ繧」繝ウ繝峨え繧オ繧、繧コ
172 FEditWindowTop: Integer;
173 FEditWindowLeft: Integer;
174 FEditWindowHeight: Integer;
175 FEditWindowWidth: Integer;
176 FEditWindowMax: Boolean;
177 FEditWindowStay: Boolean;
178 FEditWindowTranslucent: Boolean;
179
180 //繝ェ繧ケ繝育分蜿キ陦ィ遉コ
181 FListViewNo: Boolean;
182 //CSS陦ィ遉コ
183 FUseCSS: Boolean;
184 //CSS繝輔ぃ繧、繝ォ蜷?/span>
185 FCSSFileName: string;
186 // 繧ケ繧ュ繝ウ陦ィ遉コ(荳?譎ら噪縺ェ繧ゅ?縺ァ ini 縺ォ菫晏ュ倥?縺輔l縺ェ縺?
187 FUseSkin: Boolean;
188 //mail谺?。ィ遉コ
189 FShowMail: Boolean;
190 //襍キ蜍墓凾譛?譁ー100繝ャ繧ケ陦ィ遉コ
191 FOnlyAHundredRes : Boolean;
192 //髱槭い繧ッ繝?ぅ繝匁凾繝ャ繧ケ繝昴ャ繝励い繝??陦ィ遉コ
193 FUnActivePopup: Boolean;
194 //繝ャ繧ケ繝昴ャ繝励い繝??繝倥ャ繝?繝シ繝懊?繝ォ繝?/span>
195 FResPopupHeaderBold: Boolean;
196
197 //繝ュ繧ー繝輔か繝ォ繝?
198 FLogFolder: string;
199 FNewLogFolder: string;
200
201 //繝ェ繧ケ繝医き繝ゥ繝?繝倥ャ繝?繝シ繧オ繧、繧コ
202 FBBSColumnWidth: array[0..0] of Integer;
203 FCategoryColumnWidth: array[0..3] of Integer;
204 FBoardColumnWidth: array[0..7] of Integer;
205
206 //邨櫁セシ縺ソ譁?ュ怜?
207 FSelectTextList: TStringList;
208
209 //譚ソ荳?隕ァURL
210 //FBoardURL2ch: string;
211 FBoardURLs: TStringList;
212 FBoardURLSelected: Integer;
213
214 //繝ヲ繝シ繧カID繝サ繝代せ繝ッ繝シ繝?/span>
215 FUserID: string;
216 FPassword: string;
217 FAutoLogin: Boolean;
218 FForcedLogin: Boolean;
219
220 //URL繧ッ繝ェ繝?け譎りオキ蜍輔い繝励Μ
221 FURLApp: Boolean;
222 FURLAppFile: string;
223
224 //mailto繧ッ繝ェ繝?け譎ょ虚菴?/span>
225 FOpenMailer: Boolean;
226
227 //蜑企勁遒コ隱?/span>
228 FDeleteMsg: Boolean;
229
230 //CoolBar?医Γ繧、繝ウ繝サ譚ソ繝サ繝悶Λ繧ヲ繧カ??/span>
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 //繝昴ャ繝励い繝??菴咲スョ
240 FPopupPosition: TGikoPopupPosition;
241
242 //繧「繝峨Ξ繧ケ繝舌?
243 FURLDisplay: Boolean;
244 FAddressBarTabStop: Boolean;
245 FLinkAddAddressBar: Boolean;
246 FAddressHistoryCount: Integer;
247
248 //逕サ蜒上?繝ャ繝薙Η繝シ
249 FPreviewVisible: Boolean;
250 FPreviewSize: TGikoPreviewSize;
251 FPreviewWait: Integer;
252
253 //繧ケ繝ャ繝?ラ荳?隕ァ譖エ譁ー繧「繧、繧ウ繝ウ陦ィ遉コ
254 FListIconVisible: Boolean;
255
256 //繧ケ繝ャ繝?ラ荳?隕ァ縺ァLog縺ョ縺ゅk繧ケ繝ャ繝?ラ縺ョ縺ソ繧ケ繝ャ菴懈?譌・繧定。ィ遉コ縺吶k縺?/span>
257 FCreationTimeLogs: Boolean;
258 //繧ケ繝ャ繝?ラ荳?隕ァ縺ョ繧ケ繝ャ逕滓?譌・縺ァ譛ェ譚・縺ョ繧ケ繝ャ縺ョ逕滓?譌・繧定。ィ遉コ縺励↑縺?/span>
259 FFutureThread: Boolean;
260
261 //譖ク縺崎セシ縺ソ譎ゅ?繧キ繝ウ譎る俣菴ソ逕ィ險ュ螳?/span>
262 FUseMachineTime: Boolean;
263 FTimeAdjustSec: Integer;
264 FTimeAdjust: Boolean;
265
266 //縺ゅ⊂縲懊s
267 FAbonDeleterlo : Boolean; //&rlo;繧貞炎繧九°
268 FAbonReplaceul : Boolean; //<ul>繧ソ繧ー繧?lt;br>繧ソ繧ー縺ォ鄂ョ謠帙☆繧九°
269 FPopUpAbon : Boolean; //繝ャ繧ケ繝昴ャ繝励い繝??譎ゅ?縺ゅ⊂縲懊s譛牙柑
270 FShowNGLinesNum : Boolean; //隧イ蠖薙@縺滂ショ?ァ繝ッ繝シ繝峨ヵ繧。繧、繝ォ縺ョ陦梧焚繧定。ィ遉コ
271 FAddResAnchor : Boolean; //NG繝ャ繧ケ縺ク縺ョ繝ャ繧ケ繧「繝ウ繧ォ繝シ繧定ソス蜉?縺吶k
272 FDeleteSyria : Boolean; //繧キ繝ェ繧「隱槭ヶ繝ゥ繧ッ繝ゥ蟇セ遲?/span>
273
274 // 繧ケ繝ャ繝?ラ邨櫁セシ繝輔ぅ繝シ繝ォ繝峨?蟷?/span>
275 FSelectComboBoxWidth : Integer;
276
277 // 譛?蠕後↓驕ク謚槭&繧後◆繧ェ繝励す繝ァ繝ウ繝?繧、繧「繝ュ繧ー縺ョ繧ソ繝?/span>
278 FOptionDialogTabIndex: Integer;
279
280 // 譛?蠕後↓驕ク謚槭&繧後◆繧ュ繝」繝薙ロ繝?ヨ
281 FCabinetIndex: Integer;
282
283 //邨ゆコ?凾縺ォ遒コ隱阪ム繧、繧「繝ュ繧ー繧定。ィ遉コ縺吶k縺?/span>
284 FShowDialogForEnd : Boolean;
285 //蜿門セ励Ξ繧ケ謨ー縺ィ繧ケ繝ャ繝?ラ縺ョ繝ャ繧ケ謨ー縺檎焚縺ェ縺」縺溘→縺阪↓騾壼クク閭梧勹濶イ縺ィ驕輔▲縺溯牡縺ョ閭梧勹濶イ繧剃スソ逕ィ縺吶k縺?/span>
286 FUseOddColorOddResNum: Boolean;
287 FOddColor: TColor;
288
289 //Samba24蟇セ遲匁ゥ溯?繧剃スソ縺?°
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 //蜿嶺ソ。繝舌ャ繝輔ぃ繧オ繧、繧コ
355 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
356 //HTTP1.1菴ソ逕ィ
357 property Protocol: Boolean read FProtocol write FProtocol;
358 //繝励Ο繧ュ繧キ謗・邯唏TTP1.1菴ソ逕ィ
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 //縺ゅ⊂縲懊s
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 // 繧ケ繝ャ繝?ラ邨櫁セシ繝輔ぅ繝シ繝ォ繝峨?蟷?/span>
531 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
532
533 // 譛?蠕後↓驕ク謚槭&繧後◆繧ェ繝励す繝ァ繝ウ繝?繧、繧「繝ュ繧ー縺ョ繧ソ繝?/span>
534 property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
535
536 // 譛?蠕後↓驕ク謚槭&繧後◆繧ュ繝」繝薙ロ繝?ヨ
537 property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
538
539 //邨ゆコ?凾縺ォ遒コ隱阪ム繧、繧「繝ュ繧ー繧定。ィ遉コ縺吶k縺?/span>
540 property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
541 //蜿門セ励Ξ繧ケ謨ー縺ィ繧ケ繝ャ繝?ラ縺ョ繝ャ繧ケ謨ー縺檎焚縺ェ縺」縺溘→縺阪↓騾壼クク閭梧勹濶イ縺ィ驕輔▲縺溯牡縺ョ閭梧勹濶イ繧剃スソ逕ィ縺吶k縺?/span>
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 = '?ュ?ウ ?ー繧エ繧キ繝?け';
562 DEFAULT_FONT_SIZE: Integer = 9;
563 DEFAULT_FONT_COLOR: string = 'clWindowText';
564 DEFAULT_WINDOW_COLOR: string = 'clWindow';
565 DEFAULT_TAB_FONT_NAME: string = '?ュ?ウ ?ー繧エ繧キ繝?け';
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 //繧ゅ≧縺吶$縺薙l縺梧ュ」蠑上↑譚ソ荳?隕ァ縺ォ縺ェ繧九h縺?/span>
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: '蜿門セ玲?蜉?#39;; FileName: ''),
576 (Name: 'NewDiff'; ViewName: '蜿門セ玲?蜉?蟾ョ蛻?'; FileName: ''),
577 (Name: 'NoChange'; ViewName: '譛ェ譖エ譁ー'; FileName: ''),
578 // (Name: 'RoundEnd'; ViewName: '蟾。蝗樒オゆコ?蜿門セ励≠繧?'; FileName: ''),
579 // (Name: 'RoundNone'; ViewName: '蟾。蝗樒オゆコ?蜿門セ励↑縺?'; FileName: ''),
580 (Name: 'ResEnd'; ViewName: '繝ャ繧ケ騾∽ソ。螳御コ?#39;; FileName: ''),
581 (Name: 'Error'; ViewName: '繧ィ繝ゥ繝シ'; FileName: ''));
582
583 //繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
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 //繝?せ繝医Λ繧ッ繧ソ
599 destructor TSetting.Destroy();
600 begin
601 inherited;
602 FSelectTextList.Free;
603 FBoardURLs.Free;
604 FMailList.Free;
605 FNameList.Free;
606 end;
607
608 //蛻晄悄蛹悶ヵ繧。繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
609 function TSetting.GetFileName(): string;
610 begin
611 Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
612 end;
613
614 //譚ソ譖エ譁ー逕ィURL險ュ螳壹ヵ繧。繧、繝ォ蜷搾シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
615 function TSetting.GetBoardURLFileName(): string;
616 begin
617 Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
618 end;
619
620 //險ュ螳壹ヵ繧。繧、繝ォ隱ュ霎シ
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 //蜿嶺ソ。繝舌ャ繝輔ぃ繧オ繧、繧コ
641 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
642 //HTTP1.1菴ソ逕ィ
643 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
644 //繝励Ο繧ュ繧キ謗・邯唏TTP1.1菴ソ逕ィ
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 //繝??繝ォ繝舌?
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 //繝??繝ォ繝舌?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 //繝ェ繧ケ繝医き繝ゥ繝?
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 //繝ェ繧ケ繝育分蜿キ
816 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
817 //CSS
818 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
819 //CSS繝輔ぃ繧、繝ォ蜷?/span>
820 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
821
822 //Mail谺?。ィ遉コ
823 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
824 //譛?譁ー100繝ャ繧ケ陦ィ遉コ
825 FOnlyAHundredRes := ini.ReadBool('Thread', 'OnlyAHundredRes',false);
826 //髱槭い繧ッ繝?ぅ繝匁凾繝ャ繧ケ繝昴ャ繝励い繝??陦ィ遉コ
827 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
828 //繝ャ繧ケ繝昴ャ繝励い繝??繝倥ャ繝?繝シ繝懊?繝ォ繝?/span>
829 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
830
831 //蜑企勁遒コ隱?/span>
832 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
833 //邨ゆコ?「コ隱?/span>
834 FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
835 //Samba
836 FUseSamba := ini.ReadBool('Function','UseSamba', True);
837 //繝ュ繧ー繝輔か繝ォ繝?
838 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
839 NewLogFolder := '';
840
841 //譚ソURL
842 //隍?焚逋サ骭イ縺ァ縺阪k繧医≧縺ォ縺励※FBoardURLs縺ォ縺励◆縲?2003/10/05
843 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
844
845 //隱崎ィシ逕ィ繝ヲ繝シ繧カID繝サ繝代せ繝ッ繝シ繝?/span>
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繧ッ繝ェ繝?け譎りオキ蜍輔い繝励Μ
852 FURLApp := ini.ReadBool('URLApp', 'Select', False);
853 FURLAppFile := ini.ReadString('URLApp', 'File', '');
854
855 //mailto繧ッ繝ェ繝?け譎ょ虚菴?/span>
856 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
857
858 //繝昴ャ繝励い繝??菴咲スョ
859 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
860
861 //繧「繝峨Ξ繧ケ繝舌?
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 //逕サ蜒上?繝ャ繝薙Η繝シ
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 //繧ケ繝ャ繝?ラ荳?隕ァ譖エ譁ー繧「繧、繧ウ繝ウ
873 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
874 FCreationTimeLogs := ini.ReadBool('ThreadList', 'CreationTimeLogs', True);
875 FFutureThread := ini.ReadBool('ThreadList', 'FutureThread', True);
876
877 //譖ク縺崎セシ縺ソ譎ゅ?繧キ繝ウ譎ょ綾菴ソ逕ィ險ュ螳?/span>
878 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
879 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
880 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
881
882 //繧オ繧ヲ繝ウ繝?/span>
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 + '蜿門セ玲?蜉?wav';
892 SoundFileName[1] := s + '蜿門セ玲?蜉?蟾ョ蛻?.wav';
893 SoundFileName[2] := s + '譛ェ譖エ譁ー.wav';
894 SoundFileName[3] := '';
895 SoundFileName[4] := s + '繧ィ繝ゥ繝シ.wav';
896 end;
897
898 //繧ッ繝シ繝ォ繝舌?
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 //縺ゅ⊂縲懊s
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 //譚ソ譖エ譁ー逕ィURL隱ュ縺ソ霎シ縺ソ
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 //險ュ螳壹ヵ繧。繧、繝ォ菫晏ュ?system)
952 procedure TSetting.WriteSystemSettingFile();
953 var
954 ini: TMemIniFile;
955 begin
956 ini := TMemIniFile.Create(GetFileName());
957 try
958 //蜿嶺ソ。繝舌ャ繝輔ぃ繧オ繧、繧コ
959 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
960 //HTTP1.1菴ソ逕ィ
961 ini.WriteBool('HTTP', 'Protocol', FProtocol);
962 //繝励Ο繧ュ繧キ謗・邯唏TTP1.1菴ソ逕ィ
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 //險ュ螳壹ヵ繧。繧、繝ォ菫晏ュ?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 //繝??繝ォ繝舌?
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 //繝??繝ォ繝舌?Wrapable
1054 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
1055 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
1056
1057 //繧ソ繝?/span>
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 //繝。繝?そ繝シ繧ク繝舌?
1064 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
1065 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
1066
1067 //繧ケ繝??繧ソ繧ケ繝舌?
1068 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
1069
1070 //繧ュ繝」繝薙ロ繝?ヨ
1071 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
1072 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
1073 ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
1074
1075 //繝ェ繧ケ繝医?繧オ繧、繧コ縺ィ蝙ら峩豌エ蟷ウ
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 //繝ェ繧ケ繝育分蜿キ陦ィ遉コ
1088 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1089 //CSS菴ソ逕ィ
1090 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1091 //CSS繝輔ぃ繧、繝ォ蜷?/span>
1092 ini.WriteString('CSS', 'FileName', FCSSFileName);
1093 //Mail谺?。ィ遉コ
1094 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1095 //譛?譁ー100繝ャ繧ケ陦ィ遉コ
1096 ini.WriteBool('Thread', 'OnlyAHundredRes', FOnlyAHundredRes);
1097 //繝ュ繧ー蜑企勁遒コ隱?/span>
1098 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1099 //邨ゆコ?「コ隱?/span>
1100 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1101 //Samba
1102 ini.WriteBool('Function','UseSamba', FUseSamba);
1103
1104 //髱槭い繧ッ繝?ぅ繝匁凾繝昴ャ繝励い繝??陦ィ遉コ
1105 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1106 //繝ャ繧ケ繝昴ャ繝励い繝??繝倥ャ繝?繝シ繝懊?繝ォ繝?/span>
1107 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1108
1109 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1110
1111 //隱崎ィシ逕ィ繝ヲ繝シ繧カID繝サ繝代せ繝ッ繝シ繝?/span>
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繧ッ繝ェ繝?け譎りオキ蜍輔い繝励Μ
1118 ini.WriteBool('URLApp', 'Select', FURLApp);
1119 ini.WriteString('URLApp', 'File', FURLAppFile);
1120
1121 //mailto繧ッ繝ェ繝?け譎ょ虚菴?/span>
1122 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1123
1124 //繝昴ャ繝励い繝??菴咲スョ
1125 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1126
1127 //繧「繝峨Ξ繧ケ繝舌?
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 //逕サ蜒上?繝ャ繝薙Η繝シ
1134 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1135 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1136 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1137
1138 //繧ケ繝ャ繝?ラ荳?隕ァ譖エ譁ー繧「繧、繧ウ繝ウ
1139 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1140 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1141 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1142
1143 //譖ク縺崎セシ縺ソ譎ゅ?繧キ繝ウ譎ょ綾菴ソ逕ィ險ュ螳?/span>
1144 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1145 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1146 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1147
1148 //繝ェ繧ケ繝医き繝ゥ繝?
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 //繧オ繧ヲ繝ウ繝?/span>
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 //縺ゅ⊂縲懊s
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 //險ュ螳壹ヵ繧。繧、繝ォ菫晏ュ?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 //譚ソ譖エ譁ー逕ィBoardURL繧剃ソ晏ュ?/span>
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 //繝ェ繧ケ繝医き繝ゥ繝?繝倥ャ繝?繝シ
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 // 證怜捷蛹?/span>
1373 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1374
1375 // 繝舌う繝翫Μ縺ェ縺ョ縺ァ蠢?ヲ√↓蠢懊§縺ヲ繝?く繧ケ繝医↓螟画鋤
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 // 蠕ゥ蜿キ
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縺後↑縺?→縺阪↓逕滓?縺吶k
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 *繝懊?繝峨ヵ繧。繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
1478 *************************************************************************)
1479 function TSetting.GetBoardFileName: string;
1480 begin
1481 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1482 end;
1483
1484 (*************************************************************************
1485 *繝懊?繝峨ヵ繧。繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
1486 *************************************************************************)
1487 function TSetting.GetCustomBoardFileName: string;
1488 begin
1489 Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1490 end;
1491
1492 (*************************************************************************
1493 *繝懊?繝峨ョ繧」繝ャ繧ッ繝医Μ蜿門セ?/span>
1494 *************************************************************************)
1495 function TSetting.GetBoardDir: string;
1496 begin
1497 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1498 end;
1499
1500 (*************************************************************************
1501 *繝?Φ繝昴Λ繝ェ繝輔か繝ォ繝?繝シ蜷榊叙蠕?/span>
1502 *************************************************************************)
1503 function TSetting.GetHtmlTempFileName: string;
1504 begin
1505 Result := TEMP_FOLDER;
1506 end;
1507
1508
1509 (*************************************************************************
1510 *螳溯。後ヵ繧。繧、繝ォ繝輔か繝ォ繝?蜿門セ?/span>
1511 *************************************************************************)
1512 function TSetting.GetAppDir: string;
1513 begin
1514 Result := ExtractFilePath(Application.ExeName);
1515 end;
1516
1517 (*************************************************************************
1518 *TempHtml繝輔ぃ繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
1519 *************************************************************************)
1520 function TSetting.GetTempFolder: string;
1521 begin
1522 Result := GetAppDir + TEMP_FOLDER;
1523 end;
1524
1525 (*************************************************************************
1526 *sent.ini繝輔ぃ繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
1527 *************************************************************************)
1528 function TSetting.GetSentFileName: string;
1529 begin
1530 Result := GetAppDir + SENT_FILE_NAME;
1531 end;
1532
1533 (*************************************************************************
1534 *outbox.ini繝輔ぃ繧、繝ォ蜷榊叙蠕暦シ医ヱ繧ケ?九ヵ繧。繧、繝ォ蜷搾シ?/span>
1535 *************************************************************************)
1536 function TSetting.GetOutBoxFileName: string;
1537 begin
1538 Result := GetAppDir + OUTBOX_FILE_NAME;
1539 end;
1540
1541 (*************************************************************************
1542 *Config繝輔か繝ォ繝?蜿門セ?/span>
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

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26