Changeset 77 for trunk/Packages
- Timestamp:
- Jun 4, 2024, 9:53:17 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/ModularSystem/ModularSystem.pas
r75 r77 27 27 FCategory: string; 28 28 FEnabled: Boolean; 29 FOnUpdate: TNotifyEvent; 29 30 FReleaseTime: TDateTime; 30 31 FRunning: Boolean; … … 45 46 procedure SetManager(AValue: TModuleManager); 46 47 procedure SetRunning(AValue: Boolean); 48 procedure DoUpdate; 47 49 protected 48 50 procedure DoStart; virtual; … … 87 89 property WebSite: string read FWebSite write FWebSite; 88 90 // Screenshots, reviews, icon, weak dependencies, ... 91 property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; 89 92 end; 90 93 … … 272 275 Module.FManager := Self; 273 276 Module.API := API; 274 //Modules.Update;277 DoUpdate(Self); 275 278 end; 276 279 … … 278 281 begin 279 282 Modules.Remove(Module); 280 //Modules.Update;283 DoUpdate(Self); 281 284 end; 282 285 … … 286 289 Modules := TModules.Create; 287 290 Modules.OwnsObjects := False; 288 //Modules.OnUpdate := DoUpdate;289 291 end; 290 292 … … 304 306 RootKey := Context.RootKey; 305 307 for I := 0 to Modules.Count - 1 do 306 with TModule(Modules[I])do begin308 with Modules[I] do begin 307 309 OpenKey(Context.Key + '\' + Identification, True); 308 310 Installed := ReadBoolWithDefault('Installed', Installed); … … 322 324 RootKey := Context.RootKey; 323 325 for I := 0 to Modules.Count - 1 do 324 with TModule(Modules[I])do begin326 with Modules[I] do begin 325 327 OpenKey(Context.Key + '\' + Identification, True); 326 328 WriteBool('Enabled', Enabled); … … 342 344 procedure TModule.DoStart; 343 345 begin 344 345 346 end; 346 347 347 348 procedure TModule.DoStop; 348 349 begin 349 350 350 end; 351 351 352 352 procedure TModule.DoInstall; 353 353 begin 354 355 354 end; 356 355 357 356 procedure TModule.DoUninstall; 358 357 begin 359 360 358 end; 361 359 362 360 procedure TModule.DoUpgrade; 363 361 begin 364 362 end; 363 364 procedure TModule.DoUpdate; 365 begin 366 if Assigned(FOnUpdate) then FOnUpdate(Self); 365 367 end; 366 368 … … 398 400 List.Free; 399 401 end; 400 //Manager.Modules.Update;402 DoUpdate; 401 403 end; 402 404 … … 440 442 FStartUpTime := Now - StartTime; 441 443 FRunning := True; 442 //Manager.Modules.Update;444 DoUpdate; 443 445 end; 444 446 … … 458 460 end; 459 461 DoStop; 460 //Manager.Modules.Update;462 DoUpdate; 461 463 end; 462 464 … … 482 484 FInstalled := True; 483 485 DoInstall; 484 //Enable; // Auto enable installed module485 //Manager.Modules.Update;486 Enable; // Auto enable installed module 487 DoUpdate; 486 488 end; 487 489 … … 502 504 FInstalled := False; 503 505 DoUninstall; 504 //Manager.Modules.Update;506 DoUpdate; 505 507 end; 506 508 … … 514 516 begin 515 517 if not Enabled or not Installed then Exit; 516 if Running then try 518 if Running then 519 try 517 520 Stop; 518 521 DoUpgrade; … … 520 523 Start; 521 524 end else DoUpgrade; 522 //Manager.Modules.Update;525 DoUpdate; 523 526 end; 524 527 … … 540 543 begin 541 544 FInstalled := Value; 542 //Manager.Modules.Update;545 DoUpdate; 543 546 end; 544 547
Note:
See TracChangeset
for help on using the changeset viewer.