| 5 |
|
|
| 6 |
uses |
uses |
| 7 |
SysUtils, Classes, Graphics, Forms, {Math, IniFiles, UCryptAuto, UBase64,} |
SysUtils, Classes, Graphics, Forms, {Math, IniFiles, UCryptAuto, UBase64,} |
| 8 |
ComCtrls, GestureModel; |
ComCtrls, GestureModel, IniFiles; |
| 9 |
|
|
| 10 |
const |
const |
| 11 |
MAIN_COOLBAND_COUNT = 4; //メインCoolBandの数 |
MAIN_COOLBAND_COUNT = 4; //メインCoolBandの数 |
| 461 |
|
|
| 462 |
procedure SetUseCSS( value: Boolean ); |
procedure SetUseCSS( value: Boolean ); |
| 463 |
procedure SetCSSFileName( fileName: string ); |
procedure SetCSSFileName( fileName: string ); |
| 464 |
|
//! プロキシ設定読み込み |
| 465 |
|
procedure ReadProxySettings(memIni: TMemIniFile); |
| 466 |
|
//! 各種ウィンドウ設定読み込み |
| 467 |
|
procedure ReadWindowSettings(memIni: TMemIniFile); |
| 468 |
|
//! 入力履歴読み込み(検索+メール欄+名前) |
| 469 |
|
procedure ReadInputHisotrys(memIni: TMemIniFile); |
| 470 |
|
//! リストカラム幅読み込み |
| 471 |
|
procedure ReadListColumnWidth(memIni: TMemIniFile); |
| 472 |
|
//! カテゴリリストカラム順序読み込み |
| 473 |
|
procedure ReadOrdColumn(memIni: TMemIniFile); |
| 474 |
protected |
protected |
| 475 |
|
|
| 476 |
public |
public |
| 821 |
implementation |
implementation |
| 822 |
|
|
| 823 |
uses |
uses |
| 824 |
Math, IniFiles, UCryptAuto, UBase64; |
Math, UCryptAuto, UBase64; |
| 825 |
|
|
| 826 |
type |
type |
| 827 |
TSoundName = record |
TSoundName = record |
| 974 |
|
|
| 975 |
//設定ファイル読込 |
//設定ファイル読込 |
| 976 |
procedure TSetting.ReadSettingFile(); |
procedure TSetting.ReadSettingFile(); |
|
const |
|
|
DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140); |
|
|
DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130); |
|
|
DEFAULT_BOARD_WIDTH: array[0..10] of Integer = (350, 60, 60, 60, 60, 60, 80, 130, 130, 130, 60); |
|
|
MAX_WIDTH: Integer = 2000; |
|
| 977 |
var |
var |
| 978 |
ini: TMemIniFile; |
ini: TMemIniFile; |
| 979 |
i: Integer; |
i: Integer; |
|
id, code : Integer; |
|
|
wkList: TStringList; |
|
|
wkStr: string; |
|
| 980 |
Exists: Boolean; |
Exists: Boolean; |
| 981 |
s: string; |
s: string; |
|
// id: Integer; |
|
| 982 |
CoolSet: TCoolSet; |
CoolSet: TCoolSet; |
| 983 |
begin |
begin |
| 984 |
Exists := FileExists(GetFileName); |
Exists := FileExists(GetFileName); |
| 991 |
//プロキシ接続HTTP1.1使用 |
//プロキシ接続HTTP1.1使用 |
| 992 |
FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False); |
FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False); |
| 993 |
|
|
| 994 |
FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false); |
// プロキシ設定読み込み |
| 995 |
FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', ''); |
ReadProxySettings( ini ); |
| 996 |
FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0); |
|
| 997 |
FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', ''); |
// 各種ウィンドウの設定読み込み |
| 998 |
FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', ''); |
ReadWindowSettings( ini ); |
|
|
|
|
FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false); |
|
|
FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', ''); |
|
|
FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0); |
|
|
FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', ''); |
|
|
FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', ''); |
|
|
|
|
|
FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', ''); |
|
|
FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0); |
|
|
FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0); |
|
|
FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0); |
|
|
FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1); |
|
|
FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1); |
|
|
|
|
|
FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME); |
|
|
FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE); |
|
|
FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False); |
|
|
FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False); |
|
|
FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR)); |
|
|
FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR)); |
|
|
|
|
|
FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME); |
|
|
FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE); |
|
|
FListFontBold := ini.ReadBool('Window', 'ListFontBold', False); |
|
|
FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False); |
|
|
FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR)); |
|
|
FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR)); |
|
|
FUseOddColorOddResNum := ini.ReadBool('Window','UseOddColor', False); |
|
|
FOddColor := StringToColor(ini.ReadString('Window', 'OddColor', DEFAULT_WINDOW_COLOR)); |
|
|
FUnFocusedBold := ini.ReadBool('Window','UnFocusedBold', False); |
|
|
|
|
|
FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME); |
|
|
FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE); |
|
|
FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False); |
|
|
FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False); |
|
|
FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR)); |
|
|
FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR)); |
|
|
|
|
|
FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME); |
|
|
FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE); |
|
|
FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False); |
|
|
FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False); |
|
|
|
|
|
FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name); |
|
|
FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size); |
|
|
//FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False); |
|
|
//FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False); |
|
|
FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR)); |
|
|
FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk')); |
|
| 999 |
|
|
| 1000 |
FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1); |
FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1); |
| 1001 |
FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1); |
FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1); |
| 1052 |
// FListHeightMax := ini.ReadBool('List', 'HeightMax', False); |
// FListHeightMax := ini.ReadBool('List', 'HeightMax', False); |
| 1053 |
// FListWidthMax := ini.ReadBool('List', 'WidthMax', False); |
// FListWidthMax := ini.ReadBool('List', 'WidthMax', False); |
| 1054 |
|
|
| 1055 |
wkList := TStringList.Create; |
// 入力項目の履歴を読み込む |
| 1056 |
try |
ReadInputHisotrys( ini ); |
|
ini.ReadSection('Name', wkList); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString('Name', wkList[i], ''); |
|
|
if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then |
|
|
FNameList.Add(wkStr); |
|
|
end; |
|
|
ini.ReadSection('Mail', wkList); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString('Mail', wkList[i], ''); |
|
|
if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then |
|
|
FMailList.Add(wkStr); |
|
|
end; |
|
|
ini.ReadSection('SelectText', wkList); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString('SelectText', wkList[i], ''); |
|
|
if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then |
|
|
FSelectTextList.Add(wkStr); |
|
|
end; |
|
|
finally |
|
|
wkList.Free; |
|
|
end; |
|
| 1057 |
|
|
| 1058 |
// リストカラム幅 |
// リストカラム幅 |
| 1059 |
wkList := TStringList.Create; |
ReadListColumnWidth( ini ); |
|
try |
|
|
ini.ReadSection('BBSColumnWidth', wkList); |
|
|
if Length(FBBSColumnWidth) <> wkList.Count then begin |
|
|
ini.EraseSection('BBSColumnWidth'); |
|
|
end; |
|
|
for i := 0 to Length(FBBSColumnWidth) - 1 do begin |
|
|
BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]); |
|
|
if BBSColumnWidth[i] > MAX_WIDTH then |
|
|
BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i]; |
|
|
end; |
|
|
ini.ReadSection('CategoryColumnWidth', wkList); |
|
|
if Length(FCategoryColumnWidth) <> wkList.Count then begin |
|
|
ini.EraseSection('CategoryColumnWidth'); |
|
|
end; |
|
|
for i := 0 to Length(FCategoryColumnWidth) - 1 do begin |
|
|
CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]); |
|
|
if CategoryColumnWidth[i] > MAX_WIDTH then |
|
|
CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i]; |
|
|
end; |
|
|
ini.ReadSection('BoardColumnWidth', wkList); |
|
|
if Length(FBoardColumnWidth) <> wkList.Count then begin |
|
|
ini.EraseSection('BoardColumnWidth'); |
|
|
end; |
|
|
for i := 0 to Length(FBoardColumnWidth) - 1 do begin |
|
|
BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]); |
|
|
if BoardColumnWidth[i] > MAX_WIDTH then |
|
|
BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i]; |
|
|
end; |
|
|
finally |
|
|
wkList.Free; |
|
|
end; |
|
| 1060 |
|
|
| 1061 |
// カテゴリリストカラム順序 |
// カテゴリリストカラム順序 |
| 1062 |
wkList := TStringList.Create; |
ReadOrdColumn( ini ); |
|
try |
|
|
ini.ReadSection( 'BBSColumnOrder', wkList ); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString( 'BBSColumnOrder', 'ID' + IntToStr( i ), '' ); |
|
|
Val( wkStr, id, code ); |
|
|
if code = 0 then |
|
|
FBBSColumnOrder.Add( TGikoBBSColumnID( id ) ); |
|
|
end; |
|
|
if FBBSColumnOrder.Count = 0 then begin |
|
|
// 設定が無いので作成 |
|
|
for i := 0 to Integer( High( TGikoBBSColumnID ) ) do |
|
|
FBBSColumnOrder.Add( TGikoBBSColumnID( i ) ); |
|
|
end; |
|
|
|
|
|
ini.ReadSection( 'CategoryColumnOrder', wkList ); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString( 'CategoryColumnOrder', 'ID' + IntToStr( i ), '' ); |
|
|
Val( wkStr, id, code ); |
|
|
if code = 0 then |
|
|
FCategoryColumnOrder.Add( TGikoCategoryColumnID( id ) ); |
|
|
end; |
|
|
if FCategoryColumnOrder.Count = 0 then begin |
|
|
// 設定が無いので作成 |
|
|
for i := 0 to Integer( High( TGikoCategoryColumnID ) ) do |
|
|
FCategoryColumnOrder.Add( TGikoCategoryColumnID( i ) ); |
|
|
end; |
|
|
|
|
|
ini.ReadSection( 'BoardColumnOrder', wkList ); |
|
|
for i := 0 to wkList.Count - 1 do begin |
|
|
wkStr := ini.ReadString( 'BoardColumnOrder', 'ID' + IntToStr( i ), '' ); |
|
|
Val( wkStr, id, code ); |
|
|
if code = 0 then |
|
|
FBoardColumnOrder.Add( TGikoBoardColumnID( id ) ); |
|
|
end; |
|
|
if FBoardColumnOrder.Count = 0 then begin |
|
|
// 設定が無いので作成 |
|
|
for i := 0 to Integer( High( TGikoBoardColumnID ) ) do begin |
|
|
// 勢いのカラムはデフォルトで非表示にする |
|
|
if ( i <> Ord(gbcVigor) ) then begin |
|
|
FBoardColumnOrder.Add( TGikoBoardColumnID( i ) ); |
|
|
end; |
|
|
end; |
|
|
end; |
|
|
finally |
|
|
wkList.Free; |
|
|
end; |
|
| 1063 |
|
|
| 1064 |
//リスト番号 |
//リスト番号 |
| 1065 |
FListViewNo := ini.ReadBool('Function', 'ListViewNo', True); |
FListViewNo := ini.ReadBool('Function', 'ListViewNo', True); |
| 2106 |
FMoveHistorySize := AVal; |
FMoveHistorySize := AVal; |
| 2107 |
end; |
end; |
| 2108 |
end; |
end; |
| 2109 |
end. |
{ |
| 2110 |
|
\brief プロキシ設定読み込み |
| 2111 |
|
\param memIni iniファイル |
| 2112 |
|
} |
| 2113 |
|
procedure TSetting.ReadProxySettings(memIni: TMemIniFile); |
| 2114 |
|
const |
| 2115 |
|
READ_SECTION = 'ReadProxy'; |
| 2116 |
|
WRITE_SECTION= 'WriteProxy'; |
| 2117 |
|
PROXY_KEY = 'Proxy'; |
| 2118 |
|
ADDRE_KEY = 'Address'; |
| 2119 |
|
PORT_KEY = 'Port'; |
| 2120 |
|
UID_KEY = 'UserID'; |
| 2121 |
|
PASS_KEY = 'Password'; |
| 2122 |
|
begin |
| 2123 |
|
if (memIni <> nil) then begin |
| 2124 |
|
FReadProxy := memIni.ReadBool(READ_SECTION, PROXY_KEY, false); |
| 2125 |
|
FReadProxyAddress := memIni.ReadString(READ_SECTION, ADDRE_KEY, ''); |
| 2126 |
|
FReadProxyPort := memIni.ReadInteger(READ_SECTION, PORT_KEY, 0); |
| 2127 |
|
FReadProxyUserID := memIni.ReadString(READ_SECTION, UID_KEY, ''); |
| 2128 |
|
FReadProxyPassword := memIni.ReadString(READ_SECTION, PASS_KEY, ''); |
| 2129 |
|
|
| 2130 |
|
FWriteProxy := memIni.ReadBool(WRITE_SECTION, PROXY_KEY, false); |
| 2131 |
|
FWriteProxyAddress := memIni.ReadString(WRITE_SECTION, ADDRE_KEY, ''); |
| 2132 |
|
FWriteProxyPort := memIni.ReadInteger(WRITE_SECTION, PORT_KEY, 0); |
| 2133 |
|
FWriteProxyUserID := memIni.ReadString(WRITE_SECTION, UID_KEY, ''); |
| 2134 |
|
FWriteProxyPassword := memIni.ReadString(WRITE_SECTION, PASS_KEY, ''); |
| 2135 |
|
end; |
| 2136 |
|
end; |
| 2137 |
|
{ |
| 2138 |
|
\brief 各種ウィンドウ設定読み込み |
| 2139 |
|
\param menIni iniファイル |
| 2140 |
|
} |
| 2141 |
|
procedure TSetting.ReadWindowSettings(memIni: TMemIniFile); |
| 2142 |
|
const |
| 2143 |
|
WINDOW_SECTION = 'Window'; |
| 2144 |
|
begin |
| 2145 |
|
if (memIni <> nil) then begin |
| 2146 |
|
FBrowserFontName := memIni.ReadString(WINDOW_SECTION, 'BrowserFontName', ''); |
| 2147 |
|
FBrowserFontSize := memIni.ReadInteger(WINDOW_SECTION, 'BrowserFontSize', 0); |
| 2148 |
|
FBrowserFontBold := memIni.ReadInteger(WINDOW_SECTION, 'BrowserFontBold', 0); |
| 2149 |
|
FBrowserFontItalic := memIni.ReadInteger(WINDOW_SECTION, 'BrowserFontItalic', 0); |
| 2150 |
|
FBrowserFontColor := memIni.ReadInteger(WINDOW_SECTION, 'BrowserFontColor', -1); |
| 2151 |
|
FBrowserBackColor := memIni.ReadInteger(WINDOW_SECTION, 'BrowserBackColor', -1); |
| 2152 |
|
|
| 2153 |
|
FCabinetFontName := memIni.ReadString(WINDOW_SECTION, 'CabinetFontName', DEFAULT_FONT_NAME); |
| 2154 |
|
FCabinetFontSize := memIni.ReadInteger(WINDOW_SECTION, 'CabinetFontSize', DEFAULT_FONT_SIZE); |
| 2155 |
|
FCabinetFontBold := memIni.ReadBool(WINDOW_SECTION, 'CabinetFontBold', False); |
| 2156 |
|
FCabinetFontItalic := memIni.ReadBool(WINDOW_SECTION, 'CabinetFontItalic', False); |
| 2157 |
|
FCabinetFontColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'CabinetFontColor', DEFAULT_FONT_COLOR)); |
| 2158 |
|
FCabinetBackColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'CabinetBackColor', DEFAULT_WINDOW_COLOR)); |
| 2159 |
|
|
| 2160 |
|
FListFontName := memIni.ReadString(WINDOW_SECTION, 'ListFontName', DEFAULT_FONT_NAME); |
| 2161 |
|
FListFontSize := memIni.ReadInteger(WINDOW_SECTION, 'ListFontSize', DEFAULT_FONT_SIZE); |
| 2162 |
|
FListFontBold := memIni.ReadBool(WINDOW_SECTION, 'ListFontBold', False); |
| 2163 |
|
FListFontItalic := memIni.ReadBool(WINDOW_SECTION, 'ListFontItalic', False); |
| 2164 |
|
FListFontColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'ListFontColor', DEFAULT_FONT_COLOR)); |
| 2165 |
|
FListBackColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'ListBackColor', DEFAULT_WINDOW_COLOR)); |
| 2166 |
|
FUseOddColorOddResNum := memIni.ReadBool(WINDOW_SECTION,'UseOddColor', False); |
| 2167 |
|
FOddColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'OddColor', DEFAULT_WINDOW_COLOR)); |
| 2168 |
|
FUnFocusedBold := memIni.ReadBool(WINDOW_SECTION,'UnFocusedBold', False); |
| 2169 |
|
|
| 2170 |
|
FEditorFontName := memIni.ReadString(WINDOW_SECTION, 'EditorFontName', DEFAULT_FONT_NAME); |
| 2171 |
|
FEditorFontSize := memIni.ReadInteger(WINDOW_SECTION, 'EditorFontSize', DEFAULT_FONT_SIZE); |
| 2172 |
|
FEditorFontBold := memIni.ReadBool(WINDOW_SECTION, 'EditorFontBold', False); |
| 2173 |
|
FEditorFontItalic := memIni.ReadBool(WINDOW_SECTION, 'EditorFontItalic', False); |
| 2174 |
|
FEditorFontColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'EditorFontColor', DEFAULT_FONT_COLOR)); |
| 2175 |
|
FEditorBackColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'EditorBackColor', DEFAULT_WINDOW_COLOR)); |
| 2176 |
|
|
| 2177 |
|
FBrowserTabFontName := memIni.ReadString(WINDOW_SECTION, 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME); |
| 2178 |
|
FBrowserTabFontSize := memIni.ReadInteger(WINDOW_SECTION, 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE); |
| 2179 |
|
FBrowserTabFontBold := memIni.ReadBool(WINDOW_SECTION, 'BrowserTabFontBold', False); |
| 2180 |
|
FBrowserTabFontItalic := memIni.ReadBool(WINDOW_SECTION, 'BrowserTabFontItalic', False); |
| 2181 |
|
|
| 2182 |
|
FHintFontName := memIni.ReadString(WINDOW_SECTION, 'HintFontName', Screen.HintFont.Name); |
| 2183 |
|
FHintFontSize := memIni.ReadInteger(WINDOW_SECTION, 'HintFontSize', Screen.HintFont.Size); |
| 2184 |
|
//FHintFontBold := memIni.ReadBool(WINDOW_SECTION, 'HintFontBold', False); |
| 2185 |
|
//FHintFontItalic := memIni.ReadBool(WINDOW_SECTION, 'HintFontItalic', False); |
| 2186 |
|
FHintFontColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'HintFontColor', DEFAULT_FONT_COLOR)); |
| 2187 |
|
FHintBackColor := StringToColor(memIni.ReadString(WINDOW_SECTION, 'HintBackColor', 'clInfoBk')); |
| 2188 |
|
end; |
| 2189 |
|
end; |
| 2190 |
|
{ |
| 2191 |
|
\brief 入力履歴読み込み(検索+メール欄+名前) |
| 2192 |
|
\param memIni iniファイル |
| 2193 |
|
} |
| 2194 |
|
procedure TSetting.ReadInputHisotrys(memIni: TMemIniFile); |
| 2195 |
|
const |
| 2196 |
|
SECTIONS : array[0..2] of string = ('Name', 'Mail', 'SelectText'); |
| 2197 |
|
var |
| 2198 |
|
wkList : TStringList; |
| 2199 |
|
wkStr : string; |
| 2200 |
|
i, j : Integer; |
| 2201 |
|
listArray : array[0..2] of TStringList; |
| 2202 |
|
begin |
| 2203 |
|
if (memIni <> nil) then begin |
| 2204 |
|
listArray[0] := FNameList; |
| 2205 |
|
listArray[1] := FMailList; |
| 2206 |
|
listArray[2] := FSelectTextList; |
| 2207 |
|
wkList := TStringList.Create; |
| 2208 |
|
try |
| 2209 |
|
for i := 0 to High(listArray) do begin |
| 2210 |
|
memIni.ReadSection(SECTIONS[i], wkList); |
| 2211 |
|
for j := 0 to wkList.Count -1 do begin |
| 2212 |
|
wkStr := memIni.ReadString(SECTIONS[i], wkList[j], ''); |
| 2213 |
|
if (wkStr <> '') and |
| 2214 |
|
(listArray[i].IndexOf(wkStr) = -1) then begin |
| 2215 |
|
listArray[i].Add(wkStr); |
| 2216 |
|
end; |
| 2217 |
|
end; |
| 2218 |
|
end; |
| 2219 |
|
finally |
| 2220 |
|
wkList.Free; |
| 2221 |
|
end; |
| 2222 |
|
end; |
| 2223 |
|
end; |
| 2224 |
|
{ |
| 2225 |
|
\breif リストカラム幅読み込み |
| 2226 |
|
\param memIni iniファイル |
| 2227 |
|
} |
| 2228 |
|
procedure TSetting.ReadListColumnWidth(memIni: TMemIniFile); |
| 2229 |
|
const |
| 2230 |
|
SECTIONS : array[0..2] of string = |
| 2231 |
|
('BBSColumnWidth', 'CategoryColumnWidth', 'BoardColumnWidth'); |
| 2232 |
|
DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140); |
| 2233 |
|
DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130); |
| 2234 |
|
DEFAULT_BOARD_WIDTH: array[0..10] of Integer = (350, 60, 60, 60, 60, 60, 80, 130, 130, 130, 60); |
| 2235 |
|
MAX_WIDTH: Integer = 2000; |
| 2236 |
|
var |
| 2237 |
|
wkList : TStringList; |
| 2238 |
|
i : Integer; |
| 2239 |
|
begin |
| 2240 |
|
if (memIni <> nil) then begin |
| 2241 |
|
// リストカラム幅 |
| 2242 |
|
wkList := TStringList.Create; |
| 2243 |
|
try |
| 2244 |
|
memIni.ReadSection(SECTIONS[0], wkList); |
| 2245 |
|
if Length(FBBSColumnWidth) <> wkList.Count then begin |
| 2246 |
|
memIni.EraseSection(SECTIONS[0]); |
| 2247 |
|
end; |
| 2248 |
|
for i := 0 to High(FBBSColumnWidth) do begin |
| 2249 |
|
BBSColumnWidth[i] := memIni.ReadInteger(SECTIONS[0], |
| 2250 |
|
'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]); |
| 2251 |
|
if BBSColumnWidth[i] > MAX_WIDTH then |
| 2252 |
|
BBSColumnWidth[i] := DEFAULT_BBS_WIDTH[i]; |
| 2253 |
|
end; |
| 2254 |
|
memIni.ReadSection(SECTIONS[1], wkList); |
| 2255 |
|
if Length(FCategoryColumnWidth) <> wkList.Count then begin |
| 2256 |
|
memIni.EraseSection(SECTIONS[1]); |
| 2257 |
|
end; |
| 2258 |
|
for i := 0 to High(FCategoryColumnWidth) do begin |
| 2259 |
|
CategoryColumnWidth[i] := memIni.ReadInteger(SECTIONS[1], |
| 2260 |
|
'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]); |
| 2261 |
|
if CategoryColumnWidth[i] > MAX_WIDTH then |
| 2262 |
|
CategoryColumnWidth[i] := DEFAULT_CATEGORY_WIDTH[i]; |
| 2263 |
|
end; |
| 2264 |
|
memIni.ReadSection(SECTIONS[2], wkList); |
| 2265 |
|
if Length(FBoardColumnWidth) <> wkList.Count then begin |
| 2266 |
|
memIni.EraseSection(SECTIONS[2]); |
| 2267 |
|
end; |
| 2268 |
|
for i := 0 to High(FBoardColumnWidth) do begin |
| 2269 |
|
BoardColumnWidth[i] := memIni.ReadInteger(SECTIONS[2], |
| 2270 |
|
'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]); |
| 2271 |
|
if BoardColumnWidth[i] > MAX_WIDTH then |
| 2272 |
|
BoardColumnWidth[i] := DEFAULT_BOARD_WIDTH[i]; |
| 2273 |
|
end; |
| 2274 |
|
finally |
| 2275 |
|
wkList.Free; |
| 2276 |
|
end; |
| 2277 |
|
end; |
| 2278 |
|
end; |
| 2279 |
|
//! カテゴリリストカラム順序読み込み |
| 2280 |
|
procedure TSetting.ReadOrdColumn(memIni: TMemIniFile); |
| 2281 |
|
var |
| 2282 |
|
wkList : TStringList; |
| 2283 |
|
wkStr : string; |
| 2284 |
|
i, id, code : Integer; |
| 2285 |
|
begin |
| 2286 |
|
if (memIni <> nil) then begin |
| 2287 |
|
wkList := TStringList.Create; |
| 2288 |
|
try |
| 2289 |
|
memIni.ReadSection( 'BBSColumnOrder', wkList ); |
| 2290 |
|
for i := 0 to wkList.Count - 1 do begin |
| 2291 |
|
wkStr := memIni.ReadString( 'BBSColumnOrder', 'ID' + IntToStr( i ), '' ); |
| 2292 |
|
Val( wkStr, id, code ); |
| 2293 |
|
if code = 0 then |
| 2294 |
|
FBBSColumnOrder.Add( TGikoBBSColumnID( id ) ); |
| 2295 |
|
end; |
| 2296 |
|
if FBBSColumnOrder.Count = 0 then begin |
| 2297 |
|
// 設定が無いので作成 |
| 2298 |
|
for i := 0 to Integer( High( TGikoBBSColumnID ) ) do |
| 2299 |
|
FBBSColumnOrder.Add( TGikoBBSColumnID( i ) ); |
| 2300 |
|
end; |
| 2301 |
|
|
| 2302 |
|
memIni.ReadSection( 'CategoryColumnOrder', wkList ); |
| 2303 |
|
for i := 0 to wkList.Count - 1 do begin |
| 2304 |
|
wkStr := memIni.ReadString( 'CategoryColumnOrder', 'ID' + IntToStr( i ), '' ); |
| 2305 |
|
Val( wkStr, id, code ); |
| 2306 |
|
if code = 0 then |
| 2307 |
|
FCategoryColumnOrder.Add( TGikoCategoryColumnID( id ) ); |
| 2308 |
|
end; |
| 2309 |
|
if FCategoryColumnOrder.Count = 0 then begin |
| 2310 |
|
// 設定が無いので作成 |
| 2311 |
|
for i := 0 to Integer( High( TGikoCategoryColumnID ) ) do |
| 2312 |
|
FCategoryColumnOrder.Add( TGikoCategoryColumnID( i ) ); |
| 2313 |
|
end; |
| 2314 |
|
|
| 2315 |
|
memIni.ReadSection( 'BoardColumnOrder', wkList ); |
| 2316 |
|
for i := 0 to wkList.Count - 1 do begin |
| 2317 |
|
wkStr := memIni.ReadString( 'BoardColumnOrder', 'ID' + IntToStr( i ), '' ); |
| 2318 |
|
Val( wkStr, id, code ); |
| 2319 |
|
if code = 0 then |
| 2320 |
|
FBoardColumnOrder.Add( TGikoBoardColumnID( id ) ); |
| 2321 |
|
end; |
| 2322 |
|
if FBoardColumnOrder.Count = 0 then begin |
| 2323 |
|
// 設定が無いので作成 |
| 2324 |
|
for i := 0 to Integer( High( TGikoBoardColumnID ) ) do begin |
| 2325 |
|
// 勢いのカラムはデフォルトで非表示にする |
| 2326 |
|
if ( i <> Ord(gbcVigor) ) then begin |
| 2327 |
|
FBoardColumnOrder.Add( TGikoBoardColumnID( i ) ); |
| 2328 |
|
end; |
| 2329 |
|
end; |
| 2330 |
|
end; |
| 2331 |
|
finally |
| 2332 |
|
wkList.Free; |
| 2333 |
|
end; |
| 2334 |
|
end; |
| 2335 |
|
end; |
| 2336 |
|
end. |
| 2337 |
|
|