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.87 - (show annotations) (download) (as text)
Mon Feb 21 08:32:04 2005 UTC (19 years, 2 months ago) by genyakun
Branch: MAIN
Changes since 1.86: +53 -31 lines
File MIME type: text/x-pascal
Add Be2chOption & Source IndentChange

1 unit Setting;
2
3 interface
4
5 uses
6 SysUtils, Classes, Graphics, Forms, Math, IniFiles, UCryptAuto, UBase64,
7 ComCtrls, GestureModel;
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 IGNORE_FILE_NAME : String = 'Ignore.txt';
35 // DOLIB_LOGIN_URL = '/~tora3n2c/futen.cgi';
36 MAX_POPUP_RES : Integer = 10;
37 GESTURE_FILE_NAME = 'Gestures.ini';
38 SPAMFILTER_FILE_NAME = 'SpamFilter.ini';
39 LANGUAGE_FILE_NAME = 'language.ini';
40
41 type
42 TGikoTabPosition = (gtpTop, gtpBottom); // タブ位置
43 TGikoTabAppend = (gtaFirst, gtpLast); // タブ追加位置
44 TGikoTabStyle = (gtsTab, gtsButton, gtsFlat); // タブスタイル
45 TGikoListOrientation = (gloHorizontal, gloVertical); // リスト垂直・水平
46 TGikoListState = (glsMax, glsNormal, glsMin); // リストサイズ状態
47 // ポップアップ表示位置
48 TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
49 gppRight, gppCenter, gppLeft,
50 gppRightBottom, gppBottom, gppLeftBottom);
51 //プレビューサイズ
52 TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
53 TGikoBrowserAutoMaximize = (gbmNone, gbmClick, gbmDoubleClick);
54 // ブラウザを自動的に最大化する条件
55 /// レス表示範囲。10 〜 65535 は最新 n レス扱い。
56 /// 将来 201-300 のような範囲を持たせる可能性も考えて上位 2 byte は予約。
57 TGikoResRange = (grrAll, grrSelect, grrKoko, grrNew);
58
59 /// スレッド一覧表示範囲
60 TGikoThreadRange = (gtrAll, gtrSelect, gtrLog, gtrNew);
61
62 //! スパムフィルターアルゴリズム
63 TGikoSpamFilterAlgorithm = (
64 gsfaNone, gsfaPaulGraham, gsfaGaryRobinson, gsfaGaryRobinsonFisher);
65
66
67 /// カテゴリリストのカラム ID
68 type TGikoBBSColumnID = (gbbscTitle);
69 /// カテゴリリストのカラム名
70 const GikoBBSColumnCaption : array[0..0] of string =
71 ( 'カテゴリ名' );
72 /// カテゴリリストカラム配列
73 type TGikoBBSColumnList = class( TList )
74 private
75 function GetItem( index : integer ) : TGikoBBSColumnID;
76 procedure SetItem( index : integer; value : TGikoBBSColumnID);
77 public
78 constructor Create;
79 destructor Destroy; override;
80 function Add( value : TGikoBBSColumnID ) : Integer;
81 property Items[index : integer]: TGikoBBSColumnID read GetItem write SetItem; default;
82 end;
83 /// 板リストのカラム ID
84 type TGikoCategoryColumnID = (gccTitle, gccRoundName, gccLastModified);
85 /// 板リストのカラム名
86 const GikoCategoryColumnCaption : array[0..2] of string =
87 ( '板名', '巡回予約', '取得日時' );
88 /// 板リストカラム配列
89 type TGikoCategoryColumnList = class( TList )
90 private
91 function GetItem( index : integer ) : TGikoCategoryColumnID;
92 procedure SetItem( index : integer; value : TGikoCategoryColumnID);
93 public
94 constructor Create;
95 destructor Destroy; override;
96 function Add( value : TGikoCategoryColumnID ) : Integer;
97 property Items[index : integer]: TGikoCategoryColumnID read GetItem write SetItem; default;
98 end;
99 /// スレリストのカラム ID
100 type TGikoBoardColumnID = (gbcTitle, gbcAllCount, gbcLocalCount, gbcNonAcqCount,
101 gbcNewCount, gbcUnReadCount, gbcRoundName, gbcRoundDate, gbcCreated, gbcLastModified );{gbcLastModified,}
102 /// スレリストのカラム名
103 const GikoBoardColumnCaption : array[0..9] of string =
104 ( 'スレッド名', 'カウント', '取得', '未取得', '新着',
105 '未読', '巡回予約', '取得日時', 'スレ作成日時', '最終更新日時' );
106 const GikoBoardColumnAlignment : array[0..9] of TAlignment = (
107 taLeftJustify, taRightJustify, taRightJustify, taRightJustify,
108 taRightJustify, taRightJustify, taLeftJustify, taLeftJustify,
109 taLeftJustify, taLeftJustify);
110 /// スレリストカラム配列
111 type TGikoBoardColumnList = class( TList )
112 private
113 function GetItem( index : integer ) : TGikoBoardColumnID;
114 procedure SetItem( index : integer; value : TGikoBoardColumnID);
115 public
116 constructor Create;
117 destructor Destroy; override;
118 function Add( value : TGikoBoardColumnID ) : Integer;
119 property Items[index : integer]: TGikoBoardColumnID read GetItem write SetItem; default;
120 end;
121
122 type
123 //CoolBar設定レコード
124 TCoolSet = record
125 FCoolID: Integer;
126 FCoolWidth: Integer;
127 FCoolBreak: Boolean;
128 end;
129
130 TSetting = class(TObject)
131 private
132 //受信バッファサイズ
133 FRecvBufferSize: Integer;
134 //HTTP1.1使用
135 FProtocol: Boolean;
136 //プロキシ接続HTTP1.1使用
137 FProxyProtocol: Boolean;
138
139 //プロキシ(読込用)
140 FReadProxy: Boolean;
141 FReadProxyAddress: string;
142 FReadProxyPort: Integer;
143 FReadProxyUserID: string;
144 FReadProxyPassword: string;
145
146 //プロキシ(書込用)
147 FWriteProxy: Boolean;
148 FWriteProxyAddress: string;
149 FWriteProxyPort: Integer;
150 FWriteProxyUserID: string;
151 FWriteProxyPassword: string;
152
153 //キャビネット
154 FCabinetFontName: string;
155 FCabinetFontSize: Integer;
156 FCabinetFontBold: Boolean;
157 FCabinetFontItalic: Boolean;
158 FCabinetFontColor: TColor;
159 FCabinetBackColor: TColor;
160
161 //リスト
162 FListFontName: string;
163 FListFontSize: Integer;
164 FListFontBold: Boolean;
165 FListFontItalic: Boolean;
166 FListFontColor: TColor;
167 FListBackColor: TColor;
168
169 //ブラウザ
170 FBrowserFontName: string; // ''...default
171 FBrowserFontSize: Integer; // 0...default
172 FBrowserFontBold: Integer; // 0...default, -1...False, 1...True
173 FBrowserFontItalic: Integer; // 上に同じ
174 FBrowserFontColor: Integer; // -1...default
175 FBrowserBackColor: Integer; // 上に同じ
176
177 //エディタ
178 FEditorFontName: string;
179 FEditorFontSize: Integer;
180 FEditorFontBold: Boolean;
181 FEditorFontItalic: Boolean;
182 FEditorFontColor: TColor;
183 FEditorBackColor: TColor;
184
185 //タブフォント
186 FBrowserTabFontName: string;
187 FBrowserTabFontSize: Integer;
188 FBrowserTabFontBold: Boolean;
189 FBrowserTabFontItalic: Boolean;
190
191 //ヒントウィンドウ
192 FHintFontName: string;
193 FHintFontSize: Integer;
194 //FHintFontBold: Boolean;
195 //FHintFontItalic: Boolean;
196 FHintFontColor: TColor;
197 FHintBackColor: TColor;
198
199 //ウィンドウサイズ
200 FWindowTop: Integer;
201 FWindowLeft: Integer;
202 FWindowHeight: Integer;
203 FWindowWidth: Integer;
204 FWindowMax: Boolean;
205 //リストビュースタイル
206 FListStyle: TViewStyle;
207
208 //ツールバー表示
209 FStdToolBarVisible: Boolean;
210 FAddressBarVisible: Boolean;
211 FLinkBarVisible: Boolean;
212 FListToolBarVisible: Boolean;
213 FListNameBarVisible: Boolean;
214 FBrowserToolBarVisible: Boolean;
215 FBrowserNameBarVisible: Boolean;
216
217 //ブラウザタブ
218 FBrowserTabVisible: Boolean;
219 FBrowserTabPosition: TGikoTabPosition;
220 FBrowserTabAppend: TGikoTabAppend;
221 FBrowserTabStyle: TGikoTabStyle;
222
223 //メッセージバー
224 FMessageBarVisible: Boolean;
225 FMessegeBarHeight: Integer;
226
227 //ステータスバー
228 FStatusBarVisible: Boolean;
229
230 //キャビネット可視・サイズ
231 FCabinetVisible: Boolean;
232 FCabinetWidth: Integer;
233
234 //リスト・ブラウザサイズ
235 FListOrientation: TGikoListOrientation;
236 FListHeight: Integer;
237 FListHeightState: TGikoListState;
238 FListWidth: Integer;
239 FListWidthState: TGikoListState;
240 // FListHeightMax: Boolean;
241 // FListWidthMax: Boolean;
242
243 //送信用名前・メール
244 FNameList: TStringList;
245 FMailList: TStringList;
246
247 //エディターウィンドウサイズ
248 FEditWindowTop: Integer;
249 FEditWindowLeft: Integer;
250 FEditWindowHeight: Integer;
251 FEditWindowWidth: Integer;
252 FEditWindowMax: Boolean;
253 FEditWindowStay: Boolean;
254 FEditWindowTranslucent: Boolean;
255
256 //リスト番号表示
257 FListViewNo: Boolean;
258 //CSS表示
259 FUseCSS: Boolean;
260 //CSSファイル名
261 FCSSFileName: string;
262 // スキン表示(一時的なもので ini に保存はされない)
263 FUseSkin: Boolean;
264 //mail欄表示
265 FShowMail: Boolean;
266 /// レス表示範囲
267 FResRange : Longint;
268 /// 起動時レス表示範囲の固定
269 FResRangeHold : Boolean;
270 /// スレッド一覧表示範囲
271 FThreadRange : TGikoThreadRange;
272 //非アクティブ時レスポップアップ表示
273 FUnActivePopup: Boolean;
274 //レスポップアップヘッダーボールド
275 FResPopupHeaderBold: Boolean;
276
277 //ログフォルダ
278 FLogFolder: string;
279 FNewLogFolder: string;
280
281 //リストカラムヘッダーサイズ
282 FBBSColumnWidth: array[0..0] of Integer;
283 FCategoryColumnWidth: array[0..2] of Integer;
284 FBoardColumnWidth: array[0..9] of Integer;
285
286 /// カテゴリリストカラム順序
287 FBBSColumnOrder : TGikoBBSColumnList;
288 /// 板リストカラム順序
289 FCategoryColumnOrder : TGikoCategoryColumnList;
290 /// スレリストカラム順序
291 FBoardColumnOrder : TGikoBoardColumnList;
292
293 //ソート順
294 FBBSSortIndex: Integer;
295 FBBSSortOrder: Boolean;
296 FCategorySortIndex: Integer;
297 FCategorySortOrder: Boolean;
298 FBoardSortIndex: Integer;
299 FBoardSortOrder: Boolean;
300
301 //Dat落ちスレソート順
302 FDatOchiSortIndex: Integer;
303 FDatOchiSortOrder: Boolean;
304
305 //絞込み文字列
306 FSelectTextList: TStringList;
307
308 //板一覧URL
309 //FBoardURL2ch: string;
310 FBoardURLs: TStringList;
311 FBoardURLSelected: Integer;
312
313 //ユーザID・パスワード
314 FUserID: string;
315 FPassword: string;
316 FAutoLogin: Boolean;
317 FForcedLogin: Boolean;
318 FDolibURL: string;
319
320 //URLクリック時起動アプリ
321 FURLApp: Boolean;
322 FURLAppFile: string;
323
324 //mailtoクリック時動作
325 FOpenMailer: Boolean;
326
327 //削除確認
328 FDeleteMsg: Boolean;
329
330 //CoolBar(メイン・板・ブラウザ)
331 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
332 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
333 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
334
335 //ToolBar Wrapable
336 FListToolBarWrapable: Boolean;
337 FBrowserToolBarWrapable: Boolean;
338
339 //ポップアップ位置
340 FPopupPosition: TGikoPopupPosition;
341
342 //アドレスバー
343 FURLDisplay: Boolean;
344 FAddressBarTabStop: Boolean;
345 FLinkAddAddressBar: Boolean;
346 FAddressHistoryCount: Integer;
347
348 //画像プレビュー
349 FPreviewVisible: Boolean;
350 FPreviewSize: TGikoPreviewSize;
351 FPreviewWait: Integer;
352
353 // ブラウザ
354 FBrowserAutoMaximize: TGikoBrowserAutoMaximize;
355
356 //スレッド一覧更新アイコン表示
357 FListIconVisible: Boolean;
358
359 //スレッド一覧でLogのあるスレッドのみスレ作成日を表示するか
360 FCreationTimeLogs: Boolean;
361 //スレッド一覧のスレ生成日で未来のスレの生成日を表示しない
362 FFutureThread: Boolean;
363
364 //書き込み時マシン時間使用設定
365 FUseMachineTime: Boolean;
366 FTimeAdjustSec: Integer;
367 FTimeAdjust: Boolean;
368
369 //あぼ〜ん
370 FAbonDeleterlo : Boolean; //&rlo;を削るか
371 FAbonReplaceul : Boolean; //<ul>タグを<br>タグに置換するか
372 FPopUpAbon : Boolean; //レスポップアップ時のあぼ〜ん有効
373 FShowNGLinesNum : Boolean; //該当したNGワードファイルの行数を表示
374 FAddResAnchor : Boolean; //NGレスへのレスアンカーを追加する
375 FDeleteSyria : Boolean; //シリア語ブラクラ対策
376
377 // スレッド絞込フィールドの幅
378 FSelectComboBoxWidth : Integer;
379
380 // 最後に選択されたオプションダイアログのタブ
381 FOptionDialogTabIndex: Integer;
382
383 // 最後に選択されたキャビネット
384 FCabinetIndex: Integer;
385
386 //終了時に確認ダイアログを表示するか
387 FShowDialogForEnd : Boolean;
388 //全てのタブ閉じるのときに確認ダイアログを表示する
389 FShowDialogForAllTabClose: Boolean;
390 //取得レス数とスレッドのレス数が異なったときに通常背景色と違った色の背景色を使用するか
391 FUseOddColorOddResNum: Boolean;
392 FOddColor: TColor;
393
394 //Samba24対策機能を使うか
395 FUseSamba: Boolean;
396
397 //レスアンカーをクリックしてジャンプするか
398 FResAnchorJamp: Boolean;
399
400 //Tab自動保存
401 FTabAutoLoadSave : Boolean;
402
403 //にちゃん語案内サポート機能
404 F2chSupport : Boolean;
405
406 // エディタ
407 FSpaceToNBSP : Boolean; ///< 半角スペース、Tab を &nbsp; に置換
408 FAmpToCharRef : Boolean; ///< '&' を &amp; に置換
409
410 //ブラウザタブ非表示の時のスレ一覧でのカーソルキー移動の無反応時間
411 FSelectInterval : Integer;
412
413 //KuroutSettingTab 詳細設定タブのActiveTab
414 FKuroutSettingTabIndex: Integer;
415
416 //! マウスジェスチャー
417 FGestures : TGestureModel;
418 //! マウスジェスチャーを使用するかどうか
419 FGestureEnabled : Boolean;
420
421 //2ch言語設定
422 //F2chLanguage : TStringList;
423
424 //フシアナトラップ設定
425 FLocalTrapAtt : Boolean;
426 FRemoteTrapAtt : Boolean;
427 FReadTimeOut: Integer;
428
429 //! 使用するスパムフィルター
430 FSpamFilterAlgorithm : TGikoSpamFilterAlgorithm;
431 //ミュートしてるか
432 FMute: Boolean;
433 //スレ絞込みで未確定文字も有効にするか
434 FUseUndecided: Boolean;
435 //MessageListに出力されるメッセージ
436 FMessageList : array[0..13] of string;
437
438 //Be2ch
439 //認証用ユーザID・パスワード
440 FBeUserID: String;
441 FBePassword: String;
442 FBeAutoLogin: Boolean;
443
444 function GetMainCoolSet(Index: Integer): TCoolSet;
445 function GetBoardCoolSet(Index: Integer): TCoolSet;
446 function GetBrowserCoolSet(Index: Integer): TCoolSet;
447 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
448 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
449 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
450
451 function GetBBSColumnWidth(index: Integer): Integer;
452 function GetCategoryColumnWidth(index: Integer): Integer;
453 function GetBoardColumnWidth(index: Integer): Integer;
454 procedure SetBBSColumnWidth(index: Integer; value: Integer);
455 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
456 procedure SetBoardColumnWidth(index: Integer; value: Integer);
457
458 function GetSoundName(Index: Integer): string;
459 function GetSoundViewName(Index: Integer): string;
460 function GetSoundFileName(Index: Integer): string;
461 procedure SetSoundFileName(Index: Integer; value: string);
462 function Encrypt(s: string): string;
463 function Decrypt(s: string): string;
464
465 procedure MakeURLIniFile();
466
467 procedure SetUseCSS( value: Boolean );
468 procedure SetCSSFileName( fileName: string );
469 protected
470
471 public
472 constructor Create;
473 destructor Destroy; override;
474 function GetFileName: string;
475 function GetBoardURLFileName: string;
476 procedure ReadSettingFile;
477 procedure ReadBoardURLsFile;
478 procedure WriteSystemSettingFile;
479 procedure WriteWindowSettingFile;
480 procedure WriteNameMailSettingFile;
481 procedure WriteFolderSettingFile();
482 procedure WriteBoardURLSettingFile;
483 function GetSoundCount: Integer;
484 function FindSoundFileName(Name: string): string;
485
486 function GetBoardFileName: string;
487 function GetCustomBoardFileName: string;
488 function GetBoardDir: string;
489 function GetHtmlTempFileName: string;
490 function GetAppDir: string;
491 function GetTempFolder: string;
492 function GetSentFileName: string;
493 function GetConfigDir: string;
494 function GetSkinDir: string;
495 function GetSkinHeaderFileName: string;
496 function GetSkinFooterFileName: string;
497 function GetSkinResFileName: string;
498 function GetSkinNewResFileName: string;
499 function GetSkinBookmarkFileName: string;
500 function GetSkinNewmarkFileName: string;
501 function GetStyleSheetDir: string;
502 function GetOutBoxFileName: string;
503 function GetNGWordsDir: string;
504 function GetBoardPlugInDir: string;
505 function GetSambaFileName: string;
506 function GetIgnoreFileName: string;
507 function GetGestureFileName : string;
508 function GetSpamFilterFileName : string;
509 function GetLanguageFileName: string;
510 procedure SetMessages;
511 function GetMessage(AType :Integer): string;
512
513 //受信バッファサイズ
514 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
515 //HTTP1.1使用
516 property Protocol: Boolean read FProtocol write FProtocol;
517 //プロキシ接続HTTP1.1使用
518 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
519
520 property ReadProxy: Boolean read FReadProxy write FReadProxy;
521 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
522 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
523 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
524 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
525
526 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
527 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
528 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
529 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
530 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
531
532 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
533 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
534 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
535 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
536 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
537 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
538
539 property ListFontName: string read FListFontName write FListFontName;
540 property ListFontSize: Integer read FListFontSize write FListFontSize;
541 property ListFontBold: Boolean read FListFontBold write FListFontBold;
542 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
543 property ListFontColor: TColor read FListFontColor write FListFontColor;
544 property ListBackColor: TColor read FListBackColor write FListBackColor;
545
546 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
547 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
548 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
549 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
550 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
551 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
552
553 property EditorFontName: string read FEditorFontName write FEditorFontName;
554 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
555 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
556 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
557 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
558 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
559
560 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
561 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
562 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
563 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
564
565 property HintFontName: string read FHintFontName write FHintFontName;
566 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
567 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
568 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
569 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
570 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
571
572 property WindowTop: Integer read FWindowTop write FWindowTop;
573 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
574 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
575 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
576 property WindowMax: Boolean read FWindowMax write FWindowMax;
577 property ListStyle: TViewStyle read FListStyle write FListStyle;
578
579 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
580 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
581 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
582 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
583 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
584 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
585 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
586
587 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
588 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
589 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
590 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
591
592 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
593 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
594
595 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
596
597 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
598 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
599
600 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
601 property ListHeight: Integer read FListHeight write FListHeight;
602 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
603 property ListWidth: Integer read FListWidth write FListWidth;
604 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
605 // property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
606 // property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
607
608 property NameList: TStringList read FNameList write FNameList;
609 property MailList: TStringList read FMailList write FMailList;
610 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
611
612 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
613 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
614 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
615 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
616 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
617 property EditWindowStay: Boolean read FEditWindowStay write FEditWindowStay;
618 property EditWindowTranslucent: Boolean read FEditWindowTranslucent write FEditWindowTranslucent;
619
620 property ListViewNo: Boolean read FListViewNo write FListViewNo;
621 property UseCSS: Boolean read FUseCSS write SetUseCSS;
622 property CSSFileName: string read FCSSFileName write SetCSSFileName;
623 property UseSkin: Boolean read FUseSkin;
624
625 property ShowMail: Boolean read FShowMail write FShowMail;
626 property ResRange : Longint read FResRange write FResRange;
627 property ResRangeHold : Boolean read FResRangeHold write FResRangeHold;
628 property ThreadRange : TGikoThreadRange read FThreadRange write FThreadRange;
629 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
630 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
631
632 property LogFolder: string read FLogFolder write FLogFolder;
633 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
634
635 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
636 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
637 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
638
639 property BBSColumnOrder : TGikoBBSColumnList read FBBSColumnOrder write FBBSColumnOrder;
640 property CategoryColumnOrder : TGikoCategoryColumnList read FCategoryColumnOrder write FCategoryColumnOrder;
641 property BoardColumnOrder : TGikoBoardColumnList read FBoardColumnOrder write FBoardColumnOrder;
642
643 property SoundName[index: Integer]: string read GetSoundName;
644 property SoundViewName[index: Integer]: string read GetSoundViewName;
645 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
646
647 property BBSSortIndex: Integer read FBBSSortIndex write FBBSSortIndex;
648 property BBSSortOrder: Boolean read FBBSSortOrder write FBBSSortOrder;
649 property CategorySortIndex: Integer read FCategorySortIndex write FCategorySortIndex;
650 property CategorySortOrder: Boolean read FCategorySortOrder write FCategorySortOrder;
651 property BoardSortIndex: Integer read FBoardSortIndex write FBoardSortIndex;
652 property BoardSortOrder: Boolean read FBoardSortOrder write FBoardSortOrder;
653
654 property DatOchiSortIndex: Integer read FDatOchiSortIndex write FDatOchiSortIndex;
655 property DatOchiSortOrder: Boolean read FDatOchiSortOrder write FDatOchiSortOrder;
656
657 //property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
658 property BoardURLs: TStringList read FBoardURLs write FBoardURLs;
659 property BoardURLSelected: Integer read FBoardURLSelected write FBoardURLSelected;
660 property UserID: string read FUserID write FUserID;
661 property Password: string read FPassword write FPassword;
662 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
663 property ForcedLogin: Boolean read FForcedLogin write FForcedLogin;
664 property DolibURL: string read FDolibURL write FDolibURL;
665
666 property URLApp: Boolean read FURLApp write FURLApp;
667 property URLAppFile: string read FURLAppFile write FURLAppFile;
668
669 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
670
671 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
672
673 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
674 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
675 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
676
677 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
678 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
679
680 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
681
682 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
683 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
684 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
685 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
686
687 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
688 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
689 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
690 property BrowserAutoMaximize: TGikoBrowserAutoMaximize read FBrowserAutoMaximize write FBrowserAutoMaximize;
691
692 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
693 property CreationTimeLogs: Boolean read FCreationTimeLogs write FCreationTimeLogs;
694 property FutureThread: Boolean read FFutureThread write FFutureThread;
695
696 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
697 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
698 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
699
700 //あぼ〜ん
701 property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
702 property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
703 property PopUpAbon : Boolean read FPopUpAbon write FPopUpAbon;
704 property ShowNGLinesNum : Boolean read FShowNGLinesNum write FShowNGLinesNum;
705 property AddResAnchor : Boolean read FAddResAnchor write FAddResAnchor;
706 property DeleteSyria : Boolean read FDeleteSyria write FDeleteSyria;
707 // スレッド絞込フィールドの幅
708 property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
709
710 // 最後に選択されたオプションダイアログのタブ
711 property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
712
713 // 最後に選択されたキャビネット
714 property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
715
716 //終了時に確認ダイアログを表示するか
717 property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
718 property ShowDialogForAllTabClose: Boolean read FShowDialogForAllTabClose write FShowDialogForAllTabClose;
719 //取得レス数とスレッドのレス数が異なったときに通常背景色と違った色の背景色を使用するか
720 property UseOddColorOddResNum: Boolean read FUseOddColorOddResNum write FUseOddColorOddResNum;
721 property OddColor: TColor read FOddColor write FOddColor;
722 property UseSamba: Boolean read FUseSamba write FUseSamba;
723 property ResAnchorJamp: Boolean read FResAnchorJamp write FResAnchorJamp;
724
725 // エディタ
726 property SpaceToNBSP : Boolean read FSpaceToNBSP write FSpaceToNBSP;
727 property AmpToCharRef : Boolean read FAmpToCharRef write FAmpToCharRef;
728
729 property SelectInterval : Integer read FSelectInterval write FSelectInterval;
730 //Tab保存
731 property TabAutoLoadSave: Boolean read FTabAutoLoadSave write FTabAutoLoadSave;
732 //property Gengo: TStringList read F2chLanguage write F2chLanguage;
733 property GengoSupport : Boolean read F2chSupport write F2chSupport;
734 property KuroutSettingTabIndex: Integer read FKuroutSettingTabIndex write FKuroutSettingTabIndex;
735 //! マウスジェスチャー
736 property Gestures : TGestureModel read FGestures write FGestures;
737 //! マウスジェスチャーを使用するかどうか
738 property GestureEnabled : Boolean read FGestureEnabled write FGestureEnabled;
739 //フシアナトラップ設定
740 property LocalTrapAtt : Boolean read FLocalTrapAtt write FLocalTrapAtt;
741 property RemoteTrapAtt : Boolean read FRemoteTrapAtt write FRemoteTrapAtt;
742 property ReadTimeOut: Integer read FReadTimeOut write FReadTimeOut;
743 //! 使用するスパムフィルタ
744 property SpamFilterAlgorithm : TGikoSpamFilterAlgorithm
745 read FSpamFilterAlgorithm write FSpamFilterAlgorithm;
746 property Mute: Boolean read FMute write FMute;
747 property UseUndecided: Boolean read FUseUndecided write FUseUndecided;
748
749 property BeUserID: string read FBeUserID write FBeUserID;
750 property BePassword: string read FBePassword write FBePassword;
751 property BeAutoLogin: Boolean read FBeAutoLogin write FBeAutoLogin;
752 end;
753
754
755
756 implementation
757
758 type
759 TSoundName = record
760 Name: string;
761 ViewName: string;
762 FileName: string;
763 end;
764
765 const
766 INI_FILE_NAME: string = 'gikoNavi.ini';
767 BOARD_URL_INI_FILE_NAME: string = 'url.ini';
768 DEFAULT_FONT_NAME: string = 'MS Pゴシック';
769 DEFAULT_FONT_SIZE: Integer = 9;
770 DEFAULT_FONT_COLOR: string = 'clWindowText';
771 DEFAULT_WINDOW_COLOR: string = 'clWindow';
772 DEFAULT_TAB_FONT_NAME: string = 'MS Pゴシック';
773 DEFAULT_TAB_FONT_SIZE: Integer = 9;
774 DEFAULT_2CH_BOARD_URL1: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
775 DEFAULT_2CH_BOARD_URL2: string = 'http://www.ff.iij4u.or.jp/~ch2/bbsmenu.html';
776 //http://menu.2ch.net/bbsmenu.html //もうすぐこれが正式な板一覧になるよう
777 //'http://www.2ch.net/newbbsmenu.html';
778 GIKO_ENCRYPT_TEXT: string = 'gikoNaviEncryptText';
779
780 DEF_MESSAGES : array[0..13] of string = ( 'ログアウトしました',
781 'ログインしました - ',
782 '強制ログインしました - ',
783 '[スレ一覧取得完了]',
784 '(名称不明)',
785 '[スレ取得完了]',
786 '[スレ差分取得完了]',
787 '[未更新]',
788 '[中断]',
789 '[エラー]',
790 '[レス送信終了]',
791 '[新スレ送信終了]',
792 '[レス送信失敗]',
793 '[新スレ送信失敗]');
794
795 var
796 SOUND_NAME: array[0..4] of TSoundName = (
797 (Name: 'New'; ViewName: '取得成功'; FileName: ''),
798 (Name: 'NewDiff'; ViewName: '取得成功(差分)'; FileName: ''),
799 (Name: 'NoChange'; ViewName: '未更新'; FileName: ''),
800 // (Name: 'RoundEnd'; ViewName: '巡回終了(取得あり)'; FileName: ''),
801 // (Name: 'RoundNone'; ViewName: '巡回終了(取得なし)'; FileName: ''),
802 (Name: 'ResEnd'; ViewName: 'レス送信完了'; FileName: ''),
803 (Name: 'Error'; ViewName: 'エラー'; FileName: ''));
804
805 constructor TGikoBBSColumnList.Create;
806 begin
807 inherited;
808 end;
809
810 destructor TGikoBBSColumnList.Destroy;
811 begin
812 inherited;
813 end;
814
815 function TGikoBBSColumnList.GetItem( index : integer ) : TGikoBBSColumnID;
816 begin
817 Result := TGikoBBSColumnID( inherited Items[ index ] );
818 end;
819
820 procedure TGikoBBSColumnList.SetItem( index : integer; value : TGikoBBSColumnID);
821 begin
822 inherited Items[ index ] := Pointer( value );
823 end;
824
825 function TGikoBBSColumnList.Add( value : TGikoBBSColumnID ) : Integer;
826 begin
827 Result := inherited Add( Pointer( value ) );
828 end;
829
830 constructor TGikoCategoryColumnList.Create;
831 begin
832 inherited;
833 end;
834
835 destructor TGikoCategoryColumnList.Destroy;
836 begin
837 inherited;
838 end;
839
840 function TGikoCategoryColumnList.GetItem( index : integer ) : TGikoCategoryColumnID;
841 begin
842 Result := TGikoCategoryColumnID( inherited Items[ index ] );
843 end;
844
845 procedure TGikoCategoryColumnList.SetItem( index : integer; value : TGikoCategoryColumnID);
846 begin
847 inherited Items[ index ] := Pointer( value );
848 end;
849
850 function TGikoCategoryColumnList.Add( value : TGikoCategoryColumnID ) : Integer;
851 begin
852 Result := inherited Add( Pointer( value ) );
853 end;
854
855 constructor TGikoBoardColumnList.Create;
856 begin
857 inherited;
858 end;
859
860 destructor TGikoBoardColumnList.Destroy;
861 begin
862 inherited;
863 end;
864
865 function TGikoBoardColumnList.GetItem( index : integer ) : TGikoBoardColumnID;
866 begin
867 Result := TGikoBoardColumnID( inherited Items[ index ] );
868 end;
869
870 procedure TGikoBoardColumnList.SetItem( index : integer; value : TGikoBoardColumnID);
871 begin
872 inherited Items[ index ] := Pointer( value );
873 end;
874
875 function TGikoBoardColumnList.Add( value : TGikoBoardColumnID ) : Integer;
876 begin
877 Result := inherited Add( Pointer( value ) );
878 end;
879
880 //コンストラクタ
881 constructor TSetting.Create();
882 begin
883 FNameList := TStringList.Create;
884 FMailList := TStringList.Create;
885 FSelectTextList := TStringList.Create;
886 FBoardURLs := TStringList.Create;
887 FBBSColumnOrder := TGikoBBSColumnList.Create;
888 FCategoryColumnOrder := TGikoCategoryColumnList.Create;
889 FBoardColumnOrder := TGikoBoardColumnList.Create;
890 FGestures := TGestureModel.Create;
891 FNameList.Duplicates := dupIgnore;
892 FMailList.Duplicates := dupIgnore;
893 FBoardURLs.Duplicates := dupIgnore;
894 FSelectTextList.Duplicates := dupIgnore;
895 ReadSettingFile();
896 ReadBoardURLsFile();
897 end;
898
899 //デストラクタ
900 destructor TSetting.Destroy();
901 begin
902 inherited;
903 FBoardColumnOrder.Free;
904 FCategoryColumnOrder.Free;
905 FBBSColumnOrder.Free;
906 FSelectTextList.Free;
907 FBoardURLs.Free;
908 FMailList.Free;
909 FNameList.Free;
910 FGestures.Free;
911 end;
912
913 //初期化ファイル名取得(パス+ファイル名)
914 function TSetting.GetFileName(): string;
915 begin
916 Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
917 end;
918
919 //板更新用URL設定ファイル名(パス+ファイル名)
920 function TSetting.GetBoardURLFileName(): string;
921 begin
922 Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
923 end;
924
925 //設定ファイル読込
926 procedure TSetting.ReadSettingFile();
927 const
928 DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
929 DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
930 DEFAULT_BOARD_WIDTH: array[0..9] of Integer = (350, 60, 60, 60, 60, 60, 80, 130, 130, 130);
931 MAX_WIDTH: Integer = 2000;
932 var
933 ini: TMemIniFile;
934 i: Integer;
935 id, code : Integer;
936 wkList: TStringList;
937 wkStr: string;
938 Exists: Boolean;
939 s: string;
940 // id: Integer;
941 CoolSet: TCoolSet;
942 begin
943 Exists := FileExists(GetFileName);
944 ini := TMemIniFile.Create(GetFileName);
945 try
946 //受信バッファサイズ
947 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
948 //HTTP1.1使用
949 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
950 //プロキシ接続HTTP1.1使用
951 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
952
953 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
954 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
955 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
956 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
957 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
958
959 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
960 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
961 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
962 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
963 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
964
965 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
966 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
967 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
968 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
969 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
970 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
971
972 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
973 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
974 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
975 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
976 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
977 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
978
979 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
980 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
981 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
982 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
983 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
984 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
985 FUseOddColorOddResNum := ini.ReadBool('Window','UseOddColor', False);
986 FOddColor := StringToColor(ini.ReadString('Window', 'OddColor', DEFAULT_WINDOW_COLOR));
987
988 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
989 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
990 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
991 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
992 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
993 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
994
995 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
996 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
997 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
998 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
999
1000 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
1001 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
1002 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
1003 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
1004 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
1005 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
1006
1007 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
1008 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
1009 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
1010 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
1011 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
1012
1013 if FWindowHeight <= 0 then FWindowHeight := 400;
1014 if FWindowWidth <= 0 then FWindowWidth := 600;
1015
1016 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
1017
1018 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
1019 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
1020 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
1021 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
1022 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
1023 FEditWindowStay := ini.ReadBool('EditorWindowSize', 'Stay', False);
1024 FEditWindowTranslucent := ini.ReadBool('EditorWindowSize', 'Translucent', False);
1025
1026 FOptionDialogTabIndex := ini.ReadInteger('OptionDialog', 'TabIndex', 0);
1027
1028 //ツールバー
1029 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
1030 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
1031 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
1032 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
1033 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
1034 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
1035 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
1036 //ツールバーWrapable
1037 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
1038 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
1039
1040 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
1041 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
1042 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
1043 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
1044
1045 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
1046 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
1047
1048 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
1049
1050 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
1051 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
1052 FCabinetIndex := ini.ReadInteger('Cabinet', 'Index', 0);
1053
1054 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
1055 FListHeight := ini.ReadInteger('List', 'Height', 180);
1056 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
1057 FListWidth := ini.ReadInteger('List', 'Width', 180);
1058 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
1059 // FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
1060 // FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
1061
1062 wkList := TStringList.Create;
1063 try
1064 ini.ReadSection('Name', wkList);
1065 for i := 0 to wkList.Count - 1 do begin
1066 wkStr := ini.ReadString('Name', wkList[i], '');
1067 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
1068 FNameList.Add(wkStr);
1069 end;
1070 ini.ReadSection('Mail', wkList);
1071 for i := 0 to wkList.Count - 1 do begin
1072 wkStr := ini.ReadString('Mail', wkList[i], '');
1073 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
1074 FMailList.Add(wkStr);
1075 end;
1076 ini.ReadSection('SelectText', wkList);
1077 for i := 0 to wkList.Count - 1 do begin
1078 wkStr := ini.ReadString('SelectText', wkList[i], '');
1079 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
1080 FSelectTextList.Add(wkStr);
1081 end;
1082 finally
1083 wkList.Free;
1084 end;
1085
1086 // リストカラム幅
1087 wkList := TStringList.Create;
1088 try
1089 ini.ReadSection('BBSColumnWidth', wkList);
1090 if Length(FBBSColumnWidth) <> wkList.Count then begin
1091 ini.EraseSection('BBSColumnWidth');
1092 end;
1093 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1094 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
1095 if BBSColumnWidth[i] > MAX_WIDTH then
1096 BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i];
1097 end;
1098 ini.ReadSection('CategoryColumnWidth', wkList);
1099 if Length(FCategoryColumnWidth) <> wkList.Count then begin
1100 ini.EraseSection('CategoryColumnWidth');
1101 end;
1102 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1103 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
1104 if CategoryColumnWidth[i] > MAX_WIDTH then
1105 CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i];
1106 end;
1107 ini.ReadSection('BoardColumnWidth', wkList);
1108 if Length(FBoardColumnWidth) <> wkList.Count then begin
1109 ini.EraseSection('BoardColumnWidth');
1110 end;
1111 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1112 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
1113 if BoardColumnWidth[i] > MAX_WIDTH then
1114 BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i];
1115 end;
1116 finally
1117 wkList.Free;
1118 end;
1119
1120 // カテゴリリストカラム順序
1121 wkList := TStringList.Create;
1122 try
1123 ini.ReadSection( 'BBSColumnOrder', wkList );
1124 for i := 0 to wkList.Count - 1 do begin
1125 wkStr := ini.ReadString( 'BBSColumnOrder', 'ID' + IntToStr( i ), '' );
1126 Val( wkStr, id, code );
1127 if code = 0 then
1128 FBBSColumnOrder.Add( TGikoBBSColumnID( id ) );
1129 end;
1130 if FBBSColumnOrder.Count = 0 then begin
1131 // 設定が無いので作成
1132 for i := 0 to Integer( High( TGikoBBSColumnID ) ) do
1133 FBBSColumnOrder.Add( TGikoBBSColumnID( i ) );
1134 end;
1135
1136 ini.ReadSection( 'CategoryColumnOrder', wkList );
1137 for i := 0 to wkList.Count - 1 do begin
1138 wkStr := ini.ReadString( 'CategoryColumnOrder', 'ID' + IntToStr( i ), '' );
1139 Val( wkStr, id, code );
1140 if code = 0 then
1141 FCategoryColumnOrder.Add( TGikoCategoryColumnID( id ) );
1142 end;
1143 if FCategoryColumnOrder.Count = 0 then begin
1144 // 設定が無いので作成
1145 for i := 0 to Integer( High( TGikoCategoryColumnID ) ) do
1146 FCategoryColumnOrder.Add( TGikoCategoryColumnID( i ) );
1147 end;
1148
1149 ini.ReadSection( 'BoardColumnOrder', wkList );
1150 for i := 0 to wkList.Count - 1 do begin
1151 wkStr := ini.ReadString( 'BoardColumnOrder', 'ID' + IntToStr( i ), '' );
1152 Val( wkStr, id, code );
1153 if code = 0 then
1154 FBoardColumnOrder.Add( TGikoBoardColumnID( id ) );
1155 end;
1156 if FBoardColumnOrder.Count = 0 then begin
1157 // 設定が無いので作成
1158 for i := 0 to Integer( High( TGikoBoardColumnID ) ) do
1159 FBoardColumnOrder.Add( TGikoBoardColumnID( i ) );
1160 end;
1161 finally
1162 wkList.Free;
1163 end;
1164
1165 //リスト番号
1166 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
1167 //CSS
1168 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
1169 //CSSファイル名
1170 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
1171
1172 //Mail欄表示
1173 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
1174 // レス表示範囲
1175 if ini.ReadBool('Thread', 'OnlyAHundredRes',false) then
1176 FResRange := 100 // 古い設定の互換用
1177 else
1178 FResRange := ini.ReadInteger( 'Thread', 'ResRange', Ord( grrAll ) );
1179 FResRangeHold := ini.ReadBool( 'Thread', 'ResRangeHold', False );
1180 // スレッド一覧表示範囲
1181 FThreadRange := TGikoThreadRange( ini.ReadInteger('ThreadList', 'ThreadRange', Ord( gtrAll )) );
1182 //非アクティブ時レスポップアップ表示
1183 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
1184 //レスポップアップヘッダーボールド
1185 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
1186 //削除確認
1187 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
1188 //終了確認
1189 FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
1190 //AllTabClose
1191 FShowDialogForAllTabClose := ini.ReadBool('Function','ShowDialogForAllTabClose',false);
1192 //Samba
1193 FUseSamba := ini.ReadBool('Function','UseSamba', True);
1194 //ResAnchorjamp
1195 ResAnchorJamp := ini.ReadBool('Function', 'ResAnchoJamp', True);
1196 //ログフォルダ
1197 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
1198 NewLogFolder := '';
1199
1200 //板URL
1201 //複数登録できるようにしてFBoardURLsにした 2003/10/05
1202 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
1203
1204 //認証用ユーザID・パスワード
1205 FUserID := ini.ReadString('Attestation', 'UserID', '');
1206 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
1207 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
1208 FForcedLogin := ini.ReadBool('Attestation', 'FForcedLogin', False);
1209 // FDolibURL := ini.ReadString('Attestation', 'FDolibURL', DOLIB_LOGIN_URL);
1210
1211 //URLクリック時起動アプリ
1212 FURLApp := ini.ReadBool('URLApp', 'Select', False);
1213 FURLAppFile := ini.ReadString('URLApp', 'File', '');
1214
1215 //mailtoクリック時動作
1216 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
1217
1218 //ポップアップ位置
1219 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
1220
1221 //アドレスバー
1222 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
1223 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
1224 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
1225 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
1226
1227 //画像プレビュー
1228 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
1229 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
1230 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
1231
1232 // ブラウザ
1233 FBrowserAutoMaximize := TGikoBrowserAutoMaximize(
1234 ini.ReadInteger('Window', 'BrowserAutoMaximize', Ord(gbmDoubleClick)) );
1235
1236 //スレッド一覧更新アイコン
1237 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
1238 FCreationTimeLogs := ini.ReadBool('ThreadList', 'CreationTimeLogs', True);
1239 FFutureThread := ini.ReadBool('ThreadList', 'FutureThread', True);
1240 FSelectInterval := ini.ReadInteger('ThreadList', 'SelectInterval', 110);
1241 //ソート順
1242 FBBSSortIndex := ini.ReadInteger('ThreadList', 'BBSSortIndex', 0);
1243 FBBSSortOrder := ini.ReadBool('ThreadList', 'BBSSortOrder', True);
1244 FCategorySortIndex := ini.ReadInteger('ThreadList', 'CategorySortIndex', 0);
1245 FCategorySortOrder := ini.ReadBool('ThreadList', 'CategorySortOrder', True);
1246 FBoardSortIndex := ini.ReadInteger('ThreadList', 'BoardSortIndex', 0);
1247 FBoardSortOrder := ini.ReadBool('ThreadList', 'BoardSortOrder', True);
1248 //Dat落ちスレソート順
1249 FDatOchiSortIndex := ini.ReadInteger('ThreadList', 'DatOchiSortIndex', -1);
1250 FDatOchiSortOrder := ini.ReadBool('ThreadList', 'DatOchiSortOrder', False);
1251
1252 //書き込み時マシン時刻使用設定
1253 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
1254 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
1255 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
1256
1257 //サウンド
1258 if Exists then begin
1259 for i := 0 to GetSoundCount - 1 do begin
1260 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
1261 if not FileExists(SoundFileName[i]) then
1262 SoundFileName[i] := '';
1263 end;
1264 end else begin
1265 s := ExtractFileDir(Application.ExeName) + '\sound\';
1266 SoundFileName[0] := s + '取得成功.wav';
1267 SoundFileName[1] := s + '取得成功(差分).wav';
1268 SoundFileName[2] := s + '未更新.wav';
1269 SoundFileName[3] := '';
1270 SoundFileName[4] := s + 'エラー.wav';
1271 end;
1272
1273 //クールバー
1274 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1275 CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
1276 CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
1277 CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
1278 MainCoolSet[i] := CoolSet;
1279 end;
1280 FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
1281 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1282 CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
1283 CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
1284 CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
1285 ListCoolSet[i] := CoolSet;
1286 end;
1287 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1288 CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
1289 CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
1290 CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
1291 BrowserCoolSet[i] := CoolSet;
1292 end;
1293
1294 //あぼ〜ん
1295 FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
1296 FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
1297 FPopUpAbon := ini.ReadBool('Abon','Popup',false);
1298 FShowNGLinesNum := ini.ReadBool('Abon','ShowNGLines',false);
1299 FAddResAnchor := ini.ReadBool('Abon','AddResAnchor',false);
1300 FDeleteSyria := ini.ReadBool('Abon','DeleteSyria',false);
1301
1302 // エディタ
1303 FSpaceToNBSP := ini.ReadBool( 'Editor', 'SpaceToNBSP', False );
1304 FAmpToCharRef := ini.ReadBool( 'Editor', 'AmpToCharRef', False );
1305
1306 //Tab自動保存、読み込み
1307 FTabAutoLoadSave := ini.ReadBool('TabAuto', 'TabAutoLoadSave', False);
1308
1309 FKuroutSettingTabIndex := ini.ReadInteger('OptionDialog', 'KuroutTabIndex' , 0);
1310
1311 // マウスジェスチャー
1312 FGestureEnabled := ini.ReadBool( 'Guesture', 'Enabled', False );
1313
1314 //2ch言語サポ
1315 F2chSupport := ini.ReadBool('2chSupport', 'Support', False);
1316
1317 //FusianaTrap
1318 FLocalTrapAtt := ini.ReadBool('Trap', 'LocalTrap', False);
1319 FRemoteTrapAtt := ini.ReadBool('Trap', 'RemoteTrap', False);
1320 FReadTimeOut := ini.ReadInteger('HTTP', 'ReadTimeOut', 10000);
1321
1322 // 使用するスパムフィルタ
1323 FSpamFilterAlgorithm := TGikoSpamFilterAlgorithm(
1324 ini.ReadInteger( 'Abon', 'SpamFilterAlgorithm', Ord( gsfaNone ) ) );
1325 FMute := ini.ReadBool('Function', 'Mute', false);
1326 FUseUndecided := ini.ReadBool('ThreadList', 'UseUndecided', False);
1327
1328 //Be2ch
1329 //認証用ユーザID・パスワード
1330 FBeUserID := ini.ReadString('Be', 'UserID', '');
1331 FBePassword := Decrypt(ini.ReadString('Be', 'Password', ''));
1332 FBeAutoLogin := ini.ReadBool('Be', 'AutoLogin', False);
1333 ini.UpdateFile;
1334 finally
1335 ini.Free;
1336 end;
1337 end;
1338 //板更新用URL読み込み
1339 procedure TSetting.ReadBoardURLsFile();
1340 var
1341 ini: TMemIniFile;
1342 urlNum: Integer;
1343 i : Integer;
1344 begin
1345 if not FileExists(GetBoardURLFileName()) then
1346 MakeURLIniFile();
1347 ini := TMemIniFile.Create(GetBoardURLFileName());
1348 try
1349 urlNum := ini.ReadInteger('URL','count',0);
1350 BoardURLSelected := ini.ReadInteger('URL','selected',0);
1351 for i := 0 to urlNum - 1 do begin
1352 FBoardURLs.Append(ini.ReadString('URL',IntToStr(i+1),''));
1353 end;
1354 finally
1355 ini.Free;
1356 end;
1357
1358 end;
1359 //設定ファイル保存(system)
1360 procedure TSetting.WriteSystemSettingFile();
1361 var
1362 ini: TMemIniFile;
1363 begin
1364 ini := TMemIniFile.Create(GetFileName());
1365 try
1366 //受信バッファサイズ
1367 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
1368 //HTTP1.1使用
1369 ini.WriteBool('HTTP', 'Protocol', FProtocol);
1370 //プロキシ接続HTTP1.1使用
1371 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
1372
1373 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
1374 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
1375 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
1376 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
1377 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
1378
1379 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
1380 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
1381 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
1382 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
1383 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
1384
1385 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
1386 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1387 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
1388 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
1389 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
1390 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
1391 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
1392
1393 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
1394 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
1395 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
1396 ini.WriteBool('Window', 'CabinetFontBold', FCabinetFontBold);
1397 ini.WriteBool('Window', 'CabinetFontItalic', FCabinetFontItalic);
1398 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
1399
1400 ini.WriteString('Window', 'ListFontName', FListFontName);
1401 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
1402 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
1403 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
1404 ini.WriteBool('Window', 'ListFontBold', FListFontBold);
1405 ini.WriteBool('Window', 'ListFontItalic', FListFontItalic);
1406 ini.WriteBool('Window','UseOddColor',FUseOddColorOddResNum);
1407 ini.WriteString('Window', 'OddColor',ColorToString(FOddColor));
1408
1409 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
1410 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
1411 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
1412 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
1413
1414 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
1415 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
1416 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
1417 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
1418
1419 ini.WriteString('Window', 'HintFontName', FHintFontName);
1420 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
1421 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
1422 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
1423
1424 ini.UpdateFile;
1425 finally
1426 ini.Free;
1427 end;
1428 end;
1429
1430 //設定ファイル保存(window)
1431 procedure TSetting.WriteWindowSettingFile();
1432 var
1433 i: Integer;
1434 ini: TMemIniFile;
1435 CoolSet: TCoolSet;
1436 wkList : TStringList;
1437 begin
1438 ini := TMemIniFile.Create(GetFileName());
1439 try
1440 ini.WriteInteger('WindowSize', 'Top', WindowTop);
1441 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
1442 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
1443 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
1444 ini.WriteBool('WindowSize', 'Max', WindowMax);
1445
1446 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
1447
1448 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
1449 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
1450 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
1451 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
1452 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
1453 ini.WriteBool('EditorWindowSize', 'Stay', EditWindowStay);
1454 ini.WriteBool('EditorWindowSize', 'Translucent', EditWindowTranslucent);
1455
1456 ini.WriteInteger('OptionDialog', 'TabIndex', FOptionDialogTabIndex);
1457
1458 //ツールバー
1459 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
1460 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
1461 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
1462 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
1463 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
1464 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
1465 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
1466 //ツールバーWrapable
1467 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
1468 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
1469
1470 //タブ
1471 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
1472 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
1473 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
1474 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
1475
1476 //メッセージバー
1477 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
1478 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
1479
1480 //ステータスバー
1481 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
1482
1483 //キャビネット
1484 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
1485 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
1486 ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
1487
1488 //リストのサイズと垂直水平
1489 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
1490 ini.WriteInteger('List', 'Height', FListHeight);
1491 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
1492 ini.WriteInteger('List', 'Width', FListWidth);
1493 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
1494 // ini.WriteBool('List', 'HeightMax', FListHeightMax);
1495 // ini.WriteBool('List', 'WidthMax', FListWidthMax);
1496
1497
1498 // ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
1499
1500 //リスト番号表示
1501 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1502 //CSS使用
1503 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1504 //CSSファイル名
1505 ini.WriteString('CSS', 'FileName', FCSSFileName);
1506 //Mail欄表示
1507 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1508 // レス表示範囲
1509 ini.DeleteKey( 'Thread', 'OnlyAHundredRes' ); // 古い設定の削除
1510 ini.WriteInteger('Thread', 'ResRange', FResRange);
1511 ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
1512 // スレッド一覧表示範囲
1513 ini.WriteInteger('ThreadList', 'ThreadRange', Ord( FThreadRange ));
1514 //ログ削除確認
1515 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1516 //終了確認
1517 ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1518 //AllTabClose
1519 ini.WriteBool('Function','ShowDialogForAllTabClose', FShowDialogForAllTabClose);
1520 //Samba
1521 ini.WriteBool('Function','UseSamba', FUseSamba);
1522 //ResAnchorjamp
1523 ini.WriteBool('Function', 'ResAnchoJamp', ResAnchorJamp);
1524
1525 //非アクティブ時ポップアップ表示
1526 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1527 //レスポップアップヘッダーボールド
1528 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1529 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1530
1531 //認証用ユーザID・パスワード
1532 ini.WriteString('Attestation', 'UserID', FUserID);
1533 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1534 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1535 ini.WriteBool('Attestation', 'FForcedLogin', FForcedLogin);
1536 ini.WriteString('Attestation', 'FDolibURL', FDolibURL);
1537
1538 //URLクリック時起動アプリ
1539 ini.WriteBool('URLApp', 'Select', FURLApp);
1540 ini.WriteString('URLApp', 'File', FURLAppFile);
1541
1542 //mailtoクリック時動作
1543 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1544
1545 //ポップアップ位置
1546 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1547
1548 //アドレスバー
1549 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1550 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1551 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1552 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1553
1554 //画像プレビュー
1555 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1556 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1557 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1558
1559 ini.WriteInteger('Window', 'BrowserAutoMaximize', Ord( BrowserAutoMaximize ) );
1560
1561 //スレッド一覧更新アイコン
1562 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1563 ini.WriteBool('ThreadList', 'CreationTimeLogs',FCreationTimeLogs);
1564 ini.WriteBool('ThreadList', 'FutureThread', FFutureThread);
1565 ini.WriteInteger('ThreadList', 'SelectInterval', FSelectInterval);
1566 //ソート順
1567 ini.WriteInteger('ThreadList', 'BBSSortIndex', FBBSSortIndex);
1568 ini.WriteBool('ThreadList', 'BBSSortOrder', FBBSSortOrder);
1569 ini.WriteInteger('ThreadList', 'CategorySortIndex', FCategorySortIndex);
1570 ini.WriteBool('ThreadList', 'CategorySortOrder', FCategorySortOrder);
1571 ini.WriteInteger('ThreadList', 'BoardSortIndex', FBoardSortIndex);
1572 ini.WriteBool('ThreadList', 'BoardSortOrder', FBoardSortOrder);
1573 ini.WriteInteger('ThreadList', 'DatOchiSortIndex', FDatOchiSortIndex);
1574 ini.WriteBool('ThreadList', 'DatOchiSortOrder', FDatOchiSortOrder);
1575
1576 //書き込み時マシン時刻使用設定
1577 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1578 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1579 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1580
1581 // リストカラム幅
1582 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1583 ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1584 end;
1585 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1586 ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1587 end;
1588 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1589 ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1590 end;
1591
1592 wkList := TStringList.Create;
1593 try
1594 // カテゴリリスト順序
1595 ini.ReadSection( 'BBSColumnOrder', wkList );
1596 for i := wkList.Count - 1 downto 0 do
1597 ini.DeleteKey( 'BBSColumnOrder', wkList[ i ] );
1598 for i := 0 to FBBSColumnOrder.Count - 1 do
1599 ini.WriteInteger( 'BBSColumnOrder', 'ID' + IntToStr( i ), Ord( FBBSColumnOrder[ i ] ) );
1600
1601 // 板リスト順序
1602 ini.ReadSection( 'CategoryColumnOrder', wkList );
1603 for i := wkList.Count - 1 downto 0 do
1604 ini.DeleteKey( 'CategoryColumnOrder', wkList[ i ] );
1605 for i := 0 to FCategoryColumnOrder.Count - 1 do
1606 ini.WriteInteger( 'CategoryColumnOrder', 'ID' + IntToStr( i ), Ord( FCategoryColumnOrder[ i ] ) );
1607
1608 // スレリスト順序
1609 ini.ReadSection( 'BoardColumnOrder', wkList );
1610 for i := wkList.Count - 1 downto 0 do
1611 ini.DeleteKey( 'BoardColumnOrder', wkList[ i ] );
1612 for i := 0 to FBoardColumnOrder.Count - 1 do
1613 ini.WriteInteger( 'BoardColumnOrder', 'ID' + IntToStr( i ), Ord( FBoardColumnOrder[ i ] ) );
1614 finally
1615 wkList.Free;
1616 end;
1617
1618 //サウンド
1619 for i := 0 to GetSoundCount - 1 do begin
1620 if not FileExists(SoundFileName[i]) then
1621 SoundFileName[i] := '';
1622 ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1623 end;
1624
1625 //CoolBar
1626 ini.EraseSection('MainCoolBar');
1627 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1628 CoolSet := MainCoolSet[i];
1629 ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1630 ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1631 ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1632 end;
1633 ini.EraseSection('ListCoolBar');
1634 ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1635 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1636 CoolSet := ListCoolSet[i];
1637 ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1638 ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1639 ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1640 end;
1641 ini.EraseSection('BrowserCoolBar');
1642 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1643 CoolSet := BrowserCoolSet[i];
1644 ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1645 ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1646 ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1647 end;
1648
1649 //あぼ〜ん
1650 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1651 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1652 ini.WriteBool('Abon','Popup',FPopUpAbon);
1653 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1654 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1655 ini.WriteBool('Abon','DeleteSyria',FDeleteSyria);
1656
1657 // エディタ
1658 ini.WriteBool( 'Editor', 'SpaceToNBSP', FSpaceToNBSP );
1659 ini.WriteBool( 'Editor', 'AmpToCharRef', FAmpToCharRef );
1660
1661 //タブ自動保存
1662 ini.WriteBool('TabAuto', 'TabAutoLoadSave', FTabAutoLoadSave);
1663 //詳細設定
1664 ini.WriteInteger('OptionDialog', 'KuroutTabIndex', FKuroutSettingTabIndex);
1665
1666 //にちゃん語案内機能
1667 ini.WriteBool('2chSupport', 'Support', F2chSupport);
1668
1669 // マウスジェスチャーを使用するかどうか
1670 ini.WriteBool( 'Guesture', 'Enabled', FGestureEnabled );
1671
1672 //FusianaTrap
1673 ini.WriteBool('Trap', 'LocalTrap', FLocalTrapAtt);
1674 ini.WriteBool('Trap', 'RemoteTrap', FRemoteTrapAtt);
1675 ini.WriteInteger('HTTP', 'ReadTimeOut', FReadTimeOut);
1676
1677 // 使用するスパムフィルタ
1678 ini.WriteInteger( 'Abon', 'SpamFilterAlgorithm', Ord( FSpamFilterAlgorithm ) );
1679 ini.WriteBool('Function', 'Mute', FMute);
1680 ini.WriteBool('ThreadList', 'UseUndecided', FUseUndecided);
1681
1682 //認証用ユーザID・パスワード
1683 ini.WriteString('Be', 'UserID', FBeUserID);
1684 ini.WriteString('Be', 'Password', Encrypt(FBePassword));
1685 ini.WriteBool('Be', 'AutoLogin', FBeAutoLogin);
1686
1687 ini.UpdateFile;
1688 finally
1689 ini.Free;
1690 end;
1691 end;
1692
1693 //設定ファイル保存(name & mail)
1694 procedure TSetting.WriteNameMailSettingFile();
1695 var
1696 i: Integer;
1697 ini: TMemIniFile;
1698 begin
1699 ini := TMemIniFile.Create(GetFileName());
1700 try
1701 ini.EraseSection('Name');
1702 ini.EraseSection('Mail');
1703 ini.EraseSection('SelectText');
1704 for i := 0 to FNameList.Count - 1 do begin
1705 ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1706 if i >= 39 then
1707 Break;
1708 end;
1709 for i := 0 to FMailList.Count - 1 do begin
1710 ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1711 if i >= 39 then
1712 Break;
1713 end;
1714 for i := 0 to FSelectTextList.Count - 1 do begin
1715 ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1716 if i >= 39 then
1717 Break;
1718 end;
1719 ini.UpdateFile;
1720 finally
1721 ini.Free;
1722 end;
1723 end;
1724
1725 procedure TSetting.WriteFolderSettingFile();
1726 var
1727 ini: TMemIniFile;
1728 begin
1729 ini := TMemIniFile.Create(GetFileName());
1730 try
1731 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1732 ini.DeleteKey('Folder', 'LogFolder')
1733 else
1734 ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1735 ini.UpdateFile;
1736 finally
1737 ini.Free;
1738 end;
1739 end;
1740 //板更新用BoardURLを保存
1741 procedure TSetting.WriteBoardURLSettingFile();
1742 var
1743 ini: TMemIniFile;
1744 i : Integer;
1745 oldcount : Integer;
1746 begin
1747 ini := TMemIniFile.Create(GetBoardURLFileName());
1748 try
1749 oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1750 ini.WriteInteger('URL','count',FBoardURLs.Count);
1751 ini.WriteInteger('URL','selected',BoardURLSelected);
1752 for i := 0 to FBoardURLs.Count -1 do begin
1753 ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1754 end;
1755 if oldcount > FBoardURLs.Count then begin
1756 for i := FBoardURLs.Count to oldcount do begin
1757 ini.DeleteKey('URL',IntToStr(i+1));
1758 end;
1759 end;
1760 ini.UpdateFile;
1761 finally
1762 ini.Free;
1763 end;
1764 end;
1765
1766 {$R-}
1767 //リストカラムヘッダー
1768 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1769 begin
1770 Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1771 end;
1772
1773 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1774 begin
1775 Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1776 end;
1777
1778 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1779 begin
1780 Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1781 end;
1782 {$IFDEF DEBUG}
1783 {$R+}
1784 {$ENDIF}
1785
1786 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1787 begin
1788 if index in [0..Length(FBBSColumnWidth) - 1] then
1789 FBBSColumnWidth[index] := value;
1790 end;
1791
1792 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1793 begin
1794 if index in [0..Length(FCategoryColumnWidth) - 1] then
1795 FCategoryColumnWidth[index] := value;
1796 end;
1797
1798 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1799 begin
1800 if index in [0..Length(FBoardColumnWidth) - 1] then
1801 FBoardColumnWidth[index] := value;
1802 end;
1803
1804 function TSetting.GetSoundCount: Integer;
1805 begin
1806 Result := Length(SOUND_NAME);
1807 end;
1808
1809 function TSetting.GetSoundName(Index: Integer): string;
1810 begin
1811 if (Index < GetSoundCount) and (Index >= 0) then
1812 Result := SOUND_NAME[Index].Name
1813 else
1814 Result := '';
1815 end;
1816
1817 function TSetting.GetSoundViewName(Index: Integer): string;
1818 begin
1819 if (Index < GetSoundCount) and (Index >= 0) then
1820 Result := SOUND_NAME[Index].ViewName
1821 else
1822 Result := '';
1823 end;
1824
1825 function TSetting.GetSoundFileName(Index: Integer): string;
1826 begin
1827 if (Index < GetSoundCount) and (Index >= 0) then
1828 Result := SOUND_NAME[Index].FileName
1829 else
1830 Result := '';
1831 end;
1832
1833 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1834 begin
1835 if (Index < GetSoundCount) and (Index >= 0) then
1836 SOUND_NAME[Index].FileName := value;
1837 end;
1838
1839 function TSetting.FindSoundFileName(Name: string): string;
1840 var
1841 i: Integer;
1842 begin
1843 for i := 0 to GetSoundCount - 1 do begin
1844 if SoundName[i] = Name then begin
1845 Result := SoundFileName[i];
1846 Exit;
1847 end;
1848 end;
1849 Result := '';
1850 end;
1851
1852 function TSetting.Encrypt(s: string): string;
1853 var
1854 cryptObj: THogeCryptAuto;
1855 inputStream, outputStream: TStringStream;
1856 begin
1857 inputStream := TStringStream.Create(s);
1858 outputStream := TStringStream.Create('');
1859 cryptObj := THogeCryptAuto.Create;
1860 try
1861 // 暗号化
1862 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1863
1864 // バイナリなので必要に応じてテキストに変換
1865 Result := HogeBase64Encode(outputStream.DataString);
1866 finally
1867 cryptObj.Free;
1868 outputStream.Free;
1869 inputStream.Free;
1870 end;
1871 end;
1872
1873 function TSetting.Decrypt(s: string): string;
1874 var
1875 cryptObj: THogeCryptAuto;
1876 inputStream, outputStream: TStringStream;
1877 begin
1878 try
1879 inputStream := TStringStream.Create(HogeBase64Decode(s));
1880 except
1881 Result := '';
1882 Exit;
1883 end;
1884 outputStream := TStringStream.Create('');
1885 cryptObj := THogeCryptAuto.Create;
1886 try
1887 // 復号
1888 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1889 Result := outputStream.DataString;
1890 finally
1891 cryptObj.Free;
1892 outputStream.Free;
1893 inputStream.Free;
1894 end;
1895 end;
1896
1897 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1898 begin
1899 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1900 Result := FMainCoolBar[Index]
1901 else begin
1902 Result.FCoolID := -1;
1903 Result.FCoolWidth := -1;
1904 Result.FCoolBreak := False;
1905 end;
1906 end;
1907
1908 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1909 begin
1910 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1911 Result := FListCoolBar[Index]
1912 else begin
1913 Result.FCoolID := -1;
1914 Result.FCoolWidth := -1;
1915 Result.FCoolBreak := False;
1916 end;
1917 end;
1918
1919 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1920 begin
1921 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1922 Result := FBrowserCoolBar[Index]
1923 else begin
1924 Result.FCoolID := -1;
1925 Result.FCoolWidth := -1;
1926 Result.FCoolBreak := False;
1927 end;
1928 end;
1929
1930 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1931 begin
1932 if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1933 FMainCoolBar[Index] := CoolSet;
1934 end;
1935
1936 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1937 begin
1938 if Index in [0..LIST_COOLBAND_COUNT - 1] then
1939 FListCoolBar[Index] := CoolSet;
1940 end;
1941
1942 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1943 begin
1944 if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1945 FBrowserCoolBar[Index] := CoolSet;
1946 end;
1947
1948 //url.iniがないときに生成する
1949 procedure TSetting.MakeURLIniFile();
1950 var
1951 ini: TMemIniFile;
1952 begin
1953 ini := TMemIniFile.Create(GetBoardURLFileName());
1954 try
1955 ini.WriteInteger('URL','count',2);
1956 ini.WriteInteger('URL','selected',2);
1957 ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1958 ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1959 ini.UpdateFile;
1960 finally
1961 ini.Free;
1962 end;
1963 end;
1964
1965 (*************************************************************************
1966 *ボードファイル名取得(パス+ファイル名)
1967 *************************************************************************)
1968 function TSetting.GetBoardFileName: string;
1969 begin
1970 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_FILE_NAME;
1971 end;
1972
1973 (*************************************************************************
1974 *ボードファイル名取得(パス+ファイル名)
1975 *************************************************************************)
1976 function TSetting.GetCustomBoardFileName: string;
1977 begin
1978 Result := GetAppDir + CONFIG_DIR_NAME + '\' + CUSTOMBOARD_FILE_NAME;
1979 end;
1980
1981 (*************************************************************************
1982 *ボードディレクトリ取得
1983 *************************************************************************)
1984 function TSetting.GetBoardDir: string;
1985 begin
1986 Result := GetAppDir + CONFIG_DIR_NAME + '\' + BOARD_DIR_NAME + '\';
1987 end;
1988
1989 (*************************************************************************
1990 *テンポラリフォルダー名取得
1991 *************************************************************************)
1992 function TSetting.GetHtmlTempFileName: string;
1993 begin
1994 Result := TEMP_FOLDER;
1995 end;
1996
1997
1998 (*************************************************************************
1999 *実行ファイルフォルダ取得
2000 *************************************************************************)
2001 function TSetting.GetAppDir: string;
2002 begin
2003 Result := ExtractFilePath(Application.ExeName);
2004 end;
2005
2006 (*************************************************************************
2007 *TempHtmlファイル名取得(パス+ファイル名)
2008 *************************************************************************)
2009 function TSetting.GetTempFolder: string;
2010 begin
2011 Result := GetAppDir + TEMP_FOLDER;
2012 end;
2013
2014 (*************************************************************************
2015 *sent.iniファイル名取得(パス+ファイル名)
2016 *************************************************************************)
2017 function TSetting.GetSentFileName: string;
2018 begin
2019 Result := GetAppDir + SENT_FILE_NAME;
2020 end;
2021
2022 (*************************************************************************
2023 *outbox.iniファイル名取得(パス+ファイル名)
2024 *************************************************************************)
2025 function TSetting.GetOutBoxFileName: string;
2026 begin
2027 Result := GetAppDir + OUTBOX_FILE_NAME;
2028 end;
2029
2030 (*************************************************************************
2031 *Configフォルダ取得
2032 *************************************************************************)
2033 function TSetting.GetConfigDir: string;
2034 begin
2035 Result := IncludeTrailingPathDelimiter(GetAppDir + CONFIG_DIR_NAME);
2036 end;
2037
2038 function TSetting.GetStyleSheetDir: string;
2039 begin
2040 Result := IncludeTrailingPathDelimiter(GetConfigDir + CSS_DIR_NAME);
2041 end;
2042
2043 function TSetting.GetSkinDir: string;
2044 begin
2045 Result := IncludeTrailingPathDelimiter(GetConfigDir + SKIN_DIR_NAME);
2046 end;
2047
2048 function TSetting.GetSkinHeaderFileName: string;
2049 begin
2050 Result := CSSFileName + SKIN_HEADER_FILE_NAME;
2051 end;
2052
2053 function TSetting.GetSkinFooterFileName: string;
2054 begin
2055 Result := CSSFileName + SKIN_FOOTER_FILE_NAME;
2056 end;
2057
2058 function TSetting.GetSkinNewResFileName: string;
2059 begin
2060 Result := CSSFileName + SKIN_NEWRES_FILE_NAME;
2061 end;
2062
2063 function TSetting.GetSkinResFileName: string;
2064 begin
2065 Result := CSSFileName + SKIN_RES_FILE_NAME;
2066 end;
2067
2068 function TSetting.GetSkinBookmarkFileName: string;
2069 begin
2070 Result := CSSFileName + SKIN_BOOKMARK_FILE_NAME;
2071 end;
2072
2073 function TSetting.GetSkinNewmarkFileName: string;
2074 begin
2075 Result := CSSFileName + SKIN_NEWMARK_FILE_NAME;
2076 end;
2077
2078 function TSetting.GetNGWordsDir: string;
2079 begin
2080 Result := IncludeTrailingPathDelimiter(GetConfigDir + NGWORDs_DIR_NAME);
2081 end;
2082
2083 function TSetting.GetBoardPlugInDir: string;
2084 begin
2085 Result := IncludeTrailingPathDelimiter(GetConfigDir + BOARD_PLUGIN_DIR_NAME);
2086 end;
2087
2088 procedure TSetting.SetUseCSS( value: Boolean );
2089 begin
2090
2091 FUseCSS := value;
2092
2093 FUseSkin :=
2094 UseCSS and
2095 (Pos( GetSkinDir, CSSFileName ) > 0) and
2096 FileExists( GetSkinHeaderFileName );
2097
2098 end;
2099
2100 procedure TSetting.SetCSSFileName( fileName: string );
2101 begin
2102
2103 FCSSFileName := fileName;
2104
2105 FUseSkin :=
2106 UseCSS and
2107 (Pos( GetSkinDir, CSSFileName ) > 0) and
2108 FileExists( GetSkinHeaderFileName );
2109
2110 end;
2111
2112 function TSetting.GetSambaFileName: string;
2113 begin
2114 Result := GetAppDir + SAMBATIME_FILE_NAME;
2115 end;
2116 //板更新除外カテゴリリスト保存ファイル
2117 function TSetting.GetIgnoreFileName: string;
2118 begin
2119 Result := GetConfigDir + IGNORE_FILE_NAME;
2120 end;
2121
2122 //! マウスジェスチャーファイルパス
2123 function TSetting.GetGestureFileName: string;
2124 begin
2125 Result := GetConfigDir + GESTURE_FILE_NAME;
2126 end;
2127
2128 //! スパムフィルタ学習履歴ファイルパス
2129 function TSetting.GetSpamFilterFileName: string;
2130 begin
2131 Result := GetConfigDir + SPAMFILTER_FILE_NAME;
2132 end;
2133
2134 function TSetting.GetLanguageFileName: string;
2135 begin
2136 Result := GetConfigDir + LANGUAGE_FILE_NAME;
2137 end;
2138 //Messagelistに出力されるメッセージの設定
2139 procedure TSetting.SetMessages;
2140 var
2141 i :Integer;
2142 ini : TMemIniFile;
2143 begin
2144 //2ch言語読み出し
2145 if (GengoSupport) and (FileExists(GetLanguageFileName)) then begin
2146 ini := TmemIniFile.Create(GetLanguageFileName);
2147 try
2148 {
2149 'ログアウトしました',
2150 'ログインしました - ',
2151 '強制ログインしました - ',
2152 '[スレ一覧取得完了]',
2153 '(名称不明)',
2154 '[スレ取得完了]',
2155 '[スレ差分取得完了]',
2156 '[未更新]',
2157 '[中断]',
2158 '[エラー]',
2159 '[レス送信終了]',
2160 '[新スレ送信終了]',
2161 '[レス送信失敗]',
2162 '[新スレ送信失敗]'); }
2163 FMessageList[0] := ini.ReadString('Language', 'Logout', DEF_MESSAGES[0]);
2164 FMessageList[1] := ini.ReadString('Language', 'Login', DEF_MESSAGES[1]);
2165 FMessageList[2] := ini.ReadString('Language', 'ForceLogin', DEF_MESSAGES[2]);
2166 FMessageList[3] := ini.ReadString('Language', 'SureItiran', DEF_MESSAGES[3]);
2167 FMessageList[4] := ini.ReadString('Language', 'UnKnown', DEF_MESSAGES[4]);
2168 FMessageList[5] := ini.ReadString('Language', 'SureSyutoku', DEF_MESSAGES[5]);
2169 FMessageList[6] := ini.ReadString('Language', 'SureDiff', DEF_MESSAGES[6]);
2170 FMessageList[7] := ini.ReadString('Language', 'NotMod', DEF_MESSAGES[7]);
2171 FMessageList[8] := ini.ReadString('Language', 'Abort', DEF_MESSAGES[8]);
2172 FMessageList[9] := ini.ReadString('Language', 'Error', DEF_MESSAGES[9]);
2173 FMessageList[10] := ini.ReadString('Language', 'NewRes', DEF_MESSAGES[10]);
2174 FMessageList[11] := ini.ReadString('Language', 'NewSure', DEF_MESSAGES[11]);
2175 FMessageList[12] := ini.ReadString('Language', 'ResError', DEF_MESSAGES[12]);
2176 FMessageList[13] := ini.ReadString('Language', 'SureError', DEF_MESSAGES[13]);
2177 finally
2178 ini.Free;
2179 end;
2180
2181 end else begin
2182 for i := 0 to 13 do begin
2183 FMessageList[i] := DEF_MESSAGES[i];
2184 end;
2185 end;
2186 end;
2187 function TSetting.GetMessage(AType :Integer): string;
2188 begin
2189 if (AType >= 0) and (AType <= Length(FMessageList)) then
2190 Result := FMessageList[AType]
2191 else
2192 Result := '';
2193 end;
2194
2195
2196 end.
2197
2198

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