private
FOnLoaded: TNotifyEvent;
FHttpThread: THTTPDownloadThread;
+ FLoadBytes: integer;
FTitle: String;
FOnLoadFailure: TBottleLogLoadFailureEvent;
FOldSortColumn: TBottleLogSortType; // \83\8d\83O\91\8b
FOldSortDesc: boolean; // \83\8d\83O\91\8b
- FSelectedIndex: integer; // \83\8d\83O\91\8b
+ FSelectedIndex: integer;
+ FOnLoadWork: TNotifyEvent; // \83\8d\83O\91\8b
function GetBottles(Index: integer): TLogItem;
procedure SetOnLoaded(const Value: TNotifyEvent);
procedure HttpSuccess(Sender: TObject);
procedure HttpFailure(Sender: TObject);
+ procedure HttpWork(Sender: TObject; LoadBytes: integer);
procedure SetTitle(const Value: String);
procedure SetOnLoadFailure(const Value: TBottleLogLoadFailureEvent);
procedure SetSelectedIndex(const Value: integer);
+ procedure SetOnLoadWork(const Value: TNotifyEvent);
public
constructor Create(const Title: String);
destructor Destroy; override;
property Title: String read FTitle write SetTitle;
procedure LoadFromStream(Stream: TStream);
property OnLoaded: TNotifyEvent read FOnLoaded write SetOnLoaded;
+ property OnLoadWork: TNotifyEvent read FOnLoadWork write SetOnLoadWork;
property OnLoadFailure: TBottleLogLoadFailureEvent read FOnLoadFailure write SetOnLoadFailure;
property SelectedIndex: integer read FSelectedIndex write SetSelectedIndex;
procedure AddScriptLog(const Script, Channel, MID, Ghost: String);
end;
end;
+procedure TBottleLogList.HttpWork(Sender: TObject; LoadBytes: integer);
+begin
+ AddSystemLog(Format('\83_\83E\83\93\83\8d\81[\83h\92\86\82Å\82· - %4d KB', [LoadBytes div 1024]));
+ FLoadBytes := LoadBytes;
+ if Assigned(FOnLoadWork) then FOnLoadWork(self);
+end;
+
procedure TBottleLogList.LoadFromStream(Stream: TStream);
var i: integer;
SourceStream: TStringStream;
var Param: String;
begin
Self.Clear;
- AddSystemLog('\83_\83E\83\93\83\8d\81[\83h\92\86\82Å\82·');
+ AddSystemLog('\83_\83E\83\93\83\8d\81[\83h\92\86\82Å\82· - \83T\81[\83o\82©\82ç\89\9e\93\9a\91Ò\82¿');
with Cond do begin
if Cond.IsRange then begin
Param := Format('year_lo=%d&month_lo=%d&day_lo=%d&year_hi=%d&month_hi=%d&day_hi=%d&',
FHttpThread.FreeOnTerminate := true;
FHttpThread.OnSuccess := HttpSuccess;
FHttpThread.OnConnectionFailed := HttpFailure;
+ FHttpThread.OnHttpWork := HttpWork;
+
+ FLoadBytes := 0;
FHttpThread.Resume;
end;
FOnLoadFailure := Value;
end;
+procedure TBottleLogList.SetOnLoadWork(const Value: TNotifyEvent);
+begin
+ FOnLoadWork := Value;
+end;
+
procedure TBottleLogList.SetSelectedIndex(const Value: integer);
begin
FSelectedIndex := Value;