Ignore:
Timestamp:
Dec 24, 2022, 7:17:24 PM (23 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package to latest version.
  • Modified: Build with Lazarus 2.2.4.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        66Tunneler.dbg
        77tunneler.lps
         8*.res
        89heaptrclog.trc
        910Components/Common/Languages/*.mo
        10 Components/CoolTranslator/Demo/lib
         11
  • trunk/Packages/Common/UJobProgressView.pas

    r51 r54  
    11unit UJobProgressView;
    2 
    3 {$MODE Delphi}
    42
    53interface
     
    75uses
    86  SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs,
    9   Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,
     7  Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, UThreading, Math,
    108  DateUtils;
    119
     
    7169  end;
    7270
    73   TJobs = class(TObjectList)
     71  TJobs = class(TObjectList<TJob>)
    7472  end;
    7573
     
    105103    procedure ReloadJobList;
    106104    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    107     procedure FormDestroy(Sender: TObject);
    108105    procedure ListViewJobsData(Sender: TObject; Item: TListItem);
    109106    procedure TimerUpdateTimer(Sender: TObject);
     
    165162  SExecuted = 'Executed';
    166163
     164
    167165implementation
    168166
     
    286284end;
    287285
    288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);
    289 begin
    290 end;
    291 
    292286procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
    293287begin
    294288  if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
    295   with TJob(JobProgressView.Jobs[Item.Index]) do begin
     289  with JobProgressView.Jobs[Item.Index] do begin
    296290    Item.Caption := Title;
    297291    if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
     
    405399    I := 0;
    406400    while I < Jobs.Count do
    407     with TJob(Jobs[I]) do begin
     401    with Jobs[I] do begin
    408402      CurrentJobIndex := I;
    409       CurrentJob := TJob(Jobs[I]);
     403      CurrentJob := Jobs[I];
    410404      JobProgressChange(Self);
    411405      StartTime := Now;
     
    420414        Method(CurrentJob);
    421415      end else begin
     416        Thread := TJobThread.Create(True);
    422417        try
    423           Thread := TJobThread.Create(True);
    424418          with Thread do begin
    425419            FreeOnTerminate := False;
     
    494488  if AValue = FTerminate then Exit;
    495489  for I := 0 to Jobs.Count - 1 do
    496     TJob(Jobs[I]).Terminate := AValue;
     490    Jobs[I].Terminate := AValue;
    497491  FTerminate := AValue;
    498492end;
     
    620614procedure TProgress.Increment;
    621615begin
    622   try
    623     FLock.Acquire;
     616  FLock.Acquire;
     617  try
    624618    Value := Value + 1;
    625619  finally
     
    630624procedure TProgress.Reset;
    631625begin
    632   try
    633     FLock.Acquire;
     626  FLock.Acquire;
     627  try
    634628    FValue := 0;
    635629  finally
     
    647641begin
    648642  FLock.Free;
    649   inherited Destroy;
     643  inherited;
    650644end;
    651645
     
    678672destructor TJob.Destroy;
    679673begin
    680   Progress.Free;
     674  FreeAndNil(Progress);
    681675  inherited;
    682676end;
Note: See TracChangeset for help on using the changeset viewer.