Ignore:
Timestamp:
Jun 4, 2024, 9:53:17 PM (3 weeks ago)
Author:
chronos
Message:
  • Modified: Compiler targets moved into modules.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/ModularSystem/ModularSystem.pas

    r75 r77  
    2727    FCategory: string;
    2828    FEnabled: Boolean;
     29    FOnUpdate: TNotifyEvent;
    2930    FReleaseTime: TDateTime;
    3031    FRunning: Boolean;
     
    4546    procedure SetManager(AValue: TModuleManager);
    4647    procedure SetRunning(AValue: Boolean);
     48    procedure DoUpdate;
    4749  protected
    4850    procedure DoStart; virtual;
     
    8789    property WebSite: string read FWebSite write FWebSite;
    8890    // Screenshots, reviews, icon, weak dependencies, ...
     91    property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate;
    8992  end;
    9093
     
    272275  Module.FManager := Self;
    273276  Module.API := API;
    274   //Modules.Update;
     277  DoUpdate(Self);
    275278end;
    276279
     
    278281begin
    279282  Modules.Remove(Module);
    280   //Modules.Update;
     283  DoUpdate(Self);
    281284end;
    282285
     
    286289  Modules := TModules.Create;
    287290  Modules.OwnsObjects := False;
    288   //Modules.OnUpdate := DoUpdate;
    289291end;
    290292
     
    304306    RootKey := Context.RootKey;
    305307    for I := 0 to Modules.Count - 1 do
    306     with TModule(Modules[I]) do begin
     308    with Modules[I] do begin
    307309      OpenKey(Context.Key + '\' + Identification, True);
    308310      Installed := ReadBoolWithDefault('Installed', Installed);
     
    322324    RootKey := Context.RootKey;
    323325    for I := 0 to Modules.Count - 1 do
    324     with TModule(Modules[I]) do begin
     326    with Modules[I] do begin
    325327      OpenKey(Context.Key + '\' + Identification, True);
    326328      WriteBool('Enabled', Enabled);
     
    342344procedure TModule.DoStart;
    343345begin
    344 
    345346end;
    346347
    347348procedure TModule.DoStop;
    348349begin
    349 
    350350end;
    351351
    352352procedure TModule.DoInstall;
    353353begin
    354 
    355354end;
    356355
    357356procedure TModule.DoUninstall;
    358357begin
    359 
    360358end;
    361359
    362360procedure TModule.DoUpgrade;
    363361begin
    364 
     362end;
     363
     364procedure TModule.DoUpdate;
     365begin
     366  if Assigned(FOnUpdate) then FOnUpdate(Self);
    365367end;
    366368
     
    398400    List.Free;
    399401  end;
    400   //Manager.Modules.Update;
     402  DoUpdate;
    401403end;
    402404
     
    440442  FStartUpTime := Now - StartTime;
    441443  FRunning := True;
    442   //Manager.Modules.Update;
     444  DoUpdate;
    443445end;
    444446
     
    458460  end;
    459461  DoStop;
    460   //Manager.Modules.Update;
     462  DoUpdate;
    461463end;
    462464
     
    482484  FInstalled := True;
    483485  DoInstall;
    484   //Enable; // Auto enable installed module
    485   //Manager.Modules.Update;
     486  Enable; // Auto enable installed module
     487  DoUpdate;
    486488end;
    487489
     
    502504  FInstalled := False;
    503505  DoUninstall;
    504   //Manager.Modules.Update;
     506  DoUpdate;
    505507end;
    506508
     
    514516begin
    515517  if not Enabled or not Installed then Exit;
    516   if Running then try
     518  if Running then
     519  try
    517520    Stop;
    518521    DoUpgrade;
     
    520523    Start;
    521524  end else DoUpgrade;
    522   //Manager.Modules.Update;
     525  DoUpdate;
    523526end;
    524527
     
    540543begin
    541544  FInstalled := Value;
    542   //Manager.Modules.Update;
     545  DoUpdate;
    543546end;
    544547
Note: See TracChangeset for help on using the changeset viewer.