Ignore:
Timestamp:
Jun 4, 2024, 12:22:49 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Modified: Updated Common package.
File:
1 moved

Legend:

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

    r74 r75  
    1 unit UFormModuleList;
    2 
    3 {$mode delphi}
     1unit FormModuleList;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
    9   ComCtrls, ExtCtrls, Menus, ActnList, StdCtrls, SpecializedList, DateUtils,
    10   UListViewSort, UModularSystem;
     7  ComCtrls, ExtCtrls, Menus, ActnList, StdCtrls, Generics.Collections, DateUtils,
     8  ListViewSort, ModularSystem, Common;
    119
    1210type
     
    8785function ModuleToStr(Module: TObject): string;
    8886
     87
    8988implementation
    9089
     
    130129    if Version <> '' then Item.SubItems.Add(Version)
    131130      else Item.SubItems.Add(' ');
    132     Item.SubItems.Add(Dependencies.Implode(',', StrToStr));
     131    Item.SubItems.Add(Implode(',', Dependencies));
    133132    if FileName <> '' then Item.SubItems.Add(FileName)
    134133      else Item.SubItems.Add(' ');
     
    150149    if (mloShowLicense in FOptions) and (License <> '') then Memo1.Lines.Add(SLicense + ': ' + License);
    151150    if (mloShowDependencies in FOptions) and (Dependencies.Count > 0) then
    152       Memo1.Lines.Add(SDependencies + ': ' + Dependencies.Implode(', ', StrToStr));
     151      Memo1.Lines.Add(SDependencies + ': ' + Implode(', ', Dependencies));
    153152    if (mloShowDescription in FOptions) and (Description.Count > 0) then
    154       Memo1.Lines.Add(SDescription + ': ' + Description.Implode(', ', StrToStr));
     153      Memo1.Lines.Add(SDescription + ': ' + Implode(', ', Description));
    155154  end;
    156155end;
     
    191190procedure TFormModuleList.AStartExecute(Sender: TObject);
    192191var
    193   Modules: TListModule;
     192  Modules: TModules;
    194193  I: Integer;
    195194begin
     
    199198  if not Running then
    200199  try
    201     Modules := TListModule.Create;
     200    Modules := TModules.Create;
    202201    Modules.OwnsObjects := False;
    203202    EnumDependenciesCascade(Modules, [mcNotRunning]);
    204203    if Modules.Count > 0 then begin
    205204      if MessageDlg(Format(SAdditionalModulesStart, [
    206       Identification, Modules.Implode(',', ModuleToStr)]),
     205      Identification, Modules.GetNames]),
    207206      mtConfirmation, [mbYes, mbNo], 0) = mrYes then
    208207        Start;
     
    216215procedure TFormModuleList.AStopExecute(Sender: TObject);
    217216var
    218   Modules: TListModule;
     217  Modules: TModules;
    219218  I: Integer;
    220219begin
     
    224223  if Running then
    225224  try
    226     Modules := TListModule.Create;
     225    Modules := TModules.Create;
    227226    Modules.OwnsObjects := False;
    228227    EnumSuperiorDependenciesCascade(Modules, [mcRunning]);
    229228    if Modules.Count > 0 then begin
    230229      if MessageDlg(Format(SAdditionalModulesStop, [
    231       Identification,
    232       Modules.Implode(',', ModuleToStr)]),
     230      Identification, Modules.GetNames]),
    233231      mtConfirmation, [mbYes, mbNo], 0) = mrYes then
    234232        Stop;
     
    242240procedure TFormModuleList.AUninstallExecute(Sender: TObject);
    243241var
    244   Modules: TListModule;
     242  Modules: TModules;
    245243  I: Integer;
    246244begin
     
    250248  if Installed then
    251249  try
    252     Modules := TListModule.Create;
     250    Modules := TModules.Create;
    253251    Modules.OwnsObjects := False;
    254252    EnumSuperiorDependenciesCascade(Modules, [mcInstalled]);
    255253    if Modules.Count > 0 then begin
    256254      if MessageDlg(Format(SAdditionalModulesUninstall, [
    257       Identification,
    258       Modules.Implode(',', ModuleToStr)]),
     255      Identification, Modules.GetNames]),
    259256      mtConfirmation, [mbYes, mbNo], 0) = mrYes then
    260257        Uninstall;
     
    275272procedure TFormModuleList.AInstallExecute(Sender: TObject);
    276273var
    277   Modules: TListModule;
     274  Modules: TModules;
    278275  I: Integer;
    279276begin
     
    283280  if not Installed then
    284281  try
    285     Modules := TListModule.Create;
     282    Modules := TModules.Create;
    286283    Modules.OwnsObjects := False;
    287284    EnumDependenciesCascade(Modules, [mcNotInstalled]);
    288285    if Modules.Count > 0 then begin
    289286      if MessageDlg(Format(SAdditionalModulesInstall, [
    290       Identification,
    291       Modules.Implode(',', ModuleToStr)]),
     287      Identification, Modules.GetNames]),
    292288      mtConfirmation, [mbYes, mbNo], 0) = mrYes then
    293289        Install;
     
    301297procedure TFormModuleList.AEnableExecute(Sender: TObject);
    302298var
    303   Modules: TListModule;
     299  Modules: TModules;
    304300  I: Integer;
    305301begin
     
    309305  if not Enabled then
    310306  try
    311     Modules := TListModule.Create;
     307    Modules := TModules.Create;
    312308    Modules.OwnsObjects := False;
    313309    EnumDependenciesCascade(Modules, [mcNotRunning]);
    314310    if Modules.Count > 0 then begin
    315311      if MessageDlg(Format(SAdditionalModulesStart, [
    316       Identification, Modules.Implode(',', ModuleToStr)]),
     312      Identification, Modules.GetNames]),
    317313      mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
    318314        Enable;
     
    331327procedure TFormModuleList.ADisableExecute(Sender: TObject);
    332328var
    333   Modules: TListModule;
     329  Modules: TModules;
    334330  I: Integer;
    335331begin
     
    339335  if Enabled then
    340336  try
    341     Modules := TListModule.Create;
     337    Modules := TModules.Create;
    342338    Modules.OwnsObjects := False;
    343339    EnumSuperiorDependenciesCascade(Modules, [mcInstalled]);
    344340    if Modules.Count > 0 then begin
    345341      if MessageDlg(Format(SAdditionalModulesUninstall, [
    346       Identification,
    347       Modules.Implode(',', ModuleToStr)]),
     342      Identification, Modules.GetNames]),
    348343      mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin
    349344        Stop;
     
    400395      7: Result := CompareString(TModule(Item1).Version, TModule(
    401396        Item2).Version);
    402       8: Result := CompareString(TModule(Item1).Dependencies.Implode(',', StrToStr),
    403         TModule(Item2).Dependencies.Implode(',', StrToStr));
     397      8: Result := CompareString(Implode(',', TModule(Item1).Dependencies),
     398        Implode(',', TModule(Item2).Dependencies));
    404399      9: Result := CompareString(TModule(Item1).FileName,
    405400        TModule(Item2).FileName);
     
    500495
    501496initialization
    502   {$I UFormModuleList.lrs}
     497  {$I FormModuleList.lrs}
    503498
    504499end.
Note: See TracChangeset for help on using the changeset viewer.