• R/O
  • HTTP
  • SSH
  • HTTPS

gikonavi: Commit


Commit MetaInfo

Revisiona6195bc646f63a1b3a8a75a8133ce19c2a7f5dbb (tree)
Time2005-12-28 02:12:57
Authorcvs2git <cvs2git>
Commitercvs2git

Log Message

This commit was manufactured by cvs2svn to create tag 'v1_51_0_624'.

Change Summary

Incremental Difference

--- a/AbonUnit.pas
+++ b/AbonUnit.pas
@@ -374,6 +374,7 @@ var
374374 pos : Integer;
375375 buftoken : String;
376376 begin
377+ pos := 0;
377378 bufstl := TStringList.Create;
378379 try
379380 if Length(argline) > 0 then begin
--- a/BoardGroup.pas
+++ b/BoardGroup.pas
@@ -90,7 +90,6 @@ type
9090 property NodeExpand: Boolean read FExpand write FExpand;
9191 end;
9292
93-
9493 // 板(スレッド URL のリスト)
9594 // TBoard = class(THashedStringList)
9695 TBoard = class(TStringList)
@@ -459,11 +458,10 @@ function BBSsFindThreadFromURL(
459458 ) : TThreadItem;
460459 var
461460 board : TBoard;
462- tmpThread : TThreadItem;
463461 boardURL : string;
464462 protocol, host, path, document, port, bookmark : string;
465463 BBSID, BBSKey : string;
466- i, bi : Integer;
464+// i : Integer;
467465 begin
468466
469467 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
@@ -477,26 +475,6 @@ begin
477475 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
478476 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
479477 Result := board.FindThreadFromFileName(BBSKey + '.dat');
480- end else if (Result = nil) and not (board.Is2ch) then begin
481- //プラグイン系の探索(主にURLが途中で変更になった類)
482- try
483- bi := Length(BoardGroups) - 1;
484- for i := 1 to bi do begin
485- if (BoardGroups[i].BoardPlugIn <> nil) and (Assigned(Pointer(BoardGroups[i].BoardPlugIn.Module))) then begin
486- if BoardGroups[i].BoardPlugIn.AcceptURL( inURL ) = atThread then begin
487- tmpThread := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );
488- if not board.IsThreadDatRead then begin
489- GikoSys.ReadSubjectFile( board );
490- end;
491- Result := Board.FindThreadFromFileName( tmpThread.FileName );
492- tmpThread.Free;
493- Break;
494- end;
495- end;
496- end;
497- except
498- Result := nil;
499- end;
500478 end;
501479 end;
502480
@@ -1905,14 +1883,8 @@ procedure TThreadItem.SetUnRead(b: Boolean);
19051883 begin
19061884 if FUnRead = b then Exit;
19071885 FUnRead := b;
1908- if FUpdate and (ParentBoard <> nil) then begin
1886+ if FUpdate and (ParentBoard <> nil) then
19091887 ParentBoard.FModified := True;
1910- if FUnRead then begin
1911- ParentBoard.UnRead := ParentBoard.UnRead + 1;
1912- end else begin
1913- ParentBoard.UnRead := ParentBoard.UnRead - 1;
1914- end;
1915- end;
19161888 end;
19171889
19181890 procedure TThreadItem.SetScrollTop(i: Integer);
--- a/Editor.dfm
+++ b/Editor.dfm
@@ -106,7 +106,7 @@ object EditorForm: TEditorForm
106106 Width = 149
107107 Height = 20
108108 DropDownCount = 20
109- ItemHeight = 12
109+ ItemHeight = 0
110110 TabOrder = 0
111111 end
112112 object MailComboBox: TComboBox
@@ -115,7 +115,7 @@ object EditorForm: TEditorForm
115115 Width = 149
116116 Height = 20
117117 DropDownCount = 20
118- ItemHeight = 12
118+ ItemHeight = 0
119119 TabOrder = 1
120120 OnChange = MailComboBoxChange
121121 end
@@ -358,12 +358,6 @@ object EditorForm: TEditorForm
358358 object N01: TMenuItem
359359 Caption = '-'
360360 end
361- object Samba241: TMenuItem
362- Action = UpdateSambaAction
363- end
364- object N7: TMenuItem
365- Caption = '-'
366- end
367361 object CloseMenu: TMenuItem
368362 Action = CloseAction
369363 end
@@ -1726,13 +1720,6 @@ object EditorForm: TEditorForm
17261720 OnExecute = BeLogInOutEActionExecute
17271721 OnUpdate = BeLogInOutEActionUpdate
17281722 end
1729- object UpdateSambaAction: TAction
1730- Category = #12501#12449#12452#12523
1731- Caption = 'Samba24'#12398#35373#23450#20516#12434#26356#26032#12377#12427
1732- Hint = 'Samba24'#12398#35373#23450#20516#12434#26356#26032#12377#12427
1733- OnExecute = UpdateSambaActionExecute
1734- OnUpdate = UpdateSambaActionUpdate
1735- end
17361723 end
17371724 object IdLogDebug: TIdLogDebug
17381725 OnReceive = IdLogDebugReceive
--- a/Editor.pas
+++ b/Editor.pas
@@ -124,9 +124,6 @@ type
124124 SaveNameMailAction: TAction;
125125 ToolButton7: TToolButton;
126126 BeLogInOutEAction: TAction;
127- UpdateSambaAction: TAction;
128- Samba241: TMenuItem;
129- N7: TMenuItem;
130127
131128 procedure EditorPageChange(Sender: TObject);
132129 procedure FormCreate(Sender: TObject);
@@ -179,8 +176,6 @@ type
179176 procedure SaveNameMailActionExecute(Sender: TObject);
180177 procedure BeLogInOutEActionExecute(Sender: TObject);
181178 procedure BeLogInOutEActionUpdate(Sender: TObject);
182- procedure UpdateSambaActionUpdate(Sender: TObject);
183- procedure UpdateSambaActionExecute(Sender: TObject);
184179 private
185180 FThreadItem: TThreadItem;
186181 FBoard: TBoard;
@@ -210,18 +205,24 @@ type
210205 procedure SaveSendFile;
211206 procedure SetContent(Content: string; ABrowser: TWebBrowser);
212207 function GetResultType(ResponseText: string): TGikoResultType;
208+
209+ procedure ReadSambaTime(const AHost: string); overload;
210+ procedure WriteSambaTime(const AHost: string; ATime: TDateTime); overload;
211+ function ReadSettingTime(const AHost: string): Integer; overload;
212+ function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean; overload;
213+ procedure SetSamba24(AURL: string); overload;
214+
213215 //Sambaの時間を読み込む
214- procedure ReadSambaTime(const AHost: string);
216+ procedure ReadSambaTime(); overload;
215217 //Sambaに時間を書き込む
216- procedure WriteSambaTime(const AHost: string; ATime: TDateTime);
218+ procedure WriteSambaTime(ATime: TDateTime); overload;
217219 //Sambaの設定値を読み込む
218- function ReadSettingTime(const AHost: string): Integer;
220+ function ReadSettingTime(): Integer ; overload;
219221 //Sambaに引っかかるか検査する
220- function CheckSambaTime(const AHost: string; ATime: TDateTime): Boolean;
222+ function CheckSambaTime(ATime: TDateTime): Boolean; overload;
221223 //Sambaの設定値を書き込む
222- procedure SetSamba24(AURL: string);
223- //Sambaの設定値を更新する
224- procedure UpdateSamba(const AHost: String; value: Integer);
224+ procedure SetSamba24(); overload;
225+
225226 /// 引用符の取得
226227 function GetOEIndentChar : string;
227228 /// 本文の取得
@@ -258,7 +259,7 @@ type
258259 implementation
259260
260261 uses
261- Giko, ItemDownload, MojuUtils, IdGlobal, GikoMessage;
262+ Giko, ItemDownload, MojuUtils, IdGlobal;
262263 const
263264 CAPTION_NAME_NEW: string = 'ギコナビ スレ立てエディタ';
264265 CAPTION_NAME_RES: string = 'ギコナビ レスエディタ';
@@ -967,7 +968,7 @@ begin
967968 if MsgResult = IDNO then begin
968969 Board.SPID := '';
969970 Board.PON := '';
970- FWork := false;
971+ FWork := false;
971972 EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
972973 DrawMenuBar(Handle);
973974 Exit;
@@ -976,7 +977,7 @@ begin
976977 end;
977978
978979 if ResultType = grtOK then begin
979- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
980+ if GikoSys.Setting.UseSamba then
980981 WriteSambaTime(FHost, Now());
981982 State := gdsComplete;
982983 end else if ResultType = grtCookie then begin
@@ -1045,8 +1046,8 @@ begin
10451046 Exit;
10461047 end;
10471048 end else begin
1048- if (GikoSys.Setting.UseSamba) and (Timer1.Enabled) then
1049- WriteSambaTime(FHost, Now());
1049+ if GikoSys.Setting.UseSamba then
1050+ WriteSambaTime(FHost, Now());
10501051 State := gdsError;
10511052 raise Exception.Create('');
10521053 end;
@@ -1097,9 +1098,9 @@ begin
10971098 GikoForm.PlaySound('ResEnd');
10981099 SaveSendFile;
10991100 if FThreadItem = nil then
1100- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1101+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
11011102 else
1102- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1103+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
11031104 Close;
11041105 Exit;
11051106 end;
@@ -1107,20 +1108,20 @@ begin
11071108 GikoForm.PlaySound('ResEnd');
11081109 SaveSendFile;
11091110 if FThreadItem = nil then
1110- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1111+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
11111112 else
1112- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1113+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
11131114 Close;
11141115 end else if State = gdsError then begin
11151116 if FThreadItem = nil then
1116- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK)
1117+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK)
11171118 else
1118- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1119+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
11191120
11201121 EditorPage.ActivePage := PreviewTab;
11211122 SetContent(ResponseText, Browser);
11221123 end else if State = gdsAbort then begin
1123- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiSAD);
1124+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiSAD);
11241125 end;
11251126 end;
11261127
@@ -1279,13 +1280,13 @@ begin
12791280 if state = gdsComplete then begin
12801281 GikoForm.PlaySound('ResEnd');
12811282 SaveSendFile;
1282- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmNewSure), nil, gmiOK);
1283+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewSure)), nil, gmiOK);
12831284 FWork := False;
12841285 Close;
12851286 end else if State = gdsError then begin
1286- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmSureError), nil, gmiNG);
1287+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureError)), nil, gmiNG);
12871288 end else if State = gdsAbort then begin
1288- GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiNG);
1289+ GikoForm.AddMessageList(FBoard.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiNG);
12891290 end;
12901291 end else begin
12911292 // レス
@@ -1295,13 +1296,13 @@ begin
12951296 if state = gdsComplete then begin
12961297 GikoForm.PlaySound('ResEnd');
12971298 SaveSendFile;
1298- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmNewRes), nil, gmiOK);
1299- FWork := False;
1299+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmNewRes)), nil, gmiOK);
1300+ FWork := False;
13001301 Close;
13011302 end else if State = gdsError then begin
1302- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmResError), nil, gmiOK);
1303+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmResError)), nil, gmiOK);
13031304 end else if State = gdsAbort then begin
1304- GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
1305+ GikoForm.AddMessageList(FThreadItem.Title + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);
13051306 end;
13061307 end;
13071308 end else begin
@@ -1596,8 +1597,6 @@ begin
15961597 ini.WriteInteger('Setting', AHost, 0);
15971598 ini.UpdateFile;
15981599 end;
1599- //StatusBarにこの鯖の規定値を表示する
1600- StatusBar.Panels[2].Text := 'Samba24規定値' + IntToStr(Result);
16011600 finally
16021601 ini.Free;
16031602 end;
@@ -1633,7 +1632,8 @@ begin
16331632 Host := Copy(Host, 1, AnsiPos('.', Host) - 1);
16341633 FHost := Host; //FHost=鯖名
16351634 ReadSambaTime(FHost); //以前の書き込み時間を読み込む
1636- ReadSettingTime(FHost); //Sambaの設定を読み込む
1635+ //StatusBarにこの鯖の規定値を表示する
1636+ StatusBar.Panels[2].Text := 'Samba24規定値' + IntToStr(ReadSettingTime(FHost));
16371637 end;
16381638 end;
16391639 procedure TEditorForm.FormCloseQuery(Sender: TObject;
@@ -2098,8 +2098,8 @@ begin
20982098
20992099 if ABoard = nil then Exit;
21002100
2101- URL := ABoard.GETHEADTXTFileName;
2102- GikoSys.OpenBrowser(URL, gbtAuto);
2101+ URL := ABoard.GETHEADTXTFileName;
2102+ GikoSys.OpenBrowser(URL, gbtAuto);
21032103 end;
21042104
21052105 procedure TEditorForm.SaveNameMailActionExecute(Sender: TObject);
@@ -2112,8 +2112,8 @@ function TEditorForm.LFusianaGet(s: String): Boolean;
21122112 var
21132113 i: Integer;
21142114 begin
2115- i := AnsiPos('fusianasan', s);
2116- if (i > 0) then Result := True else Result := False;
2115+ i := AnsiPos('fusianasan', s);
2116+ if (i > 0) then Result := True else Result := False;
21172117 end;
21182118
21192119 procedure TEditorForm.BeLogInOutEActionExecute(Sender: TObject);
@@ -2166,49 +2166,101 @@ begin
21662166 end;
21672167 end;
21682168
2169-//! Sambaの設定値を更新する
2170-procedure TEditorForm.UpdateSamba(const AHost: String; value: Integer);
2169+//Sambaの時間を読み込む
2170+procedure TEditorForm.ReadSambaTime();
21712171 var
21722172 ini :TMemIniFile;
2173+ skey: String;
2174+ board: TBoard;
2175+ tmp: string;
21732176 begin
2177+ Timer1.Enabled := false; //経過秒数表示TimerをOffにする(これがONのときSamba24対策On)
21742178 ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
21752179 try
2176- ini.WriteInteger('Setting', AHost, value);
2177- ini.UpdateFile;
2180+ //文字列で読み取って、変換関数でTDateTimeへ
2181+ if( FThreadItem <> nil ) then
2182+ board := FThreadItem.ParentBoard
2183+ else
2184+ board := FBoard;
2185+
2186+ if (board <> nil) then begin
2187+ //BBSIDとホスト名が一致していたら BBSID@ホスト名
2188+ if( board.BBSID = FHost ) then
2189+ skey := board.BBSID + '@' + FHost
2190+ else
2191+ skey := board.BBSID;
2192+
2193+ tmp := ini.ReadString('Send', skey, DateTimeToStr(ZERO_DATE));
2194+
2195+ //BBSIDのキーが無いならFHostに切り替えてみる
2196+ if (tmp = DateTimeToStr(ZERO_DATE)) then begin
2197+ tmp := ini.ReadString('Send', FHost, DateTimeToStr(ZERO_DATE));
2198+ end;
2199+ FSambaTime := ConvertDateTimeString(tmp);
2200+ end;
21782201 finally
21792202 ini.Free;
21802203 end;
2204+ FNow := Now(); //現在時間を取得(Timer表示用で、Checkするときは再びNow()を呼ぶ)
2205+ Timer1.Enabled := true; //経過秒数表示TimerをOnにする(これがONのときSamba24対策On)
21812206 end;
21822207
2183-//! サンバ更新のアクションのUpdateイベント 簡単のためタイマーと同じにしておく
2184-procedure TEditorForm.UpdateSambaActionUpdate(Sender: TObject);
2208+//Sambaに時間を書き込む
2209+procedure TEditorForm.WriteSambaTime(ATime: TDateTime);
2210+var
2211+ ini :TMemIniFile;
21852212 begin
2186- UpdateSambaAction.Enabled := Timer1.Enabled;
2213+ ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
2214+ try
2215+// ini.WriteDateTime('Send', AHost, ATime);
2216+ ini.UpdateFile;
2217+ finally
2218+ ini.Free;
2219+ end;
21872220 end;
2188-
2189-//! サンバ更新アクション
2190-procedure TEditorForm.UpdateSambaActionExecute(Sender: TObject);
2221+//Sambaの設定値を読み込む
2222+function TEditorForm.ReadSettingTime(): Integer ;
21912223 var
2192- input : String;
2193- i : Integer;
2194-begin
2195- if InputQuery('Samba24設定値更新', '新しい設定値を入力してください', input) then begin
2196- input := ZenToHan(input);
2197- if GikoSys.IsNumeric(input) then begin
2198- UpdateSamba(FHost, StrToInt(input));
2199- //全てのフォームから、同じホストのエディタに読み込み指示
2200- for i := 0 to Screen.FormCount - 1 do begin
2201- if Screen.Forms[i] is TEditorForm then begin
2202- if FHost = TEditorForm(Screen.Forms[i]).FHost then begin
2203- TEditorForm(Screen.Forms[i]).ReadSettingTime(FHost);
2204- end;
2205- end;
2224+ ini :TMemIniFile;
2225+ skey: String;
2226+ board: TBoard;
2227+begin
2228+ ini := TMemIniFile.Create(GikoSys.GetSambaFileName);
2229+ try
2230+ if( FThreadItem <> nil ) then
2231+ board := FThreadItem.ParentBoard
2232+ else
2233+ board := FBoard;
2234+
2235+ if (board <> nil) then begin
2236+ //BBSIDとホスト名が一致していたら BBSID@ホスト名
2237+ if( board.BBSID = FHost ) then
2238+ skey := board.BBSID + '@' + FHost
2239+ else
2240+ skey := board.BBSID;
2241+
2242+ Result := ini.ReadInteger('Setting', skey, -1);
2243+ //BBSIDのキーが無いならFHostを使う
2244+ if( Result = -1 ) then
2245+ Result := ini.ReadInteger('Setting', FHost, -1);
2246+
2247+ //規定値が設定されていないときは、ファイルに書きたす。
2248+ if Result = -1 then begin
2249+ ini.WriteInteger('Setting', FHost, 0);
2250+ ini.UpdateFile;
22062251 end;
2207- end else begin
2208- ShowMessage('数値を入力してください');
2209- UpdateSambaActionExecute(Sender);
2210- end;
2252+ end;
2253+ finally
2254+ ini.Free;
22112255 end;
22122256 end;
2257+//Sambaに引っかかるか検査する
2258+function TEditorForm.CheckSambaTime(ATime: TDateTime): Boolean;
2259+begin
2260+end;
2261+//Sambaの設定値を書き込む
2262+procedure TEditorForm.SetSamba24();
2263+begin
2264+end;
22132265
22142266 end.
--- a/ExternalThreadItem.pas
+++ b/ExternalThreadItem.pas
@@ -290,35 +290,32 @@ var
290290 threadItem : TThreadItem;
291291 res : TResRec;
292292 no : string;
293- resLink : TResLinkRec;
294293 begin
295294
296295 threadItem := TThreadItem( inInstance );
297296 // 引数を分解
298- THTMLCreate.DivideStrLine( string( inDatRes ) , @res);
299- if AnsiCompareStr( string( inDatRes ) , '' ) <> 0 then begin
300- res.FBody := THTMLCreate.DeleteLink(res.FBody);
301- resLink.FBbs := threadItem.ParentBoard.BBSID;
302- resLink.FKey := ChangeFileExt( threadItem.FileName, '' );
303- HTMLCreater.AddAnchorTag( @res );
304- HTMLCreater.ConvRes( @res, @resLink );
305-
306- no := IntToStr( inResNo );
307-
308- try
309- if GikoSys.Setting.UseSkin then begin
310- // スキン
311- if inIsNew then
297+ res := DivideStrLine( string( inDatRes ) );
298+ if AnsiCompareStr( string( inDatRes ) , '' ) <> 0 then begin
299+ res.FBody := GikoSys.DeleteLink(res.FBody);
300+ res.FBody := HTMLCreater.AddAnchorTag( res.FBody );
301+ res.FBody := HTMLCreater.ConvRes( res.FBody, threadItem.ParentBoard.BBSID, ChangeFileExt( threadItem.FileName, '' ), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
302+
303+ no := IntToStr( inResNo );
304+
305+ try
306+ if GikoSys.Setting.UseSkin then begin
307+ // スキン
308+ if inIsNew then
312309 Result := CreateResultString( HTMLCreater.SkinedRes(
313310 HTMLCreater.LoadFromSkin(
314311 GikoSys.Setting.GetSkinNewResFileName, threadItem, threadItem.Size
315- ), @res, no
312+ ), res, no
316313 ) )
317314 else
318315 Result := CreateResultString( HTMLCreater.SkinedRes(
319316 HTMLCreater.LoadFromSkin(
320317 GikoSys.Setting.GetSkinResFileName, threadItem, threadItem.Size
321- ), @res, no
318+ ), res, no
322319 ) );
323320 end else if GikoSys.Setting.UseCSS then begin
324321 // CSS
--- a/Favorite.pas
+++ b/Favorite.pas
@@ -4,44 +4,42 @@ interface
44
55 uses
66 Messages, SysUtils, Classes, Contnrs, ComCtrls, {HttpApp,} YofUtils,
7- GikoSystem{, XMLIntf, XMLDoc}, GikoXMLDoc, BoardGroup, windows;
7+ GikoSystem{, XMLIntf, XMLDoc}, GikoXMLDoc, BoardGroup, windows,
8+ MojuUtils;
89 {SAX, SAXHelpers, SAXComps, SAXKW;}
910
1011 type
1112 TFavoriteFolder = class
1213 end;
1314
14- TFavoriteItem = class(TObject)
15+ TFavoriteBoardItem = class
1516 private
17+ FItem : TBoard;
1618 FURL : string;
1719 FTitle : string;
18- public
19- function GetItemTitle : string; virtual;abstract;
20- property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される
21- property Title : string read FTitle write FTitle;
22- end;
23- TFavoriteBoardItem = class(TFavoriteItem)
24- private
25- FItem : TBoard;
2620 function GetItem : TBoard;
2721 public
2822 constructor Create( inURL : string; inTitle : string = ''; inItem : TBoard = nil );
2923 constructor CreateWithItem( inItem : TBoard );
30- destructor Destory;
31- function GetItemTitle : string; override;
24+ destructor Destory;
3225 property Item : TBoard read GetItem write FItem;
26+ property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される
27+ property Title : string read FTitle write FTitle;
3328 end;
3429
35- TFavoriteThreadItem = class(TFavoriteItem)
30+ TFavoriteThreadItem = class
3631 private
3732 FItem : TThreadItem;
33+ FURL : string;
34+ FTitle : string;
3835 function GetItem : TThreadItem;
3936 public
4037 constructor Create( inURL : string; inTitle : string = ''; inItem : TThreadItem = nil );
4138 constructor CreateWithItem( inItem : TThreadItem );
42- destructor Destory;
43- function GetItemTitle : string; override;
39+ destructor Destory;
4440 property Item : TThreadItem read GetItem write FItem;
41+ property URL : string read FURL write FURL; // Item が取得できなくても URL は常に保持される
42+ property Title : string read FTitle write FTitle;
4543 end;
4644
4745 TFavoriteDM = class(TDataModule)
@@ -50,7 +48,7 @@ type
5048 { Private 宣言 }
5149 FStack: TStack;
5250 FTreeView: TTreeView;
53- FModified: boolean;
51+
5452 procedure ReadNode(Node: IXMLNode);
5553 procedure AddSaveString(Node: TTreeNode; SaveList: TStringList);
5654 // procedure AddSaveString(Node: TTreeNode; XMLNode: IXMLNode);
@@ -61,15 +59,14 @@ type
6159 // procedure SAXCharacters(Sender: TObject; const PCh: SAXString);
6260 public
6361 { Public 宣言 }
64- procedure Clear;
65- function GetFavoriteFilePath() : String;
66- function SaveFavoriteFile(FileName: String) : Boolean;
62+ procedure Clear;
63+ function GetFavoriteFilePath() : String;
64+ function SaveFavoriteFile(FileName: String) : Boolean;
6765 procedure SetFavTreeView(TreeView: TTreeView);
6866 procedure ReadFavorite;
6967 procedure WriteFavorite;
70- procedure URLReplace(oldURLs: TStringList; newURLs: TStringList);
68+ procedure URLReplace(oldURLs: TStringList; newURLs: TStringList);
7169 property TreeView: TTreeView read FTreeView;
72- property Modified: boolean read FModified write FModified;
7370 end;
7471
7572 var
@@ -79,7 +76,7 @@ const
7976
8077 implementation
8178
82-uses ExternalBoardManager, ExternalBoardPlugInMain, MojuUtils;
79+uses ExternalBoardManager, ExternalBoardPlugInMain;
8380
8481 const
8582 FAVORITE_ROOT_NAME = 'お気に入り';
@@ -116,30 +113,15 @@ begin
116113 FItem.Free;
117114 inherited;
118115 end;
119-//! 保持している板のタイトルを返す
120-function TFavoriteBoardItem.GetItemTitle : string;
121-begin
122- Result := '';
123- //一度も板を開いていないとき(起動時にキャビネットをお気に入りとか)
124- //のときにFItemがnilなのでそのときはべっと検索
125- if FItem = nil then begin
126- FItem := BBSsFindBoardFromURL(URL);
127- end;
128- if FItem <> nil then begin
129- try
130- if not FItem.IsThreadDatRead then begin
131- GikoSys.ReadSubjectFile(FItem);
132- end;
133- except
134- end;
135- Result := FItem.Title;
136- end;
137-end;
138116 function TFavoriteBoardItem.GetItem : TBoard;
139117 var
140118 protocol, host, path, document, port, bookmark : string;
141- BBSID : string;
142- tmpURL : string;
119+ BBSID{, BBSKey} : string;
120+ tmpURL{, boardURL} : string;
121+// category : TCategory;
122+ {i, bi: Integer;}
123+ {tmpThread: TThreadItem;}
124+ {tmpBoard: TBoard;}
143125 begin
144126
145127 if FItem = nil then begin
@@ -194,17 +176,6 @@ begin
194176 FItem.Free;
195177 inherited;
196178 end;
197-//! 保持しているスレのタイトルを返す
198-function TFavoriteThreadItem.GetItemTitle : string;
199-begin
200- Result := '';
201- if FItem = nil then begin
202- FItem := BBSsFindThreadFromURL(URL);
203- end;
204- if FItem <> nil then begin
205- Result := FItem.Title;
206- end;
207-end;
208179
209180 function TFavoriteThreadItem.GetItem : TThreadItem;
210181 var
@@ -288,8 +259,7 @@ begin
288259 end;
289260 TreeView.Items.Clear;
290261 TreeView.Items.EndUpdate;
291-
292- FavoriteDM.Modified := true;
262+ //TreeView.Free;
293263 end;
294264
295265 procedure TFavoriteDM.SetFavTreeView(TreeView: TTreeView);
@@ -307,7 +277,7 @@ var
307277 FavFolder: TFavoriteFolder;
308278 LinkExists: Boolean;
309279 begin
310- FavoriteDM.Modified := true;
280+
311281 FileName := GikoSys.GetConfigDir + FAVORITE_FILE_NAME;
312282
313283 FavFolder := TFavoriteFolder.Create;
@@ -479,7 +449,6 @@ var
479449 SaveList: TStringList;
480450
481451 begin
482- FavoriteDM.Modified := true;
483452 FileName := GikoSys.GetConfigDir + FAVORITE_FILE_NAME;
484453 if FileExists(FileName) then begin
485454 tmpFileName := GikoSys.GetConfigDir + '~' + FAVORITE_FILE_NAME;
@@ -491,10 +460,7 @@ begin
491460 try
492461 SaveList.Add('<?xml version="1.0" encoding="Shift_JIS" standalone="yes"?>');
493462 SaveList.Add('<favorite>');
494- try
495- AddSaveString(TreeView.Items.GetFirstNode.getFirstChild, SaveList);
496- except
497- end;
463+ AddSaveString(TreeView.Items.GetFirstNode.getFirstChild, SaveList);
498464 SaveList.Add('</favorite>');
499465 SaveList.SaveToFile(FileName);
500466 finally
--- a/Gesture.pas
+++ b/Gesture.pas
@@ -130,6 +130,10 @@ begin
130130 FLastTime := GetTickCount;
131131 FLastPoint := Point(x, y);
132132 end;
133+ //マウスを再設定
134+ if (hwnd <> 0) and (hwnd <> FHandle) then
135+ SetCapture(hwnd);
136+
133137 Result := True;
134138 end;
135139 end;
@@ -139,7 +143,7 @@ begin
139143 FLastTime := 0;
140144 FLastPoint := Point(x, y);
141145 FStartPoint := Point(x, y);
142- Result := True;
146+ CheckAction := True;
143147 SetCapture(FHandle);
144148 end;
145149 end;
--- a/Giko.dfm
+++ b/Giko.dfm
@@ -1,6 +1,6 @@
11 object GikoForm: TGikoForm
2- Left = 363
3- Top = 92
2+ Left = 332
3+ Top = 101
44 HorzScrollBar.Visible = False
55 VertScrollBar.Visible = False
66 AutoScroll = False
@@ -39,9 +39,6 @@ object GikoForm: TGikoForm
3939 Width = 500
4040 end
4141 item
42- Width = 80
43- end
44- item
4542 Width = 50
4643 end>
4744 SimplePanel = False
@@ -98,6 +95,7 @@ object GikoForm: TGikoForm
9895 Height = 167
9996 BorderStyle = bsNone
10097 ChangeDelay = 50
98+ DragMode = dmAutomatic
10199 HideSelection = False
102100 Images = ItemIcon16
103101 Indent = 19
@@ -106,12 +104,16 @@ object GikoForm: TGikoForm
106104 RightClickSelect = True
107105 ShowRoot = False
108106 TabOrder = 0
107+ OnClick = TreeViewClick
109108 OnCollapsed = TreeViewCollapsed
109+ OnCollapsing = TreeViewCollapsing
110110 OnCustomDraw = TreeViewCustomDraw
111111 OnCustomDrawItem = TreeViewCustomDrawItem
112+ OnDblClick = TreeViewDblClick
113+ OnExpanding = TreeViewExpanding
112114 OnExpanded = TreeViewExpanded
113115 OnKeyDown = TreeViewKeyDown
114- OnMouseDown = TreeViewMouseDown
116+ OnMouseUp = TreeViewMouseUp
115117 end
116118 object Panel3: TPanel
117119 Left = 0
@@ -226,13 +228,18 @@ object GikoForm: TGikoForm
226228 RightClickSelect = True
227229 ShowRoot = False
228230 TabOrder = 3
231+ OnClick = FavoriteTreeViewClick
232+ OnCollapsing = FavoriteTreeViewCollapsing
233+ OnDblClick = FavoriteTreeViewDblClick
229234 OnDragDrop = FavoriteTreeViewDragDrop
230235 OnDragOver = FavoriteTreeViewDragOver
231236 OnEdited = FavoriteTreeViewEdited
232237 OnEditing = FavoriteTreeViewEditing
233238 OnEndDrag = FavoriteTreeViewEndDrag
239+ OnExpanding = FavoriteTreeViewExpanding
234240 OnKeyDown = FavoriteTreeViewKeyDown
235241 OnMouseDown = FavoriteTreeViewMouseDown
242+ OnMouseUp = FavoriteTreeViewMouseUp
236243 end
237244 object FavoriteToolBar: TToolBar
238245 Left = 0
--- a/Giko.pas
+++ b/Giko.pas
@@ -20,10 +20,6 @@ uses
2020 ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection,
2121 IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord;
2222
23-const
24- NGWORDNAME_PANEL = 3;
25- THREADSIZE_PANEL = 2;
26-
2723 type
2824 TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite);
2925 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
@@ -358,7 +354,7 @@ type
358354 N63: TMenuItem;
359355 N64: TMenuItem;
360356 dummy1: TMenuItem;
361- TreeSelectLogDeletePopupMenu: TMenuItem;
357+ TreeSelectLogDeletePopupMenu: TMenuItem;
362358 N65: TMenuItem;
363359 BBSSelectPopupMenu: TPopupMenu;
364360 PlugInMenu: TMenuItem;
@@ -378,7 +374,7 @@ type
378374 ResRangeKokoPMenuItem: TMenuItem;
379375 ResRangeNewPMenuItem: TMenuItem;
380376 ResRangeAllPMenuItem: TMenuItem;
381- BrowsBoradHeadAction1: TMenuItem;
377+ BrowsBoradHeadAction1: TMenuItem;
382378 ThreadRangePopupMenu: TPopupMenu;
383379 A15: TMenuItem;
384380 L8: TMenuItem;
@@ -398,7 +394,7 @@ type
398394 N73: TMenuItem;
399395 SelectComboBoxPanel: TPanel;
400396 SelectComboBoxSplitter: TImage;
401- ToolButton1: TToolButton;
397+ ToolButton1: TToolButton;
402398 N74: TMenuItem;
403399 WikiFAQ: TMenuItem;
404400 GikoApplicationEvents: TApplicationEvents;
@@ -423,6 +419,7 @@ type
423419 procedure TreeViewCustomDrawItem(Sender: TCustomTreeView;
424420 Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
425421 procedure TreeViewExpanded(Sender: TObject; Node: TTreeNode);
422+ procedure TreeViewDblClick(Sender: TObject);
426423 procedure ListViewCustomDraw(Sender: TCustomListView;
427424 const ARect: TRect; var DefaultDraw: Boolean);
428425 procedure ListViewMouseDown(Sender: TObject; Button: TMouseButton;
@@ -494,6 +491,7 @@ type
494491 procedure FavoriteTreeViewKeyDown(Sender: TObject; var Key: Word;
495492 Shift: TShiftState);
496493 procedure FavoriteTreePopupMenuPopup(Sender: TObject);
494+ procedure FavoriteTreeViewDblClick(Sender: TObject);
497495 procedure LinkToolBarDragDrop(Sender, Source: TObject; X, Y: Integer);
498496 procedure BrowserTabMouseUp(Sender: TObject; Button: TMouseButton;
499497 Shift: TShiftState; X, Y: Integer);
@@ -512,12 +510,15 @@ type
512510 var Handled: Boolean);
513511 procedure BrowserTabPopupMenuPopup(Sender: TObject);
514512 procedure BrowserTabResize(Sender: TObject);
513+ procedure TreeViewClick(Sender: TObject);
515514 procedure TreeViewKeyDown(Sender: TObject; var Key: Word;
516515 Shift: TShiftState);
517516 procedure FavoriteTreeViewMouseDown(Sender: TObject;
518517 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
519518 procedure MessagePanelResize(Sender: TObject);
520519 procedure OnResized;
520+ procedure FavoriteTreeViewMouseUp(Sender: TObject;
521+ Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
521522 procedure SelectTimerTimer(Sender: TObject);
522523 procedure ListViewColumnRightClick(Sender: TObject;
523524 Column: TListColumn; Point: TPoint);
@@ -533,16 +534,27 @@ type
533534 Shift: TShiftState);
534535 procedure FavoriteTreeViewEditing(Sender: TObject; Node: TTreeNode;
535536 var AllowEdit: Boolean);
536- procedure CabinetCloseSpeedButtonClick(Sender: TObject);
537+ procedure CabinetCloseSpeedButtonClick(Sender: TObject);
537538 procedure FavoriteArrangeToolButtonClick(Sender: TObject);
538539 procedure GikoApplicationEventsMessage(var Msg: tagMSG;
539540 var Handled: Boolean);
540541 procedure GikoApplicationEventsDeactivate(Sender: TObject);
541542 procedure GikoApplicationEventsException(Sender: TObject; E: Exception);
542- procedure TreeViewMouseDown(Sender: TObject; Button: TMouseButton;
543+ procedure FavoriteTreeViewClick(Sender: TObject);
544+ procedure FavoriteTreeViewCollapsing(Sender: TObject; Node: TTreeNode;
545+ var AllowCollapse: Boolean);
546+ procedure FavoriteTreeViewExpanding(Sender: TObject; Node: TTreeNode;
547+ var AllowExpansion: Boolean);
548+ procedure TreeViewCollapsing(Sender: TObject; Node: TTreeNode;
549+ var AllowCollapse: Boolean);
550+ procedure TreeViewExpanding(Sender: TObject; Node: TTreeNode;
551+ var AllowExpansion: Boolean);
552+ procedure TreeViewMouseUp(Sender: TObject; Button: TMouseButton;
543553 Shift: TShiftState; X, Y: Integer);
544554 private
545555 { Private 宣言 }
556+ FSortIndex: Integer;
557+ FSortOrder: Boolean;
546558 FEnabledCloseButton: Boolean;
547559 FClickNode: TTreeNode;
548560 FHttpState: Boolean;
@@ -588,7 +600,6 @@ type
588600 FIsHandledWheel : Boolean; ///< 既に受け取った WM_MOUSEWHEEL かどうか
589601 DiffComp: Boolean; //Add by Genyakun スレが更新されたときにTrueになる
590602 FOrigenCaption: String; //お気に入りツリーのアイテム編集時の編集前の文字列
591- FPreviewBrowserRect: TRect; ///< プレビューの表示位置を記憶する
592603 procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
593604 procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
594605 procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
@@ -689,6 +700,8 @@ type
689700 property ToolBarSettingSender : TToolBarSettingSenderType
690701 read FToolBarSettingSender write FToolBarSettingSender;
691702 property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
703+ property SortIndex: Integer read FSortIndex write FSortIndex;
704+ property SortOrder: Boolean read FSortOrder write FSortOrder;
692705 property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
693706 property WorkCount: Integer read FWorkCount write FWorkCount;
694707 procedure SetContent(inThread: TBrowserRecord);
@@ -820,17 +833,31 @@ uses
820833 FavoriteArrange, AddressHistory, Preview, Gesture,
821834 About, Option, Round, Splash, Sort, ListSelect, Imm,
822835 NewBoard, MojuUtils, Clipbrd, GikoBayesian,Y_TextConverter,
823- HTMLCreate, ListViewUtils, GikoDataModule, GikoMessage;
836+ HTMLCreate, ListViewUtils, GikoDataModule;
824837
825838 const
839+ CAPTION_NAME: string = 'ギコナビ';
826840 BLANK_HTML: string = 'about:blank';
827841 BROWSER_COUNT = 5; //ブラウザの数
828842 //D&D閾値
829843 DandD_THRESHOLD = 5; //D&Dの閾値(pixcel)
830844 //プレビューファイル名
831845 HTML_FILE_NAME = 'temp_preview.html';
846+ //スレッド絞込みボックス
847+ SELECTCOMBOBOX_NAME: string = ''; // 'スレッド絞込検索';
848+ SELECTCOMBOBOX_COLOR: TColor = clWindow;
849+ //ツールバーアイコン
850+ TOOL_ICON_HEIGHT_MAX = 16; //高さ最大アイコン
851+ TOOL_ICON_HEIGHT_MIN = 17; //高さ最小アイコン
852+ TOOL_ICON_HEIGHT_NORMAL = 18; //高さ標準アイコン
853+ TOOL_ICON_WIDTH_MAX = 19; //幅最大アイコン
854+ TOOL_ICON_WIDTH_MIN = 20; //幅最小アイコン
855+ TOOL_ICON_WIDTH_NORMAL = 21; //幅標準アイコン
832856 ITEM_ICON_THREADLOG1 = 6; //スレアイコン(ログあり)
833857 ITEM_ICON_THREADLOG2 = 7; //スレアイコン(ログあり)
858+ TOOL_ICON_FAV_FOLDER = 30; //お気に入りフォルダアイコン
859+ TOOL_ICON_FAV_BOARD = 31; //お気に入り板アイコン
860+ TOOL_ICON_FAV_THREAD = 32; //お気に入りスレアイコン
834861 //メッセージID
835862 USER_TREECLICK = WM_USER + 2000;
836863 USER_RESIZED = WM_USER + 2001;
@@ -859,6 +886,7 @@ var
859886 msg: string;
860887 i: Integer;
861888 wp: TWindowPlacement;
889+ s: string;
862890 begin
863891 {$IFDEF DEBUG}
864892 AllocConsole;
@@ -885,6 +913,7 @@ begin
885913 Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
886914
887915 //アドレス履歴読み込み
916+ //AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
888917 AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
889918
890919 EnabledCloseButton := True;
@@ -1047,36 +1076,36 @@ begin
10471076 case GikoSys.Setting.ListWidthState of
10481077 glsMax: begin
10491078 ViewPanel.Width := 1;
1050- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1051- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1079+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1080+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
10521081 end;
10531082 glsMin: begin
10541083 ViewPanel.Width := GikoSys.Setting.ListWidth;
1055- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1056- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
1084+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1085+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
10571086 end;
10581087 else begin
10591088 ViewPanel.Width := GikoSys.Setting.ListWidth;
1060- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
1061- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
1089+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1090+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
10621091 end;
10631092 end;
10641093 end else begin
10651094 case GikoSys.Setting.ListHeightState of
10661095 glsMax: begin
10671096 ViewPanel.Height := 1;
1068- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1069- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1097+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1098+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
10701099 end;
10711100 glsMin: begin
10721101 ViewPanel.Height := GikoSys.Setting.ListHeight;
1073- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1074- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
1102+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1103+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
10751104 end;
10761105 else begin
10771106 ViewPanel.Height := GikoSys.Setting.ListHeight;
1078- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
1079- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
1107+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1108+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
10801109 end;
10811110 end;
10821111 end;
@@ -1127,7 +1156,7 @@ begin
11271156 end;
11281157
11291158 //キー設定読み込み
1130- GikoSys.LoadKeySetting(GikoDM.GikoFormActionList, GikoSys.GetMainKeyFileName);
1159+ GikoSys.LoadKeySetting(GikoDM.GikoFormActionList);
11311160
11321161 //最終巡回時間
11331162 // FLastRoundTime := 0;
@@ -1162,7 +1191,9 @@ begin
11621191 MoveToURL(ParamStr(i));
11631192 end;
11641193
1165- GikoDM.RepaintStatusBar;
1194+ s := GikoSys.FAbon.NGwordname;
1195+ StatusBar.Panels[2].Text := s;
1196+ StatusBar.Panels[2].Width := Max(StatusBar.Canvas.TextWidth(s), 100);
11661197 StatusBarResize(Sender);
11671198
11681199 dummy1.Caption := ItemReservPMenu.Caption;
@@ -1188,7 +1219,7 @@ begin
11881219 MouseGesture.SetHook( Handle );
11891220
11901221 //2ch言語読み出し
1191- GikoSys.SetGikoMessage;
1222+ GikoSys.Setting.SetMessages;
11921223
11931224 //オートログイン
11941225 if GikoSys.Setting.AutoLogin then
@@ -1200,7 +1231,6 @@ begin
12001231 FavoriteAddToolButton.Caption := '追加...';
12011232 AntiIndivAbonMenuItem.Caption := '個別あぼ〜ん解除';
12021233
1203-
12041234 end;
12051235
12061236 // CoolBar の設定を変数に保存
@@ -1521,6 +1551,7 @@ begin
15211551 //アドレス履歴保存
15221552 try
15231553 //AddressHistoryDMは自動生成フォームなので、解放は自動的にされる。
1554+ //AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.AddressHistoryCount);
15241555 AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
15251556 except
15261557 end;
@@ -1655,6 +1686,7 @@ begin
16551686 GikoSys.Setting.ShowDialogForAllTabClose := false;
16561687 GikoDM.AllTabCloseAction.Execute;
16571688 GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
1689+
16581690 SetContent(BrowserNullTab);
16591691 //TreeViewクリア(BBS2ch.Freeの後にクリアするとXPスタイル時にエラー出る)
16601692 TreeView.Items.Clear;
@@ -1985,35 +2017,27 @@ procedure TGikoForm.ListViewColumnClick(Sender: TObject;
19852017 var
19862018 id, idx : Integer;
19872019 orderList : TList;
1988- vSortIndex : Integer;
1989- vSortOrder : Boolean;
19902020 begin
19912021 idx := TListViewUtils.ActiveListTrueColumn( Column ).Tag;
1992- if TObject( FActiveList ) is TBBS then begin
1993- orderList := GikoSys.Setting.BBSColumnOrder;
1994- vSortIndex := GikoSys.Setting.BBSSortIndex;
1995- vSortOrder := GikoSys.Setting.BBSSortOrder;
1996- end else if TObject( FActiveList ) is TCategory then begin
1997- orderList := GikoSys.Setting.CategoryColumnOrder;
1998- vSortIndex := GikoSys.Setting.CategorySortIndex;
1999- vSortOrder := GikoSys.Setting.CategorySortOrder;
2000- end else if TObject( FActiveList ) is TBoard then begin
2001- orderList := GikoSys.Setting.BoardColumnOrder;
2002- vSortIndex := GikoSys.Setting.BoardSortIndex;
2003- vSortOrder := GikoSys.Setting.BoardSortOrder;
2004- end else
2022+
2023+ if TObject( FActiveList ) is TBBS then
2024+ orderList := GikoSys.Setting.BBSColumnOrder
2025+ else if TObject( FActiveList ) is TCategory then
2026+ orderList := GikoSys.Setting.CategoryColumnOrder
2027+ else if TObject( FActiveList ) is TBoard then
2028+ orderList := GikoSys.Setting.BoardColumnOrder
2029+ else
20052030 Exit;
20062031
20072032 id := Integer( orderList[ idx ] );
20082033
2009-
2010- if vSortIndex = id then
2011- vSortOrder := not vSortOrder
2034+ if FSortIndex = id then
2035+ FSortOrder := not FSortOrder
20122036 else begin
2013- vSortOrder := id = 0;
2037+ FSortOrder := id = 0;
20142038 end;
20152039
2016- TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, vSortOrder);
2040+ TListViewUtils.ListViewSort(Sender, ListView, Column, GikoDM.ListNumberVisibleAction.Checked, FSortOrder, FSortIndex );
20172041 end;
20182042
20192043 procedure TGikoForm.MenuToolBarCustomDrawButton(Sender: TToolBar;
@@ -2212,13 +2236,31 @@ begin
22122236 ListView.SetFocus;
22132237 ListView.SelectAll;
22142238 end;
2239+// *************************************************************************
2240+//! ツリービューのダブルクリックイベント
2241+// *************************************************************************
2242+procedure TGikoForm.TreeViewDblClick(Sender: TObject);
2243+var
2244+ pos : TPoint;
2245+ rect: TRect;
2246+begin
2247+ pos := FMouseDownPos;
2248+ if (FClickNode <> nil) and (FClickNode = TreeView.GetNodeAt(pos.X, pos.Y)) then begin
2249+ //マウスがnodeの上にいるか
2250+ rect := FClickNode.DisplayRect(true);
2251+ if ((rect.Left <= pos.X) and (rect.Right >= pos.X)) and
2252+ ((rect.Bottom >= pos.Y) and (rect.Top <= pos.Y)) then begin
2253+ TreeDoubleClick( FClickNode );
2254+ FClickNode := nil;
2255+ end;
2256+ end;
2257+end;
2258+
22152259 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
22162260 begin
22172261 AddMessageList(Msg, nil, Icon);
22182262 end;
2219-// *************************************************************************
2220-//! ダウンロードが完了したときに発生するイベント
2221-// *************************************************************************
2263+
22222264 procedure TGikoForm.DownloadEnd(Sender: TObject; Item: TDownloadItem);
22232265 var
22242266 ATitle: string;
@@ -2226,7 +2268,6 @@ var
22262268 boardPlugIn : TBoardPlugIn;
22272269 i: Integer;
22282270 browserRec : TBrowserRecord;
2229- Res : TResRec;
22302271 begin
22312272 try
22322273 if Item.DownType = gdtBoard then
@@ -2234,21 +2275,16 @@ begin
22342275 else
22352276 ATitle := Item.ThreadItem.Title;
22362277 if ATitle = '' then
2237- ATitle := GikoSys.GetGikoMessage(gmUnKnown);
2278+ ATitle := GikoSys.Setting.GetMessage(Ord(gmUnKnown));
22382279
22392280 if Item.State in [gdsComplete, gdsDiffComplete] then begin
22402281 //正常終了
22412282 if Item.DownType = gdtBoard then begin
22422283 //板
22432284 Item.SaveListFile;
2244- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureItiran), nil, gmiOK);
2285+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureItiran)), nil, gmiOK);
22452286 if GetActiveList = Item.Board then begin
22462287 FActiveList := nil;
2247- //自動ソートの場合板一覧のソート順をクリアする
2248- if (GikoSys.Setting.AutoSortThreadList) then begin
2249- GikoSys.Setting.BoardSortIndex := 0;
2250- GikoSys.Setting.BoardSortOrder := True;
2251- end;
22522288 SetActiveList(Item.Board);
22532289 end;
22542290 Item.Board.Modified := True;
@@ -2262,12 +2298,10 @@ begin
22622298 if (Item.ThreadItem.ParentBoard.IsBoardPlugInAvailable) and (Item.ThreadItem.Title = '') then begin
22632299 //boardPlugIn := Item.ThreadItem.BoardPlugIn;
22642300 boardPlugIn := Item.ThreadItem.ParentBoard.BoardPlugIn;
2265- THTMLCreate.DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 ), @Res);
2266- Item.ThreadItem.Title := Res.FTitle;
2301+ Item.ThreadItem.Title := DivideStrLine(boardPlugIn.GetDat( DWORD( Item.ThreadItem ), 1 )).FTitle;
22672302 ATitle := Item.ThreadItem.Title;
22682303 end else if ATitle = '(名称不明)' then begin
2269- THTMLCreate.DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1), @Res);
2270- ATitle := Res.FTitle;
2304+ ATitle := DivideStrLine(GikoSys.ReadThreadFile(Item.ThreadItem.GetThreadFileName, 1)).FTitle;
22712305 end;
22722306 for i := BrowserTab.Tabs.Count - 1 downto 0 do begin
22732307 if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then begin
@@ -2295,12 +2329,12 @@ begin
22952329
22962330 if Item.State = gdsComplete then begin
22972331 PlaySound('New');
2298- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureSyutoku), nil, gmiOK);
2332+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureSyutoku)), nil, gmiOK);
22992333 //Add by Genyakun
23002334 DiffComp := True;
23012335 end else begin
23022336 PlaySound('NewDiff');
2303- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmSureDiff), nil, gmiOK);
2337+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmSureDiff)), nil, gmiOK);
23042338 //Add by Genyakun
23052339 DiffComp := True;
23062340 end;
@@ -2333,18 +2367,18 @@ begin
23332367 //SetContent(Item.ThreadItem);
23342368 InsertBrowserTab(Item.ThreadItem);
23352369 end;}
2336- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmNotMod), nil, gmiSAD);
2370+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmNotMod)), nil, gmiSAD);
23372371 PlaySound('NoChange');
23382372 Screen.Cursor := crDefault;
23392373 end else if Item.State = gdsAbort then begin
23402374 //中断
2341- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmAbort), nil, gmiOK);
2375+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmAbort)), nil, gmiOK);
23422376 end else if Item.State = gdsError then begin
23432377 //エラー
23442378 s := Item.ErrText;
23452379 if s <> '' then
23462380 s := ':' + s;
2347- AddMessageList(ATitle + ' ' + GikoSys.GetGikoMessage(gmError) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
2381+ AddMessageList(ATitle + ' ' + GikoSys.Setting.GetMessage(Ord(gmError)) + ' (' + IntToStr(Item.ResponseCode) + ')' + s, nil, gmiNG);
23482382 // if Item.ResponseCode = 302 then
23492383 // AddMessageList('板が移転したかもしれないので板更新を行ってください。', nil, gmiNG);
23502384 PlaySound('Error');
@@ -2524,9 +2558,6 @@ begin
25242558 BrowserNullTab := TBrowserRecord.Create;
25252559 BrowserNullTab.Browser := Browser;
25262560 end;
2527- if BrowserNullTab.thread <> ThreadItem then begin
2528- BrowserNullTab.Movement := '';
2529- end;
25302561 BrowserNullTab.thread := ThreadItem;
25312562 Result := BrowserNullTab;
25322563 BrowserTab.TabIndex := -1;
@@ -2556,7 +2587,6 @@ begin
25562587 idx := BrowserTab.TabIndex;
25572588 if (FActiveContent <> nil) and
25582589 (FActiveContent.Thread <> Thread.Thread) and
2559- (FActiveContent.Browser <> nil) and
25602590 (Assigned(FActiveContent.Browser.Document)) then begin
25612591 try
25622592 try
@@ -2575,7 +2605,7 @@ begin
25752605 ItemBoardImage.Picture := nil;
25762606 BrowserNameLabel.Caption := '';
25772607 ItemImage.Picture := nil;
2578- BrowserNullTab.Thread := nil;
2608+ BrowserNullTab.Thread := nil;
25792609 //TOleControl(BrowserNullTab.Browser).Visible := true;
25802610 ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW);
25812611 FActiveContent := nil;
@@ -2631,9 +2661,7 @@ begin
26312661 FActiveContent := Thread;
26322662
26332663 if not ThreadIsLog then begin
2634- Self.Caption := GikoDataModule.CAPTION_NAME ;
2635- //ステータスバーに表示しているスレの容量を消去
2636- StatusBar.Panels[THREADSIZE_PANEL].Text := '';
2664+ Self.Caption := CAPTION_NAME ;
26372665 try
26382666 s := '<HTML><BODY><CENTER>このスレッドは取得していません</CENTER></BODY></HTML>';
26392667 doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2;
@@ -2644,11 +2672,7 @@ begin
26442672 finally
26452673 end;
26462674 end else begin
2647- Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']';
2648- //ステータスバーに表示しているスレの容量を表示
2649- StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]);
2650- StatusBar.Panels[THREADSIZE_PANEL].Width :=
2651- Max(StatusBar.Canvas.TextWidth(StatusBar.Panels[THREADSIZE_PANEL].Text), 70);
2675+ Self.Caption := CAPTION_NAME + ' - [' + ThreadTitle + ']';
26522676 //Thread.Repaintは、スキン等の設定を変更したとき、Threadをダウンロードしたとき
26532677 //新規にThreadを開いたときに真になっている。
26542678 if Thread.Repaint then begin
@@ -2660,7 +2684,7 @@ begin
26602684 //GikoSys.CreateHTML2(doc, ThreadItem, sTitle);
26612685 HTMLCreater.CreateHTML2(doc, ThreadItem, sTitle);
26622686 Thread.Browser.OnStatusTextChange := BrowserStatusTextChange;
2663-
2687+
26642688 if ThreadItem = nil then begin
26652689 FActiveContent := nil;
26662690 BrowserTab.Repaint;
@@ -2728,20 +2752,10 @@ begin
27282752 ListView.Selected := nil;
27292753 // ListView.Columns.Clear;
27302754 if (FActiveContent <> nil) and (FActiveContent.Thread <> nil)
2731- and (FActiveContent.Thread.IsLogFile) then begin
2732- try
2733- Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']'
2734- except
2735- on E: Exception do begin
2736- //スレ一覧DL後などにFActiveContentの持つThreadが
2737- //削除されている場合があるのでここて処理する
2738- ReleaseBrowser(FActiveContent);
2739- FActiveContent.Thread := nil;
2740- Self.Caption := GikoDataModule.CAPTION_NAME;
2741- end;
2742- end;
2743- end else
2744- Self.Caption := GikoDataModule.CAPTION_NAME;
2755+ and (FActiveContent.Thread.IsLogFile) then
2756+ Self.Caption := CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']'
2757+ else
2758+ Self.Caption := CAPTION_NAME;
27452759 //Application.Title := CAPTION_NAME;
27462760
27472761 // ActiveListColumnSave;
@@ -2749,11 +2763,14 @@ begin
27492763 Screen.Cursor := crHourGlass;
27502764 try
27512765 if Obj is TBBS then begin
2752- TListViewUtils.SetCategoryListItem(TBBS(obj), ListView, GikoDM.ListNumberVisibleAction.Checked);
2766+ TListViewUtils.SetCategoryListItem(TBBS(obj), ListView, GikoDM.ListNumberVisibleAction.Checked,
2767+ FSortIndex, FSortOrder);
27532768 end else if Obj is TCategory then begin
2754- TListViewUtils.SetBoardListItem(TCategory(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked);
2769+ TListViewUtils.SetBoardListItem(TCategory(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked,
2770+ FSortIndex, FSortOrder);
27552771 end else if Obj is TBoard then begin
2756- TListViewUtils.SetThreadListItem(TBoard(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked);
2772+ TListViewUtils.SetThreadListItem(TBoard(Obj), ListView, GikoDM.ListNumberVisibleAction.Checked,
2773+ FSortIndex, FSortOrder);
27572774 end;
27582775 finally
27592776 Screen.Cursor := crDefault;
@@ -3497,9 +3514,6 @@ begin
34973514 end else if TObject(Node.Data) is TBoard then begin
34983515 TBoard(Node.Data).NodeExpand := False;
34993516 end;
3500- if (TreeView.Selected <> nil) and (TreeView.Selected = Node) then begin
3501- TreeClick(TreeView.Selected);
3502- end;
35033517 end;
35043518
35053519 procedure TGikoForm.MessageListViewResize(Sender: TObject);
@@ -3706,6 +3720,8 @@ begin
37063720 AddRoundNameMenu(ListReservPMenu);
37073721 end;
37083722
3723+
3724+//ActiveListがTBoardかTCategoryでスレ一覧で1つ以上選択していると有効になるActionde共通
37093725 procedure TGikoForm.TreePopupMenuPopup(Sender: TObject);
37103726 begin
37113727 FClickNode := TreeView.Selected;
@@ -3801,6 +3817,7 @@ var
38013817 idx: Integer;
38023818 wkIntSt: Integer;
38033819 wkIntTo: Integer;
3820+ document: IHTMLDocument2;
38043821 BNum, BRes: string;
38053822 threadItem: TThreadItem;
38063823 begin
@@ -3888,31 +3905,31 @@ begin
38883905 if GikoSys.Setting.ListOrientation = gloHorizontal then begin
38893906 if ViewPanel.Width < 2 then begin
38903907 ViewPanel.Width := 1;
3891- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
3892- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
3908+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
3909+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
38933910 GikoSys.Setting.ListWidthState := glsMax;
38943911 end else if ViewPanel.Width > (ThreadMainPanel.Width - 80) then begin
3895- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
3896- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_NORMAL;
3912+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
3913+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
38973914 GikoSys.Setting.ListWidthState := glsMin;
38983915 end else begin
3899- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MAX;
3900- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_WIDTH_MIN;
3916+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
3917+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
39013918 GikoSys.Setting.ListWidthState := glsNormal;
39023919 end;
39033920 end else begin
39043921 if ViewPanel.Height < 2 then begin
39053922 ViewPanel.Height := 1;
3906- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
3907- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
3923+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
3924+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
39083925 GikoSys.Setting.ListHeightState := glsMax;
39093926 end else if ViewPanel.Height > (ThreadMainPanel.Height - BrowserCoolBar.Height - 7) then begin
3910- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
3911- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_NORMAL;
3927+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
3928+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
39123929 GikoSys.Setting.ListHeightState := glsMin;
39133930 end else begin
3914- GikoDM.BrowserMaxAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MAX;
3915- GikoDM.BrowserMinAction.ImageIndex := GikoDataModule.TOOL_ICON_HEIGHT_MIN;
3931+ GikoDM.BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
3932+ GikoDM.BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
39163933 GikoSys.Setting.ListHeightState := glsNormal;
39173934 end;
39183935 end;
@@ -3928,11 +3945,14 @@ var
39283945 idx: Integer;
39293946 begin
39303947
3948+// if NewTab = -1 then
3949+// ThreadItem := nil;
39313950 if not BrowserTab.Dragging then begin
39323951 FTabHintIndex := -1;
39333952 BrowserTab.Hint := '';
39343953 idx := BrowserTab.TabIndex;
39353954 if idx = -1 then begin
3955+ BrowserNullTab.Thread := nil;
39363956 SetContent(BrowserNullTab);
39373957
39383958 end else if(BrowserTab.Tabs.Objects[idx] <> nil) and (BrowserTab.Tabs.Objects[idx] is TBrowserRecord) then begin
@@ -3958,6 +3978,8 @@ begin
39583978 end;
39593979 MoveWindow(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser.Handle, 0, 0, BrowserPanel.Width, BrowserPanel.Height, false);
39603980 TOleControl(TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser).BringToFront;
3981+// GikoSys.OnlyAHundredRes := TBrowserRecord(BrowserTab.Tabs.Objects[idx]).OnlyHundred;
3982+// OnlyAHundredRes.Checked := TBrowserRecord(BrowserTab.Tabs.Objects[idx]).OnlyHundred;
39613983 SetContent(TBrowserRecord(BrowserTab.Tabs.Objects[idx]));
39623984
39633985 if (GikoSys.Setting.URLDisplay) and (GetActiveContent <> nil) then
@@ -4144,11 +4166,6 @@ begin
41444166 FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
41454167 FEvent.OnContextMenu := OnDocumentContextMenu;
41464168 FEvent.OnClick := WebBrowserClick; //追加したOnClickイベント
4147- end else begin
4148- if FEvent <> nil then begin
4149- FEvent.Free;
4150- FEvent := nil;
4151- end;
41524169 end;
41534170
41544171 end;
@@ -4160,19 +4177,17 @@ begin
41604177 if (BrowserRecord <> nil) and (Length( BrowserRecord.Movement ) > 0) then begin
41614178 if threadItem.UnRead then begin
41624179 threadItem.UnRead := False;
4180+ threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
4181+ if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0;
41634182 TreeView.Refresh;
41644183 ListView.Refresh;
41654184 end;
4166- // スクロール先が取得外のレスの時は終端に移動
4167- if (StrToIntDef(BrowserRecord.Movement, 0) <= BrowserRecord.Thread.Count) then begin
4168- BrowserRecord.Move(BrowserRecord.Movement);
4169- BrowserRecord.Movement := '';
4170- end else begin
4171- BrowserRecord.Move(IntToStr(BrowserRecord.Thread.Count));
4172- end;
4173-
4185+ BrowserRecord.Move(BrowserRecord.Movement);
4186+ BrowserRecord.Movement := '';
41744187 end else if threadItem.UnRead then begin
41754188 threadItem.UnRead := False;
4189+ threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1;
4190+ if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0;
41764191 TreeView.Refresh;
41774192 BrowserRecord.Move('new');
41784193 ListView.Refresh;
@@ -4322,52 +4337,47 @@ procedure TGikoForm.FavoriteMenuClick(Sender: TObject);
43224337 var
43234338 NewMenu: TMenuItem;
43244339 begin
4325- if FavoriteDM.Modified then begin
4326- FavoriteMenu.Clear;
4340+ FavoriteMenu.Clear;
43274341
4328- //お気に入りの追加
4329- NewMenu := TMenuItem.Create(MainMenu);
4330- NewMenu.Action := GikoDM.FavoriteAddAction;
4331- FavoriteMenu.Add(NewMenu);
4332- //お気に入りの整理
4333- NewMenu := TMenuItem.Create(FavoriteMenu);
4334- NewMenu.Action := GikoDM.FavoriteArrangeAction;
4335- FavoriteMenu.Add(NewMenu);
4336- //セパレータ
4337- FavoriteMenu.InsertNewLineAfter(NewMenu);
4338- CreateFavMenu(FavoriteDM.TreeView.Items.GetFirstNode, FavoriteMenu);
4339- FavoriteDM.Modified := false;
4340- end;
4342+ //お気に入りの追加
4343+ NewMenu := TMenuItem.Create(MainMenu);
4344+ NewMenu.Action := GikoDM.FavoriteAddAction;
4345+ FavoriteMenu.Add(NewMenu);
4346+ //お気に入りの整理
4347+ NewMenu := TMenuItem.Create(FavoriteMenu);
4348+ NewMenu.Action := GikoDM.FavoriteArrangeAction;
4349+ FavoriteMenu.Add(NewMenu);
4350+ //セパレータ
4351+ NewMenu := TMenuItem.Create(FavoriteMenu);
4352+ NewMenu.Caption := '-';
4353+ FavoriteMenu.Add(NewMenu);
4354+
4355+ CreateFavMenu(FavoriteDM.TreeView.Items.GetFirstNode, FavoriteMenu);
43414356 end;
43424357
43434358 procedure TGikoForm.CreateFavMenu(Node: TTreeNode; MenuItem: TMenuItem);
43444359 var
43454360 i: Integer;
4346- NewMenu: array of TMenuItem;
4361+ NewMenu: TMenuItem;
43474362 begin
4348- SetLength(NewMenu, Node.Count);
4349- Node := Node.getFirstChild;
4350- i := 0;
4351- while ( Node <> nil ) do begin
4352- NewMenu[i] := TFavoriteMenuItem.Create(nil);
4353- NewMenu[i].AutoHotkeys := maAutomatic;
4354- NewMenu[i].Caption := CustomStringReplace(Node.Text, '&', '&&');
4355- TFavoriteMenuItem(NewMenu[i]).Data := Node.Data;
4363+ for i := 0 to Node.Count - 1 do begin
4364+ NewMenu := TFavoriteMenuItem.Create(Self);
4365+ NewMenu.AutoHotkeys := maAutomatic;
4366+ NewMenu.Caption := CustomStringReplace(Node.Item[i].Text, '&', '&&');
4367+ TFavoriteMenuItem(NewMenu).Data := Node.Item[i].Data;
4368+ MenuItem.Add(NewMenu);
43564369
4357- if TObject(Node.Data) is TFavoriteFolder then begin
4358- NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_FOLDER;
4359- CreateFavMenu(Node, NewMenu[i]);
4360- end else if TObject(Node.Data) is TFavoriteBoardItem then begin
4361- NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_BOARD;
4362- NewMenu[i].OnClick := FavoriteClick;
4363- end else if TObject(Node.Data) is TFavoriteThreadItem then begin
4364- NewMenu[i].ImageIndex := GikoDataModule.TOOL_ICON_FAV_THREAD;
4365- NewMenu[i].OnClick := FavoriteClick;
4370+ if TObject(Node.Item[i].Data) is TFavoriteFolder then begin
4371+ NewMenu.ImageIndex := TOOL_ICON_FAV_FOLDER;
4372+ CreateFavMenu(Node.Item[i], NewMenu);
4373+ end else if TObject(Node.Item[i].Data) is TFavoriteBoardItem then begin
4374+ NewMenu.ImageIndex := TOOL_ICON_FAV_BOARD;
4375+ NewMenu.OnClick := FavoriteClick;
4376+ end else if TObject(Node.Item[i].Data) is TFavoriteThreadItem then begin
4377+ NewMenu.ImageIndex := TOOL_ICON_FAV_THREAD;
4378+ NewMenu.OnClick := FavoriteClick;
43664379 end;
4367- Inc(i);
4368- Node := Node.getNextSibling;
43694380 end;
4370- MenuItem.Add(NewMenu);
43714381 end;
43724382
43734383 procedure TGikoForm.ShowFavoriteAddDialog( Item : TObject );
@@ -4431,7 +4441,9 @@ end;
44314441
44324442 procedure TGikoForm.FavoriteClick(Sender: TObject);
44334443 begin
4444+
44344445 FavoriteClick( Sender, True );
4446+
44354447 end;
44364448
44374449 procedure TGikoForm.FavoriteClick(Sender: TObject; ActiveTab: Boolean);
@@ -4533,8 +4545,11 @@ begin
45334545 //===== プラグイン
45344546 try
45354547 //作業中//
4548+ //bi := High( BoardPlugIns );
45364549 bi := Length(BoardGroups) - 1;
4550+ //for i := Low( BoardPlugIns ) to bi do begin
45374551 for i := 1 to bi do begin
4552+ //if Assigned( Pointer( BoardPlugIns[ i ].Module ) ) then begin
45384553 if (BoardGroups[i].BoardPlugIn <> nil) and (Assigned(Pointer(BoardGroups[i].BoardPlugIn.Module))) then begin
45394554 case BoardGroups[i].BoardPlugIn.AcceptURL( inURL ) of
45404555 atThread:
@@ -4580,12 +4595,8 @@ begin
45804595 GikoSys.GetPopupResNumber( inURL, stRes, edRes );
45814596 browserRec := InsertBrowserTab( ThreadItem );
45824597 if ThreadItem.IsLogFile then begin
4583- if (browserRec <> nil) and (stRes > 0) then begin
4584- browserRec.Movement := IntToStr( stRes );
4585- if (stRes > ThreadItem.Count) then begin
4586- DownloadContent( ThreadItem );
4587- end;
4588- end;
4598+ if (browserRec <> nil) and (stRes > 0) then
4599+ browserRec.Move(IntToStr( stRes ));
45894600 end else begin
45904601 if (browserRec <> nil) and (stRes > 0) then
45914602 browserRec.Movement := IntToStr( stRes );
@@ -4684,12 +4695,8 @@ begin
46844695 if ThreadItem.IsLogFile then begin
46854696 GikoSys.GetPopupResNumber( inURL, stRes, edRes );
46864697 browserRec := InsertBrowserTab(ThreadItem);
4687- if (browserRec <> nil) and (stRes > 0) then begin
4698+ if (browserRec <> nil) and (stRes > 0) then
46884699 browserRec.Movement := IntToStr( stRes );
4689- if (stRes > ThreadItem.Count) then begin
4690- DownloadContent(ThreadItem);
4691- end;
4692- end;
46934700 end else begin
46944701 if AnsiPos(Host, Board.URL) = 0 then
46954702 ThreadItem.DownloadHost := Host
@@ -4950,42 +4957,26 @@ begin
49504957
49514958 SetWindowPos(FPreviewBrowser.Handle, HWND_TOPMOST, ARect.Left, ARect.Top, WindowWidth, WindowHeight, SWP_NOACTIVATE or SWP_HIDEWINDOW);
49524959 ShowWindow(FPreviewBrowser.Handle, SW_SHOWNOACTIVATE);
4953- FPreviewBrowserRect := ARect;
4960+
49544961 // Style := GetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE);
49554962 // SetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE, Style xor WS_EX_APPWINDOW);
49564963
49574964 end;
49584965
49594966 procedure TGikoForm.WMSetCursor(var Message: TWMSetCursor);
4960-var
4961- Pos : TPoint;
49624967 begin
4963-
49644968 if PreviewTimer.Enabled then
49654969 PreviewTimer.Enabled := False;
49664970 if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin
49674971 FHint.ReleaseHandle;
49684972 FHint.ClearAllRes;
49694973 end;
4970-
4971- if (FPreviewBrowser <> nil)
4972- and (IsWindowVisible(FPreviewBrowser.Handle)) then begin
4973- //ここで消されるのが問題
4974- //たぶんこれで表示範囲判定できているはず
4975- Pos := Mouse.CursorPos;
4976- Pos.X := Pos.X + Left;
4977- Pos.Y := Pos.Y + Top;
4978- if (FPreviewBrowserRect.Left > Pos.X) or
4979- (FPreviewBrowserRect.Right < Pos.X) or
4980- (FPreviewBrowserRect.Top > Pos.Y) or
4981- (FPreviewBrowserRect.Bottom < Pos.Y) then begin
4982- ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
4983- end;
4984- end;
4985-
4974+ if (FPreviewBrowser <> nil) and (IsWindowVisible(FPreviewBrowser.Handle)) then
4975+ ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
49864976 Message.Result := 1;
49874977 inherited;
49884978 end;
4979+
49894980 procedure TGikoForm.MessageHideButtonClick(Sender: TObject);
49904981 begin
49914982 GikoDM.MsgBarCloseAction.Execute;
@@ -5105,12 +5096,12 @@ begin
51055096 CreateFavMenu(FavoriteTreeView.Items[i].Item[j], MenuItem);
51065097 LinkBarPopupMenu.Items.Add(MenuItem);
51075098 ToolButton.MenuItem := MenuItem;
5108- ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_FOLDER;
5099+ ToolButton.ImageIndex := TOOL_ICON_FAV_FOLDER;
51095100 end else if TObject(FavoriteTreeView.Items[i].Item[j].Data) is TFavoriteBoardItem then begin
5110- ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_BOARD;
5101+ ToolButton.ImageIndex := TOOL_ICON_FAV_BOARD;
51115102 ToolButton.OnClick := FavoriteClick;
51125103 end else if TObject(FavoriteTreeView.Items[i].Item[j].Data) is TFavoriteThreadItem then begin
5113- ToolButton.ImageIndex := GikoDataModule.TOOL_ICON_FAV_THREAD;
5104+ ToolButton.ImageIndex := TOOL_ICON_FAV_THREAD;
51145105 ToolButton.OnClick := FavoriteClick;
51155106 end;
51165107 ToolButton.Caption := FavoriteTreeView.Items[i].Item[j].Text;
@@ -5658,13 +5649,16 @@ function TGikoForm.FindToolBarButton( bar : TToolBar; action : TAction ) : TTool
56585649 var
56595650 i : Integer;
56605651 begin
5661- Result := nil;
5652+
56625653 for i := bar.ButtonCount - 1 downto 0 do begin
56635654 if bar.Buttons[ i ].Action = action then begin
56645655 Result := bar.Buttons[ i ];
5665- Break;
5656+ Exit;
56665657 end;
56675658 end;
5659+
5660+ Result := nil;
5661+
56685662 end;
56695663
56705664 procedure TGikoForm.SetToolBarPopup;
@@ -5818,8 +5812,8 @@ begin
58185812
58195813 if Length( SelectComboBox.Text ) = 0 then
58205814 begin
5821- SelectComboBox.Text := GikoDataModule.SELECTCOMBOBOX_NAME;
5822- SelectComboBox.Color := GikoDataModule.SELECTCOMBOBOX_COLOR;
5815+ SelectComboBox.Text := SELECTCOMBOBOX_NAME;
5816+ SelectComboBox.Color := SELECTCOMBOBOX_COLOR;
58235817 end;
58245818
58255819 end;
@@ -5854,6 +5848,7 @@ begin
58545848 end;
58555849
58565850
5851+// 全てのレスを表示
58575852 procedure TGikoForm.SelectComboBoxSplitterMouseMove(Sender: TObject;
58585853 Shift: TShiftState; X, Y: Integer);
58595854 var
@@ -5913,15 +5908,14 @@ end;
59135908 procedure TGikoForm.StatusBarResize(Sender: TObject);
59145909 begin
59155910 StatusBar.Panels[1].Width := StatusBar.Width -
5916- StatusBar.Panels[0].Width -
5917- StatusBar.Panels[THREADSIZE_PANEL].Width -
5918- StatusBar.Panels[NGWORDNAME_PANEL].Width;
5911+ StatusBar.Panels[0].Width -
5912+ StatusBar.Panels[2].Width;
59195913 end;
59205914 procedure TGikoForm.SelectComboBoxEnter(Sender: TObject);
59215915 begin
59225916
59235917 if (Length( SelectComboBox.Text ) = 0) or
5924- (SelectComboBox.Text = GikoDataModule.SELECTCOMBOBOX_NAME) then
5918+ (SelectComboBox.Text = SELECTCOMBOBOX_NAME) then
59255919 begin
59265920 SelectComboBox.Text := '';
59275921 SelectComboBox.Color := clWindow;
@@ -5929,6 +5923,7 @@ begin
59295923
59305924 end;
59315925
5926+//板名検索
59325927 procedure TGikoForm.FavoriteMoveTo( SenderNode, SourceNode: TTreeNode );
59335928 begin
59345929
@@ -6053,8 +6048,6 @@ begin
60536048 FDropSpaceNode := nil;
60546049 end;
60556050 end;
6056- //更新したことを教える
6057- FavoriteDM.Modified := true;
60586051
60596052 SetLinkBar;
60606053
@@ -6063,8 +6056,6 @@ end;
60636056 procedure TGikoForm.FavoriteTreeViewEdited(Sender: TObject;
60646057 Node: TTreeNode; var S: String);
60656058 begin
6066- //更新したことを教える
6067- FavoriteDM.Modified := true;
60686059
60696060 FavoriteTreeView.ReadOnly := True;
60706061 SetLinkBar;
@@ -6092,10 +6083,7 @@ begin
60926083 FavoriteTreeView.Selected.Expanded := not FavoriteTreeView.Selected.Expanded;
60936084 end;
60946085 VK_SPACE:
6095- begin
6096- FClickNode := FavoriteTreeView.Selected;
6097- GikoDM.FavoriteTreeViewReloadActionExecute( Sender );
6098- end;
6086+ FavoriteTreeViewDblClick( Sender );
60996087 end;
61006088 end else begin
61016089 //編集中にESCを押したら、編集を終了して、元の文字列に戻す
@@ -6228,6 +6216,27 @@ begin
62286216 end;
62296217
62306218 end;
6219+// *************************************************************************
6220+//! お気に入りツリーのダブルクリックイベント
6221+// *************************************************************************
6222+procedure TGikoForm.FavoriteTreeViewDblClick(Sender: TObject);
6223+var
6224+ pos : TPoint;
6225+ rect: TRect;
6226+begin
6227+ //クリック時の選択イベントと同じならダブルクリック実行
6228+ pos := FMouseDownPos;
6229+ if (FClickNode <> nil) and (FClickNode = FavoriteTreeView.GetNodeAt(pos.X, pos.Y)) then begin
6230+ //マウスがnodeの上にいるか
6231+ rect := FClickNode.DisplayRect(true);
6232+ if ((rect.Left <= pos.X) and (rect.Right >= pos.X)) and
6233+ ((rect.Bottom >= pos.Y) and (rect.Top <= pos.Y)) then begin
6234+ GikoDM.FavoriteTreeViewReloadActionExecute( Sender );
6235+ FClickNode := nil;
6236+ end;
6237+ end;
6238+end;
6239+
62316240 function TGikoForm.TreeNodeDataFind(Node: TTreeNode; FindPointer: Pointer): TTreeNode;
62326241 var
62336242 Found: TTreeNode;
@@ -6313,8 +6322,6 @@ begin
63136322 finally
63146323 FDropSpaceNode := nil;
63156324 end;
6316- //更新したことを教える
6317- FavoriteDM.Modified := true;
63186325 SetLinkBar;
63196326 end;
63206327
@@ -6423,7 +6430,7 @@ begin
64236430 tmp := GikoSys.ReadThreadFile(FileName, Number);
64246431 end;
64256432 if tmp <> '' then begin
6426- THTMLCreate.DivideStrLine(tmp, @Res);
6433+ Res := DivideStrLine(tmp);
64276434
64286435 Header := IntToStr(Number) + ' :' + Res.FName + ' :' + Res.FDateTime + #13#10;
64296436 if ReplaceTag then begin
@@ -6445,7 +6452,7 @@ begin
64456452 end;
64466453 Body := CustomStringReplace(Body, '</a>', '',true);
64476454
6448- Body := HTMLCreater.DeleteLink(Body);
6455+ Body := GikoSys.DeleteLink(Body);
64496456 if ReplaceTag then begin
64506457 Body := CustomStringReplace(Body, '&lt;', '<');
64516458 Body := CustomStringReplace(Body, '&gt;', '>');
@@ -6658,8 +6665,13 @@ begin
66586665
66596666 end;
66606667 // *************************************************************************
6661-//! ツリービューのKeyDownイベント
6668+//! ツリービューのクリックイベント
66626669 // *************************************************************************
6670+procedure TGikoForm.TreeViewClick(Sender: TObject);
6671+begin
6672+ FClickNode := TreeView.Selected;
6673+ FMouseDownPos := TreeView.ScreenToClient(Mouse.CursorPos);
6674+end;
66636675 procedure TGikoForm.TreeViewKeyDown(Sender: TObject; var Key: Word;
66646676 Shift: TShiftState);
66656677 begin
@@ -6672,35 +6684,21 @@ begin
66726684 TreeView.Selected.Expanded := not TreeView.Selected.Expanded;
66736685 end;
66746686 end;
6675-//! お気に入りのMouseDownイベント
6687+
66766688 procedure TGikoForm.FavoriteTreeViewMouseDown(Sender: TObject;
66776689 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
66786690 var
66796691 favItem : TTreeNode;
66806692 favThreadItem : TFavoriteThreadItem;
6681- rect: TRect;
66826693 begin
6694+
66836695 case Button of
6684- mbLeft:
6696+{ mbLeft:
66856697 begin
6686- if not (ssAlt in Shift) and (FavoriteTreeView.Selected <> nil) and
6687- (FavoriteTreeView.Selected = FavoriteTreeView.GetNodeAt(X, Y)) then begin
6688- //マウスがnodeの上にいるか
6689- rect := FavoriteTreeView.Selected.DisplayRect(true);
6690- if ((rect.Left <= X) and (rect.Right >= X)) and
6691- ((rect.Bottom >= Y) and (rect.Top <= Y)) then begin
6692- if ssDouble in Shift then begin
6693- FClickNode := FavoriteTreeView.Selected;
6694- GikoDM.FavoriteTreeViewReloadActionExecute(Sender);
6695- FClickNode := nil;
6696- end else begin
6697- FavoriteClick(
6698- TObject(FavoriteTreeView.Selected));
6699- end;
6700- end;
6701- end;
6698+ FMouseDownPos.X := X;
6699+ FMouseDownPos.Y := Y;
67026700 end;
6703- mbMiddle:
6701+} mbMiddle:
67046702 begin
67056703 favItem := FavoriteTreeView.GetNodeAt( X, Y );
67066704 if favItem = nil then Exit;
@@ -6760,6 +6758,16 @@ end;
67606758 // *************************************************************************
67616759 //! お気に入りツリーのマウスアップイベント
67626760 // *************************************************************************
6761+procedure TGikoForm.FavoriteTreeViewMouseUp(Sender: TObject;
6762+ Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
6763+begin
6764+ if (Button = mbLeft) and not (ssDouble in Shift) then begin
6765+ if (FClickNode <> nil) and (FClickNode = FavoriteTreeView.GetNodeAt(X, Y)) then begin
6766+ FavoriteClick( TObject( FClickNode ) );
6767+ end;
6768+ end;
6769+end;
6770+
67636771 function TGikoForm.WebBrowserClick(Sender: TObject): WordBool;
67646772 var
67656773 p : TPoint;
@@ -6838,21 +6846,18 @@ var
68386846 rec : TBrowserRecord;
68396847 i, bound : Integer;
68406848 begin
6841- bound := BrowserTab.Tabs.Count -1;
6849+ bound := BrowserTab.Tabs.Count -1;
68426850 if bound = -1 then begin
68436851 Result := False;
68446852 Exit; //forに飛ばないで操作を抜ける
6845- end;
6853+ end;
68466854
6847- for i := 0 to bound do begin
6848- try
6849- rec := TBrowserRecord( BrowserTab.Tabs.Objects[ i ] );
6850- if( rec <> nil) and (rec.Thread <> nil) then
6851- AStringList.Add( rec.Thread.URL );
6852- except
6853- end;
6854- end;
6855- Result := True;
6855+ for i := 0 to bound do begin
6856+ rec := TBrowserRecord( BrowserTab.Tabs.Objects[ i ] );
6857+ if( rec <> nil) and (rec.Thread <> nil) then
6858+ AStringList.Add( rec.Thread.URL );
6859+ end;
6860+ Result := True;
68566861 end;
68576862
68586863 function TGikoForm.SaveTabURLs : Boolean;
@@ -6867,15 +6872,12 @@ begin
68676872 SaveStringList := TStringList.Create;
68686873 try
68696874 if GetTabURLs(SaveStringList) then begin
6870- try
6871- if FileExists( GikoSys.GetAppDir + Filename) then begin
6872- if FileExists( GikoSys.GetAppDir + bFilename) then
6873- DeleteFile(GikoSys.GetAppDir + bFilename);
6875+ if FileExists( GikoSys.GetAppDir + Filename) then begin
6876+ if FileExists( GikoSys.GetAppDir + bFilename) then
6877+ DeleteFile(GikoSys.GetAppDir + bFilename);
68746878
6875- //バックアップを作る。
6876- RenameFile(GikoSys.GetAppDir + Filename, GikoSys.GetAppDir + bFilename);
6877- end;
6878- except
6879+ //バックアップを作る。
6880+ RenameFile(GikoSys.GetAppDir + Filename, GikoSys.GetAppDir + bFilename);
68796881 end;
68806882 SaveStringList.SaveToFile(GikoSys.GetAppDir + Filename);
68816883 Result := true;
@@ -6886,8 +6888,6 @@ begin
68866888 end;
68876889
68886890 function TGikoForm.LoadTabURLs : Boolean;
6889-const
6890- TABFILE = 'tab.sav';
68916891 var
68926892 i, bound : Integer;
68936893 item : TThreadItem;
@@ -6896,7 +6896,7 @@ var
68966896 fileName : string;
68976897 begin
68986898
6899- fileName := ExtractFilePath(Application.ExeName) + TABFILE;
6899+ fileName := ExtractFilePath(Application.ExeName) + 'tab.sav';
69006900 URLs := TStringList.Create();
69016901 GikoTab := GikoSys.Setting.BrowserTabAppend;
69026902 try
@@ -6912,10 +6912,6 @@ begin
69126912 if item <> nil then
69136913 InsertBrowserTab( item, false );
69146914 end;
6915- //最初の1枚に設定 アドレスの設定のためのカラ呼び
6916- if BrowserTab.Tabs.Count > 0 then begin
6917- BrowserTab.OnChange(nil);
6918- end;
69196915 end else
69206916 Result := False;
69216917 end else
@@ -7635,6 +7631,61 @@ begin
76357631 end;
76367632 end;
76377633 // *************************************************************************
7634+//! お気に入りツリーのクリックイベント
7635+// *************************************************************************
7636+procedure TGikoForm.FavoriteTreeViewClick(Sender: TObject);
7637+begin
7638+ //現在選択されているアイテムを保存
7639+ FClickNode := FavoriteTreeView.Selected;
7640+ FMouseDownPos := FavoriteTreeView.ScreenToClient(Mouse.CursorPos);
7641+end;
7642+// *************************************************************************
7643+//! お気に入りツリーのアイテムの縮小時イベント
7644+// *************************************************************************
7645+procedure TGikoForm.FavoriteTreeViewCollapsing(Sender: TObject;
7646+ Node: TTreeNode; var AllowCollapse: Boolean);
7647+begin
7648+ //縮小されたら保存されているクリック時選択アイテムをクリア
7649+ FClickNode := nil;
7650+end;
7651+// *************************************************************************
7652+//! お気に入りツリーのアイテムの展開時イベント
7653+// *************************************************************************
7654+procedure TGikoForm.FavoriteTreeViewExpanding(Sender: TObject;
7655+ Node: TTreeNode; var AllowExpansion: Boolean);
7656+begin
7657+ //展開されたら保存されているクリック時選択アイテムをクリア
7658+ FClickNode := nil;
7659+end;
7660+// *************************************************************************
7661+//! ツリービューのアイテムの縮小時イベント
7662+// *************************************************************************
7663+procedure TGikoForm.TreeViewCollapsing(Sender: TObject; Node: TTreeNode;
7664+ var AllowCollapse: Boolean);
7665+begin
7666+ FClickNode := nil;
7667+end;
7668+// *************************************************************************
7669+//! ツリービューのアイテムの展開時イベント
7670+// *************************************************************************
7671+procedure TGikoForm.TreeViewExpanding(Sender: TObject; Node: TTreeNode;
7672+ var AllowExpansion: Boolean);
7673+begin
7674+ FClickNode := nil;
7675+end;
7676+// *************************************************************************
7677+//! ツリービューのマウスアップイベント
7678+// *************************************************************************
7679+procedure TGikoForm.TreeViewMouseUp(Sender: TObject; Button: TMouseButton;
7680+ Shift: TShiftState; X, Y: Integer);
7681+begin
7682+ if (Button = mbLeft) and not (ssDouble in Shift) then begin
7683+ if (FClickNode <> nil) and (FClickNode = TreeView.GetNodeAt(X, Y)) then begin
7684+ TreeClick(FClickNode);
7685+ end;
7686+ end;
7687+end;
7688+// *************************************************************************
76387689 //! ダウンロードコントロールスレッドの生成
76397690 // *************************************************************************
76407691 procedure TGikoForm.CreateControlThread();
@@ -7742,32 +7793,6 @@ begin
77427793 except
77437794 end;
77447795 end;
7745-//! キャビネットのマウスダウンイベント
7746-procedure TGikoForm.TreeViewMouseDown(Sender: TObject;
7747- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
7748-var
7749- rect : TRect;
7750-begin
7751- case Button of
7752- mbLeft:
7753- begin
7754- if (TreeView.Selected <> nil) and
7755- (TreeView.Selected = TreeView.GetNodeAt(X, Y)) then begin
7756- //マウスがnodeの上にいるか
7757- rect := TreeView.Selected.DisplayRect(true);
7758- if ((rect.Left <= X) and (rect.Right >= X)) and
7759- ((rect.Bottom >= Y) and (rect.Top <= Y)) then begin
7760- // クリックとダブルクリックをココで判定
7761- if ssDouble in Shift then begin
7762- TreeDoubleClick( TreeView.Selected );
7763- end else begin
7764- TreeClick(TreeView.Selected);
7765- end;
7766- end;
7767- end;
7768- end;
7769- end;
7770-end;
77717796
77727797 initialization
77737798 OleInitialize(nil);
--- a/GikoDataModule.dfm
+++ b/GikoDataModule.dfm
@@ -1030,6 +1030,13 @@ object GikoDM: TGikoDM
10301030 ImageIndex = 44
10311031 OnExecute = SelectItemSaveForDatExecute
10321032 end
1033+ object FileSaveAs1: TFileSaveAs
1034+ Tag = -1
1035+ Category = #12501#12449#12452#12523
1036+ Caption = #21517#21069#12434#20184#12369#12390#20445#23384'(&A)...'
1037+ Hint = #21029#21517#12391#20445#23384'|'#29694#22312#12398#12501#12449#12452#12523#12395#26032#12375#12356#21517#21069#12434#12388#12369#12390#20445#23384
1038+ ImageIndex = 44
1039+ end
10331040 object LogFolderOpenAction: TAction
10341041 Category = #26495
10351042 Caption = 'Explorer'#12391'Log'#12501#12457#12523#12480#12434#38283#12367
@@ -1195,12 +1202,6 @@ object GikoDM: TGikoDM
11951202 Hint = #12462#12467#12490#12499'Wiki'#12398'FAQ'#12434#34920#31034#12377#12427
11961203 OnExecute = WikiFAQWebPageActionExecute
11971204 end
1198- object ThreadSizeCalcForFileAction: TAction
1199- Category = #12484#12540#12523
1200- Caption = #12473#12524#12483#12489#12398#23481#37327#12434#12501#12449#12452#12523#12363#12425#20877#35336#31639#12377#12427
1201- Hint = #12473#12524#12483#12489#12398#23481#37327#12434#12501#12449#12452#12523#12363#12425#20877#35336#31639#12377#12427
1202- OnExecute = ThreadSizeCalcForFileActionExecute
1203- end
12041205 end
12051206 object ToobarImageList: TImageList
12061207 Left = 44
@@ -3193,8 +3194,4 @@ object GikoDM: TGikoDM
31933194 F81FE0FFE007FFFFF83FFFFFF81FFFFF00000000000000000000000000000000
31943195 000000000000}
31953196 end
3196- object SaveDialog: TSaveDialog
3197- Left = 48
3198- Top = 128
3199- end
32003197 end
--- a/GikoDataModule.pas
+++ b/GikoDataModule.pas
@@ -11,38 +11,7 @@ uses
1111 SHDocVw_TLB,
1212 MSHTML_TLB,
1313 {$IFEND}
14- ComCtrls, BrowserRecord, Graphics, Messages, Setting, Dialogs;
15-
16-const
17- CAPTION_NAME: string = 'ギコナビ';
18- USER_SETLINKBAR = WM_USER + 2003;
19-
20- ITEM_ICON_SORT1 = 12; //!< ソートアイコン
21- ITEM_ICON_SORT2 = 13; //!< ソートアイコン
22-
23- //ツールバーアイコン
24- TOOL_ICON_HEIGHT_MAX = 16; //!< 高さ最大アイコン
25- TOOL_ICON_HEIGHT_MIN = 17; //!< 高さ最小アイコン
26- TOOL_ICON_HEIGHT_NORMAL = 18; //!< 高さ標準アイコン
27- TOOL_ICON_WIDTH_MAX = 19; //!< 幅最大アイコン
28- TOOL_ICON_WIDTH_MIN = 20; //!< 幅最小アイコン
29- TOOL_ICON_WIDTH_NORMAL = 21; //!< 幅標準アイコン
30-
31- TOOL_ICON_FAV_FOLDER = 30; //!< お気に入りフォルダアイコン
32- TOOL_ICON_FAV_BOARD = 31; //!< お気に入り板アイコン
33- TOOL_ICON_FAV_THREAD = 32; //!< お気に入りスレアイコン
34-
35- //! ギコナビサイトのURL
36- URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';
37- //! MonazillaサイトのURL
38- URL_MONAZILLA: string = 'http://www.monazilla.org/';
39- //! 2ちゃんねるのURL
40- URL_2ch: string = 'http://www.2ch.net/';
41- //! ギコナビWikiのURL
42- URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ';
43-
44- SELECTCOMBOBOX_NAME: string = ''; // 'スレッド絞込検索';
45- SELECTCOMBOBOX_COLOR: TColor = clWindow;
14+ ComCtrls, BrowserRecord;
4615
4716
4817 type
@@ -185,6 +154,7 @@ type
185154 BrowserMaxAndFocusAction: TAction;
186155 SelectItemSaveForHTML: TAction;
187156 SelectItemSaveForDat: TAction;
157+ FileSaveAs1: TFileSaveAs;
188158 LogFolderOpenAction: TAction;
189159 TabsSaveAction: TAction;
190160 TabsOpenAction: TAction;
@@ -210,8 +180,6 @@ type
210180 UnSelectedListViewAction: TAction;
211181 WikiFAQWebPageAction: TAction;
212182 ToobarImageList: TImageList;
213- SaveDialog: TSaveDialog;
214- ThreadSizeCalcForFileAction: TAction;
215183 procedure EditNGActionExecute(Sender: TObject);
216184 procedure ReloadActionExecute(Sender: TObject);
217185 procedure GoFowardActionExecute(Sender: TObject);
@@ -393,22 +361,10 @@ type
393361 procedure MidokuActionExecute(Sender: TObject);
394362 procedure AllSelectActionExecute(Sender: TObject);
395363 procedure AllSelectActionUpdate(Sender: TObject);
396- procedure ThreadSizeCalcForFileActionExecute(Sender: TObject);
397364 private
398365 { Private 宣言 }
399- procedure ClearResFilter;
400- procedure SetResRange(range: Integer);
401- procedure SetThreadAreaHorNormal;
402- procedure SetThreadAreaHorizontal(gls : TGikoListState);
403- procedure SetThreadAreaVerNormal;
404- procedure SetThreadAreaVertical(gls : TGikoListState);
405- procedure SetThreadReadProperty(read: Boolean);
406- procedure SelectThreadSaveToFile(dat: Boolean);
407- function GetSortProperties(List: TObject;var vSortOrder: Boolean): Boolean;
408- procedure RecalcThreadSize(limit : Integer);
409366 public
410367 { Public 宣言 }
411- procedure RepaintStatusBar;
412368 published
413369 { Published 宣言 }
414370 //! TActionでGetActiveContentがnil以外で有効になる
@@ -426,16 +382,46 @@ var
426382 implementation
427383
428384 uses
429- Windows, Math, Clipbrd,
385+ Windows, Math, Messages, Dialogs, Clipbrd,
430386 Giko, GikoSystem, GikoUtil, BoardGroup,
431- FavoriteArrange, Favorite, MojuUtils,
387+ FavoriteArrange, Favorite, Setting, MojuUtils,
432388 Editor, ListSelect, Search, Option, Round,
433389 KeySetting, Gesture, Kotehan, ToolBarSetting,
434390 ToolBarUtil, NewBoard, HTMLCreate, IndividualAbon,
435- GikoBayesian, About, ShellAPI,
391+ GikoBayesian, About, ShellAPI, Graphics,
436392 RoundName, RoundData, Menus, ListViewUtils,
437- ThreadControl, GikoMessage;
393+ ThreadControl;
438394
395+const
396+ CAPTION_NAME: string = 'ギコナビ';
397+ USER_SETLINKBAR = WM_USER + 2003;
398+
399+ ITEM_ICON_SORT1 = 12; //!< ソートアイコン
400+ ITEM_ICON_SORT2 = 13; //!< ソートアイコン
401+
402+ //ツールバーアイコン
403+ TOOL_ICON_HEIGHT_MAX = 16; //!< 高さ最大アイコン
404+ TOOL_ICON_HEIGHT_MIN = 17; //!< 高さ最小アイコン
405+ TOOL_ICON_HEIGHT_NORMAL = 18; //!< 高さ標準アイコン
406+ TOOL_ICON_WIDTH_MAX = 19; //!< 幅最大アイコン
407+ TOOL_ICON_WIDTH_MIN = 20; //!< 幅最小アイコン
408+ TOOL_ICON_WIDTH_NORMAL = 21; //!< 幅標準アイコン
409+
410+ TOOL_ICON_FAV_FOLDER = 30; //!< お気に入りフォルダアイコン
411+ TOOL_ICON_FAV_BOARD = 31; //!< お気に入り板アイコン
412+ TOOL_ICON_FAV_THREAD = 32; //!< お気に入りスレアイコン
413+
414+ //! ギコナビサイトのURL
415+ URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/';
416+ //! MonazillaサイトのURL
417+ URL_MONAZILLA: string = 'http://www.monazilla.org/';
418+ //! 2ちゃんねるのURL
419+ URL_2ch: string = 'http://www.2ch.net/';
420+ //! ギコナビWikiのURL
421+ URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ';
422+
423+ SELECTCOMBOBOX_NAME: string = ''; // 'スレッド絞込検索';
424+ SELECTCOMBOBOX_COLOR: TColor = clWindow;
439425
440426 {$R *.dfm}
441427 // *************************************************************************
@@ -485,13 +471,19 @@ end;
485471 //! NGワード読み込み(一つ後ろ)
486472 // *************************************************************************
487473 procedure TGikoDM.GoFowardActionExecute(Sender: TObject);
474+var
475+ s: string;
488476 begin
489477 //一つ後ろの読み込み 失敗したらメッセージ出力
490478 if GikoSys.FAbon.GoBack =false then begin
491479 MsgBox(GikoForm.Handle, '一つ後ろのNGワードファイルの読み込みに失敗しました', 'エラー', MB_OK or MB_ICONEXCLAMATION);
492480 end else begin
493481 //ステータスに表示されるNGワードファイル名を更新
494- RepaintStatusBar;
482+ s := GikoSys.FAbon.NGwordname;
483+ GikoForm.StatusBar.Panels.Items[2].Text := s;
484+ //ステータスの表示サイズのリサイズ
485+ GikoForm.StatusBar.Panels[2].Width := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100);
486+ GikoForm.StatusBarResize(Sender);
495487 //全てのタブに再描画を設定
496488 GikoForm.RepaintAllTabsBrowser();
497489 end;
@@ -500,33 +492,24 @@ end;
500492 //! NGワード読み込み(一つ前)
501493 // *************************************************************************
502494 procedure TGikoDM.GoBackActionExecute(Sender: TObject);
495+var
496+ s: string;
503497 begin
504498 //一つ後ろの読み込み 失敗したらメッセージ出力
505499 if GikoSys.FAbon.GoForward =false then begin
506500 MsgBox(GikoForm.Handle, '一つ前のNGワードファイルの読み込みに失敗しました', 'エラー', MB_OK or MB_ICONEXCLAMATION);
507501 end else begin
508- //ステータスに表示されるNGワードファイル名を更新
509- RepaintStatusBar;
510- //全てのタブに再描画を設定
502+ //ステータスに表示されるNGワードファイル名を更新
503+ s := GikoSys.FAbon.NGwordname;
504+ GikoForm.StatusBar.Panels.Items[2].Text := s;
505+ //ステータスの表示サイズのリサイズ
506+ GikoForm.StatusBar.Panels[2].Width := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100);
507+ GikoForm.StatusBarResize(Sender);
508+ //全てのタブに再描画を設定
511509 GikoForm.RepaintAllTabsBrowser();
512510 end;
513511 end;
514512 // *************************************************************************
515-//! NGワードを変更した後のステータスバーの更新処理
516-// *************************************************************************
517-procedure TGikoDM.RepaintStatusBar;
518-var
519- s : String;
520-begin
521- //ステータスに表示されるNGワードファイル名を更新
522- s := GikoSys.FAbon.NGwordname;
523- GikoForm.StatusBar.Panels.Items[GiKo.NGWORDNAME_PANEL].Text := s;
524- //ステータスの表示サイズのリサイズ
525- GikoForm.StatusBar.Panels[GiKo.NGWORDNAME_PANEL].Width
526- := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100);
527- GikoForm.StatusBarResize(nil);
528-end;
529-// *************************************************************************
530513 //! アドレスバーに表示しているアドレスへ移動する
531514 // *************************************************************************
532515 procedure TGikoDM.MoveToActionExecute(Sender: TObject);
@@ -615,8 +598,7 @@ begin
615598 end else begin
616599 GikoForm.ClickNode.Text := InputBox( '名前の変更', 'お気に入りの新しい名前を入力してください', GikoForm.ClickNode.Text );
617600 end;
618- //更新したことを教える
619- FavoriteDM.Modified := true;
601+
620602 GikoForm.SetLinkBar;
621603 end;
622604 // *************************************************************************
@@ -644,8 +626,6 @@ begin
644626 // FClickNode.Selected.Expanded := True;
645627 GikoForm.FavoriteTreeView.Selected := Node;
646628 GikoForm.ClickNode := Node;
647- //更新したことを教える
648- FavoriteDM.Modified := true;
649629 FavoriteTreeViewRenameAction.Execute;
650630 finally
651631 end;
@@ -676,8 +656,6 @@ begin
676656 end;
677657
678658 GikoForm.ClickNode.Delete;
679- //更新したことを教える
680- FavoriteDM.Modified := true;
681659
682660 GikoForm.SetLinkBar;
683661
@@ -695,21 +673,26 @@ end;
695673 // *************************************************************************
696674 procedure TGikoDM.FavoriteTreeViewReloadActionExecute(Sender: TObject);
697675 var
676+ ThreadItem: TThreadItem;
698677 FavThread: TFavoriteThreadItem;
678+ Board: TBoard;
699679 FavBoard: TFavoriteBoardItem;
700680 shiftDown: Boolean;
701681 begin
702- if (GikoForm.ClickNode = nil) then Exit;
682+
683+ if GikoForm.ClickNode = nil then Exit;
703684
704685 shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
705686
706687 if TObject( GikoForm.ClickNode.Data ) is TFavoriteThreadItem then begin
707688 FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data );
708- if FavThread.Item <> nil then
709- GikoForm.DownloadContent(FavThread.Item, shiftDown);
689+ ThreadItem := FavThread.Item;
690+ if ThreadItem <> nil then
691+ GikoForm.DownloadContent(ThreadItem, shiftDown);
710692 end else if TObject( GikoForm.ClickNode.Data ) is TFavoriteBoardItem then begin
711693 FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data );
712- GikoForm.DownloadList(FavBoard.Item, shiftDown);
694+ Board := FavBoard.Item;
695+ GikoForm.DownloadList(Board, shiftDown);
713696 end;
714697
715698 end;
@@ -717,26 +700,73 @@ end;
717700 //! 選択されているスレッドのURLをコピーする
718701 // *************************************************************************
719702 procedure TGikoDM.FavoriteTreeViewURLCopyActionExecute(Sender: TObject);
703+var
704+ FavThread : TFavoriteThreadItem;
705+ FavBoard : TFavoriteBoardItem;
706+ s : string;
720707 begin
721708
722709 if GikoForm.ClickNode = nil then Exit;
723710
724- if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin
725- Clipboard.AsText := TFavoriteItem( GikoForm.ClickNode.Data ).URL + #13#10;
711+ if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin
712+
713+ FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data );
714+ s := FavThread.URL + #13#10;
715+ if s <> '' then
716+ Clipboard.AsText := s;
717+
718+ end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin
719+
720+ FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data );
721+ s := FavBoard.URL + #13#10;
722+ if s <> '' then
723+ Clipboard.AsText := s;
724+
726725 end;
727726 end;
728727 // *************************************************************************
729728 //! 選択されている板の名前をコピーする
730729 // *************************************************************************
731730 procedure TGikoDM.FavoriteTreeViewNameCopyActionExecute(Sender: TObject);
731+var
732+ ThreadItem: TThreadItem;
733+ FavThread: TFavoriteThreadItem;
734+ Board: TBoard;
735+ FavBoard: TFavoriteBoardItem;
736+ s: string;
732737 begin
733738
734739 if GikoForm.ClickNode = nil then Exit;
735740
736- if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin
737- Clipboard.AsText :=
738- TFavoriteItem(GikoForm.ClickNode.Data).GetItemTitle + #13#10;
741+ if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin
742+
743+ FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data );
744+ ThreadItem := FavThread.Item;
745+
746+ try
747+ s := ThreadItem.Title + #13#10;
748+ if s <> '' then
749+ Clipboard.AsText := s;
750+ finally
751+ end;
752+
753+ end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin
754+
755+ FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data );
756+ Board := FavBoard.Item;
757+ if Board <> nil then
758+ if not Board.IsThreadDatRead then
759+ GikoSys.ReadSubjectFile(Board);
760+
761+ try
762+ s := Board.Title + #13#10;
763+ if s <> '' then
764+ Clipboard.AsText := s;
765+ finally
766+ end;
767+
739768 end;
769+
740770 end;
741771 // *************************************************************************
742772 //! 選択されているスレッドの名前とURLをコピーする
@@ -744,15 +774,42 @@ end;
744774 procedure TGikoDM.FavoriteTreeViewNameURLCopyActionExecute(
745775 Sender: TObject);
746776 var
747- favItem : TFavoriteItem;
777+ ThreadItem: TThreadItem;
778+ FavThread: TFavoriteThreadItem;
779+ Board: TBoard;
780+ FavBoard: TFavoriteBoardItem;
781+ s: string;
748782 begin
749783
750784 if GikoForm.ClickNode = nil then Exit;
751785
752- if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin
753- favItem := TFavoriteItem(GikoForm.ClickNode.Data);
754- Clipboard.AsText := favItem.GetItemTitle + #13#10 +
755- favItem.URL + #13#10;
786+ if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin
787+
788+ FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data );
789+ ThreadItem := FavThread.Item;
790+
791+ try
792+ s := ThreadItem.Title + #13#10 + ThreadItem.URL + #13#10;
793+ if s <> '' then
794+ Clipboard.AsText := s;
795+ finally
796+ end;
797+
798+ end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin
799+
800+ FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data );
801+ Board := FavBoard.Item;
802+ if Board <> nil then
803+ if not Board.IsThreadDatRead then
804+ GikoSys.ReadSubjectFile(Board);
805+
806+ try
807+ s := Board.Title + #13#10 + Board.URL + #13#10;
808+ if s <> '' then
809+ Clipboard.AsText := s;
810+ finally
811+ end;
812+
756813 end;
757814
758815 end;
@@ -810,50 +867,41 @@ begin
810867
811868 end;
812869 end;
813-//! レスの絞込みフィルターを空にする
814-procedure TGikoDM.ClearResFilter;
815-var
816- FilterList : TStringList;
817-begin
818- // フィルタ文字列を空にする
819- FilterList := TStringList.Create;
820- try
821- GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
822- GikoSys.FSelectResFilter.Reverse := False;
823- finally
824- FilterList.Free;
825- end;
826- GikoForm.SelectResWord := '';
827-end;
828-// *************************************************************************
829-//! レスの表示範囲を設定する
830-// *************************************************************************
831-procedure TGikoDM.SetResRange(range: Integer);
832-begin
833- if GikoSys.ResRange <> range then begin
834- GikoSys.ResRange := range;
835- // フィルタ文字列を空にする
836- ClearResFilter;
837- GikoForm.RepaintAllTabsBrowser();
838- end;
839-end;
840870 // *************************************************************************
841871 //! 最新100レスのみ表示
842872 // *************************************************************************
843873 procedure TGikoDM.OnlyAHundredResActionExecute(Sender: TObject);
874+var
875+ FilterList : TStringList;
844876 begin
845877 if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil)
846878 and (GikoForm.ActiveContent.Browser.Busy) then Exit;
847879
848880 GikoForm.ResRangeMenuSelect := 100;
849881 OnlyAHundredResAction.Checked := True;
850- // 表示範囲を設定する
851- SetResRange(100);
882+
883+ if GikoSys.ResRange <> 100 then begin
884+ GikoSys.ResRange := 100;
885+
886+ // フィルタ文字列を空にする
887+ FilterList := TStringList.Create;
888+ try
889+ GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
890+ GikoSys.FSelectResFilter.Reverse := False;
891+ finally
892+ FilterList.Free;
893+ end;
894+
895+ GikoForm.SelectResWord := '';
896+ GikoForm.RepaintAllTabsBrowser();
897+ end;
852898 end;
853899 // *************************************************************************
854900 //! 未読レスのみ表示
855901 // *************************************************************************
856902 procedure TGikoDM.OnlyKokoResActionExecute(Sender: TObject);
903+var
904+ FilterList : TStringList;
857905 begin
858906 if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil)
859907 and (GikoForm.ActiveContent.Browser.Busy) then Exit;
@@ -861,13 +909,28 @@ begin
861909 GikoForm.ResRangeMenuSelect := Ord( grrKoko );
862910 OnlyKokoResAction.Checked := True;
863911
864- // 表示範囲を設定する
865- SetResRange(Ord( grrKoko ));
912+ if GikoSys.ResRange <> Ord( grrKoko ) then begin
913+ GikoSys.ResRange := Ord( grrKoko );
914+
915+ // フィルタ文字列を空にする
916+ FilterList := TStringList.Create;
917+ try
918+ GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
919+ GikoSys.FSelectResFilter.Reverse := False;
920+ finally
921+ FilterList.Free;
922+ end;
923+
924+ GikoForm.SelectResWord := '';
925+ GikoForm.RepaintAllTabsBrowser();
926+ end;
866927 end;
867928 // *************************************************************************
868929 //! 新着レスのみ表示
869930 // *************************************************************************
870931 procedure TGikoDM.OnlyNewResActionExecute(Sender: TObject);
932+var
933+ FilterList : TStringList;
871934 begin
872935 if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil)
873936 and (GikoForm.ActiveContent.Browser.Busy) then Exit;
@@ -875,85 +938,21 @@ begin
875938 GikoForm.ResRangeMenuSelect := Ord( grrNew );
876939 OnlyNewResAction.Checked := True;
877940
878- // 表示範囲を設定する
879- SetResRange(Ord( grrNew ));
880-end;
881-// *************************************************************************
882-//! スレッド表示エリア通常表示にする 注)ListOrientation = gloHorizontal 
883-// *************************************************************************
884-procedure TGikoDM.SetThreadAreaHorNormal;
885-begin
886- //通常表示にする
887- if GikoForm.ActiveContent <> nil then
888- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
889- GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth;
890- BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
891- BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
892- GikoSys.Setting.ListWidthState := glsNormal;
893- if GikoForm.ActiveContent <> nil then
894- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
895-end;
896-// *************************************************************************
897-//! スレッド表示エリア最大/最小表示にする 注)ListOrientation = gloHorizontal 
898-// *************************************************************************
899-procedure TGikoDM.SetThreadAreaHorizontal(gls : TGikoListState);
900-begin
901- if GikoForm.ActiveContent <> nil then
902- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
903- if GikoSys.Setting.ListWidthState = glsNormal then
904- GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width;
905- //最大表示
906- if (gls = glsMax) then begin
907- GikoForm.ViewPanel.Width := 1;
908- BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
909- BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
910- GikoSys.Setting.ListWidthState := glsMax;
911- end else if (gls = glsMin) then begin
912- GikoForm.ViewPanel.Width := GikoForm.ThreadMainPanel.Width - 80;
913- BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
914- BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
915- GikoSys.Setting.ListWidthState := glsMin;
916- end;
917- if GikoForm.ActiveContent <> nil then
918- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
919-end;
920-// *************************************************************************
921-//! スレッド表示エリア通常表示にする 注)ListOrientation = gloVertical
922-// *************************************************************************
923-procedure TGikoDM.SetThreadAreaVerNormal;
924-begin
925- //通常表示にする
926- if GikoForm.ActiveContent <> nil then
927- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
928- GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight;
929- BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
930- BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
931- GikoSys.Setting.ListHeightState := glsNormal;
932- if GikoForm.ActiveContent <> nil then
933- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
934-end;
935-// *************************************************************************
936-//! スレッド表示エリア最大/最小表示にする 注)ListOrientation = gloVertical
937-// *************************************************************************
938-procedure TGikoDM.SetThreadAreaVertical(gls : TGikoListState);
939-begin
940- if GikoForm.ActiveContent <> nil then
941- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
942- if GikoSys.Setting.ListHeightState = glsNormal then
943- GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height;
944- if (gls = glsMin) then begin
945- GikoForm.ViewPanel.Height := GikoForm.ThreadMainPanel.Height - GikoForm.BrowserCoolBar.Height - 7;
946- BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
947- BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
948- GikoSys.Setting.ListHeightState := glsMin;
949- end else if (gls = glsMax) then begin
950- GikoForm.ViewPanel.Height := 1;
951- BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
952- BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
953- GikoSys.Setting.ListHeightState := glsMax;
941+ if GikoSys.ResRange <> Ord( grrNew ) then begin
942+ GikoSys.ResRange := Ord( grrNew );
943+
944+ // フィルタ文字列を空にする
945+ FilterList := TStringList.Create;
946+ try
947+ GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
948+ GikoSys.FSelectResFilter.Reverse := False;
949+ finally
950+ FilterList.Free;
951+ end;
952+
953+ GikoForm.SelectResWord := '';
954+ GikoForm.RepaintAllTabsBrowser();
954955 end;
955- if GikoForm.ActiveContent <> nil then
956- SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
957956 end;
958957 // *************************************************************************
959958 //! スレッド表示エリアを大きく表示する
@@ -964,22 +963,54 @@ begin
964963 case GikoSys.Setting.ListWidthState of
965964 glsMax: begin
966965 //通常表示にする
967- SetThreadAreaHorNormal;
966+ if GikoForm.ActiveContent <> nil then
967+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
968+ GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth;
969+ BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
970+ BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
971+ GikoSys.Setting.ListWidthState := glsNormal;
972+ if GikoForm.ActiveContent <> nil then
973+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
968974 end;
969975 glsMin, glsNormal: begin
970976 //最大表示にする
971- SetThreadAreaHorizontal(glsMax);
977+ if GikoForm.ActiveContent <> nil then
978+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
979+ if GikoSys.Setting.ListWidthState = glsNormal then
980+ GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width;
981+ if GikoForm.ActiveContent <> nil then
982+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
983+ GikoForm.ViewPanel.Width := 1;
984+ BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
985+ BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
986+ GikoSys.Setting.ListWidthState := glsMax;
972987 end;
973988 end;
974989 end else begin
975990 case GikoSys.Setting.ListHeightState of
976991 glsMax: begin
977992 //通常表示にする
978- SetThreadAreaVerNormal;
993+ if GikoForm.ActiveContent <> nil then
994+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
995+ GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight;
996+ BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
997+ BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
998+ GikoSys.Setting.ListHeightState := glsNormal;
999+ if GikoForm.ActiveContent <> nil then
1000+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
9791001 end;
9801002 glsMin, glsNormal: begin
9811003 //最大表示にする
982- SetThreadAreaVertical(glsMax);
1004+ if GikoForm.ActiveContent <> nil then
1005+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
1006+ if GikoSys.Setting.ListHeightState = glsNormal then
1007+ GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height;
1008+ if GikoForm.ActiveContent <> nil then
1009+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
1010+ GikoForm.ViewPanel.Height := 1;
1011+ BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1012+ BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1013+ GikoSys.Setting.ListHeightState := glsMax;
9831014 end;
9841015 end;
9851016 end;
@@ -993,22 +1024,54 @@ begin
9931024 case GikoSys.Setting.ListWidthState of
9941025 glsMax, glsNormal: begin
9951026 //最小表示にする
996- SetThreadAreaHorizontal(glsMin);
1027+ if GikoForm.ActiveContent <> nil then
1028+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
1029+ if GikoSys.Setting.ListWidthState = glsNormal then
1030+ GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width;
1031+ if GikoForm.ActiveContent <> nil then
1032+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
1033+ GikoForm.ViewPanel.Width := GikoForm.ThreadMainPanel.Width - 80;
1034+ BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1035+ BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL;
1036+ GikoSys.Setting.ListWidthState := glsMin;
9971037 end;
9981038 glsMin: begin
9991039 //通常表示にする
1000- SetThreadAreaHorNormal;
1040+ if GikoForm.ActiveContent <> nil then
1041+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
1042+ GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth;
1043+ BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX;
1044+ BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN;
1045+ GikoSys.Setting.ListWidthState := glsNormal;
1046+ if GikoForm.ActiveContent <> nil then
1047+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
10011048 end;
10021049 end;
10031050 end else begin
10041051 case GikoSys.Setting.ListHeightState of
10051052 glsMax, glsNormal: begin
10061053 //最小表示にする
1007- SetThreadAreaVertical(glsMin);
1054+ if GikoForm.ActiveContent <> nil then
1055+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
1056+ if GikoSys.Setting.ListHeightState = glsNormal then
1057+ GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height;
1058+ GikoForm.ViewPanel.Height := GikoForm.ThreadMainPanel.Height - GikoForm.BrowserCoolBar.Height - 7;
1059+ BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1060+ BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL;
1061+ GikoSys.Setting.ListHeightState := glsMin;
1062+ if GikoForm.ActiveContent <> nil then
1063+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
10081064 end;
10091065 glsMin: begin
10101066 //通常表示にする
1011- SetThreadAreaVerNormal;
1067+ if GikoForm.ActiveContent <> nil then
1068+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //描画停止
1069+ GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight;
1070+ BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX;
1071+ BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN;
1072+ GikoSys.Setting.ListHeightState := glsNormal;
1073+ if GikoForm.ActiveContent <> nil then
1074+ SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //描画
10121075 end;
10131076 end;
10141077 end;
@@ -1062,7 +1125,7 @@ begin
10621125 if Item = nil then Exit;
10631126 Editor := TEditorForm.Create(GikoForm.GetMainForm);
10641127 Editor.SetThreadItem(Item);
1065- GikoSys.LoadKeySetting(Editor.ActionList, GikoSys.GetEditorKeyFileName);
1128+ GikoSys.LoadEditorKeySetting(Editor.ActionList);
10661129 Editor.Show;
10671130 Editor.BodyEdit.SetFocus;
10681131 end;
@@ -1403,6 +1466,8 @@ end;
14031466 //! 全てのレスを表示する
14041467 // *************************************************************************
14051468 procedure TGikoDM.AllResActionExecute(Sender: TObject);
1469+var
1470+ FilterList : TStringList;
14061471 begin
14071472 if(GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil )
14081473 and (GikoForm.ActiveContent.Browser.Busy) then Exit;
@@ -1410,8 +1475,22 @@ begin
14101475 GikoForm.ResRangeMenuSelect := Ord( grrAll );
14111476 AllResAction.Checked := True;
14121477
1413- // 表示範囲を設定する
1414- SetResRange(Ord( grrAll ));
1478+ if GikoSys.ResRange <> Ord( grrAll ) then begin
1479+ GikoSys.ResRange := Ord( grrAll );
1480+
1481+ // フィルタ文字列を空にする
1482+ FilterList := TStringList.Create;
1483+ try
1484+ GikoSys.FSelectResFilter.LoadFromStringList( FilterList );
1485+ GikoSys.FSelectResFilter.Reverse := False;
1486+ finally
1487+ FilterList.Free;
1488+ end;
1489+
1490+ GikoForm.SelectResWord := '';
1491+
1492+ GikoForm.RepaintAllTabsBrowser();
1493+ end;
14151494 end;
14161495 // *************************************************************************
14171496 //! レスの表示範囲を設定
@@ -1562,8 +1641,8 @@ begin
15621641 Dlg := TKeySettingForm.Create(GikoForm);
15631642 try
15641643 if Dlg.ShowModal = mrOk then begin
1565- GikoSys.SaveKeySetting(GikoFormActionList, Setting.KEY_SETTING_FILE_NAME);
1566- GikoSys.SaveKeySetting(Dlg.EditorForm.ActionList, Setting.KEY_SETTING_FILE_NAME);
1644+ GikoSys.SaveKeySetting(GikoFormActionList);
1645+ GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList);
15671646 GikoSys.Setting.Gestures.SaveGesture( GikoSys.Setting.GetGestureFileName );
15681647 end;
15691648
@@ -1822,7 +1901,7 @@ begin
18221901 //ログアウト
18231902 GikoSys.Dolib.Disconnect;
18241903 LoginAction.Checked := False;
1825- GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmLogout), nil, gmiOK);
1904+ GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmLogout)), nil, gmiOK);
18261905 LoginAction.Caption := 'ログイン(&L)';
18271906 end else begin
18281907 TmpCursor := GikoForm.ScreenCursor;
@@ -1842,7 +1921,7 @@ begin
18421921 end;
18431922 if GikoSys.Dolib.Connect then begin
18441923 LoginAction.Checked := True;
1845- GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmLogin) + GikoSys.Setting.UserID, nil, gmiOK);
1924+ GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmLogin)) + GikoSys.Setting.UserID, nil, gmiOK);
18461925 LoginAction.Caption := 'ログアウト(&L)';
18471926 //LoginToolButton.Style := tbsCheck;
18481927 end else begin
@@ -1872,7 +1951,7 @@ begin
18721951 GikoSys.Dolib.ForcedConnect;
18731952 if GikoSys.Dolib.Connect then begin
18741953 LoginAction.Checked := True;
1875- GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmForceLogin) + GikoSys.Setting.UserID, nil, gmiOK);
1954+ GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmForceLogin)) + GikoSys.Setting.UserID, nil, gmiOK);
18761955 LoginAction.Caption := 'ログアウト(&L)';
18771956 //LoginToolButton.Style := tbsCheck;
18781957 end else begin
@@ -2043,9 +2122,9 @@ begin
20432122 end;
20442123 end;
20452124 // *************************************************************************
2046-//! 選択スレッドをファイルに保存する
2125+//! 選択スレッドをHTML化して保存
20472126 // *************************************************************************
2048-procedure TGikoDM.SelectThreadSaveToFile(dat: Boolean);
2127+procedure TGikoDM.SelectItemSaveForHTMLExecute(Sender: TObject);
20492128 var
20502129 List: TList;
20512130 i: Integer;
@@ -2064,34 +2143,20 @@ begin
20642143 else if(List.Count = 0) then
20652144 ShowMessage('スレッドを選択してください')
20662145 else begin
2067- if dat then begin
2068- SaveDialog.Title := '選択スレッドをdatのまま保存';
2069- SaveDialog.Filter := 'DATファイル(*.dat)|*.dat';
2070- end else begin
2071- SaveDialog.Title := '選択スレッドをHTML化して保存';
2072- SaveDialog.Filter := 'HTMLファイル(*.html)|*.html';
2073- end;
2146+ FileSaveAs1.Dialog.Title := '選択スレッドをHTML化して保存';
2147+ FileSaveAs1.Dialog.Filter := 'HTMLファイル(*.html)|*.html';
20742148 for i := 0 to List.Count - 1 do begin
20752149 if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin
2076- if dat then begin
2077- SaveDialog.FileName := TThreadItem(List[i]).FileName;
2078- end else begin
2079- SaveDialog.FileName := ReplaseNoValidateChar(TThreadItem(List[i]).Title) + '.html';
2080- end;
2081- if SaveDialog.Execute then begin
2082- if dat then begin
2083- CopyFile(PChar(TThreadItem(List[i]).FilePath),
2084- PChar(SaveDialog.FileName), true);
2085- end else begin
2086- html := TStringList.Create;
2087- title := TThreadItem(List[i]).Title;
2088- try
2089- HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title);
2090- html.SaveToFile(SaveDialog.FileName);
2091- THTMLCreate.SkinorCSSFilesCopy(ExtractFilePath(SaveDialog.FileName));
2092- finally
2093- html.Free;
2094- end;
2150+ FileSaveAs1.Dialog.FileName := ReplaseNoValidateChar(TThreadItem(List[i]).Title) + '.html';
2151+ if FileSaveAs1.Dialog.Execute then begin
2152+ html := TStringList.Create;
2153+ title := TThreadItem(List[i]).Title;
2154+ try
2155+ HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title);
2156+ html.SaveToFile(FileSaveAs1.Dialog.FileName);
2157+ THTMLCreate.SkinorCSSFilesCopy(ExtractFilePath(FileSaveAs1.Dialog.FileName));
2158+ finally
2159+ html.Free;
20952160 end;
20962161 end;
20972162 end;
@@ -2103,18 +2168,42 @@ begin
21032168 end;
21042169 end;
21052170 // *************************************************************************
2106-//! 選択スレッドをHTML化して保存
2107-// *************************************************************************
2108-procedure TGikoDM.SelectItemSaveForHTMLExecute(Sender: TObject);
2109-begin
2110- SelectThreadSaveToFile(false);
2111-end;
2112-// *************************************************************************
21132171 //! 選択スレッドをDAT形式のまま保存
21142172 // *************************************************************************
21152173 procedure TGikoDM.SelectItemSaveForDatExecute(Sender: TObject);
2174+var
2175+ List: TList;
2176+ i: Integer;
21162177 begin
2117- SelectThreadSaveToFile(true);
2178+ List := TList.Create;
2179+ try
2180+ GikoForm.ScreenCursor := crHourGlass;
2181+ GikoForm.SelectListItem(List);
2182+ if ((GikoSys.Setting.ListOrientation = gloVertical) and
2183+ (GikoSys.Setting.ListHeightState = glsMax)) or
2184+ ((GikoSys.Setting.ListOrientation = gloHorizontal) and
2185+ (GikoSys.Setting.ListWidthState = glsMax)) then
2186+ ShowMessage('スレッド一覧を表示してください')
2187+ else if(List.Count = 0) then
2188+ ShowMessage('スレッドを選択してください')
2189+ else begin
2190+ FileSaveAs1.Dialog.Title := '選択スレッドをdatのまま保存';
2191+ FileSaveAs1.Dialog.Filter := 'DATファイル(*.dat)|*.dat';
2192+ for i := 0 to List.Count - 1 do begin
2193+ if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin
2194+ FileSaveAs1.Dialog.FileName := TThreadItem(List[i]).FileName;
2195+ if FileSaveAs1.Dialog.Execute then begin
2196+ CopyFile(PChar(TThreadItem(List[i]).FilePath),
2197+ PChar(FileSaveAs1.Dialog.FileName), true);
2198+ end;
2199+ end;
2200+ end;
2201+ end;
2202+ finally
2203+ GikoForm.ScreenCursor := crDefault;
2204+ List.Free;
2205+ end;
2206+
21182207 end;
21192208 // *************************************************************************
21202209 //! タブの順番を保存
@@ -2227,7 +2316,7 @@ begin
22272316
22282317 Editor := TEditorForm.Create(GikoForm);
22292318 Editor.SetThreadItem(Item);
2230- GikoSys.LoadKeySetting(Editor.ActionList, GikoSys.GetEditorKeyFileName);
2319+ GikoSys.LoadEditorKeySetting(Editor.ActionList);
22312320 Editor.BodyEdit.Text := '>>' + IntToStr(Number) + #13#10;
22322321 Editor.Show;
22332322 Editor.BodyEdit.SetFocus;
@@ -3048,44 +3137,26 @@ begin
30483137
30493138 end;
30503139 // *************************************************************************
3051-//! スレ一覧の表示している内容にしたがって、ソートカラムの位置と方向を取得する
3052-// *************************************************************************
3053-function TGikoDM.GetSortProperties(List: TObject;
3054- var vSortOrder: Boolean): Boolean;
3055-begin
3056- Result := True;
3057- if (List <> nil) then begin
3058- if (List is TBBS) then begin
3059- vSortOrder := GikoSys.Setting.BBSSortOrder;
3060- end else if (List is TCategory) then begin
3061- vSortOrder := GikoSys.Setting.CategorySortOrder;
3062- end else if (List is TBoard) then begin
3063- vSortOrder := GikoSys.Setting.BoardSortOrder;
3064- end else begin
3065- Result := False;
3066- end;
3067- end else begin
3068- Result := False;
3069- end;
3070-end;
3071-// *************************************************************************
30723140 //! 現在のカラムをソートする
30733141 // *************************************************************************
30743142 procedure TGikoDM.SortActiveColumnActionExecute(Sender: TObject);
30753143 var
30763144 i : Integer;
30773145 so : boolean;
3146+ si : Integer;
30783147 begin
3079- if GetSortProperties(GikoForm.GetActiveList, so) then begin
3080- for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin
3081- if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or
3082- (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT2) then begin
3083- so := not so;
3084- TListViewUtils.ListViewSort(nil, GikoForm.ListView,
3085- GikoForm.ListView.Column[ i ], ListNumberVisibleAction.Checked,
3086- so);
3087- break;
3088- end;
3148+ for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin
3149+ if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or
3150+ (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT2) then begin
3151+ GikoForm.SortOrder := not GikoForm.SortOrder;
3152+ so := GikoForm.SortOrder;
3153+ si := GikoForm.SortIndex;
3154+ TListViewUtils.ListViewSort(nil, GikoForm.ListView,
3155+ GikoForm.ListView.Column[ i ], ListNumberVisibleAction.Checked,
3156+ so, si );
3157+ GikoForm.SortIndex := si;
3158+ GikoForm.SortOrder := so;
3159+ break;
30893160 end;
30903161 end;
30913162 end;
@@ -3095,6 +3166,8 @@ end;
30953166 procedure TGikoDM.SortNextColumnActionExecute(Sender: TObject);
30963167 var
30973168 i, id : Integer;
3169+ so : boolean;
3170+ si : Integer;
30983171 begin
30993172 for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin
31003173 if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or
@@ -3102,9 +3175,14 @@ begin
31023175 id := i + 1;
31033176 if id > GikoForm.ListView.Columns.Count - 1 then
31043177 id := 0;
3178+ GikoForm.SortOrder := id = 0;
3179+ so := GikoForm.SortOrder;
3180+ si := GikoForm.SortIndex;
31053181 TListViewUtils.ListViewSort( nil, GikoForm.ListView,
31063182 GikoForm.ListView.Column[ id ], ListNumberVisibleAction.Checked,
3107- id = 0);
3183+ so, si );
3184+ GikoForm.SortIndex := si;
3185+ GikoForm.SortOrder := so;
31083186 break;
31093187 end;
31103188 end;
@@ -3115,6 +3193,8 @@ end;
31153193 procedure TGikoDM.SortPrevColumnActionExecute(Sender: TObject);
31163194 var
31173195 i, id : Integer;
3196+ so : boolean;
3197+ si : Integer;
31183198 begin
31193199 for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin
31203200 if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or
@@ -3122,9 +3202,14 @@ begin
31223202 id := i - 1;
31233203 if id < 0 then
31243204 id := GikoForm.ListView.Columns.Count - 1;
3205+ GikoForm.SortOrder := id = 0;
3206+ so := GikoForm.SortOrder;
3207+ si := GikoForm.SortIndex;
31253208 TListViewUtils.ListViewSort( nil, GikoForm.ListView,
31263209 GikoForm.ListView.Column[ id ], ListNumberVisibleAction.Checked,
3127- id = 0);
3210+ so, si );
3211+ GikoForm.SortIndex := si;
3212+ GikoForm.SortOrder := so;
31283213 break;
31293214 end;
31303215 end;
@@ -3649,20 +3734,33 @@ end;
36493734 //! 選択されているスレッドを既読にする
36503735 // *************************************************************************
36513736 procedure TGikoDM.KidokuActionExecute(Sender: TObject);
3737+var
3738+ List: TList;
3739+ i: Integer;
36523740 begin
3653- SetThreadReadProperty(true);
3741+ List := TList.Create;
3742+ try
3743+ GikoForm.SelectListItem(List);
3744+ for i := 0 to List.Count - 1 do begin
3745+ if TObject(List[i]) is TThreadItem then begin
3746+ if (TThreadItem(List[i]).UnRead) then begin
3747+ TThreadItem(List[i]).UnRead := false;
3748+ TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1;
3749+ end;
3750+ end;
3751+ end;
3752+ if GikoForm.TreeView.Visible then
3753+ GikoForm.TreeView.Refresh;
3754+ if GikoForm.ListView.Visible then
3755+ GikoForm.ListView.Refresh;
3756+ finally
3757+ List.Free;
3758+ end;
36543759 end;
36553760 // *************************************************************************
36563761 //! 選択されているスレッドを未読にする
36573762 // *************************************************************************
36583763 procedure TGikoDM.MidokuActionExecute(Sender: TObject);
3659-begin
3660- SetThreadReadProperty(false);
3661-end;
3662-// *************************************************************************
3663-//! 選択されているスレッドの未読・既読を設定する true : 既読 false : 未読
3664-// *************************************************************************
3665-procedure TGikoDM.SetThreadReadProperty(read: Boolean);
36663764 var
36673765 List: TList;
36683766 i: Integer;
@@ -3672,8 +3770,9 @@ begin
36723770 GikoForm.SelectListItem(List);
36733771 for i := 0 to List.Count - 1 do begin
36743772 if TObject(List[i]) is TThreadItem then begin
3675- if (TThreadItem(List[i]).IsLogFile) then begin
3676- TThreadItem(List[i]).UnRead := not read;
3773+ if (TThreadItem(List[i]).IsLogFile) and (not TThreadItem(List[i]).UnRead) then begin
3774+ TThreadItem(List[i]).UnRead := true;
3775+ TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1;
36773776 end;
36783777 end;
36793778 end;
@@ -3700,88 +3799,5 @@ begin
37003799 AllSelectAction.Enabled := GikoForm.ListView.SelCount > 0;
37013800 end;
37023801 ////////////////////////////////編集までおしまい/////////////////////
3703-//! スレッドのサイズを再計算する
3704-procedure TGikoDM.ThreadSizeCalcForFileActionExecute(Sender: TObject);
3705-const
3706- RECALC_MES : String = 'スレッドの容量をファイルから再計算します。'#13#10 +
3707- 'この操作中、ギコナビの他の操作をするとデータが破壊される恐れがあります。' +
3708- 'またこの操作は、非常に時間がかかる場合がありますが、よろしいですか?';
3709- RECALC_TITLE : String = 'スレッドの容量をファイルから再計算';
3710- LIMIT_SIZE = 1024;
3711-var
3712- limitSize : Integer;
3713- limitStr : String;
3714-begin
3715-{ まず、時間がかかることを警告するメッセージを出力
3716- 再計算するスレッドのサイズの閾値(デフォルト1024B)を確認
3717- プラグインを利用しないところで全てのログ有りスレッドを検索
3718- 閾値以下のサイズの場合、DATのファイルサイズと比較、ずれていれば、
3719- DATのファイルサイズで更新する
3720-}
3721- if MsgBox(GikoForm.Handle, RECALC_MES,
3722- RECALC_TITLE, MB_YESNO or MB_ICONWARNING) = ID_YES then begin
3723- //閾値の確認
3724- limitSize := LIMIT_SIZE;
3725- limitStr := IntToStr(limitSize);
3726- if InputQuery('閾値入力', '指定した数値 B以下の容量のスレッドのみ再計算します', limitStr) then begin
3727- limitSize := StrToInt(MojuUtils.ZenToHan(limitStr));
3728- if (limitSize < 0) then begin
3729- ShowMessage('閾値に負は指定できません!');
3730- ThreadSizeCalcForFileActionExecute(nil);
3731- end else begin
3732- RecalcThreadSize(limitSize);
3733- end;
3734- end;
3735- end;
3736-end;
3737-//! limitよりもサイズの小さいスレッドの容量をDATファイルから計算
3738-procedure TGikoDM.RecalcThreadSize(limit : Integer);
3739-var
3740- i, j, tmpSize : Integer;
3741- Obj : TObject;
3742- Board : TBoard;
3743- Thread: TThreadItem;
3744- dat : TStringList;
3745-begin
3746- // 再計算スタート プラグインを利用しないところを全部見る!
3747- GikoForm.ScreenCursor := crHourGlass;
3748- try
3749- GikoForm.ProgressBar.Max := BoardGroups[0].Count;
3750- for i := 0 to BoardGroups[0].Count - 1 do begin
3751- Obj := BoardGroups[0].Objects[i];
3752- if (Obj <> nil) then begin
3753- Board := TBoard(Obj);
3754- if not Board.IsThreadDatRead then begin
3755- GikoSys.ReadSubjectFile(Board);
3756- end;
3757- for j := 0 to Board.Count - 1 do begin
3758- Thread := Board.Items[j];
3759- if (Thread <> nil) and (Thread.IsLogFile)
3760- and (Thread.Size <= limit) then begin
3761- dat := TStringList.Create;
3762- try
3763- tmpSize := Thread.Size;
3764- try
3765- dat.LoadFromFile(Thread.GetThreadFileName);
3766- tmpSize := Length(dat.Text);
3767- tmpSize := tmpSize - dat.Count;
3768- except
3769- end;
3770- Thread.Size := tmpSize;
3771- finally
3772- dat.Free;
3773- end;
3774- end;
3775- end;
3776- end;
3777- GikoForm.ProgressBar.StepBy(1);
3778- end;
3779- finally
3780- GikoForm.ScreenCursor := crDefault;
3781- end;
3782- GikoForm.ProgressBar.Position := 0;
3783- ShowMessage('計算終了しました。');
3784-end;
3785-
37863802 end.
37873803
--- a/GikoMessage.pas
+++ /dev/null
@@ -1,68 +0,0 @@
1-unit GikoMessage;
2-
3-interface
4-
5-uses
6- Classes, IniFiles;
7-
8-type
9- //! MessageList
10- TGikoMessageListType = (gmLogout, gmLogin, gmForceLogin, gmSureItiran,
11- gmUnKnown, gmSureSyutoku, gmSureDiff, gmNotMod, gmAbort, gmError,
12- gmNewRes, gmNewSure, gmResError, gmSureError);
13-
14- TGikoMessage = class(THashedStringList)
15- private
16- public
17- constructor Create;
18- function GetMessage(MesType: TGikoMessageListType): String;
19- end;
20-
21-implementation
22-
23-const
24- DEF_MESSAGES : array[0..13] of string = ( 'ログアウトしました',
25- 'ログインしました - ',
26- '強制ログインしました - ',
27- '[スレ一覧取得完了]',
28- '(名称不明)',
29- '[スレ取得完了]',
30- '[スレ差分取得完了]',
31- '[未更新]',
32- '[中断]',
33- '[エラー]',
34- '[レス送信終了]',
35- '[新スレ送信終了]',
36- '[レス送信失敗]',
37- '[新スレ送信失敗]');
38-
39- MESSAGE_KEYS : array[0..13] of String = ( 'Logout', 'Login',
40- 'ForceLogin', 'SureItiran',
41- 'UnKnown', 'SureSyutoku',
42- 'SureDiff', 'NotMod',
43- 'Abort', 'Error',
44- 'NewRes', 'NewSure',
45- 'ResError', 'SureError');
46-
47-constructor TGikoMessage.Create;
48-begin
49- inherited Create;
50- Self.Sorted := true;
51- Self.Duplicates := dupIgnore;
52-end;
53-//! MesTypeで指定されたメッセージ文字列を取得する
54-function TGikoMessage.GetMessage(MesType: TGikoMessageListType): String;
55-begin
56- Result := '';
57- if MesType in [gmLogout..gmSureError] then begin
58- //Keyで検索して見つかればそれを返す
59- Result := Self.Values[MESSAGE_KEYS[Ord(MesType)]];
60- if Result = '' then begin
61- //見つからないので、デフォルトで返す
62- Result := DEF_MESSAGES[Ord(MesType)];
63- end;
64- end;
65-end;
66-
67-end.
68-
\ No newline at end of file
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -4,7 +4,7 @@ interface
44
55 uses
66 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
7- ComCtrls, {IniFiles,} ShellAPI, ActnList, Math,
7+ ComCtrls, IniFiles, ShellAPI, ActnList, Math,
88 {$IF Defined(DELPRO) }
99 SHDocVw,
1010 MSHTML,
@@ -12,10 +12,10 @@ uses
1212 SHDocVw_TLB,
1313 MSHTML_TLB,
1414 {$IFEND}
15- {HttpApp,} URLMon, IdGlobal, IdURI, {Masks,}
15+ {HttpApp,} YofUtils, URLMon, IdGlobal, IdURI, {Masks,}
1616 Setting, BoardGroup, gzip, Dolib, bmRegExp, AbonUnit,
1717 ExternalBoardManager, ExternalBoardPlugInMain,
18- GikoBayesian, GikoMessage;
18+ Sort, GikoBayesian;
1919
2020 type
2121 TVerResourceKey = (
@@ -76,9 +76,6 @@ type
7676 FCount: Integer;
7777 end;
7878
79- //! レスレコードへのポインタ
80- PResRec = ^TResRec;
81-
8279 //! レスレコード
8380 TResRec = record
8481 FTitle: string;
@@ -102,6 +99,11 @@ type
10299 FNoParam: Boolean; //!< レス番パラメータなし
103100 end;
104101
102+ //! MessageList
103+ TGikoMessageListType = (gmLogout, gmLogin, gmForceLogin, gmSureItiran,
104+ gmUnKnown, gmSureSyutoku, gmSureDiff, gmNotMod, gmAbort, gmError,
105+ gmNewRes, gmNewSure, gmResError, gmSureError);
106+
105107 TGikoSys = class(TObject)
106108 private
107109 { Private 宣言 }
@@ -111,7 +113,8 @@ type
111113 FResRange : Longint;
112114 FBayesian : TGikoBayesian; //!< ベイジアンフィルタ
113115 FVersion : String; //!< ファイルバージョン
114- FGikoMessage: TGikoMessage;
116+// FExitWrite: TStringList;
117+// function StrToFloatDef(s: string; Default: Double): Double;
115118 public
116119 { Public 宣言 }
117120 FAbon : TAbon;
@@ -150,8 +153,6 @@ type
150153 function GetUserAgent: string;
151154 function GetSambaFileName : string;
152155
153- function GetMainKeyFileName : String;
154- function GetEditorKeyFileName: String;
155156 procedure ReadSubjectFile(Board: TBoard);
156157 procedure CreateThreadDat(Board: TBoard);
157158 procedure WriteThreadDat(Board: TBoard);
@@ -172,6 +173,7 @@ type
172173
173174 function GetFileSize(FileName : string) : longint;
174175 function GetFileLineCount(FileName : string): longint;
176+ function Get2chDate(aDate: TDateTime): string;
175177 function IntToDateTime(val: Int64): TDateTime;
176178 function DateTimeToInt(ADate: TDateTime): Int64;
177179
@@ -181,13 +183,17 @@ type
181183
182184 function RemoveToken(var s:string; const delimiter:string):string;
183185 function GetTokenIndex(s: string; delimiter: string; index: Integer): string;
186+ function DeleteLink(const s: string): string;
184187
185188 function GetShortName(const LongName: string; ALength: integer): string;
186189 function BoolToInt(b: Boolean): Integer;
187190 function IntToBool(i: Integer): Boolean;
188191 function GzipDecompress(ResStream: TStream; ContentEncoding: string): string;
189- procedure LoadKeySetting(ActionList: TActionList; FileName: String);
190- procedure SaveKeySetting(ActionList: TActionList; FileName: String);
192+ procedure LoadKeySetting(ActionList: TActionList);
193+ procedure SaveKeySetting(ActionList: TActionList);
194+ procedure LoadEditorKeySetting(ActionList: TActionList);
195+ procedure SaveEditorKeySetting(ActionList: TActionList);
196+
191197 procedure CreateProcess(const AppPath: string; const Param: string);
192198 procedure OpenBrowser(URL: string; BrowserType: TGikoBrowserType);
193199 function HTMLDecode(const AStr: String): String;
@@ -241,10 +247,6 @@ type
241247 //! IEのバージョン情報の取得
242248 function GetIEVersion: string;
243249 function SetUserOptionalStyle(): string;
244- //! ギコナビのメッセージを設定する
245- procedure SetGikoMessage;
246- //! ギコナビのメッセージを取得する
247- function GetGikoMessage(MesType: TGikoMessageListType): String;
248250 end;
249251
250252 var
@@ -263,8 +265,7 @@ const
263265 implementation
264266
265267 uses
266- Giko, RoundData, Favorite, Registry, HTMLCreate, MojuUtils, Sort, YofUtils,
267- IniFiles;
268+ Giko, RoundData, Favorite, Registry, HTMLCreate, MojuUtils;
268269
269270 const
270271 FOLDER_INDEX_VERSION = '1.01';
@@ -321,8 +322,6 @@ begin
321322 FVersion := Trim(GetVersionInfo(vrFileVersion));
322323 FBayesian := TGikoBayesian.Create;
323324 //FBoardURLList := TStringList.Create;
324- //メッセージの作成
325- FGikoMessage := TGikoMessage.Create;
326325 end;
327326
328327 // *************************************************************************
@@ -343,7 +342,6 @@ begin
343342 FDolib.Free;
344343 FAbon.Free;
345344 FSelectResFilter.Free;
346- FGikoMessage.Free;
347345 //FBoardURLList.Free;
348346 //テンポラリHTMLを削除
349347 FileList := TStringList.Create;
@@ -525,6 +523,19 @@ begin
525523 end;
526524
527525 {!
526+\brief 2ちゃんねる方式時刻取得
527+\param 変換する時刻
528+\return 2ちゃんねる方式で時刻を表した文字列
529+}
530+function TGikoSys.Get2chDate(aDate: TDateTime): string;
531+var
532+ d2: TDateTime;
533+begin
534+ d2 := aDate - EncodeTime(9, 0, 0, 0);
535+ Result := FloatToStr(Trunc((d2 - ZERO_DATE) * 86400));
536+end;
537+
538+{!
528539 \brief 経過秒を TDateTime に変換
529540 \param val 1970/1/1/ 00:00:00 からの経過秒
530541 \return val を示す TDateTime
@@ -699,13 +710,13 @@ begin
699710 Board.BoardPlugIn,
700711 Board,
701712 Board.BoardPlugIn.FileName2ThreadURL( DWORD( Board ), FileList[i] ) );
702- THTMLCreate.DivideStrLine(Board.BoardPlugIn.GetDat( DWORD( ThreadItem ), 1 ), @ResRec);
713+ ResRec := DivideStrLine(Board.BoardPlugIn.GetDat( DWORD( ThreadItem ), 1 ));
703714 end else begin
704715 ThreadItem := TThreadItem.Create(
705716 nil,
706717 Board,
707718 Get2chBoard2ThreadURL( Board, ChangeFileExt( FileList[i], '' ) ) );
708- THTMLCreate.DivideStrLine(ReadThreadFile(FileName, 1), @ResRec);
719+ ResRec := DivideStrLine(ReadThreadFile(FileName, 1));
709720 end;
710721
711722 ThreadItem.BeginUpdate;
@@ -720,7 +731,7 @@ begin
720731 ThreadItem.RoundDate := ZERO_DATE;
721732 ThreadItem.LastModified := ZERO_DATE;
722733 ThreadItem.Kokomade := -1;
723- ThreadItem.NewReceive := 0;
734+ ThreadItem.NewReceive := ThreadItem.Count;
724735 ThreadItem.ParentBoard := Board;
725736 ThreadItem.IsLogFile := True;
726737 ThreadItem.Round := False;
@@ -1405,6 +1416,39 @@ begin
14051416 Result := RemoveToken(s, delimiter);
14061417 end;
14071418
1419+{!
1420+\brief HTML からアンカータグを削除
1421+\param s 元になる HTML
1422+\return アンカータグが削除された HTML
1423+}
1424+function TGikoSys.DeleteLink(const s: string): string;
1425+var
1426+ s1: string;
1427+ s2: string;
1428+ idx: Integer;
1429+ i: Integer;
1430+begin
1431+ i := 0;
1432+ Result := '';
1433+ while True do begin
1434+ s1 := GetTokenIndex(s, '<a href="', i);
1435+ s2 := GetTokenIndex(s, '<a href="', i + 1);
1436+
1437+ idx := Pos('">', s1);
1438+ if idx <> 0 then
1439+ Delete(s1, 1, idx + 1);
1440+ idx := Pos('">', s2);
1441+ if idx <> 0 then
1442+ Delete(s2, 1, idx + 1);
1443+
1444+ Result := Result + s1 + s2;
1445+
1446+ if s2 = '' then
1447+ Break;
1448+
1449+ inc(i, 2);
1450+ end;
1451+end;
14081452
14091453 //インデックス未更新バッファをフラッシュ!
14101454 {procedure TGikoSys.FlashExitWrite;
@@ -1554,9 +1598,11 @@ end;
15541598 {!
15551599 \brief アクションにショートカットキーを設定
15561600 \param ActionList 設定するアクション一覧
1557-\param FileName Iniファイルの名前
1601+\todo STD_SEC を GetXXXFileName() に追い出せ
1602+
1603+KeySetting.ini に保存されているショートカットキーを ActionList に設定します。
15581604 }
1559-procedure TGikoSys.LoadKeySetting(ActionList: TActionList; FileName: String);
1605+procedure TGikoSys.LoadKeySetting(ActionList: TActionList);
15601606 const
15611607 STD_SEC = 'KeySetting';
15621608 var
@@ -1567,10 +1613,10 @@ var
15671613 SecList: TStringList;
15681614 Component: TComponent;
15691615 begin
1570- if not FileExists(fileName) then
1616+ if not FileExists(GetConfigDir + KEY_SETTING_FILE_NAME) then
15711617 Exit;
15721618 SecList := TStringList.Create;
1573- ini := TMemIniFile.Create(fileName);
1619+ ini := TMemIniFile.Create(GetConfigDir + KEY_SETTING_FILE_NAME);
15741620 try
15751621 ini.ReadSection(STD_SEC, SecList);
15761622 for i := 0 to SecList.Count - 1 do begin
@@ -1592,18 +1638,18 @@ end;
15921638 {!
15931639 \brief アクションに設定されているショートカットキーをファイルに保存
15941640 \param ActionList 保存するアクション一覧
1595-\param FileName Iniファイル名
1641+\todo STD_SEC を GetXXXFileName() に追い出せ
15961642
1597-ActionList に設定されているショートカットキーを FileName に保存します。
1643+ActionList に設定されているショートカットキーを KeySetting.ini に保存します。
15981644 }
1599-procedure TGikoSys.SaveKeySetting(ActionList: TActionList; FileName: String);
1645+procedure TGikoSys.SaveKeySetting(ActionList: TActionList);
16001646 const
16011647 STD_SEC = 'KeySetting';
16021648 var
16031649 i: Integer;
16041650 ini: TMemIniFile;
16051651 begin
1606- ini := TMemIniFile.Create(GetConfigDir + FileName);
1652+ ini := TMemIniFile.Create(GetConfigDir + KEY_SETTING_FILE_NAME);
16071653 try
16081654 for i := 0 to ActionList.ActionCount - 1 do begin
16091655 if ActionList.Actions[i].Tag = -1 then
@@ -1616,6 +1662,74 @@ begin
16161662 end;
16171663 end;
16181664
1665+{!
1666+\brief レスエディタのアクションにショートカットを設定
1667+\param ActionList 設定するアクション一覧
1668+\todo STD_SEC, EKEY_SETTING_FILE_NAME を GetXXXFileName() に追い出せ
1669+\todo LoadKeySetting と統合せよ
1670+
1671+ファイルに保存されているショートカットキーを ActionList に設定します。
1672+}
1673+procedure TGikoSys.LoadEditorKeySetting(ActionList: TActionList);
1674+const
1675+ STD_SEC = 'KeySetting';
1676+var
1677+ i: Integer;
1678+ ini: TMemIniFile;
1679+ ActionName: string;
1680+ ActionKey: Integer;
1681+ SecList: TStringList;
1682+ Component: TComponent;
1683+begin
1684+ if not FileExists(GetConfigDir + EKEY_SETTING_FILE_NAME) then
1685+ Exit;
1686+ SecList := TStringList.Create;
1687+ ini := TMemIniFile.Create(GetConfigDir + EKEY_SETTING_FILE_NAME);
1688+ try
1689+ ini.ReadSection(STD_SEC, SecList);
1690+ for i := 0 to SecList.Count - 1 do begin
1691+ ActionName := SecList[i];
1692+ ActionKey := ini.ReadInteger(STD_SEC, ActionName, -1);
1693+ if ActionKey <> -1 then begin
1694+ Component := ActionList.Owner.FindComponent(ActionName);
1695+ if TObject(Component) is TAction then begin
1696+ TAction(Component).ShortCut := ActionKey;
1697+ end;
1698+ end;
1699+ end;
1700+ finally
1701+ ini.Free;
1702+ SecList.Free;
1703+ end;
1704+end;
1705+
1706+{!
1707+\brief レスエディタに設定されているショートカットキーをファイルに保存
1708+\param ActionList 保存するアクション一覧
1709+\todo STD_SEC, EKEY_SETTING_FILE_NAME を GetXXXFileName() に追い出せ
1710+\todo LoadKeySetting と統合せよ
1711+
1712+ActionList に設定されているショートカットキーをファイルに保存します。
1713+}
1714+procedure TGikoSys.SaveEditorKeySetting(ActionList: TActionList);
1715+const
1716+ STD_SEC = 'KeySetting';
1717+var
1718+ i: Integer;
1719+ ini: TMemIniFile;
1720+begin
1721+ ini := TMemIniFile.Create(GetConfigDir + EKEY_SETTING_FILE_NAME);
1722+ try
1723+ for i := 0 to ActionList.ActionCount - 1 do begin
1724+ if ActionList.Actions[i].Tag = -1 then
1725+ Continue;
1726+ ini.WriteInteger(STD_SEC, ActionList.Actions[i].Name, TAction(ActionList.Actions[i]).ShortCut);
1727+ end;
1728+ ini.UpdateFile;
1729+ finally
1730+ ini.Free;
1731+ end;
1732+end;
16191733
16201734 {!
16211735 \brief プロセスの生成
@@ -2805,11 +2919,7 @@ begin
28052919 finally
28062920 body.Free;
28072921 end;
2808-
2809- Result := HTMLCreater.ConvRes(
2810- Result,
2811- ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''),
2812- 'bbs', 'key', 'st', 'to', 'nofirst', 'true', false);
2922+ Result := HTMLCreater.ConvRes(Result, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', false);
28132923 end;
28142924 end;
28152925
@@ -2836,7 +2946,7 @@ begin
28362946
28372947 for i := 0 to threadItem.Count - 1 do begin
28382948 // レス
2839- THTMLCreate.DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), i + 1), @Res);
2949+ Res := DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), i + 1));
28402950 if(AnsiPos(AID, Res.FDateTime) > 0) then begin
28412951 body.Add(IntToStr(i+1));
28422952 end;
@@ -2846,7 +2956,7 @@ begin
28462956 try
28472957 ReadList.LoadFromFile(ThreadItem.GetThreadFileName);
28482958 for i := 0 to ReadList.Count - 1 do begin
2849- THTMLCreate.DivideStrLine(ReadList[i], @Res);
2959+ Res := DivideStrLine(ReadList[i]);
28502960 if AnsiPos(AID, Res.FDateTime) > 0 then begin
28512961 body.Add(IntToStr(i+1));
28522962 end;
@@ -2888,11 +2998,7 @@ begin
28882998 finally
28892999 body.Free;
28903000 end;
2891- Result := HTMLCreater.ConvRes(
2892- Result, ThreadItem.ParentBoard.BBSID,
2893- ChangeFileExt(ThreadItem.FileName, ''),
2894- 'bbs', 'key', 'st', 'to', 'nofirst', 'true',
2895- false);
3001+ Result := HTMLCreater.ConvRes(Result, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', false);
28963002 end;
28973003 end;
28983004
@@ -2917,9 +3023,9 @@ begin
29173023 //===== プラグインによる表示
29183024 //boardPlugIn := ThreadItem.BoardPlugIn;
29193025 boardPlugIn := ThreadItem.ParentBoard.BoardPlugIn;
2920- THTMLCreate.DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), AIDNum), @Res);
3026+ Res := DivideStrLine(boardPlugIn.GetDat(DWORD( threadItem ), AIDNum));
29213027 end else begin
2922- THTMLCreate.DivideStrLine( ReadThreadFile(ThreadItem.GetThreadFileName, AIDNum), @Res);
3028+ Res := DivideStrLine( ReadThreadFile(ThreadItem.GetThreadFileName, AIDNum));
29233029 end;
29243030 AID := Res.FDateTime;
29253031 if AnsiPos('id', AnsiLowerCase(AID)) > 0 then begin
@@ -3238,44 +3344,7 @@ begin
32383344 R.Free;
32393345 end;
32403346 end;
3241-//! mainフォームのショートカットキーのIniファイル名
3242-function TGikoSys.GetMainKeyFileName : String;
3243-begin
3244- Result := Setting.GetMainKeyFileName;
3245-end;
3246-//! EditorフォームのショートカットキーのIniファイル名
3247-function TGikoSys.GetEditorKeyFileName: String;
3248-begin
3249- Result := Setting.GetEditorKeyFileName;
3250-end;
32513347
3252-//! ギコナビのメッセージを設定する
3253-procedure TGikoSys.SetGikoMessage;
3254-begin
3255- if FGikoMessage = nil then begin
3256- FGikoMessage := TGikoMessage.Create;
3257- end else begin
3258- FGikoMessage.Clear;
3259- end;
3260-
3261- if (Setting.GengoSupport) then begin
3262- try
3263- if (FileExists(Setting.GetLanguageFileName)) then begin
3264- FGikoMessage.LoadFromFile(Setting.GetLanguageFileName);
3265- end;
3266- except
3267- FGikoMessage.Clear;
3268- end;
3269- end;
3270-end;
3271-//! ギコナビのメッセージを取得する
3272-function TGikoSys.GetGikoMessage(MesType: TGikoMessageListType): String;
3273-begin
3274- Result := '';
3275- if FGikoMessage <> nil then begin
3276- Result := FGikoMessage.GetMessage(MesType);
3277- end;
3278-end;
32793348
32803349 initialization
32813350 GikoSys := TGikoSys.Create;
--- a/HTMLCreate.pas
+++ b/HTMLCreate.pas
@@ -18,13 +18,6 @@ uses
1818 {Sort,} ,GikoBayesian, HintWindow;
1919
2020 type
21-
22- PResLinkRec = ^TResLinkRec;
23- TResLinkRec = record
24- FBbs: string;
25- FKey : string;
26- end;
27-
2821 THTMLCreate = class(TObject)
2922 private
3023 { Private 宣言 }
@@ -42,18 +35,15 @@ type
4235 procedure CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList);
4336 procedure CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
4437 procedure CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
45- procedure ConvertResAnchor(PRes: PResRec);
38+ function ConvertResAnchor(res: string): string;
4639 procedure separateNumber(var st: String; var et: String; const Text, Separator: String);
47- function checkComma(const s : String; var j : Integer; var No : String) : boolean;
48- function addResAnchor(PAddRes: PResRec; PResLink : PResLinkRec; dat : boolean;
49- var s : String; j : Integer; const No: String) : string;
5040 public
5141 { Public 宣言 }
52- procedure AddAnchorTag(PRes: PResRec);
42+ function AddAnchorTag(s: string): string;
5343 function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string;
54- function SkinedRes(const skin: string; PRes: PResRec; const No: string): string;
55- procedure ConvRes( PRes : PResRec; PResLink : PResLinkRec; DatToHTML: boolean = false); overload;
44+ function SkinedRes(skin: string; Res: TResRec; No: string): string;
5645 function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; DatToHTML: boolean = false): string; overload;
46+// function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload;
5747 procedure CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string);
5848 procedure CreateHTML3(var html: TStringList; ThreadItem: TThreadItem; var sTitle: string);
5949 //レスポップアップの作成
@@ -62,10 +52,6 @@ type
6252 class function GetRespopupURL(AText, AThreadURL : string): string;
6353 //指定したパスにスキンもしくはCSSのファイルのコピーを作る
6454 class procedure SkinorCSSFilesCopy(path: string);
65- //dat1行をレスに分解する
66- class procedure DivideStrLine(Line: string; PRes: PResRec);
67- //HTMLからリンクタグを削除する
68- class function DeleteLink(const s: string): string;
6955 end;
7056
7157 var
@@ -170,70 +156,58 @@ end;
170156
171157 // レスの値を置換する
172158 function THTMLCreate.SkinedRes(
173- const skin: string;
174- PRes: PResRec;
175- const No: string
159+ skin: string;
160+ Res: TResRec;
161+ No: string
176162 ): string;
177-const
178- FORMT_NAME = '<b>%s</b>';
179- FORMT_NUM = '<a href="menu:%s" name="%s">%s</a>';
180- FORMT_MAILNAME = '<a href="mailto:%s"><b>%s</b></a>';
181163 var
182164 spamminess : Extended;
183-{$IFDEF SPAM_FILTER_ENABLED}
184165 wordCount : TWordCount;
185-{$ENDIF}
186166 begin
187-{$IFDEF SPAM_FILTER_ENABLED}
167+
188168 wordCount := TWordCount.Create;
189169 try
190170 spamminess := Floor( GikoSys.SpamParse(
191171 Res.FName + '<>' + Res.FMailTo + '<>' + Res.FBody, wordCount ) * 100 );
192-{$ELSE}
193- spamminess := 0;
194-{$ENDIF}
195- Result := CustomStringReplace( skin, '<SPAMMINESS/>', FloatToStr( spamminess ) );
196- Result := CustomStringReplace( Result, '<NONSPAMMINESS/>', FloatToStr( 100 - spamminess ) );
197- Result := CustomStringReplace( Result, '<MAIL/>', PRes.FMailTo);
198- Result := CustomStringReplace( Result, '<DATE/>', PRes.FDateTime);
199- Result := CustomStringReplace( Result, '<PLAINNUMBER/>', No);
200- Result := CustomStringReplace( Result, '<NAME/>',
201- Format(FORMT_NAME, [PRes.FName]));
202- Result := CustomStringReplace( Result, '<NUMBER/>',
203- Format(FORMT_NUM, [No, No, No]));
204- Result := CustomStringReplace( Result, '<MAILNAME/>',
205- Format(FORMT_MAILNAME,[PRes.FMailTo, PRes.FName]));
206- Result := CustomStringReplace( Result, '<MESSAGE/>', PRes.FBody);
172+
173+ Skin := CustomStringReplace( Skin, '<NUMBER/>',
174+ Format('<a href="menu:%s" name="%s">%s</a>', [No, No, No]));
175+ Skin := CustomStringReplace( Skin, '<PLAINNUMBER/>', No);
176+ Skin := CustomStringReplace( Skin, '<NAME/>', '<b>' + Res.FName + '</b>');
177+ Skin := CustomStringReplace( Skin, '<MAILNAME/>',
178+ Format('<a href="mailto:%s"><b>%s</b></a>',[Res.FMailTo, Res.FName]));
179+ Skin := CustomStringReplace( Skin, '<MAIL/>', Res.FMailTo);
180+ Skin := CustomStringReplace( Skin, '<DATE/>', Res.FDateTime);
181+ Skin := CustomStringReplace( Skin, '<MESSAGE/>', Res.FBody);
182+ Skin := CustomStringReplace( Skin, '<SPAMMINESS/>', FloatToStr( spamminess ) );
183+ Skin := CustomStringReplace( Skin, '<NONSPAMMINESS/>', FloatToStr( 100 - spamminess ) );
207184
208185 //----- かちゅ〜しゃ互換用。コメントアウトしてもよし
209186 if GikoSys.Setting.UseKatjushaType then begin
210- Result := CustomStringReplace( Result, '&NUMBER',
187+ Skin := CustomStringReplace( Skin, '&NUMBER',
211188 '<a href="menu:' + No + '" name="' + No + '">' + No + '</a>');
212- Result := CustomStringReplace( Result, '&PLAINNUMBER', No);
213- Result := CustomStringReplace( Result, '&NAME', '<b>' + PRes.FName + '</b>');
214- Result := CustomStringReplace( Result, '&MAILNAME',
215- '<a href="mailto:' + PRes.FMailTo + '"><b>' + PRes.FName + '</b></a>');
216- Result := CustomStringReplace( Result, '&MAIL', PRes.FMailTo);
217- Result := CustomStringReplace( Result, '&DATE', PRes.FDateTime);
218- Result := CustomStringReplace( Result, '&MESSAGE', PRes.FBody);
219- Result := CustomStringReplace( Result, '&SPAMMINESS', FloatToStr( spamminess ) );
220- Result := CustomStringReplace( Result, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) );
189+ Skin := CustomStringReplace( Skin, '&PLAINNUMBER', No);
190+ Skin := CustomStringReplace( Skin, '&NAME', '<b>' + Res.FName + '</b>');
191+ Skin := CustomStringReplace( Skin, '&MAILNAME',
192+ '<a href="mailto:' + Res.FMailTo + '"><b>' + Res.FName + '</b></a>');
193+ Skin := CustomStringReplace( Skin, '&MAIL', Res.FMailTo);
194+ Skin := CustomStringReplace( Skin, '&DATE', Res.FDateTime);
195+ Skin := CustomStringReplace( Skin, '&MESSAGE', Res.FBody);
196+ Skin := CustomStringReplace( Skin, '&SPAMMINESS', FloatToStr( spamminess ) );
197+ Skin := CustomStringReplace( Skin, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) );
221198 end;
222199 //----- ここまで
223-{$IFDEF SPAM_FILTER_ENABLED}
200+
201+ Result := Skin;
224202 finally
225203 wordCount.Free;
226204 end;
227-{$ENDIF}
228205
229206 end;
230207 (*************************************************************************
231208 *http://の文字列をanchorタグ付きにする。
232209 *************************************************************************)
233-procedure THTMLCreate.AddAnchorTag(PRes: PResRec);
234-const
235- _HEAD : array[0..9] of String =
236- ('', 'h', 'ht', '', 'htt', '', 'http://', '', '', '');
210+function THTMLCreate.AddAnchorTag(s: string): string;
237211 var
238212 url: string;
239213 href: string;
@@ -242,14 +216,10 @@ var
242216 idx, idx2: Integer;
243217 pos : PChar;
244218 pp, pe : PChar;
245- s : String;
246- len : Integer;
247219 begin
248- s := PRes.FBody;
249- PRes.FBody := '';
220+ Result := '';
250221
251- //while True do begin
252- repeat
222+ while True do begin
253223 idx := MaxInt;
254224 idx2 := MaxInt;
255225 pp := PChar(s);
@@ -266,62 +236,63 @@ begin
266236
267237 if idx = MaxInt then begin
268238 //リンクが無いよ。
269- len := Length(PRes.FBody);
270- SetLength(PRes.FBody, Length(s) + len);
271- Move(pp^, PRes.FBody[len + 1], Length(s));
272- end else begin
273- if (idx > anchorLen) and
274- (AnsiStrPosEx(pp + idx - 1 - anchorLen, pp + idx, pANCHORs, pANCHORe) <> nil) then begin
275- //既にリンクタグがついているっぽいときはムシ
276- //</a></A>を探す、小文字で見つからなければ大文字で検索
277- pos := AnsiStrPosEx(pp + idx, pe, pCTAGLs, pCTAGLe);
278- if pos = nil then
279- pos := AnsiStrPosEx(pp + idx, pe, pCTAGUs, pCTAGUe);
280- if pos = nil then
281- b := Length(REF_MARK[idx2])
282- else
283- b := pos - pp + 1;
239+ Result := Result + s;
240+ Break;
241+ end;
284242
285- len := Length(PRes.FBody);
286- SetLength(PRes.FBody, len + idx + b);
287- Move(pp^, PRes.FBody[len + 1], idx + b);
288- Delete(s, 1, idx + b);
289- end else begin
290- pp := PChar(s);
291- len := Length(PRes.FBody);
292- SetLength(PRes.FBody, len + idx - 1);
293- Move(pp^, PRes.FBody[len + 1], idx - 1);
294-
295- Delete(s, 1, idx - 1);
296- b := Length( s ) + 1;
297- pp := PChar(s);
298- for i := 1 to b do begin
299- //1バイト文字でURLに使えない文字なら
300- if (AnsiStrPosEx(pURLCHARs, pURLCHARe, pp, pp + 1) = nil) then begin
301- url := Copy(s, 1, i - 1);
302- Delete(s, 1, i - 1);
303- href := Format('%s%s', [_HEAD[idx2], url]);
304- PRes.FBody
305- := Format('%s<a href="%s" target="_blank">%s</a>', [PRes.FBody, href, url]);
306- Break;
307- end;
308- //一文字進める。
309- Inc(pp);
243+ if (idx > 1) and (idx > anchorLen) and
244+ (AnsiStrPosEx(pp + idx - 1 - anchorLen, pp + idx, pANCHORs, pANCHORe) <> nil) then begin
245+ //既にリンクタグがついているっぽいときはムシ
246+ //</a></A>を探す、小文字で見つからなければ大文字で検索
247+ pos := AnsiStrPosEx(pp + idx, pe, pCTAGLs, pCTAGLe);
248+ if pos = nil then
249+ pos := AnsiStrPosEx(pp + idx, pe, pCTAGUs, pCTAGUe);
250+ if pos = nil then
251+ b := Length(REF_MARK[idx2])
252+ else
253+ b := pos - pp + 1;
254+
255+ Result := Result + Copy(s, 1, idx + b);
256+ Delete(s, 1, idx + b);
257+ Continue;
258+ end;
259+
260+ Result := Result + Copy(s, 1, idx - 1);
261+ Delete(s, 1, idx - 1);
262+ b := Length( s ) + 1;
263+ pp := PChar(s);
264+ for i := 1 to b do begin
265+ pe := AnsiStrPosEx(pURLCHARs, pURLCHARe, pp, pp + 1);
266+
267+ if pe = nil then begin
268+ //URLじゃない文字発見!とか、文字がなくなった。
269+ url := Copy(s, 1, i - 1);
270+ case idx2 of
271+ 1 : href := 'h' + url;
272+ 2 : href := 'ht' + url;
273+ 4 : href := 'htt' + url;
274+ 6 : href := 'http://' + url;
275+ else
276+ href := url;
310277 end;
278+
279+ Result := Result + '<a href="' + href + '" target="_blank">' + url + '</a>';
280+ Delete(s, 1, i - 1);
281+ Break;
311282 end;
283+ //一文字進める。
284+ Inc(pp);
312285 end;
313- until idx = MaxInt;
286+ end;
314287 end;
315288
316289 //引数、AID:対象となる日付ID文字列、ANum:レス番 AURL:そのスレッドのURL
317290 function THTMLCreate.AddBeProfileLink(AID : string; ANum: Integer):string ;
318-const
319- BE_MARK : string = 'BE:';
320291 var
321292 p : integer;
322293 BNum, BMark : string;
323294 begin
324- p := AnsiPos(BE_MARK, AnsiUpperCase(AID));
295+ p := AnsiPos('BE:', AnsiUpperCase(AID));
325296 if p > 0 then begin
326297 BNum := Copy(AID, p, Length(AID));
327298 AID := Copy(AID, 1, p - 1);
@@ -336,7 +307,7 @@ begin
336307 end else
337308 Result := AID;
338309 end;
339-procedure THTMLCreate.separateNumber(var st: String; var et: String; const Text:String; const Separator: String);
310+procedure THTMLCreate.separateNumber(var st: String; var et: String; const Text, Separator: String);
340311 var
341312 p : Integer;
342313 begin
@@ -349,203 +320,6 @@ begin
349320 et := Text;
350321 end;
351322 end;
352-procedure THTMLCreate.ConvRes( PRes : PResRec; PResLink : PResLinkRec; DatToHTML: boolean = false);
353-const
354- GT = '&gt;';
355- SN = '0123456789';
356- //検索対象の文字列郡
357- TOKEN : array[0..5] of string = (GT+GT, GT, '>>', '>', '<a ', '<A ');
358-var
359- i : integer;
360- s : string;
361- sw: boolean;
362- cm: boolean;
363- No: string;
364- oc : string;
365- pos, pmin : integer;
366- j : integer;
367- ch : string;
368- db : boolean;
369- len : integer;
370- rink : string;
371-
372- procedure getNumberString;
373- begin
374- while (j <= len) do begin
375- if (ByteType(s, j) = mbSingleByte) then begin
376- //1byte文字
377- ch := s[j];
378- Inc(j);
379- db := false;
380- end else begin
381- //2byte文字
382- ch := ZenToHan(Copy(s, j, 2));
383- Inc(j, 2);
384- db := true;
385- end;
386-
387- if System.Pos(ch, SN) > 0 then begin
388- No := No + ch;
389- end else if (ch = '-') then begin
390- if sw then break;
391- if No = '' then break;
392- No := No + ch;
393- sw := true;
394- end else begin
395- break;
396- end;
397- end;
398- end;
399-
400-begin
401- //s に本文を全部入れる
402- s := PRes.FBody;
403- //結果をクリア
404- PRes.FBody := '';
405-
406- //
407- while Length(s) > 2 do begin
408- pmin := Length(s) + 1;
409- i := Length(token);
410- for j := 0 to 5 do begin
411- pos := AnsiPos(TOKEN[j], s);
412- if pos <> 0 then begin
413- if pos < pmin then begin
414- //どれでヒットしたか保存
415- i := j;
416- //最小値を更新
417- pmin := pos;
418- end;
419- end;
420- end;
421-
422- //ヒットした文字列の一つ手前まで結果にコピー
423- PRes.FBody := PRes.FBody + Copy(s, 1, pmin - 1);
424- Delete(s, 1, pmin - 1);
425-
426- if i = 6 then begin
427- //ヒットなし
428- end else if (i = 4) or (i = 5) then begin
429- //'<a ' or '<A' でヒット '</a>' or '</A>' までコピー
430- pmin := AnsiPos('</a>' , s);
431- pos := AnsiPos('</A>' , s);
432- if (pmin <> 0) and (pos <> 0) then begin
433- if (pmin > pos) then begin
434- pmin := pos;
435- end;
436- end else if (pos <> 0) then begin
437- pmin := pos;
438- end;
439- rink := Copy(s, 1, pmin + 3);
440- PRes.FBody := PRes.FBody + rink;
441- Delete(s, 1, pmin + 3);
442-
443- pmin := Length(rink);
444- i := Length(TOKEN);
445- for j := 0 to 3 do begin
446- pos := AnsiPos(TOKEN[j], rink);
447- if pos <> 0 then begin
448- if pos < pmin then begin
449- //どれでヒットしたか保存
450- i := j;
451- //最小値を更新
452- pmin := pos;
453- end;
454- end;
455- end;
456- // レスアンカーが含まれていたら,が続く限りアンカーとして扱う
457- if i <= 3 then begin
458- No := '';
459- j := 1;
460- len := Length(s);
461- cm := checkComma(s, j, No);
462- len := Length(s);
463- while cm do begin
464- oc := '';
465- No := '';
466- sw := false;
467- db := false;
468- getNumberString;
469- //終端まで行っての終了かチェック
470- if j <= len then begin
471- if db then j := j - 2
472- else j := j - 1;
473- end;
474- addResAnchor(PRes, PResLink, DatToHTML, s, j, No);
475- j := 1;
476- len := Length(s);
477- cm := checkComma(s, j, No);
478- end;
479- end;
480- end else begin
481- //何かしら見つかったパターン
482- j := Length(TOKEN[i]) + 1;
483- oc := '';
484- No := '';
485- sw := false;
486- db := false;
487- len := Length(s);
488- getNumberString;
489- //終端まで行っての終了かチェック
490- if j <= len then begin
491- if db then j := j - 2
492- else j := j - 1;
493- end;
494- addResAnchor(PRes, PResLink, DatToHTML, s, j, No);
495- end;
496- end;
497- if Length(s) > 0 then begin
498- PRes.FBody := PRes.FBody + s;
499- end;
500-end;
501-function THTMLCreate.checkComma(
502- const s : String;
503- var j : Integer;
504- var No : String
505-) : boolean;
506-var
507- bType : TMbcsByteType;
508-begin
509- Result := false;
510- if (Length(s) > 0) then begin
511- bType := ByteType(s, j);
512- if ((bType = mbSingleByte) and (s[j] = ',') or
513- ((bType = mbLeadByte) and (ZenToHan(Copy(s, j ,2)) = ','))) then begin
514- Result := true;
515- if (bType = mbSingleByte) then
516- Inc(j)
517- else
518- Inc(j, 2);
519- No := '';
520- end;
521- end;
522-end;
523-function THTMLCreate.addResAnchor(
524- PAddRes: PResRec; PResLink : PResLinkRec; dat : boolean;
525- var s : String; j : Integer; const No: String) : string;
526-const
527- FORMAT_LINK = '<a href="../test/read.cgi?bbs=%s&key=%s&st=%s&to=%s&nofirst=true" target="_blank">';
528-var
529- st,et : string;
530-begin
531-
532- //何も数字が見つからないとき
533- if No = '' then begin
534- PAddRes.FBody := PAddRes.FBody + Copy(s, 1, j - 1);
535- end else begin
536- separateNumber(st, et, No, '-');
537-
538- if not dat then begin
539- PAddRes.FBody := PAddRes.FBody +
540- Format(FORMAT_LINK, [PResLink.FBbs, PResLink.FKey, st, et]);
541- end else begin
542- PAddRes.FBody := PAddRes.FBody + Format('<a href="#%s">', [st]);
543- end;
544- PAddRes.FBody := PAddRes.FBody + Copy(s, 1, j - 1) + '</a>';
545- end;
546- Delete(s, 1, j - 1);
547-end;
548-
549323 (*************************************************************************
550324 *
551325 * from HotZonu
@@ -727,7 +501,7 @@ begin
727501 Result := Result + s;
728502 end;
729503
730-procedure THTMLCreate.ConvertResAnchor(PRes: PResRec);
504+function THTMLCreate.ConvertResAnchor(res: string): string;
731505 const
732506 _HEAD : string = '<a href="../';
733507 _TAIL : string = ' target="_blank">';
@@ -738,17 +512,15 @@ const
738512 var
739513 i, j, k: Integer;
740514 tmp: string;
741- res: string;
742515 begin
743- res := PRes.FBody;
744- PRes.FBody := '';
516+ Result := '';
745517 i := AnsiPos(_HEAD, res);
746518 while i <> 0 do begin
747- PRes.FBody := PRes.FBody + Copy(res, 1, i -1);
519+ Result := Result + Copy(res, 1, i -1);
748520 Delete(res, 1, i - 1);
749521 j := AnsiPos(_TAIL, res);
750522 if j = 0 then begin
751- PRes.FBody := PRes.FBody + res;
523+ Result := Result + res;
752524 Exit;
753525 end;
754526 tmp := Copy(res, 1, j - 1);
@@ -756,11 +528,11 @@ begin
756528 if (AnsiPos(_ST, tmp) <> 0) and (AnsiPos(_TO, tmp) <> 0) then begin
757529 Delete(tmp, 1, AnsiPos(_ST, tmp) + 3);
758530 Delete(tmp, AnsiPos(_TO, tmp), Length(tmp));
759- PRes.FBody := PRes.FBody + '<a href="#' + tmp + '">';
531+ Result := Result + '<a href="#' + tmp + '">';
760532 end else if (AnsiPos(_STA, tmp) <> 0) and (AnsiPos(_END, tmp) <> 0) then begin
761533 Delete(tmp, 1, AnsiPos(_STA, tmp) + 6);
762534 Delete(tmp, AnsiPos(_END, tmp), Length(tmp));
763- PRes.FBody := PRes.FBody + '<a href="#' + tmp + '">';
535+ Result := Result + '<a href="#' + tmp + '">';
764536 end else begin
765537 k := LastDelimiter('/', tmp);
766538 Delete(tmp, 1, k);
@@ -769,11 +541,11 @@ begin
769541 else
770542 Delete(tmp, AnsiPos('"', tmp), Length(tmp));
771543
772- PRes.FBody := PRes.FBody + '<a href="#' + tmp + '">';
544+ Result := Result + '<a href="#' + tmp + '">';
773545 end;
774546 i := AnsiPos(_HEAD, res);
775547 end;
776- PRes.FBody := PRes.FBody + res;
548+ Result := Result + res;
777549
778550 end;
779551
@@ -794,8 +566,8 @@ begin
794566 doc.open;
795567 // ヘッダ
796568 doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ),
797- '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ));
798- doc.Write('<p id="idSearch"></p>');
569+ '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 );
570+ doc.Write('<p id="idSearch"></p>'#13#10 );
799571
800572 for i := 0 to threadItem.Count - 1 do begin
801573 // 1 は必ず表示
@@ -819,24 +591,24 @@ begin
819591 try
820592 if GikoSys.Setting.UseSkin then begin
821593 if FileExists( GikoSys.GetSkinNewmarkFileName ) then
822- doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ))
594+ doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
823595 else
824- doc.Write( '<a name="new"></a>');
596+ doc.Write( '<a name="new"></a>'#13#10 );
825597 end else if GikoSys.Setting.UseCSS then begin
826- doc.Write('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>');
598+ doc.Write('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>'#13#10);
827599 end else begin
828600 doc.Write('</dl>');
829601 doc.Write('<a name="new"></a>');
830602 doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>');
831- doc.Write('<dl>');
603+ doc.Write('<dl>'#13#10);
832604 end;
833605 except
834- doc.Write( '<a name="new"></a>');
606+ doc.Write( '<a name="new"></a>'#13#10);
835607 end;
836608 end;
837609
838610 // レス
839- doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ));
611+ doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 );
840612
841613 if ThreadItem.Kokomade = (i + 1) then begin
842614 // ここまで読んだ
@@ -845,23 +617,23 @@ begin
845617 if FileExists( GikoSys.GetSkinBookmarkFileName ) then
846618 doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
847619 else
848- doc.Write( '<a name="koko"></a>');
620+ doc.Write( '<a name="koko"></a>'#13#10 );
849621 end else if GikoSys.Setting.UseCSS then begin
850- doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>');
622+ doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>'#13#10 );
851623 end else begin
852624 doc.Write('</dl>');
853625 doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>');
854- doc.Write('<dl>');
626+ doc.Write('<dl>'#13#10 );
855627 end;
856628 except
857- doc.Write( '<a name="koko"></a>');
629+ doc.Write( '<a name="koko"></a>'#13#10 );
858630 end;
859631 end;
860632 end;
861633
862634
863635 // スキン(フッタ)
864- doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ));
636+ doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 );
865637 finally
866638 doc.Close;
867639 end;
@@ -869,27 +641,29 @@ end;
869641
870642
871643 procedure THTMLCreate.CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList);
872-const
873- KOKO_TAG = '<a name="koko"></a>';
874- NEW_TAG = '<a name="new"></a>';
875644 var
876645 i: integer;
646+ No: string;
647+ CSSFileName: string;
877648 NewReceiveNo: Integer;
878649 Res: TResRec;
879650 UserOptionalStyle: string;
880651 SkinHeader: string;
881652 SkinNewRes: string;
882653 SkinRes: string;
654+ strTmp : string;
883655 ThreadName : string;
884- ResLink :TResLinkRec;
656+ function ReplaceRes( skin: string ): string;
657+ begin
658+ Result := SkinedRes( skin, Res, No );
659+ end;
885660 begin
886661 NewReceiveNo := ThreadItem.NewReceive;
887662 // フォントやサイズの設定
888663 UserOptionalStyle := GikoSys.SetUserOptionalStyle;
664+ CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
889665 ThreadName := ChangeFileExt(ThreadItem.FileName, '');
890- ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
891- ResLink.FKey := ThreadName;
892- //,
666+
893667 doc.open;
894668 try
895669 doc.charset := 'Shift_JIS';
@@ -904,8 +678,15 @@ begin
904678 except
905679 end;
906680
907- SkinNewRes := LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, ThreadItem.Size);
908- SkinRes := LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, ThreadItem.Size );
681+ try
682+ SkinNewRes := LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, ThreadItem.Size);
683+ except
684+ end;
685+
686+ try
687+ SkinRes := LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, ThreadItem.Size );
688+ except
689+ end;
909690
910691 doc.Write('<p id="idSearch"></p>'#13#10'<a name="top"></a>');
911692
@@ -928,38 +709,55 @@ begin
928709
929710 // 新着マーク
930711 if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin
931- if FileExists( GikoSys.GetSkinNewmarkFileName ) then
932- doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ))
933- else
934- doc.Write( NEW_TAG );
712+ try
713+ if FileExists( GikoSys.GetSkinNewmarkFileName ) then
714+ doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ))
715+ else
716+ doc.Write( '<a name="new"></a>');
717+ except
718+ doc.Write( '<a name="new"></a>' );
719+ end;
935720 end;
936721
937722 if (Trim(ReadList[i]) <> '') then begin
938- DivideStrLine(ReadList[i], @Res);
939- AddAnchorTag(@Res);
940- ConvRes(@Res, @ResLink);
723+ No := IntToStr(i + 1);
724+
725+ Res := DivideStrLine(ReadList[i]);
726+ Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ThreadName, 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
941727 Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
942728
943- if NewReceiveNo <= (i + 1) then
944- // 新着レス
945- doc.Write(SkinedRes(SkinNewRes, @Res, IntToStr(i + 1)))
946- else
947- // 通常のレス
948- doc.Write(SkinedRes(SkinRes, @Res, IntToStr(i + 1)));
729+ try
730+ if NewReceiveNo <= (i + 1) then
731+ // 新着レス
732+ strTmp := ReplaceRes( SkinNewRes )
733+ else
734+ // 通常のレス
735+ strTmp := ReplaceRes( SkinRes );
736+
737+ doc.Write( strTmp );
738+ except
739+ end;
949740 end;
950741
951742 if ThreadItem.Kokomade = (i + 1) then begin
952743 // ここまで読んだ
953- if FileExists( GikoSys.GetSkinBookmarkFileName ) then
954- doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
955- else
956- doc.Write( KOKO_TAG );
744+ try
745+ if FileExists( GikoSys.GetSkinBookmarkFileName ) then
746+ doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
747+ else
748+ doc.Write( '<a name="koko"></a>' );
749+ except
750+ doc.Write( '<a name="koko"></a>' );
751+ end;
957752 end;
958753 end;
959754
960755 doc.Write('<a name="bottom"></a>');
961756 // スキン(フッタ)
962- doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) );
757+ try
758+ doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) );
759+ except
760+ end;
963761 finally
964762 doc.close;
965763 end;
@@ -989,16 +787,11 @@ var
989787 NewReceiveNo: Integer;
990788 Res: TResRec;
991789 UserOptionalStyle: string;
992- ThreadName :String;
993- ResLink :TResLinkRec;
994790 begin
995791 doc.open;
996792 try
997793 doc.charset := 'Shift_JIS';
998794 NewReceiveNo := ThreadItem.NewReceive;
999- ThreadName := ChangeFileExt(ThreadItem.FileName, '');
1000- ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
1001- ResLink.FKey := ThreadName;
1002795 // フォントやサイズの設定
1003796 UserOptionalStyle := GikoSys.SetUserOptionalStyle;
1004797 CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
@@ -1036,9 +829,8 @@ begin
1036829
1037830 if (Trim(ReadList[i]) <> '') then begin
1038831 No := IntToStr(i + 1);
1039- DivideStrLine(ReadList[i], @Res);
1040- AddAnchorTag(@Res);
1041- ConvRes(@Res, @ResLink);
832+ Res := DivideStrLine(ReadList[i]);
833+ Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
1042834 Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
1043835 if Res.FMailTo = '' then
1044836 doc.Write(Format(FORMAT_NOMAIL, [No, No, No, Res.FName, Res.FDateTime, Res.FBody]))
@@ -1069,16 +861,11 @@ var
1069861 No: string;
1070862 NewReceiveNo: Integer;
1071863 Res: TResRec;
1072- ThreadName: String;
1073- ResLink : TResLinkRec;
1074864 begin
1075865 doc.open;
1076866 try
1077867 doc.charset := 'Shift_JIS';
1078868 NewReceiveNo := ThreadItem.NewReceive;
1079- ThreadName := ChangeFileExt(ThreadItem.FileName, '');
1080- ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
1081- ResLink.FKey := ThreadName;
1082869 doc.Write('<html><head>'#13#10);
1083870 doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10);
1084871 doc.Write('<title>' + sTitle + '</title></head>'#13#10);
@@ -1105,17 +892,16 @@ begin
1105892 end;
1106893
1107894 if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
1108- doc.Write('</dl>');
1109- doc.Write('<a name="new"></a>');
1110- doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>');
1111- doc.Write('<dl>');
895+ doc.Write('</dl>'#13#10);
896+ doc.Write('<a name="new"></a>'#13#10);
897+ doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'#13#10);
898+ doc.Write('<dl>'#13#10);
1112899 end;
1113900
1114901 if (Trim(ReadList[i]) <> '') then begin
1115902 No := IntToStr(i + 1);
1116- DivideStrLine(ReadList[i], @Res);
1117- AddAnchorTag(@Res);
1118- ConvRes(@Res, @ResLink);
903+ Res := DivideStrLine(ReadList[i]);
904+ Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
1119905 Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
1120906 if Res.FMailTo = '' then
1121907 doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<font color="forestgreen"><b> ' + Res.FName + ' </b></font> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>'#13#10)
@@ -1125,12 +911,14 @@ begin
1125911 doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>'#13#10);
1126912 end;
1127913 if ThreadItem.Kokomade = (i + 1) then begin
1128- doc.Write('</dl>');
1129- doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>');
1130- doc.Write('<dl>');
914+ doc.Write('</dl>'#13#10);
915+ doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>'#13#10);
916+ doc.Write('<dl>'#13#10);
1131917 end;
1132918 end;
1133- doc.Write('</dl>'#13#10'<a name="bottom"></a>'#13#10'</body></html>');
919+ doc.Write('</dl>'#13#10);
920+ doc.Write('<a name="bottom"></a>'#13#10);
921+ doc.Write('</body></html>'#13#10);
1134922 finally
1135923 doc.Close;
1136924 end;
@@ -1162,15 +950,13 @@ begin
1162950 ReadList := TStringList.Create;
1163951 try
1164952 if ThreadItem.IsLogFile then begin
1165- ReadList.BeginUpdate;
1166953 FileName := ThreadItem.GetThreadFileName;
1167954 ReadList.LoadFromFile(FileName);
1168- ReadList.EndUpdate;
1169955 GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG'));
1170956 GikoSys.FAbon.Execute(ReadList); // あぼ〜んして
1171957 GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする
1172958 if ThreadItem.Title = '' then begin
1173- DivideStrLine(ReadList[0], @Res);
959+ Res := DivideStrLine(ReadList[0]);
1174960 sTitle := Res.FTitle;
1175961 end else
1176962 sTitle := ThreadItem.Title
@@ -1186,7 +972,6 @@ begin
1186972 end else begin
1187973 CreateDefaultHTML(doc, ThreadItem, ReadList, sTitle);
1188974 end;
1189-
1190975 finally
1191976 ReadList.Free;
1192977 end;
@@ -1216,23 +1001,18 @@ var
12161001 SkinHeader: string;
12171002 SkinRes: string;
12181003 tmp, tmp1: string;
1219- ThreadName: String;
1220- ResLink : TResLinkRec;
12211004 function LoadSkin( fileName: string ): string;
12221005 begin
12231006 Result := LoadFromSkin( fileName, ThreadItem, ThreadItem.Size );
12241007 end;
12251008 function ReplaceRes( skin: string ): string;
12261009 begin
1227- Result := SkinedRes( skin, @Res, No );
1010+ Result := SkinedRes( skin, Res, No );
12281011 end;
12291012
12301013 begin
12311014 if ThreadItem <> nil then begin
12321015 CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
1233- ThreadName := ChangeFileExt(ThreadItem.FileName, '');
1234- ResLink.FBbs := ThreadItem.ParentBoard.BBSID;
1235- ResLink.FKey := ThreadName;
12361016 html.Clear;
12371017 html.BeginUpdate;
12381018 //if ThreadItem.IsBoardPlugInAvailable then begin
@@ -1264,9 +1044,7 @@ begin
12641044 for i := 0 to threadItem.Count - 1 do begin
12651045
12661046 // レス
1267- Res.FBody := boardPlugIn.GetRes( DWORD( threadItem ), i + 1 );
1268- ConvertResAnchor(@Res);
1269- html.Append( Res.FBody );
1047+ html.Append( ConvertResAnchor(boardPlugIn.GetRes( DWORD( threadItem ), i + 1 )) );
12701048
12711049 end;
12721050 // スキン(フッタ)
@@ -1289,7 +1067,7 @@ begin
12891067 GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG'));
12901068 GikoSys.FAbon.Execute(ReadList); // あぼ〜んして
12911069 GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする
1292- DivideStrLine(ReadList[0], @Res);
1070+ Res := DivideStrLine(ReadList[0]);
12931071 //Res.FTitle := CustomStringReplace(Res.FTitle, '@`', ',');
12941072 sTitle := Res.FTitle;
12951073 end else begin
@@ -1324,10 +1102,9 @@ begin
13241102 if (Trim(ReadList[i]) <> '') then begin
13251103 No := IntToStr(i + 1);
13261104
1327- DivideStrLine(ReadList[i], @Res);
1328- AddAnchorTag(@Res);
1329- ConvRes(@Res, @ResLink, true);
1330- ConvertResAnchor(@Res);
1105+ Res := DivideStrLine(ReadList[i]);
1106+ Res.FBody := AddAnchorTag(Res.FBody);
1107+ Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', true));
13311108
13321109 try
13331110 html.Append( ReplaceRes( SkinRes ) );
@@ -1363,10 +1140,9 @@ begin
13631140 for i := 0 to ReadList.Count - 1 do begin
13641141 if (Trim(ReadList[i]) <> '') then begin
13651142 No := IntToStr(i + 1);
1366- DivideStrLine(ReadList[i], @Res);
1367- AddAnchorTag(@Res);
1368- ConvRes(@Res, @ResLink, true);
1369- ConvertResAnchor(@Res);
1143+ Res := DivideStrLine(ReadList[i]);
1144+ Res.FBody := AddAnchorTag(Res.FBody);
1145+ Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', true));
13701146 if Res.FMailTo = '' then
13711147 html.Append('<a name="' + No + '"></a>'
13721148 + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> '
@@ -1410,10 +1186,9 @@ begin
14101186 for i := 0 to ReadList.Count - 1 do begin
14111187 if (Trim(ReadList[i]) <> '') then begin
14121188 No := IntToStr(i + 1);
1413- DivideStrLine(ReadList[i], @Res);
1414- AddAnchorTag(@Res);
1415- ConvRes(@Res, @ResLink, true);
1416- ConvertResAnchor(@Res);
1189+ Res := DivideStrLine(ReadList[i]);
1190+ Res.FBody := AddAnchorTag(Res.FBody);
1191+ Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true', true));
14171192 if Res.FMailTo = '' then
14181193 html.Append('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<font color="forestgreen"><b> ' + Res.FName + ' </b></font> 投稿日: ' + Res.FDateTime+ '<br><dd>' + Res.Fbody + ' <br><br><br>')
14191194 else if GikoSys.Setting.ShowMail then
@@ -1480,7 +1255,7 @@ begin
14801255 //ここで2ちゃんねるのdatの形式で1行読み込めれば・・・。↓読めるようになった
14811256 tmp := boardPlugIn.GetDat( DWORD( threadItem ), i );
14821257 if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin
1483- DivideStrLine(tmp, @Res);
1258+ Res := DivideStrLine(tmp);
14841259 if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then
14851260 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' 投稿日: ' + Res.FDateTime
14861261 else
@@ -1491,7 +1266,7 @@ begin
14911266 Body := CustomStringReplace(Res.FBody, '<br> ', #10,true);
14921267 Body := CustomStringReplace(Body, '<br>', #10,true);
14931268 Body := CustomStringReplace(Body, '</a>', '',true);
1494- Body := THTMLCreate.DeleteLink(Body);
1269+ Body := GikoSys.DeleteLink(Body);
14951270 Body := CustomStringReplace(Body, '&lt;', '<');
14961271 Body := CustomStringReplace(Body, '&gt;', '>');
14971272 Body := CustomStringReplace(Body, '&quot;', '"');
@@ -1507,7 +1282,7 @@ begin
15071282 FileName := ThreadItem.FilePath;
15081283 tmp := GikoSys.ReadThreadFile(FileName, Line);
15091284 if (tmp <> '') And ( not GikoSys.FAbon.CheckAbonPopupRes(tmp) And( not GikoSys.FAbon.CheckIndividualAbonList(line))) then begin
1510- DivideStrLine(tmp, @Res);
1285+ Res := DivideStrLine(tmp);
15111286 if (GikoSys.Setting.ShowMail = false) or (Length(res.FMailTo) = 0) then
15121287 Header := IntToStr(Line) + ' 名前: ' + Res.FName + ' 投稿日: ' + Res.FDateTime
15131288 else
@@ -1517,7 +1292,7 @@ begin
15171292 Body := CustomStringReplace(Body, '<br> ', #10,true);
15181293 Body := CustomStringReplace(Body, '<br>', #10,true);
15191294 Body := CustomStringReplace(Body, '</a>', '',true);
1520- Body := THTMLCreate.DeleteLink(Body);
1295+ Body := GikoSys.DeleteLink(Body);
15211296 Body := CustomStringReplace(Body, '&lt;', '<');
15221297 Body := CustomStringReplace(Body, '&gt;', '>');
15231298 Body := CustomStringReplace(Body, '&quot;', '"');
@@ -1598,9 +1373,9 @@ begin
15981373 for i := 0 to dirs.Count - 1 do begin
15991374 files := TStringList.Create;
16001375 try
1601- files.BeginUpdate;
1376+ files.BeginUpdate;
16021377 gikoSys.GetFileList(dirs[i], '*.*', files, true);
1603- files.EndUpdate;
1378+ files.EndUpdate;
16041379 tmpD := CustomStringReplace(dirs[i], GikoSys.GetConfigDir, path);
16051380 if (AnsiPos(dirs[i], tmp) <> 0) and not (DirectoryExists(tmpD)) then
16061381 ForceDirectories(tmpD);
@@ -1631,80 +1406,6 @@ begin
16311406 finally
16321407 dirs.Free;
16331408 end;
1634-end;{!
1635-\brief datファイルの一ラインを分解
1636-\param Line datファイルを構成する 1 行
1637-\return レス情報
1638-}
1639-class procedure THTMLCreate.DivideStrLine(Line: string; PRes: PResRec);
1640-const
1641- delimiter = '<>';
1642-var
1643- pds, pde : PChar;
1644- pss, pse : PChar;
1645- ppos : PChar;
1646-begin
1647- //固定
1648- PRes.FType := glt2chNew;
1649-
1650- pss := PChar(Line);
1651- pse := pss + Length(Line);
1652- pds := PChar(delimiter);
1653- pde := pds + Length(delimiter);
1654-
1655- ppos := AnsiStrPosEx(pss, pse, pds, pde);
1656- if (ppos = nil) then begin
1657- Line := CustomStringReplace(Line, '<>', '&lt;&gt;');
1658- Line := CustomStringReplace(Line, ',', '<>');
1659- Line := CustomStringReplace(Line, '@`', ',');
1660- end;
1661- //Trimしてはいけない気がする byもじゅ
1662- PRes.FName := RemoveToken(Line, delimiter);
1663- PRes.FMailTo := RemoveToken(Line, delimiter);
1664- PRes.FDateTime := RemoveToken(Line, delimiter);
1665- PRes.FBody := RemoveToken(Line, delimiter);
1666- //2ちゃんねるとかだと、本文の先頭に1つ半角空白が入っているので削除する
1667- //他の掲示板で、レス自体の空白かもしれないけどそれは諦める
1668- PRes.FBody := TrimLeft(PRes.FBody);
1669- //空だと問題が起きるから、空白を設定する
1670- if PRes.FBody = '' then
1671- PRes.FBody := '&nbsp;';
1672-
1673- PRes.FTitle := RemoveToken(Line, delimiter);
1674-end;
1675-
1676-{!
1677-\brief HTML からアンカータグを削除
1678-\param s 元になる HTML
1679-\return アンカータグが削除された HTML
1680-}
1681-class function THTMLCreate.DeleteLink(const s: string): string;
1682-var
1683- s1: string;
1684- s2: string;
1685- idx: Integer;
1686- i: Integer;
1687-begin
1688- i := 0;
1689- Result := '';
1690- while True do begin
1691- s1 := GikoSys.GetTokenIndex(s, '<a href="', i);
1692- s2 := GikoSys.GetTokenIndex(s, '<a href="', i + 1);
1693-
1694- idx := Pos('">', s1);
1695- if idx <> 0 then
1696- Delete(s1, 1, idx + 1);
1697- idx := Pos('">', s2);
1698- if idx <> 0 then
1699- Delete(s2, 1, idx + 1);
1700-
1701- Result := Result + s1 + s2;
1702-
1703- if s2 = '' then
1704- Break;
1705-
1706- inc(i, 2);
1707- end;
17081409 end;
17091410
17101411
--- a/ItemDownload.pas
+++ b/ItemDownload.pas
@@ -53,9 +53,7 @@ type
5353 function ParseCgiStatus(Content: string): TCgiStatus;
5454 function CgiDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime): Boolean;
5555 function DatDownload(ItemType: TGikoDownloadType; URL: string; Modified: TDateTime; RangeStart: Integer; AdjustLen: Integer): Boolean;
56- procedure DeleteStatusLine(Item: TDownloadItem);
57- procedure InitHttpClient(client: TIdHttp);
58- procedure ClearHttpClient(client: TIdHttp);
56+ function DeleteStatusLine(Content: string): string;
5957 protected
6058 procedure Execute; override;
6159 public
@@ -106,7 +104,7 @@ type
106104 implementation
107105
108106 uses
109- Y_TextConverter, MojuUtils, HTMLCreate;
107+ Y_TextConverter, MojuUtils;
110108
111109 constructor TDownloadThread.Create(CreateSuspended: Boolean);
112110 begin
@@ -120,7 +118,13 @@ end;
120118
121119 destructor TDownloadThread.Destroy;
122120 begin
123- ClearHttpClient(FIndy);
121+ FIndy.Request.CustomHeaders.Clear;
122+ FIndy.Request.RawHeaders.Clear;
123+ FIndy.Request.Clear;
124+ FIndy.Response.CustomHeaders.Clear;
125+ FIndy.Response.RawHeaders.Clear;
126+ FIndy.Response.Clear;
127+ FIndy.ProxyParams.Clear;
124128 FIndy.Free;
125129 inherited;
126130 end;
@@ -142,65 +146,7 @@ begin
142146 [Day, Copy(StrMonth, 1 + 3 * (Month - 1), 3),
143147 Year, Hour, Min, Sec]);
144148 end;
145-// ******************************************************************
146-// HTTPClientの初期化
147-// ******************************************************************
148-procedure TDownloadThread.InitHttpClient(client: TIdHttp);
149-begin
150- ClearHttpClient(client);
151- client.Disconnect;
152- client.Request.UserAgent := GikoSys.GetUserAgent;
153- client.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
154- client.ProxyParams.BasicAuthentication := False;
155- client.ReadTimeout := GikoSys.Setting.ReadTimeOut;
156- {$IFDEF DEBUG}
157- Writeln('------------------------------------------------------------');
158- {$ENDIF}
159- //FIndy.AllowCookies := False;
160- if GikoSys.Setting.ReadProxy then begin
161- if GikoSys.Setting.ProxyProtocol then
162- client.ProtocolVersion := pv1_1
163- else
164- client.ProtocolVersion := pv1_0;
165- client.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
166- client.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
167- client.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
168- client.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
169- if GikoSys.Setting.ReadProxyUserID <> '' then
170- client.ProxyParams.BasicAuthentication := True;
171- {$IFDEF DEBUG}
172- Writeln('プロキシ設定あり');
173- Writeln('ホスト: ' + GikoSys.Setting.ReadProxyAddress);
174- Writeln('ポート: ' + IntToStr(GikoSys.Setting.ReadProxyPort));
175- {$ENDIF}
176- end else begin
177- if GikoSys.Setting.Protocol then
178- client.ProtocolVersion := pv1_1
179- else
180- client.ProtocolVersion := pv1_0;
181- client.ProxyParams.ProxyServer := '';
182- client.ProxyParams.ProxyPort := 80;
183- client.ProxyParams.ProxyUsername := '';
184- client.ProxyParams.ProxyPassword := '';
185- {$IFDEF DEBUG}
186- Writeln('プロキシ設定なし');
187- {$ENDIF}
188- end;
189-end;
190-// ******************************************************************
191-// HTTPClientのリクエストとレスポンスのデータの消去
192-// ******************************************************************
193-procedure TDownloadThread.ClearHttpClient(client: TIdHttp);
194-begin
195- client.Request.CustomHeaders.Clear;
196- client.Request.RawHeaders.Clear;
197- client.Request.Clear;
198- client.Response.CustomHeaders.Clear;
199- client.Response.RawHeaders.Clear;
200- client.Response.Clear;
201-
202- client.ProxyParams.Clear;
203-end;
149+
204150 procedure TDownloadThread.Execute;
205151 var
206152 ResStream: TMemoryStream;
@@ -244,11 +190,11 @@ begin
244190 begin
245191 FDownloadTitle := FItem.FThreadItem.Title;
246192 if FItem.FThreadItem <> nil then begin
247- if FItem.FThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
248- boardPlugIn := FItem.FThreadItem.ParentBoard.BoardPlugIn;
249- Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) );
250- end;
251- //if FItem.FThreadItem.IsBoardPlugInAvailable then begin
193+ if FItem.FThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
194+ boardPlugIn := FItem.FThreadItem.ParentBoard.BoardPlugIn;
195+ Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) );
196+ end;
197+ //if FItem.FThreadItem.IsBoardPlugInAvailable then begin
252198 // boardPlugIn := FItem.FThreadItem.BoardPlugIn;
253199 // Item.State := TGikoDownloadState( boardPlugIn.DownloadThread( DWORD( FItem.FThreadItem ) ) );
254200 //end;
@@ -271,9 +217,51 @@ begin
271217 Continue;
272218 end;
273219
274- FAbort := False;
275220 //===== プラグインを使用しない場合
276- InitHttpClient(FIndy);
221+ FAbort := False;
222+ FIndy.Request.CustomHeaders.Clear;
223+ FIndy.Response.Clear;
224+ FIndy.Request.Clear;
225+ FIndy.ProxyParams.Clear;
226+ FIndy.Disconnect;
227+ FIndy.Request.UserAgent := GikoSys.GetUserAgent;
228+ FIndy.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
229+ FIndy.ProxyParams.BasicAuthentication := False;
230+ FIndy.ReadTimeout := GikoSys.Setting.ReadTimeOut;
231+ {$IFDEF DEBUG}
232+ Writeln('------------------------------------------------------------');
233+ {$ENDIF}
234+ //FIndy.AllowCookies := False;
235+ if GikoSys.Setting.ReadProxy then begin
236+ if GikoSys.Setting.ProxyProtocol then
237+ FIndy.ProtocolVersion := pv1_1
238+ else
239+ FIndy.ProtocolVersion := pv1_0;
240+ FIndy.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
241+ FIndy.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
242+ FIndy.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
243+ FIndy.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
244+ if GikoSys.Setting.ReadProxyUserID <> '' then
245+ FIndy.ProxyParams.BasicAuthentication := True;
246+ {$IFDEF DEBUG}
247+ Writeln('プロキシ設定あり');
248+ Writeln('ホスト: ' + GikoSys.Setting.ReadProxyAddress);
249+ Writeln('ポート: ' + IntToStr(GikoSys.Setting.ReadProxyPort));
250+ {$ENDIF}
251+ end else begin
252+ if GikoSys.Setting.Protocol then
253+ FIndy.ProtocolVersion := pv1_1
254+ else
255+ FIndy.ProtocolVersion := pv1_0;
256+ FIndy.ProxyParams.ProxyServer := '';
257+ FIndy.ProxyParams.ProxyPort := 80;
258+ FIndy.ProxyParams.ProxyUsername := '';
259+ FIndy.ProxyParams.ProxyPassword := '';
260+ {$IFDEF DEBUG}
261+ Writeln('プロキシ設定なし');
262+ {$ENDIF}
263+ end;
264+
277265 adjustMargin := 0;
278266 if Item.DownType = gdtThread then begin
279267 if FileExists( Item.ThreadItem.GetThreadFileName ) then begin
@@ -532,7 +520,8 @@ begin
532520 Writeln('CGIStatus: OK');
533521 {$ENDIF}
534522 Item.ResponseCode := 200;
535- DeleteStatusLine(Item);
523+ Item.Content := DeleteStatusLine(Item.Content);
524+ Item.ContentLength := CgiStatus.FSize;
536525 end;
537526 gcsINCR: begin
538527 //今はありえない
@@ -540,7 +529,8 @@ begin
540529 Writeln('CGIStatus: 206');
541530 {$ENDIF}
542531 Item.ResponseCode := 206;
543- DeleteStatusLine(Item);
532+ Item.Content := DeleteStatusLine(Item.Content);
533+ Item.ContentLength := CgiStatus.FSize;
544534 end;
545535 gcsERR: begin
546536 {$IFDEF DEBUG}
@@ -605,9 +595,68 @@ begin
605595 else
606596 Item.State := gdsError;
607597 end;
598+{
599+ //無いと思うけど。。。
600+ if (Item.ResponseCode in [200, 206]) and (Item.Content = '') then
601+ Item.State := gdsError;
602+ Item.LastModified := FIndy.Response.LastModified;
603+ //差分取得で1バイト前からとってきたときはマイナスする
604+ Item.ContentLength := FIndy.Response.ContentLength + AdjustLen;
605+ try
606+ ResStream.Clear;
607+ FIndy.Get(URL, ResStream);
608+ Item.Content := GikoSys.GzipDecompress(ResStream, FIndy.Response.ContentEncoding);
609+ if (Item.DownType = gdtThread) and (AdjustLen = -1) and (Item.Content[1] <> #10) then begin
610+ //差分取得かつ1バイト目がLFでない場合は「あぼーん」されているかもしれんので再取得
611+ //ここでメッセージ表示イベント
612+ //event
613+ FMsg := '「あぼーん」を検出したので再取得を行います';
614+ if Assigned(OnDownloadMsg) then
615+ Synchronize(FireDownloadMsg);
616+ FIndy.Request.ContentRangeStart := 0;
617+ FIndy.Request.ContentRangeEnd := 0;
618+ AdjustLen := 0;
619+ ResStream.Clear;
620+ FIndy.Get(URL, ResStream);
621+ Item.Content := GikoSys.GzipDecompress(ResStream, FIndy.Response.ContentEncoding);
622+ end else if (Item.DownType = gdtThread) and (AdjustLen = -1) and (Item.Content[1] = #10) then begin
623+ //差分取得かつ1バイト目がLFの場合(正常取得)は頭のLFを削除
624+ Item.Content := Copy(Item.Content, 2, Length(Item.Content));
625+ end;
626+ except
627+ Item.State := gdsError;
628+ end;
629+ Item.ResponseCode := FIndy.ResponseCode;
630+}
631+{
632+ try
633+ ResStream.Clear;
634+ FIndy.Get(URL, ResStream);
635+ Item.Content := GikoSys.GzipDecompress(ResStream, FIndy.Response.ContentEncoding);
636+ except
637+ Item.State := gdsError;
638+ end;
639+
640+ CgiStatus := ParseCgiStatus(Item.Content);
641+ if CgiStatus.FStatus = gcsOK then begin
642+ if CgiStatus.FSize = 0 then
643+ Item.State := gdsNotModify
644+ else if Item.DownType = gdtBoard then
645+ Item.State := gdsComplete
646+ else
647+ Item.State := gdsDiffComplete;
648+ end else if CgiStatus.FStatus = gcsINCR then begin
649+ Item.State := gdsComplete;
650+ end else if CgiStatus.FStatus = gcsERR then begin
651+ Item.State := gdsError;
652+ Item.ErrText := CgiStatus.FErrText;
653+ end;
654+ Item.ContentLength := CgiStatus.FSize;
655+ }
608656 except
609657 Item.State := gdsError;
610658 end;
659+ //Item.ResponseCode := FIndy.ResponseCode;
611660 if FAbort then
612661 Item.State := gdsAbort;
613662 finally
@@ -616,7 +665,13 @@ begin
616665 ResStream.Free;
617666 end;
618667
619- ClearHttpClient(FIndy);
668+ FIndy.Request.CustomHeaders.Clear;
669+ FIndy.Request.RawHeaders.Clear;
670+ FIndy.Request.Clear;
671+ FIndy.Response.CustomHeaders.Clear;
672+ FIndy.Response.RawHeaders.Clear;
673+ FIndy.Response.Clear;
674+ FIndy.ProxyParams.Clear;
620675
621676 if Terminated then Break;
622677 Suspend;
@@ -708,6 +763,8 @@ var
708763 begin
709764 ResponseCode := -1;
710765 if (ItemType = gdtThread) and (RangeStart > 0) then begin
766+// if (ItemType = gdtThread) and (Item.ThreadItem.Size > 0) then begin
767+// FIndy.Request.ContentRangeStart := Item.ThreadItem.Size + AdjustLen;
711768 FIndy.Request.ContentRangeStart := RangeStart + AdjustLen;
712769 FIndy.Request.ContentRangeEnd := 0;
713770 end else begin
@@ -720,7 +777,9 @@ begin
720777 FIndy.Request.CustomHeaders.Add('Pragma: no-cache');
721778 if (Modified <> 0) and (Modified <> ZERO_DATE) then begin
722779 FIndy.Request.LastModified := modified - OffsetFromUTC;
780+ //FIndy.Request.CustomHeaders.Add('If-Modified-Since: ' + RFC1123_Date(modified - OffsetFromUTC) + ' GMT');
723781 end;
782+// FIndy.Request.AcceptEncoding := 'gzip';
724783 if RangeStart = 0 then
725784 FIndy.Request.AcceptEncoding := 'gzip'
726785 else
@@ -889,20 +948,17 @@ begin
889948 end;
890949 end;
891950
892-//1行目を消して、コンテンツサイズを設定する
893-procedure TDownloadThread.DeleteStatusLine(Item: TDownloadItem);
951+//手抜きな処理で1行目を消す
952+function TDownloadThread.DeleteStatusLine(Content: string): string;
894953 var
895954 SList: TStringList;
896955 begin
897956 SList := TStringList.Create;
898957 try
899- SList.Text := Item.Content;
900- //1行目を削除
958+ SList.Text := Content;
901959 if SList.Count > 1 then
902960 SList.Delete(0);
903- Item.Content := SList.Text;
904- //改行コードをCRLF -> LFと考えて、行数分だけマイナス
905- Item.ContentLength := Length(SList.Text) - SList.Count;
961+ Result := SList.Text;
906962 finally
907963 SList.Free;
908964 end;
@@ -1194,6 +1250,11 @@ var
11941250 NewRes: Integer;
11951251 finish : Boolean;
11961252 loopCnt : Integer;
1253+// KokoTxt : string;
1254+// KokoIdx : Integer;
1255+// NewTxt : string;
1256+// NewIdx : Integer;
1257+// LastTxt : string;
11971258 LastIdx : Integer;
11981259 begin
11991260 FileName := ThreadItem.GetThreadFileName;
@@ -1292,7 +1353,7 @@ begin
12921353 Body.SaveToFile(FileName);
12931354
12941355 if ThreadItem.Title = '' then begin
1295- THTMLCreate.DivideStrLine(Body[0], @Res);
1356+ Res := DivideStrLine(Body[0]);
12961357 ThreadItem.Title := Res.FTitle;
12971358 end;
12981359 ThreadItem.Size := 0;
@@ -1314,6 +1375,7 @@ begin
13141375 ThreadItem.RoundDate := Now;
13151376 if not ThreadItem.UnRead then begin
13161377 ThreadItem.UnRead := True;
1378+ ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead + 1;
13171379 end;
13181380 // if ThreadItem.RoundNo = 6 then
13191381 // ThreadItem.RoundNo := 0;
--- a/KeySetting.pas
+++ b/KeySetting.pas
@@ -4,8 +4,8 @@ interface
44
55 uses
66 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7- Dialogs, ComCtrls, StdCtrls, ExtCtrls, ActnList, Menus,
8- Editor;
7+ Dialogs, ComCtrls, StdCtrls, ExtCtrls, ActnList, Menus, GikoSystem, GikoUtil,
8+ Editor;
99
1010 type
1111 TKeySettingItem = class(TObject)
@@ -64,7 +64,7 @@ type
6464 { Private 宣言 }
6565 public
6666 { Public 宣言 }
67- EditorForm: TEditorForm;
67+ EditorForm: TEditorForm;
6868 end;
6969
7070 //var
@@ -72,8 +72,7 @@ type
7272
7373 implementation
7474
75-uses
76- Giko, GikoUtil, Gesture, GikoDataModule, GikoSystem;
75+uses Giko, Gesture, GikoDataModule;
7776
7877 const
7978 GUESTURE_NOTHING = 'なし';
@@ -111,7 +110,7 @@ begin
111110 if ListView.Items.Count > 0 then
112111 ListView.Selected := ListView.Items[0];
113112 EditorForm := TEditorForm.Create(Self);
114- GikoSys.LoadKeySetting(EditorForm.ActionList, GikoSys.GetEditorKeyFileName);
113+ GikoSys.LoadEditorKeySetting(EditorForm.ActionList);
115114 try
116115 for i := 0 to EditorForm.ActionList.ActionCount - 1 do begin
117116 if EditorForm.ActionList.Actions[i] is TAction then begin
--- a/KuroutSetting.pas
+++ b/KuroutSetting.pas
@@ -136,7 +136,7 @@ begin
136136 GikoSys.Setting.TimeAdjust := PutPostTimeRadioButton.Checked;
137137 //2ch言語サポート
138138 GikoSys.Setting.GengoSupport := GengoSupport.Checked;
139- GikoSys.SetGikoMessage;
139+ GikoSys.Setting.SetMessages;
140140 //ローカル・リモートフシアナ警告
141141 GikoSys.Setting.LocalTrapAtt := LocalTrapAtt.Checked;
142142 GikoSys.Setting.RemoteTrapAtt := RemoteTrapAtt.Checked;
--- a/ListViewUtils.pas
+++ b/ListViewUtils.pas
@@ -10,24 +10,20 @@ type
1010 TListViewUtils = class(TObject)
1111 private
1212 {Private 宣言}
13- class procedure DrawCategoryItem(BBS: TBBS; Item: TListItem; ListView: TListView);
14- class procedure DrawBoardItem(Category: TCategory; Item: TListItem; ListView: TListView);
15- class procedure DrawThreadItem(Board: TBoard; Item: TListItem; ListView: TListView);
16- class procedure DrawItemLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
17- class procedure DrawItemNoLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
1813 public
1914 {Public 宣言}
2015 class procedure SetBoardTreeNode(inBBS : TBBS; treeView: TTreeView);
2116 class function SetCategoryListItem(ABBS2ch: TBBS; ListView: TListView;
22- NumberVisible: Boolean): Integer;
17+ NumberVisible: Boolean; var vSortIndex: Integer; var vSortOrder: Boolean): Integer;
2318 class procedure ListViewSort(Sender: TObject; ListView: TListView; Column: TListColumn;
24- NumberVisible: Boolean; vSortOrder: Boolean);
19+ NumberVisible: Boolean; var vSortOrder: Boolean; var vSortIndex: Integer);
2520 class function ActiveListTrueColumn( column : TListColumn ) : TListColumn;
2621 class function SetBoardListItem(Category: TCategory; ListView: TListView;
27- NumberVisible: Boolean): Integer;
22+ NumberVisible: Boolean; var vSortIndex: Integer; var vSortOrder: Boolean): Integer;
2823 class function SetThreadListItem(Board: TBoard; ListView: TListView;
29- NumberVisible: Boolean): Integer;
24+ NumberVisible: Boolean; var vSortIndex: Integer; var vSortOrder: Boolean): Integer;
3025 class procedure ListViewData(Sender: TObject; Item: TListItem);
26+
3127 end;
3228
3329
@@ -141,7 +137,9 @@ end;
141137 class function TListViewUtils.SetCategoryListItem(
142138 ABBS2ch: TBBS;
143139 ListView: TListView;
144- NumberVisible: Boolean
140+ NumberVisible: Boolean;
141+ var vSortIndex: Integer;
142+ var vSortOrder: Boolean
145143 ): Integer;
146144 var
147145 TitleColumn : TListColumn;
@@ -181,13 +179,12 @@ begin
181179 GikoForm.FolderImage.Picture := nil;
182180 GikoForm.ItemIcon16.GetBitmap(1, GikoForm.FolderImage.Picture.Bitmap);
183181
182+ vSortIndex := GikoSys.Setting.BBSSortIndex;
183+ vSortOrder := GikoSys.Setting.BBSSortOrder;
184184 for i := ListView.Columns.Count - 1 downto 0 do begin
185- if (GikoSys.Setting.BBSSortIndex
186- = Integer(GikoSys.Setting.BBSColumnOrder[ ListView.Column[ i ].Tag ])) then begin
187- ListViewSort( nil, ListView, ListView.Column[ i ],
188- NumberVisible, GikoSys.Setting.BBSSortOrder);
189- Break;
190- end;
185+ idx := ListView.Column[ i ].Tag;
186+ if vSortIndex = Ord( GikoSys.Setting.BBSColumnOrder[ idx ] ) then
187+ ListViewSort( nil, ListView, ListView.Column[ i ], NumberVisible, vSortOrder, vSortIndex );
191188 end;
192189
193190 Result := ABBS2ch.Count;
@@ -201,10 +198,11 @@ class procedure TListViewUtils.ListViewSort(
201198 ListView: TListView;
202199 Column: TListColumn;
203200 NumberVisible: Boolean;
204- vSortOrder: Boolean
201+ var vSortOrder: Boolean;
202+ var vSortIndex: Integer
205203 );
206204 var
207- i, idx : Integer;
205+ i, id, idx : Integer;
208206 orderList : TList;
209207 wkBBS: TBBS;
210208 wkCategory: TCategory;
@@ -215,41 +213,53 @@ begin
215213 for i := 0 to ListView.Columns.Count - 1 do begin
216214 ListView.Column[i].ImageIndex := -1;
217215 end;
218- if vSortOrder then
216+
217+ if SortOrder then
219218 ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT1
220219 else
221220 ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT2;
222221
223-
224222 Sort.SortNoFlag := NumberVisible;
225223
224+ //if TObject(TreeView.Selected.Data) is TBBS then begin
226225 if TObject( GikoForm.ActiveList ) is TBBS then begin
226+ //wkBBS := TBBS(TreeView.Selected.Data);
227227 wkBBS := TBBS( GikoForm.ActiveList );
228228 orderList := GikoSys.Setting.BBSColumnOrder;
229+ id := Integer( orderList[ idx ] );
229230 Sort.SortOrder := vSortOrder;
230- Sort.SortIndex := Integer( orderList[ idx ] );
231- GikoSys.Setting.BBSSortIndex := Sort.SortIndex;
232- GikoSys.Setting.BBSSortOrder := Sort.SortOrder;
231+ Sort.SortIndex := id;
232+ GikoSys.Setting.BBSSortIndex := id;
233+ GikoSys.Setting.BBSSortOrder := vSortOrder;
233234 wkBBS.Sort(Sort.CategorySortProc);
235+ //end else if TObject(TreeView.Selected.Data) is TCategory then begin
234236 end else if TObject( GikoForm.ActiveList ) is TCategory then begin
237+ //wkCategory := TCategory(TreeView.Selected.Data);
235238 wkCategory := TCategory( GikoForm.ActiveList );
236239 orderList := GikoSys.Setting.CategoryColumnOrder;
240+ id := Integer( orderList[ idx ] );
237241 Sort.SortOrder := vSortOrder;
238- Sort.SortIndex := Integer( orderList[ idx ] );
239- GikoSys.Setting.CategorySortIndex := Sort.SortIndex;
240- GikoSys.Setting.CategorySortOrder := Sort.SortOrder;
242+ Sort.SortIndex := id;
243+ GikoSys.Setting.CategorySortIndex := id;
244+ GikoSys.Setting.CategorySortOrder := vSortOrder;
241245 wkCategory.CustomSort(BoardSortProc);
246+ //end else if TObject(TreeView.Selected.Data) is TBoard then begin
242247 end else if TObject( GikoForm.ActiveList ) is TBoard then begin
248+ //wkBoard := TBoard(TreeView.Selected.Data);
243249 wkBoard := TBoard( GikoForm.ActiveList );
244250 orderList := GikoSys.Setting.BoardColumnOrder;
251+ id := Integer( orderList[ idx ] );
245252 Sort.SortOrder := vSortOrder;
246- Sort.SortIndex := Integer( orderList[ idx ] );
247- GikoSys.Setting.BoardSortIndex := Sort.SortIndex;
248- GikoSys.Setting.BoardSortOrder := Sort.SortOrder;
253+ Sort.SortIndex := id;
254+ GikoSys.Setting.BoardSortIndex := id;
255+ GikoSys.Setting.BoardSortOrder := vSortOrder;
249256 wkBoard.CustomSort(ThreadItemSortProc);
257+ end else begin
258+ id := 0;
250259 end;
251260
252261 ListView.Refresh;
262+ vSortIndex := id;
253263 end;
254264
255265 {!
@@ -259,16 +269,49 @@ Delphi 6 Personal
259269 正しいカラムが渡されないため、正しいカラムに変換します。
260270 }
261271 class function TListViewUtils.ActiveListTrueColumn( column : TListColumn ) : TListColumn;
272+{*
273+var
274+ i, idx : Integer;
275+ orderList : TList;
276+*}
262277 begin
278+
263279 // 正しく変換する方法が分からないので保留
264280 Result := column;
265281 Exit;
282+{*
283+ Result := column;
284+
285+ if TObject( FActiveList ) is TBBS then
286+ orderList := GikoSys.Setting.BBSColumnOrder
287+ else if TObject( FActiveList ) is TCategory then
288+ orderList := GikoSys.Setting.CategoryColumnOrder
289+ else if TObject( FActiveList ) is TBoard then
290+ orderList := GikoSys.Setting.BoardColumnOrder
291+ else
292+ Exit;
293+
294+ idx := column.Tag;
295+
296+ for i := 0 to ListView.Columns.Count - 1 do begin
297+ if Integer( orderList[ ListView.Column[ i ].Tag ] ) = 0 then begin
298+ if idx = 0 then
299+ Result := ListView.Column[ i ]
300+ else if idx <= i then
301+ Result := ListView.Column[ idx - 1 ];
302+ Exit;
303+ end;
304+ end;
305+*}
306+
266307 end;
267308 //ListViewにBoardItemを設定する
268309 class function TListViewUtils.SetBoardListItem(
269310 Category: TCategory;
270311 ListView: TListView;
271- NumberVisible: Boolean
312+ NumberVisible: Boolean;
313+ var vSortIndex: Integer;
314+ var vSortOrder: Boolean
272315 ): Integer;
273316 var
274317 TitleColumn : TListColumn;
@@ -323,13 +366,12 @@ begin
323366 GikoForm.FolderImage.Picture := nil;
324367 GikoForm.ItemIcon16.GetBitmap(3, GikoForm.FolderImage.Picture.Bitmap);
325368
369+ vSortIndex := GikoSys.Setting.CategorySortIndex;
370+ vSortOrder := GikoSys.Setting.CategorySortOrder;
326371 for i := ListView.Columns.Count - 1 downto 0 do begin
327- if (GikoSys.Setting.CategorySortIndex =
328- Integer( GikoSys.Setting.CategoryColumnOrder[ ListView.Columns[i].Tag ] )) then begin
329- ListViewSort( nil, ListView, ListView.Column[ i ],
330- NumberVisible, GikoSys.Setting.CategorySortOrder);
331- Break;
332- end;
372+ idx := ListView.Column[ i ].Tag;
373+ if vSortIndex = Ord( GikoSys.Setting.CategoryColumnOrder[ idx ] ) then
374+ ListViewSort( nil, ListView, ListView.Column[ i ], NumberVisible, vSortOrder, vSortIndex );
333375 end;
334376
335377 Result := Category.Count;
@@ -341,7 +383,9 @@ end;
341383 class function TListViewUtils.SetThreadListItem(
342384 Board: TBoard;
343385 ListView: TListView;
344- NumberVisible: Boolean
386+ NumberVisible: Boolean;
387+ var vSortIndex: Integer;
388+ var vSortOrder: Boolean
345389 ): Integer;
346390 var
347391 TitleColumn : TListColumn;
@@ -416,13 +460,12 @@ begin
416460 GikoForm.FolderImage.Picture := nil;
417461 GikoForm.ItemIcon16.GetBitmap(5, GikoForm.FolderImage.Picture.Bitmap);
418462
463+ vSortIndex := GikoSys.Setting.BoardSortIndex;
464+ vSortOrder := GikoSys.Setting.BoardSortOrder;
419465 for i := ListView.Columns.Count - 1 downto 0 do begin
420- if (GikoSys.Setting.BoardSortIndex
421- = Integer( GikoSys.Setting.BoardColumnOrder[ ListView.Columns[ i ].Tag ] )) then begin
422- ListViewSort( nil, ListView, ListView.Column[ i ],
423- NumberVisible, GikoSys.Setting.BoardSortOrder);
424- Break;
425- end;
466+ idx := ListView.Column[ i ].Tag;
467+ if vSortIndex = Ord( GikoSys.Setting.BoardColumnOrder[ idx ] ) then
468+ ListViewSort( nil, ListView, ListView.Column[ i ], NumberVisible, vSortOrder, vSortIndex );
426469 end;
427470
428471 Result := Board.Count;
@@ -433,268 +476,285 @@ end;
433476
434477 class procedure TListViewUtils.ListViewData(Sender: TObject; Item: TListItem);
435478 var
436- ActivListObj : TObject;
479+// FileName: string;
480+// DateTime: TDateTime;
481+ BoardCnt: Integer;
482+ BBS: TBBS;
483+ Category: TCategory;
484+ Board: TBoard;
485+ ThreadItem: TThreadItem;
486+ RepStr: string;
487+ ActivListObj : TObject;
488+ i, idx : Integer;
437489 ListView : TListView;
438490 begin
439491 if (Sender <> nil) and (Sender is TListView) then begin
440- ListView := TListView(Sender);
441- ActivListObj := GikoForm.ActiveList;
442- if ActivListObj is TBBS then begin
443- DrawCategoryItem(TBBS(ActivListObj), Item, ListView);
444- end else if ActivListObj is TCategory then begin
445- DrawBoardItem(TCategory(ActivListObj), Item, ListView);
446- end else if ActivListObj is TBoard then begin
447- DrawThreadItem(TBoard(ActivListObj), Item, ListView);
448- end;
492+ ListView := TListView(Sender)
493+ end else begin
494+ Exit;
449495 end;
450-end;
451-//! リストビューのアイテムを描画する(カテゴリー用)
452-class procedure TListViewUtils.DrawCategoryItem(
453- BBS: TBBS; Item: TListItem; ListView: TListView
454-);
455-var
456- Category : TCategory;
457-begin
458496
459- //===== カテゴリリスト =====
460- ListView.StateImages := nil;
497+ ActivListObj := GikoForm.ActiveList;
498+ if ActivListObj is TBBS then begin
499+ //===== カテゴリリスト =====
500+ BBS := TBBS(ActivListObj);
461501
462- if (BBS = nil) or (BBS.Count <= 0) or (Item = nil)
463- or (Item.Index >= BBS.Count) or (ListView.Items.Count = 0)
464- or (not (BBS.Items[Item.index] is TCategory)) then Exit;
502+ GikoForm.ListView.StateImages := nil;
465503
466- Category := TCategory(BBS.Items[Item.index]);
504+ if (BBS = nil) or (BBS.Count <= 0) or (Item = nil)
505+ or (Item.Index >= BBS.Count) or (ListView.Items.Count = 0)
506+ or (not (BBS.Items[Item.index] is TCategory)) then Exit;
507+ //if BBS.Count <= 0 then Exit;
508+ //if Item = nil then Exit;
509+ //if Item.Index >= BBS.Count then Exit;
510+ //if ListView.Items.Count = 0 then Exit;
467511
468- if (Category = nil) then Exit;
512+ //if not (BBS.Items[Item.index] is TCategory) then Exit;
513+ Category := TCategory(BBS.Items[Item.index]);
469514
470- if GikoDM.ListNumberVisibleAction.Checked then
471- Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
472- else
473- Item.Caption := Category.Title;
515+ if Category = nil then Exit;
474516
475- Item.ImageIndex := ITEM_ICON_CATEGORY1;
476- Item.Data := Category;
477-end;
478-//! リストビューのアイテムを描画する(板用)
479-class procedure TListViewUtils.DrawBoardItem(
480- Category: TCategory; Item: TListItem; ListView: TListView
481-);
482-var
483- Board: TBoard;
484- i, idx : Integer;
485-begin
486- //===== 板リスト =====
487- ListView.StateImages := nil;
517+ if GikoDM.ListNumberVisibleAction.Checked then
518+ Item.Caption := IntToStr(Category.No) + ': ' + Category.Title
519+ else
520+ Item.Caption := Category.Title;
488521
489- if (Category = nil) or (Category.Count <= 0) or (Item = nil)
490- or (Item.Index >= Category.Count) or (ListView.Items.Count = 0)
491- or (not (Category.Items[Item.Index] is TBoard)) then Exit;
522+ Item.ImageIndex := ITEM_ICON_CATEGORY1;
523+ Item.Data := Category;
492524
493- Board := TBoard(Category.Items[Item.Index]);
525+ end else if ActivListObj is TCategory then begin
494526
495- if (Board = nil) then Exit;
527+ //===== 板リスト =====
528+ Category := TCategory(ActivListObj);
496529
497- if GikoDM.ListNumberVisibleAction.Checked then
498- Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
499- else
500- Item.Caption := Board.Title;
530+ ListView.StateImages := nil;
501531
502- if Item.SubItems.Count <> ListView.Columns.Count then begin
503- Item.SubItems.Clear;
504- Item.SubItems.Capacity := GikoSys.Setting.CategoryColumnOrder.Count;
505- for i := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 1 do
506- Item.SubItems.Add('');
507- end;
532+ if (Category = nil) or (Category.Count <= 0) or (Item = nil)
533+ or (Item.Index >= Category.Count) or (ListView.Items.Count = 0)
534+ or (not (Category.Items[Item.Index] is TBoard)) then Exit;
535+ //if Category.Count <= 0 then Exit;
536+ //if Item = nil then Exit;
537+ //if Item.Index >= Category.Count then Exit;
538+ //if ListView.Items.Count = 0 then Exit;
508539
509- Item.ImageIndex := ITEM_ICON_BOARD1;
510- idx := 0;
511- for i := 0 to ListView.Columns.Count - 1 do begin
512- if GikoSys.Setting.CategoryColumnOrder.Count <= i then
513- Break;
514- case GikoSys.Setting.CategoryColumnOrder[ i ] of
515- gccTitle:
516- // Item.Caption は SubItems に含まれ無いので
517- Dec( idx );
518-
519- gccRoundName:
520- if Board.Round then
521- Item.SubItems[ idx ] := Board.RoundName // '予約'
522- else
523- Item.SubItems[ idx ] := '';
540+ //if not (Category.Items[Item.Index] is TBoard) then Exit;
541+ Board := TBoard(Category.Items[Item.Index]);
524542
525- gccLastModified:
526- if Board.RoundDate = ZERO_DATE then begin
527- Item.SubItems[ idx ] := '';
528- end else
529- Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
530- end;
531- Inc( idx );
532- end;
543+ if Board = nil then Exit;
533544
534- Item.Data := Board;
545+ if GikoDM.ListNumberVisibleAction.Checked then
546+ Item.Caption := IntToStr(Board.No) + ': ' + Board.Title
547+ //Item.Caption := IntToStr(Item.Index + 1) + ': ' + Board.Title
548+ else
549+ Item.Caption := Board.Title;
535550
536-end;
537-//! リストビューのアイテムを描画する(スレッド用)
538-class procedure TListViewUtils.DrawThreadItem(
539- Board: TBoard; Item: TListItem;ListView : TListView
540-);
541-var
542- ThreadItem: TThreadItem;
543- BoardCnt: Integer;
544- RepStr: String;
545- i: Integer;
546-begin
547- //===== スレリスト =====
548- if GikoSys.Setting.ListIconVisible then
549- ListView.StateImages := GikoForm.StateIconImageList
550- else
551- ListView.StateImages := nil;
551+ if Item.SubItems.Count <> ListView.Columns.Count then begin
552+ Item.SubItems.Clear;
553+ Item.SubItems.Capacity := GikoSys.Setting.CategoryColumnOrder.Count;
554+ for i := GikoSys.Setting.CategoryColumnOrder.Count - 1 downto 1 do
555+ Item.SubItems.Add('');
556+ end;
552557
558+ Item.ImageIndex := ITEM_ICON_BOARD1;
559+ idx := 0;
560+ for i := 0 to ListView.Columns.Count - 1 do begin
561+ if GikoSys.Setting.CategoryColumnOrder.Count <= i then
562+ Break;
563+// case TGikoCategoryColumnID( ListView.Column[ i ].Tag ) of
564+ case GikoSys.Setting.CategoryColumnOrder[ i ] of
565+ gccTitle:
566+ // Item.Caption は SubItems に含まれ無いので
567+ Dec( idx );
568+
569+ gccRoundName:
570+ if Board.Round then
571+ Item.SubItems[ idx ] := Board.RoundName // '予約'
572+ else
573+ Item.SubItems[ idx ] := '';
574+
575+ gccLastModified:
576+ if Board.RoundDate = ZERO_DATE then begin
577+ Item.SubItems[ idx ] := '';
578+ end else
579+ Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Board.RoundDate);
580+ end;
581+ Inc( idx );
582+ end;
553583
554- case GikoForm.ViewType of
555- gvtAll: BoardCnt := Board.Count;
556- gvtLog: BoardCnt := Board.LogThreadCount;
557- gvtNew: BoardCnt := Board.NewThreadCount;
558- gvtUser: BoardCnt := Board.UserThreadCount;
559- else
560- BoardCnt := 0;
561- end;
584+ Item.Data := Board;
562585
563- if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
564- or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;
565-
566- //改善すべきブロック/////////////////////////////////////////////////////
567- ThreadItem := nil;
568- case GikoForm.ViewType of
569- gvtAll: if Item.Index >= Board.Count then Exit else
570- ThreadItem := TThreadItem(Board.Items[Item.Index]);
571- gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
572- gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
573- gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
574- end;
575- //////////////////////////////////////////////////////////////////////////
576-
577- if (ThreadItem = nil) then Exit;
578-
579- RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );
580- RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
581- RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
582- RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
583- //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);
584- if Item.SubItems.Count <> ListView.Columns.Count then begin
585- Item.SubItems.Clear;
586- Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;
587- for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
588- Item.SubItems.Add('');
589- end;
586+ end else if ActivListObj is TBoard then begin
590587
591- if GikoDM.ListNumberVisibleAction.Checked then
592- Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
593- else
594- Item.Caption := RepStr;
588+ //===== スレリスト =====
589+ Board := TBoard(ActivListObj);
595590
596- case ThreadItem.AgeSage of
597- gasNone: Item.StateIndex := -1;
598- gasNew: Item.StateIndex := 0;
599- gasAge: Item.StateIndex := 1;
600- gasSage: Item.StateIndex := 2;
601- end;
591+ if GikoSys.Setting.ListIconVisible then
592+ ListView.StateImages := GikoForm.StateIconImageList
593+ else
594+ ListView.StateImages := nil;
602595
603- if ThreadItem.IsLogFile then begin
604- DrawItemLogThread(ThreadItem, Item, ListView.Columns.Count);
605- end else begin
606- DrawItemNoLogThread(ThreadItem, Item, GikoSys.Setting.BoardColumnOrder.Count);
607- end;
608596
609- Item.Data := ThreadItem;
610-end;
611-//! ログ有りスレッドを描画する
612-class procedure TListViewUtils.DrawItemLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
613-var
614- i, idx : Integer;
615-begin
616- idx := 0;
617- for i := 0 to ColumnCount - 1 do begin
618- if GikoSys.Setting.BoardColumnOrder.Count <= i then
619- Break;
620-
621- case GikoSys.Setting.BoardColumnOrder[ i ] of
622- gbcTitle:
623- // Item.Caption は SubItems に含まれ無いので
624- Dec( idx );
625- gbcAllCount:
626- Item.SubItems[ idx ] := IntToStr(Thread.AllResCount);
627- gbcLocalCount:
628- Item.SubItems[ idx ] := IntToStr(Thread.Count);
629- gbcNonAcqCount:
630- Item.SubItems[ idx ] := IntToStr(Thread.AllResCount - Thread.Count);
631- gbcNewCount:
632- if Thread.NewResCount = 0 then
633- Item.SubItems[ idx ] := ''
597+ case GikoForm.ViewType of
598+ gvtAll: BoardCnt := Board.Count;
599+ gvtLog: BoardCnt := Board.LogThreadCount;
600+ gvtNew: BoardCnt := Board.NewThreadCount;
601+ gvtUser: BoardCnt := Board.UserThreadCount;
634602 else
635- Item.SubItems[ idx ] := IntToStr(Thread.NewResCount);
636- gbcUnReadCount:
637- Item.SubItems[ idx ] := '';
638- gbcRoundName:
639- if Thread.Round then
640- Item.SubItems[ idx ] := Thread.RoundName
603+ BoardCnt := 0;
604+ end;
605+ {
606+ case GikoForm.ViewType of
607+ gvtAll: BoardCnt := Board.Count;
608+ gvtLog: BoardCnt := Board.GetLogThreadCount;
609+ gvtNew: BoardCnt := Board.GetNewThreadCount;
610+ gvtUser: BoardCnt := Board.GetUserThreadCount;
641611 else
642- Item.SubItems[ idx ] := '';
643- gbcRoundDate://gbcLastModified:
644- if (Thread.RoundDate = ZERO_DATE) then begin
645- Item.SubItems[ idx ] := '';
646- end else
647- Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.RoundDate);
648- gbcCreated:
649- if Thread.CreateDate = ZERO_DATE then begin
650- Item.SubItems[ idx ] := '';
651- end else
652- Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.CreateDate);
653- gbcLastModified:
654- if (Thread.LastModified = ZERO_DATE) then begin
655- Item.SubItems[ idx ] := '';
656- end else
657- Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.LastModified);
612+ BoardCnt := 0;
658613 end;
659- Inc( idx );
660- end;
614+ }
615+// if Board = nil then Exit;
616+ if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
617+ or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;
661618
662- if Thread.NewArrival then
663- Item.ImageIndex := ITEM_ICON_THREADNEW1
664- else
665- Item.ImageIndex := ITEM_ICON_THREADLOG1;
666-end;
667-//! ログなしスレッドを描画する
668-class procedure TListViewUtils.DrawItemNoLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
669-var
670- i, idx: Integer;
671-begin
672- idx := 0;
673- for i := 0 to ColumnCount - 1do begin
674- case GikoSys.Setting.BoardColumnOrder[ i ] of
675- gbcTitle:
676- // Item.Caption は SubItems に含まれ無いので
677- Dec( idx );
678- gbcAllCount:
679- Item.SubItems[ idx ] := IntToStr(Thread.AllResCount);
680- gbcRoundDate://gbcLastModified:
681- Item.SubItems[ idx ] := '';
682- gbcCreated:
683- if Thread.CreateDate = ZERO_DATE then begin
684- Item.SubItems[ idx ] := '';
685- end else
686- Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.CreateDate);
687- gbcLastModified:
688- Item.SubItems[ idx ] := '';
619+ //改善すべきブロック/////////////////////////////////////////////////////
620+ ThreadItem := nil;
621+ case GikoForm.ViewType of
622+ gvtAll: if Item.Index >= Board.Count then Exit else
623+ ThreadItem := TThreadItem(Board.Items[Item.Index]);
624+ gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
625+ gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
626+ gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
627+ end;
628+ //////////////////////////////////////////////////////////////////////////
629+
630+ if ThreadItem = nil then Exit;
631+
632+ RepStr := CustomStringReplace(ThreadItem.Title, '&lt;', '<' );
633+ RepStr := CustomStringReplace(RepStr, '&gt;', '>' );
634+ RepStr := CustomStringReplace(RepStr, '&quot;', '"' );
635+ RepStr := CustomStringReplace(RepStr, '&amp;', '&' );
636+ //RepStr := StringReplace(RepStr, '@`', ',', [rfReplaceAll]);
637+ if Item.SubItems.Count <> ListView.Columns.Count then begin
638+ Item.SubItems.Clear;
639+ Item.SubItems.Capacity := GikoSys.Setting.BoardColumnOrder.Count;
640+ for i := GikoSys.Setting.BoardColumnOrder.Count - 1 downto 1 do
641+ Item.SubItems.Add('');
642+ end;
643+
644+ if GikoDM.ListNumberVisibleAction.Checked then
645+ Item.Caption := IntToStr(ThreadItem.No) + ': ' + RepStr
689646 else
690- Item.SubItems[ idx ] := '';
647+ Item.Caption := RepStr;
648+
649+ case ThreadItem.AgeSage of
650+ gasNone: Item.StateIndex := -1;
651+ gasNew: Item.StateIndex := 0;
652+ gasAge: Item.StateIndex := 1;
653+ gasSage: Item.StateIndex := 2;
654+ end;
655+
656+ if ThreadItem.IsLogFile then begin
657+ idx := 0;
658+ for i := 0 to ListView.Columns.Count - 1 do begin
659+ if GikoSys.Setting.BoardColumnOrder.Count <= i then
660+ Break;
661+// case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
662+ case GikoSys.Setting.BoardColumnOrder[ i ] of
663+ gbcTitle:
664+ // Item.Caption は SubItems に含まれ無いので
665+ Dec( idx );
666+
667+ gbcAllCount:
668+ Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
669+
670+ gbcLocalCount:
671+ Item.SubItems[ idx ] := IntToStr(ThreadItem.Count);
672+
673+ gbcNonAcqCount:
674+ Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount - ThreadItem.Count);
675+
676+ gbcNewCount:
677+ if ThreadItem.NewResCount = 0 then
678+ Item.SubItems[ idx ] := ''
679+ else
680+ Item.SubItems[ idx ] := IntToStr(ThreadItem.NewResCount);
681+
682+ gbcUnReadCount:
683+ Item.SubItems[ idx ] := '';
684+
685+ gbcRoundName:
686+ if ThreadItem.Round then
687+ Item.SubItems[ idx ] := ThreadItem.RoundName
688+ else
689+ Item.SubItems[ idx ] := '';
690+
691+ gbcRoundDate://gbcLastModified:
692+ if (ThreadItem.RoundDate = ZERO_DATE) then begin
693+ Item.SubItems[ idx ] := '';
694+ end else
695+ Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.RoundDate);
696+
697+ gbcCreated:
698+ if ThreadItem.CreateDate = ZERO_DATE then begin
699+ Item.SubItems[ idx ] := '';
700+ end else
701+ Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
702+
703+ gbcLastModified:
704+ if (ThreadItem.LastModified = ZERO_DATE) then begin
705+ Item.SubItems[ idx ] := '';
706+ end else
707+ Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.LastModified);
708+
709+
710+ end;
711+ Inc( idx );
712+ end;
713+
714+ if ThreadItem.NewArrival then
715+ Item.ImageIndex := ITEM_ICON_THREADNEW1
716+ else
717+ Item.ImageIndex := ITEM_ICON_THREADLOG1;
718+
719+
720+ end else begin
721+ idx := 0;
722+ for i := 0 to GikoSys.Setting.BoardColumnOrder.Count - 1 do begin
723+// case TGikoBoardColumnID( ListView.Column[ i ].Tag ) of
724+ case GikoSys.Setting.BoardColumnOrder[ i ] of
725+ gbcTitle:
726+ // Item.Caption は SubItems に含まれ無いので
727+ Dec( idx );
728+
729+ gbcAllCount:
730+ Item.SubItems[ idx ] := IntToStr(ThreadItem.AllResCount);
731+
732+ gbcRoundDate://gbcLastModified:
733+ Item.SubItems[ idx ] := '';
734+
735+ gbcCreated:
736+ if ThreadItem.CreateDate = ZERO_DATE then begin
737+ Item.SubItems[ idx ] := '';
738+ end else
739+ Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', ThreadItem.CreateDate);
740+
741+ gbcLastModified:
742+ Item.SubItems[ idx ] := '';
743+
744+ else
745+ Item.SubItems[ idx ] := '';
746+ end;
747+ Inc( idx );
748+ end;
749+ if ThreadItem.NewArrival then
750+ Item.ImageIndex := ITEM_ICON_THREADNEW1
751+ else
752+ Item.ImageIndex := ITEM_ICON_THREAD1;
691753 end;
692- Inc( idx );
754+
755+ Item.Data := ThreadItem;
756+
693757 end;
694- if Thread.NewArrival then
695- Item.ImageIndex := ITEM_ICON_THREADNEW1
696- else
697- Item.ImageIndex := ITEM_ICON_THREAD1;
698758 end;
699759
700760 end.
--- a/MojuUtils.pas
+++ b/MojuUtils.pas
@@ -14,23 +14,24 @@ unit MojuUtils;
1414 interface
1515
1616 uses
17- Windows, Classes, SysUtils;
17+ Windows, Classes, SysUtils, GikoSystem;
1818
1919 function StrPosEx(StrStart, StrEnd, SubstrStart, SubstrEnd: PChar): PChar;
2020 function AnsiStrPosEx(StrStart, StrEnd, SubstrStart, SubstrEnd: PChar): PChar;
21- function ReplaceString(const S: String; const OldPattern: String; const NewPattern: string): String;
22- function IgnoCaseReplaceString(const S: String; const OldPattern:String; const NewPattern: string): String;
21+ function ReplaceString(const S, OldPattern, NewPattern: string): string;
22+ function IgnoCaseReplaceString(const S, OldPattern, NewPattern: string): string;
2323
24- function CustomStringReplace(const S: String; const OldPattern: String; const NewPattern: string; IgnoreCase : Boolean = False): String; overload;
25- procedure CustomStringReplace(var S : TStringList;const OldPattern: String;const NewPattern: string; IgnoreCase : Boolean = False); overload;
24+ function CustomStringReplace(S , OldPattern: String;const NewPattern: string; IgnoreCase : Boolean = False): String; overload;
25+ procedure CustomStringReplace(var S : TStringList; OldPattern: String;const NewPattern: string; IgnoreCase : Boolean = False); overload;
2626
2727 function ZenToHan(const s: string): string;
28- function VaguePos(const Substr: String; const S: string): Integer;
28+ function VaguePos(const Substr, S: string): Integer;
2929
3030 function ReplaseNoValidateChar( inVal : String): String;
3131 function IsNoValidID( inID :String): Boolean;
3232 //<font>タグを全て削除する
33- function DeleteFontTag( inSource : string) : string;
33+ function DeleteFontTag( inSource : string) : string;
34+ function DivideStrLine(Line: string): TResRec;
3435 function RemoveToken(var s: string;const delimiter: string): string;
3536
3637 implementation
@@ -110,49 +111,48 @@ begin
110111 Result := nil;
111112 end;
112113
114+{$R-}
113115 //高速文字列置換関数(大文字小文字の違いを無視しない)
114-function ReplaceString(const S: String; const OldPattern: String; const NewPattern: string): String;
116+function ReplaceString(const S, OldPattern, NewPattern: string): string;
115117 var
116- ReplaceCount: Integer;
117- DestIndex: Integer;
118- i, l: Integer;
119- p, e, ps, pe: PChar;
120- Count: Integer;
121- olen: Integer;
118+ ReplaceCount: Integer;
119+ DestIndex: Integer;
120+ i, l: Integer;
121+ p, e, ps, pe: PChar;
122+ Count: Integer;
122123 begin
123- Result := S;
124- olen := Length(OldPattern);
125- if olen = 0 then Exit;
124+ Result := S;
125+ if OldPattern = '' then Exit;
126126 p := PChar(S);
127127 e := p + Length(S);
128128 ps := PChar(OldPattern);
129- pe := ps + olen;
129+ pe := ps + Length(OldPattern);
130130 ReplaceCount := 0;
131131 while p < e do begin
132132 p := AnsiStrPosEx(p, e, ps, pe);
133133 if p = nil then Break;
134134 Inc(ReplaceCount);
135- Inc(p, olen);
135+ Inc(p, Length(OldPattern));
136136 end;
137137 if ReplaceCount = 0 then Exit;
138138 SetString(Result, nil, Length(S) +
139- (Length(NewPattern) - olen) * ReplaceCount);
140- p := PChar(S);
141- DestIndex := 1;
142- l := Length( NewPattern );
143- for i := 0 to ReplaceCount - 1 do begin
144- Count := AnsiStrPosEx(p, e, ps, pe) - p;
145- Move(p^, Result[DestIndex], Count);
146- Inc(p, Count);//p := pp;
147- Inc(DestIndex, Count);
148- Move(NewPattern[1], Result[DestIndex], l);
149- Inc(p, olen);
150- Inc(DestIndex, l);
151- end;
152- Move(p^, Result[DestIndex], e - p);
139+ (Length(NewPattern) - Length(OldPattern)) * ReplaceCount);
140+ p := PChar(S);
141+ DestIndex := 1;
142+ l := Length( NewPattern );
143+ for i := 0 to ReplaceCount - 1 do begin
144+ Count := AnsiStrPosEx(p, e, ps, pe) - p;
145+ Move(p^, Result[DestIndex], Count);
146+ Inc(p, Count);//p := pp;
147+ Inc(DestIndex, Count);
148+ Move(NewPattern[1], Result[DestIndex], l);
149+ Inc(p, Length(OldPattern));
150+ Inc(DestIndex, l);
151+ end;
152+ Move(p^, Result[DestIndex], e - p);
153153 end;
154154 //高速文字列置換関数(大文字小文字の違いを無視する)
155-function IgnoCaseReplaceString(const S: String;const OldPattern:String;const NewPattern: string): String;
155+function IgnoCaseReplaceString(const S, OldPattern, NewPattern: string): string;
156156 var
157157 ReplaceCount: Integer;
158158 DestIndex: Integer;
@@ -203,14 +203,18 @@ begin
203203 end;
204204 Move(p^, Result[DestIndex], e - p);
205205 end;
206+{$IFDEF DEBUG}
207+{$R+}
208+{$ENDIF}
209+
206210 //高速文字列置換関数(汎用版1)
207211 function CustomStringReplace(
208- const S :String;
209- const OldPattern: String;
212+ S , OldPattern: String;
210213 const NewPattern: string;
211214 IgnoreCase : Boolean
212215 ): String;
213216 begin
217+ Result := '';
214218 if not IgnoreCase then begin
215219 Result := ReplaceString(S,OldPattern,NewPattern);
216220 end else begin
@@ -221,7 +225,7 @@ end;
221225 //高速文字列置換関数(汎用版2)
222226 procedure CustomStringReplace(
223227 var S : TStringList;
224- const OldPattern: String;
228+ OldPattern: String;
225229 const NewPattern: string;
226230 IgnoreCase : Boolean
227231 );
@@ -265,7 +269,7 @@ end;
265269 (*************************************************************************
266270 * 全角半角ひらがなかたかなを区別しない凄いPos
267271 *************************************************************************)
268-function VaguePos(const Substr:String; const S: string): Integer;
272+function VaguePos(const Substr, S: string): Integer;
269273 begin
270274 Result := AnsiPos(ZenToHan(Substr), ZenToHan(S));
271275 end;
@@ -331,6 +335,45 @@ begin
331335 end;
332336 // *************************************************************************
333337
338+{!
339+\brief datファイルの一ラインを分解
340+\param Line datファイルを構成する 1 行
341+\return レス情報
342+}
343+function DivideStrLine(Line: string): TResRec;
344+const
345+ delimiter = '<>';
346+var
347+ pds, pde : PChar;
348+ pss, pse : PChar;
349+begin
350+ pss := PChar(Line);
351+ pse := pss + Length(Line);
352+ pds := PChar(delimiter);
353+ pde := pds + Length(delimiter);
354+
355+ if AnsiStrPosEx(pss, pse, pds, pde) = nil then begin
356+ Line := CustomStringReplace(Line, '<>', '&lt;&gt;');
357+ Line := CustomStringReplace(Line, ',', '<>');
358+ Line := CustomStringReplace(Line, '@`', ',');
359+ end;
360+ //Delim := '<>';
361+ Result.FType := glt2chNew;
362+ //Trimしてはいけない気がする byもじゅ
363+ Result.FName := RemoveToken(Line, delimiter);
364+ Result.FMailTo := RemoveToken(Line, delimiter);
365+ Result.FDateTime := RemoveToken(Line, delimiter);
366+ Result.FBody := RemoveToken(Line, delimiter);
367+ //2ちゃんねるとかだと、本文の先頭に1つ半角空白が入っているので削除する
368+ //他の掲示板で、レス自体の空白かもしれないけどそれは諦める
369+ Result.FBody := TrimLeft(Result.FBody);
370+ //空だと問題が起きるから、空白を設定する
371+ if Result.FBody = '' then
372+ Result.FBody := '&nbsp;';
373+
374+ Result.FTitle := RemoveToken(Line, delimiter);
375+
376+end;
334377
335378 (*************************************************************************
336379 *
--- a/NewBoard.pas
+++ b/NewBoard.pas
@@ -36,9 +36,8 @@ type
3636 { Private 宣言 }
3737 IgnoreLists : TStringList;
3838 FAbort: Boolean;
39- function BoardDownload(const URL: String): TNewBoardItem;
40- function BoardLoardFromFile(const FilePath: String): String;
41- function UpdateURL(s: string): boolean;
39+ function BoardDownload: TNewBoardItem;
40+ procedure UpdateURL(s: string);
4241 procedure SetIgnoreCategory(b: boolean);
4342 procedure EditIgnoreList(Sender: TObject);
4443 procedure UpdateIgnoreList(Sender: TObject);
@@ -59,24 +58,15 @@ uses Giko, IdHeaderList, MojuUtils, GikoDataModule;
5958 procedure TNewBoardDialog.UpdateButtonClick(Sender: TObject);
6059 var
6160 Item: TNewBoardItem;
62- URL : String;
63- protocol, host, path, document, port, bookmark: String;
6461 begin
6562 try
66- MessageMemo.Clear;
6763 GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
6864 FAbort := False;
6965 UpdateButton.Enabled := False;
7066 StopButton.Enabled := True;
7167 CloseButton.Enabled := False;
7268 EditIgnoreListsButton.Enabled := False;
73- URL := BoardURLComboBox.Text;
74- GikoSys.ParseURI(URL, protocol, host, path, document, port, bookmark);
75- if (protocol = '') then begin
76- Item.FContent := BoardLoardFromFile(URL);
77- end else if (AnsiPos('http', protocol) > 0) then begin
78- Item := BoardDownload(URL);
79- end;
69+ Item := BoardDownload;
8070 StopButton.Enabled := False;
8171 if FAbort then
8272 Exit;
@@ -84,9 +74,8 @@ begin
8474 GikoDM.TabsSaveAction.Tag := 1;
8575 GikoDM.TabsOpenAction.Tag := 1;
8676 GikoDM.TabsSaveAction.Execute;
87- if (UpdateURL(Item.FContent)) then begin
88- GikoForm.ReloadBBS;
89- end;
77+ UpdateURL(Item.FContent);
78+ GikoForm.ReloadBBS;
9079 GikoDM.TabsSaveAction.Tag := 0;
9180 GikoDM.TabsOpenAction.Tag := 0;
9281 end else
@@ -110,12 +99,14 @@ begin
11099 Close;
111100 end;
112101
113-function TNewBoardDialog.BoardDownload(const URL: String): TNewBoardItem;
102+function TNewBoardDialog.BoardDownload: TNewBoardItem;
114103 var
104+ URL: string;
115105 Stream: TMemoryStream;
116106 s: string;
117107 i: Integer;
118108 begin
109+ MessageMemo.Clear;
119110 Indy.Request.Clear;
120111 Indy.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
121112 Indy.ProxyParams.BasicAuthentication := False;
@@ -141,7 +132,7 @@ begin
141132 Indy.ProxyParams.ProxyPassword := '';
142133 end;
143134 //URL := GikoSys.Setting.BoardURL2ch;
144- //URL := BoardURLComboBox.Text;
135+ URL := BoardURLComboBox.Text;
145136 Indy.Request.UserAgent := GikoSys.GetUserAgent;
146137 Indy.Request.Referer := '';
147138 Indy.Request.AcceptEncoding := 'gzip';
@@ -196,9 +187,10 @@ begin
196187 end;
197188 end;
198189
199-function TNewBoardDialog.UpdateURL(s: string): boolean;
190+procedure TNewBoardDialog.UpdateURL(s: string);
200191 var
201192 i: Integer;
193+// j: Integer;
202194 idx: Integer;
203195 idx1: Integer;
204196 idx2: Integer;
@@ -334,7 +326,6 @@ begin
334326 oldURLs.Free;
335327 newURLs.Free;
336328 end;
337- Result := Change;
338329 end;
339330
340331 procedure TNewBoardDialog.FormCreate(Sender: TObject);
@@ -413,21 +404,5 @@ procedure TNewBoardDialog.FormClose(Sender: TObject;
413404 begin
414405 IgnoreLists.Free;
415406 end;
416-//! ローカルファイルをロードする
417-function TNewBoardDialog.BoardLoardFromFile(const FilePath: String): String;
418-var
419- html : TStringList;
420-begin
421- Result := '';
422- // ファイルが存在しているかチェック
423- if (FileExists(FilePath)) then begin
424- html := TStringList.Create();
425- try
426- html.LoadFromFile(FilePath);
427- Result := html.Text;
428- finally
429- html.Free;
430- end;
431- end;
432-end;
407+
433408 end.
--- a/Option.dfm
+++ b/Option.dfm
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog
6161 Top = 4
6262 Width = 509
6363 Height = 389
64- ActivePage = TabSheet3
64+ ActivePage = CSSTabSheet
6565 MultiLine = True
66- TabIndex = 3
66+ TabIndex = 2
6767 TabOrder = 3
6868 OnChange = OptionTabChange
6969 object ConnectSheet: TTabSheet
@@ -687,7 +687,7 @@ object OptionDialog: TOptionDialog
687687 Left = 12
688688 Top = 52
689689 Width = 477
690- Height = 45
690+ Height = 64
691691 Caption = #12473#12524#20316#25104#26085#26178#34920#31034#35373#23450
692692 TabOrder = 1
693693 object CreationTimeLogsCheckBox: TCheckBox
@@ -699,8 +699,8 @@ object OptionDialog: TOptionDialog
699699 TabOrder = 0
700700 end
701701 object FutureThreadCheckBox: TCheckBox
702- Left = 204
703- Top = 16
702+ Left = 12
703+ Top = 40
704704 Width = 265
705705 Height = 17
706706 Caption = #26085#20184#12364#26410#26469#12398#12418#12398#12399#34920#31034#12375#12394#12356#65288'492'#12473#12524#31995#65289
@@ -709,7 +709,7 @@ object OptionDialog: TOptionDialog
709709 end
710710 object GroupBox5: TGroupBox
711711 Left = 12
712- Top = 105
712+ Top = 121
713713 Width = 477
714714 Height = 86
715715 Caption = #12502#12521#12454#12470#12398#26368#22823#21270
@@ -737,35 +737,35 @@ object OptionDialog: TOptionDialog
737737 end
738738 object GroupBox17: TGroupBox
739739 Left = 12
740- Top = 196
740+ Top = 212
741741 Width = 477
742- Height = 45
742+ Height = 63
743743 Caption = #12502#12521#12454#12470#12479#12502#38750#34920#31034#26178#35373#23450
744744 TabOrder = 3
745745 object SelectIntervalLabel: TLabel
746- Left = 10
747- Top = 20
746+ Left = 13
747+ Top = 24
748748 Width = 199
749749 Height = 12
750750 Caption = #12459#12540#12477#12523#12461#12540#12391#12398#31227#21205#26178#12398#28961#21453#24540#26178#38291
751751 end
752752 object Label4: TLabel
753- Left = 271
754- Top = 20
753+ Left = 292
754+ Top = 24
755755 Width = 29
756756 Height = 12
757757 Caption = #12511#12522#31186
758758 end
759759 object Label6: TLabel
760- Left = 305
761- Top = 20
760+ Left = 14
761+ Top = 40
762762 Width = 164
763763 Height = 12
764764 Caption = #65288'55'#12511#12522#31186#20197#19978#12395#35373#23450#12375#12390#19979#12373#12356#65289
765765 end
766766 object SelectIntervalEdit: TEdit
767- Left = 214
768- Top = 16
767+ Left = 235
768+ Top = 20
769769 Width = 49
770770 Height = 20
771771 ImeMode = imClose
@@ -775,7 +775,7 @@ object OptionDialog: TOptionDialog
775775 end
776776 object GroupBox18: TGroupBox
777777 Left = 12
778- Top = 246
778+ Top = 278
779779 Width = 477
780780 Height = 43
781781 Caption = 'dat'#33853#12385#12473#12524#12477#12540#12488#38918
@@ -800,29 +800,6 @@ object OptionDialog: TOptionDialog
800800 #12473#12524#26368#32066#26356#26032#26085#26178#65288#38477#38918#65289)
801801 end
802802 end
803- object GroupBox20: TGroupBox
804- Left = 12
805- Top = 291
806- Width = 477
807- Height = 41
808- Caption = #12473#12524#12483#12489#19968#35239#12480#12454#12531#12525#12540#12489#24460#12398#21205#20316
809- TabOrder = 5
810- object Label24: TLabel
811- Left = 219
812- Top = 18
813- Width = 142
814- Height = 12
815- Caption = #65288#12481#12455#12483#12463#12375#12394#12356#22580#21512#28961#20966#29702#65289
816- end
817- object AutoSortCheckBox: TCheckBox
818- Left = 10
819- Top = 16
820- Width = 207
821- Height = 17
822- Caption = #33258#21205#12391#12473#12524#12483#12489#21517#12391#26119#38918#12477#12540#12488#12377#12427
823- TabOrder = 0
824- end
825- end
826803 end
827804 object ThreadSheet: TTabSheet
828805 Caption = #12473#12524#12483#12489#65297
--- a/Option.pas
+++ b/Option.pas
@@ -202,9 +202,6 @@ type
202202 UnFocusedBoldCheckBox: TCheckBox;
203203 IgnoreKanaCheckBox: TCheckBox;
204204 UseKatjuTypeSkinCheckBox: TCheckBox;
205- GroupBox20: TGroupBox;
206- AutoSortCheckBox: TCheckBox;
207- Label24: TLabel;
208205 procedure FormCreate(Sender: TObject);
209206 procedure FormDestroy(Sender: TObject);
210207 procedure ApplyButtonClick(Sender: TObject);
@@ -356,7 +353,7 @@ begin
356353 FClose := False;
357354 Exit;
358355 end;
359- SetAbonpropertys;
356+ SetAbonpropertys;
360357 SaveSetting;
361358 SettingApply;
362359
@@ -824,8 +821,7 @@ begin
824821 else
825822 DatOchiSortCombo.ItemIndex := 0;
826823 end;
827- AutoSortCheckBox.Checked := GikoSys.Setting.AutoSortThreadList;
828-
824+
829825 //あぼ〜ん
830826 RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
831827 ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
@@ -1102,7 +1098,6 @@ begin
11021098 GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
11031099 end;
11041100 end;
1105- GikoSys.Setting.AutoSortThreadList := AutoSortCheckBox.Checked;
11061101
11071102 GikoSys.Setting.WriteSystemSettingFile;
11081103 GikoSys.Setting.WriteBoardURLSettingFile;
@@ -1551,8 +1546,8 @@ begin
15511546 html :=
15521547 HTMLCreater.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
15531548 '<a name="top"></a>' +
1554- HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), @Res[0], '1' ) +
1555- HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), @Res[1], '2' ) +
1549+ HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), Res[0], '1' ) +
1550+ HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), Res[1], '2' ) +
15561551 '<a name="bottom"></a>' +
15571552 HTMLCreater.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
15581553
--- a/Setting.pas
+++ b/Setting.pas
@@ -1,10 +1,9 @@
11 unit Setting;
22
3-
43 interface
54
65 uses
7- SysUtils, Classes, Graphics, Forms, {Math, IniFiles, UCryptAuto, UBase64,}
6+ SysUtils, Classes, Graphics, Forms, Math, IniFiles, UCryptAuto, UBase64,
87 ComCtrls, GestureModel;
98
109 const
@@ -12,7 +11,33 @@ const
1211 LIST_COOLBAND_COUNT = 2; //板CoolBandの数
1312 BROWSER_COOLBAND_COUNT = 3; //ブラウザCoolBandの数
1413
15-
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+
1641 type
1742 TGikoTabPosition = (gtpTop, gtpBottom); // タブ位置
1843 TGikoTabAppend = (gtaFirst, gtpLast); // タブ追加位置
@@ -399,6 +424,9 @@ type
399424 //! マウスジェスチャーを使用するかどうか
400425 FGestureEnabled : Boolean;
401426
427+ //2ch言語設定
428+ //F2chLanguage : TStringList;
429+
402430 //フシアナトラップ設定
403431 FLocalTrapAtt : Boolean;
404432 FRemoteTrapAtt : Boolean;
@@ -410,6 +438,8 @@ type
410438 FMute: Boolean;
411439 //スレ絞込みで未確定文字も有効にするか
412440 FUseUndecided: Boolean;
441+ //MessageListに出力されるメッセージ
442+ FMessageList : array[0..13] of string;
413443
414444 //Be2ch
415445 //認証用ユーザID・パスワード
@@ -420,8 +450,6 @@ type
420450 //履歴の最大保存件数
421451 FMaxRecordCount : Integer;
422452
423- //スレッド一覧をダウンロード後にソートするか
424- FAutoSortThreadList : Boolean;
425453 function GetMainCoolSet(Index: Integer): TCoolSet;
426454 function GetBoardCoolSet(Index: Integer): TCoolSet;
427455 function GetBrowserCoolSet(Index: Integer): TCoolSet;
@@ -487,9 +515,9 @@ type
487515 function GetIgnoreFileName: string;
488516 function GetGestureFileName : string;
489517 function GetSpamFilterFileName : string;
490- function GetLanguageFileName: string;
491- function GetMainKeyFileName: String;
492- function GetEditorKeyFileName: String;
518+ function GetLanguageFileName: string;
519+ procedure SetMessages;
520+ function GetMessage(AType :Integer): string;
493521 procedure WriteLogFolder(AVal : String);
494522
495523 //受信バッファサイズ
@@ -737,50 +765,13 @@ type
737765 property BeAutoLogin: Boolean read FBeAutoLogin write FBeAutoLogin;
738766 property BeLogin: Boolean read FBeLogin write FBeLogin;
739767 property MaxRecordCount : Integer read FMaxRecordCount write FMaxRecordCount;
740- //! スレッド一覧ダウンロード後にスレッド名で昇順ソートするか
741- property AutoSortThreadList : Boolean read FAutoSortThreadList write FAutoSortThreadList;
742-end;
743768
744-
745-const
746-// MAIN_COOLBAND_COUNT = 4; //メインCoolBandの数
747-// LIST_COOLBAND_COUNT = 2; //板CoolBandの数
748-// BROWSER_COOLBAND_COUNT = 3; //ブラウザCoolBandの数
749-
750- BOARD_FILE_NAME = 'board.2ch';
751- CUSTOMBOARD_FILE_NAME = 'custom.2ch';
752- BOARD_DIR_NAME = 'Board';
753- KEY_SETTING_FILE_NAME = 'key.ini';
754- EKEY_SETTING_FILE_NAME = 'Ekey.ini';
755- TEMP_FOLDER = 'Temp';
756- OUTBOX_FILE_NAME = 'outbox.ini';
757- SENT_FILE_NAME = 'sent.ini';
758- CONFIG_DIR_NAME = 'config';
759- CSS_DIR_NAME = 'css';
760- SKIN_DIR_NAME = 'skin';
761- SKIN_HEADER_FILE_NAME = 'Header.html';
762- SKIN_FOOTER_FILE_NAME = 'Footer.html';
763- SKIN_NEWRES_FILE_NAME = 'NewRes.html';
764- SKIN_RES_FILE_NAME = 'Res.html';
765- SKIN_BOOKMARK_FILE_NAME = 'Bookmark.html';
766- SKIN_NEWMARK_FILE_NAME = 'Newmark.html';
767- NGWORDs_DIR_NAME : String = 'NGwords';
768- BOARD_PLUGIN_DIR_NAME = 'BoardPlugin';
769- SAMBATIME_FILE_NAME : String = 'Samba.ini';
770- IGNORE_FILE_NAME : String = 'Ignore.txt';
771-// DOLIB_LOGIN_URL = '/~tora3n2c/futen.cgi';
772- MAX_POPUP_RES : Integer = 10;
773- GESTURE_FILE_NAME = 'Gestures.ini';
774- SPAMFILTER_FILE_NAME = 'SpamFilter.ini';
775- LANGUAGE_FILE_NAME = 'language.ini';
769+end;
776770
777771
778772
779773 implementation
780774
781-uses
782- Math, IniFiles, UCryptAuto, UBase64;
783-
784775 type
785776 TSoundName = record
786777 Name: string;
@@ -798,8 +789,26 @@ const
798789 DEFAULT_TAB_FONT_NAME: string = 'MS Pゴシック';
799790 DEFAULT_TAB_FONT_SIZE: Integer = 9;
800791 DEFAULT_2CH_BOARD_URL1: string = 'http://menu.2ch.net/bbsmenu.html';
792+ //OCNを削除しました
793+ //DEFAULT_2CH_BOARD_URL2: string = 'http://menu.2ch.net/bbsmenu.html';
794+ //2005/10/1にiij4uの方は消滅 //'http://www.2ch.net/newbbsmenu.html';
801795 GIKO_ENCRYPT_TEXT: string = 'gikoNaviEncryptText';
802796
797+ DEF_MESSAGES : array[0..13] of string = ( 'ログアウトしました',
798+ 'ログインしました - ',
799+ '強制ログインしました - ',
800+ '[スレ一覧取得完了]',
801+ '(名称不明)',
802+ '[スレ取得完了]',
803+ '[スレ差分取得完了]',
804+ '[未更新]',
805+ '[中断]',
806+ '[エラー]',
807+ '[レス送信終了]',
808+ '[新スレ送信終了]',
809+ '[レス送信失敗]',
810+ '[新スレ送信失敗]');
811+
803812 var
804813 SOUND_NAME: array[0..4] of TSoundName = (
805814 (Name: 'New'; ViewName: '取得成功'; FileName: ''),
@@ -1256,8 +1265,6 @@ begin
12561265 FCategorySortOrder := ini.ReadBool('ThreadList', 'CategorySortOrder', True);
12571266 FBoardSortIndex := ini.ReadInteger('ThreadList', 'BoardSortIndex', 0);
12581267 FBoardSortOrder := ini.ReadBool('ThreadList', 'BoardSortOrder', True);
1259- // DL後の自動ソート
1260- FAutoSortThreadList := ini.ReadBool('ThreadList', 'AutoSort', True);
12611268 //Dat落ちスレソート順
12621269 FDatOchiSortIndex := ini.ReadInteger('ThreadList', 'DatOchiSortIndex', -1);
12631270 FDatOchiSortOrder := ini.ReadBool('ThreadList', 'DatOchiSortOrder', False);
@@ -1592,8 +1599,6 @@ begin
15921599 ini.WriteBool('ThreadList', 'BoardSortOrder', FBoardSortOrder);
15931600 ini.WriteInteger('ThreadList', 'DatOchiSortIndex', FDatOchiSortIndex);
15941601 ini.WriteBool('ThreadList', 'DatOchiSortOrder', FDatOchiSortOrder);
1595- // DL後の自動ソート
1596- ini.WriteBool('ThreadList', 'AutoSort', FAutoSortThreadList);
15971602
15981603 //書き込み時マシン時刻使用設定
15991604 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
@@ -2164,19 +2169,68 @@ function TSetting.GetLanguageFileName: string;
21642169 begin
21652170 Result := GetConfigDir + LANGUAGE_FILE_NAME;
21662171 end;
2172+//Messagelistに出力されるメッセージの設定
2173+procedure TSetting.SetMessages;
2174+var
2175+ i :Integer;
2176+ ini : TMemIniFile;
2177+begin
2178+ //2ch言語読み出し
2179+ if (GengoSupport) and (FileExists(GetLanguageFileName)) then begin
2180+ ini := TmemIniFile.Create(GetLanguageFileName);
2181+ try
2182+ {
2183+ 'ログアウトしました',
2184+ 'ログインしました - ',
2185+ '強制ログインしました - ',
2186+ '[スレ一覧取得完了]',
2187+ '(名称不明)',
2188+ '[スレ取得完了]',
2189+ '[スレ差分取得完了]',
2190+ '[未更新]',
2191+ '[中断]',
2192+ '[エラー]',
2193+ '[レス送信終了]',
2194+ '[新スレ送信終了]',
2195+ '[レス送信失敗]',
2196+ '[新スレ送信失敗]'); }
2197+ FMessageList[0] := ini.ReadString('Language', 'Logout', DEF_MESSAGES[0]);
2198+ FMessageList[1] := ini.ReadString('Language', 'Login', DEF_MESSAGES[1]);
2199+ FMessageList[2] := ini.ReadString('Language', 'ForceLogin', DEF_MESSAGES[2]);
2200+ FMessageList[3] := ini.ReadString('Language', 'ThreadList', DEF_MESSAGES[3]);
2201+ FMessageList[4] := ini.ReadString('Language', 'UnKnown', DEF_MESSAGES[4]);
2202+ FMessageList[5] := ini.ReadString('Language', 'ThreadGet', DEF_MESSAGES[5]);
2203+ FMessageList[6] := ini.ReadString('Language', 'ThreadDiffGet', DEF_MESSAGES[6]);
2204+ FMessageList[7] := ini.ReadString('Language', 'NotMod', DEF_MESSAGES[7]);
2205+ FMessageList[8] := ini.ReadString('Language', 'Abort', DEF_MESSAGES[8]);
2206+ FMessageList[9] := ini.ReadString('Language', 'Error', DEF_MESSAGES[9]);
2207+ FMessageList[10] := ini.ReadString('Language', 'NewReply', DEF_MESSAGES[10]);
2208+ FMessageList[11] := ini.ReadString('Language', 'NewThread', DEF_MESSAGES[11]);
2209+ FMessageList[12] := ini.ReadString('Language', 'ReplyError', DEF_MESSAGES[12]);
2210+ FMessageList[13] := ini.ReadString('Language', 'ThreadError', DEF_MESSAGES[13]);
2211+ finally
2212+ ini.Free;
2213+ end;
2214+
2215+ end else begin
2216+ for i := 0 to 13 do begin
2217+ FMessageList[i] := DEF_MESSAGES[i];
2218+ end;
2219+ end;
2220+end;
2221+function TSetting.GetMessage(AType :Integer): string;
2222+begin
2223+ if (AType >= 0) and (AType <= Length(FMessageList)) then
2224+ Result := FMessageList[AType]
2225+ else
2226+ Result := '';
2227+end;
21672228 procedure TSetting.WriteLogFolder(AVal : String);
21682229 begin
21692230 FLogFolder := AVal;
21702231 FLogFolderP := IncludeTrailingPathDelimiter(LogFolder);
21712232 end;
2172-function TSetting.GetMainKeyFileName: String;
2173-begin
2174- Result := GetConfigDir + KEY_SETTING_FILE_NAME;
2175-end;
2176-function TSetting.GetEditorKeyFileName: String;
2177-begin
2178- Result := GetConfigDir + EKEY_SETTING_FILE_NAME;
2179-end;
2233+
21802234 end.
21812235
21822236
--- a/gikoNavi.dpr
+++ b/gikoNavi.dpr
@@ -70,8 +70,7 @@ uses
7070 HTMLCreate in 'HTMLCreate.pas',
7171 ListViewUtils in 'ListViewUtils.pas',
7272 GikoDataModule in 'GikoDataModule.pas' {GikoDM: TDataModule},
73- BrowserRecord in 'BrowserRecord.pas',
74- GikoMessage in 'GikoMessage.pas';
73+ BrowserRecord in 'BrowserRecord.pas';
7574
7675 {$R *.RES}
7776 {$R gikoResource.res}
Binary files a/gikoNavi.res and b/gikoNavi.res differ
--- a/readme/language.ini
+++ /dev/null
@@ -1,15 +0,0 @@
1-[Language]
2-Logout=ログアウトしますた
3-Login=ログインしますた -
4-ForceLogin=強制ログインしますた -
5-SureItiran=[スレ一覧取得しますた]
6-Unknown=(名称不明でつ)
7-SureSyutoku=[スレ取得完了しますた]
8-SureDiff=[スレ差分取得完了しますた]
9-NotMod=[未更新 もちけつ]
10-Abort=[中断・・・_| ̄|○]
11-Error=[エラー発生キタ━(゚∀゚)━!!]
12-NewRes=[新レス送信終了しますた(`・ω・´)]
13-NewSure=[新スレ送信終了しますた(`・ω・´)]
14-ResError=[レス送信失敗(´・ω・`)]
15-SureError= [新スレ送信失敗(´・ω・`)]
--- a/readme/readme.txt
+++ b/readme/readme.txt
@@ -109,19 +109,6 @@ LICENSE
109109 ------------------------------
110110 200X/XX/XX
111111 Version バタ51
112- スレッド描画処理の最適化
113- レス番指定URLをクリックしたときの動作で、取得済み外のレス番の場合自動でDLするように変更
114- レスエディタからSambaの設定値を変更できるように変更
115- キャビネット上でクリック・ダブルクリックイベントが過剰に発生する不具合の修正
116- マウスジェスチャー有効時にプレビュー上で右クリックできない不具合の修正
117- メインフォーム上でのショートカットキーの優先順位がギコナビ自体が最上位に変更
118- メインメニューのお気に入りの描画の高速化
119- ステータスバーに現在表示しているスレッドの容量を表示するようにした
120- DAT落ちしたスレの容量を取得できない不具合の修正
121- 板更新でローカルファイルを指定できるように変更
122- スレッド一覧ダウンロード後のソートをオプション化
123- NGワードに全半角ひらがなカタカナの違いを同一視するオプションの追加
124- レスの絞込みで全半角ひらがなカタカタの違いを無視するように変更
125112
126113 2005/10/10
127114 Version バタ50 リリース3
Show on old repository browser