Changeset 54 for trunk/Packages/Common/UJobProgressView.pas
- Timestamp:
- Dec 24, 2022, 7:17:24 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 6 6 Tunneler.dbg 7 7 tunneler.lps 8 *.res 8 9 heaptrclog.trc 9 10 Components/Common/Languages/*.mo 10 Components/CoolTranslator/Demo/lib 11
-
- Property svn:ignore
-
trunk/Packages/Common/UJobProgressView.pas
r51 r54 1 1 unit UJobProgressView; 2 3 {$MODE Delphi}4 2 5 3 interface … … 7 5 uses 8 6 SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs, 9 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,7 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, UThreading, Math, 10 8 DateUtils; 11 9 … … 71 69 end; 72 70 73 TJobs = class(TObjectList )71 TJobs = class(TObjectList<TJob>) 74 72 end; 75 73 … … 105 103 procedure ReloadJobList; 106 104 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 107 procedure FormDestroy(Sender: TObject);108 105 procedure ListViewJobsData(Sender: TObject; Item: TListItem); 109 106 procedure TimerUpdateTimer(Sender: TObject); … … 165 162 SExecuted = 'Executed'; 166 163 164 167 165 implementation 168 166 … … 286 284 end; 287 285 288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);289 begin290 end;291 292 286 procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem); 293 287 begin 294 288 if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then 295 with TJob(JobProgressView.Jobs[Item.Index])do begin289 with JobProgressView.Jobs[Item.Index] do begin 296 290 Item.Caption := Title; 297 291 if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1 … … 405 399 I := 0; 406 400 while I < Jobs.Count do 407 with TJob(Jobs[I])do begin401 with Jobs[I] do begin 408 402 CurrentJobIndex := I; 409 CurrentJob := TJob(Jobs[I]);403 CurrentJob := Jobs[I]; 410 404 JobProgressChange(Self); 411 405 StartTime := Now; … … 420 414 Method(CurrentJob); 421 415 end else begin 416 Thread := TJobThread.Create(True); 422 417 try 423 Thread := TJobThread.Create(True);424 418 with Thread do begin 425 419 FreeOnTerminate := False; … … 494 488 if AValue = FTerminate then Exit; 495 489 for I := 0 to Jobs.Count - 1 do 496 TJob(Jobs[I]).Terminate := AValue;490 Jobs[I].Terminate := AValue; 497 491 FTerminate := AValue; 498 492 end; … … 620 614 procedure TProgress.Increment; 621 615 begin 622 try623 FLock.Acquire;616 FLock.Acquire; 617 try 624 618 Value := Value + 1; 625 619 finally … … 630 624 procedure TProgress.Reset; 631 625 begin 632 try633 FLock.Acquire;626 FLock.Acquire; 627 try 634 628 FValue := 0; 635 629 finally … … 647 641 begin 648 642 FLock.Free; 649 inherited Destroy;643 inherited; 650 644 end; 651 645 … … 678 672 destructor TJob.Destroy; 679 673 begin 680 Progress.Free;674 FreeAndNil(Progress); 681 675 inherited; 682 676 end;
Note:
See TracChangeset
for help on using the changeset viewer.