Changeset 439 for ModularSystem/UFormModuleList.pas
- Timestamp:
- Nov 19, 2012, 2:40:44 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ModularSystem/UFormModuleList.pas
r431 r439 7 7 uses 8 8 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 9 ComCtrls, ExtCtrls, Menus, ActnList, StdCtrls, SpecializedList, 9 ComCtrls, ExtCtrls, Menus, ActnList, StdCtrls, SpecializedList, DateUtils, 10 10 UListViewSort, UModularSystem; 11 11 … … 14 14 mloShowIdentification, mloShowLicense, mloShowEnable, mloShowRunning, 15 15 mloShowDependencies, mloShowInstalled, mloShowInfoBar, mloShowDescription, 16 mlo AllowInstall, mloAllowEnable, mloAllowRegister, mloAllowStart);16 mloShowStartUpTime, mloAllowInstall, mloAllowEnable, mloAllowRegister, mloAllowStart); 17 17 TModuleListOptions = set of TModuleListOption; 18 18 … … 92 92 SYes = 'Yes'; 93 93 SNo = 'No'; 94 SAdditionalModulesInstall = 'In addition to "%0:s" module also dependent modules will be installed: %1:s';95 SAdditionalModulesUninstall = 'In addition to "%0:s" module alse dependent modules will be uninstalled: %1:s';96 SAdditionalModulesStart = 'In addition to "%0:s" module also dependent modules will be started: %1:s';97 SAdditionalModulesStop = 'In addition to "%0:s" module also dependent modules will be stopped: %1:s';94 SAdditionalModulesInstall = 'In addition to "%0:s" module also dependent modules will be installed: "%1:s"'; 95 SAdditionalModulesUninstall = 'In addition to "%0:s" module alse dependent modules will be uninstalled: "%1:s"'; 96 SAdditionalModulesStart = 'In addition to "%0:s" module also dependent modules will be started: "%1:s"'; 97 SAdditionalModulesStop = 'In addition to "%0:s" module also dependent modules will be stopped: "%1:s"'; 98 98 SIdentification = 'Identification'; 99 99 SName = 'Name'; … … 133 133 if FileName <> '' then Item.SubItems.Add(FileName) 134 134 else Item.SubItems.Add(' '); 135 Item.SubItems.Add(FloatToStr(Trunc(StartUpTime / OneMillisecond))); 135 136 end; 136 137 end; … … 199 200 try 200 201 Modules := TListModule.Create; 202 Modules.OwnsObjects := False; 201 203 EnumDependenciesCascade(Modules, [mcNotRunning]); 202 204 if Modules.Count > 0 then begin … … 223 225 try 224 226 Modules := TListModule.Create; 225 TModule(ListViewModules.Selected.Data).EnumSuperiorDependenciesCascade(Modules, [mcRunning]); 227 Modules.OwnsObjects := False; 228 EnumSuperiorDependenciesCascade(Modules, [mcRunning]); 226 229 if Modules.Count > 0 then begin 227 230 if MessageDlg(Format(SAdditionalModulesStop, [ 228 TModule(ListViewModules.Selected.Data).Identification,231 Identification, 229 232 Modules.Implode(',', ModuleToStr)]), 230 233 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 231 TModule(ListViewModules.Selected.Data).Stop;232 end else TModule(ListViewModules.Selected.Data).Stop;234 Stop; 235 end else Stop; 233 236 finally 234 237 FreeAndNil(Modules); … … 248 251 try 249 252 Modules := TListModule.Create; 250 TModule(ListViewModules.Selected.Data).EnumSuperiorDependenciesCascade(Modules, [mcInstalled]); 253 Modules.OwnsObjects := False; 254 EnumSuperiorDependenciesCascade(Modules, [mcInstalled]); 251 255 if Modules.Count > 0 then begin 252 256 if MessageDlg(Format(SAdditionalModulesUninstall, [ 253 TModule(ListViewModules.Selected.Data).Identification,257 Identification, 254 258 Modules.Implode(',', ModuleToStr)]), 255 259 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 256 TModule(ListViewModules.Selected.Data).Uninstall;257 end else TModule(ListViewModules.Selected.Data).Uninstall;260 Uninstall; 261 end else Uninstall; 258 262 finally 259 263 Modules.Free; … … 280 284 try 281 285 Modules := TListModule.Create; 282 TModule(ListViewModules.Selected.Data).EnumDependenciesCascade(Modules, [mcNotInstalled]); 286 Modules.OwnsObjects := False; 287 EnumDependenciesCascade(Modules, [mcNotInstalled]); 283 288 if Modules.Count > 0 then begin 284 289 if MessageDlg(Format(SAdditionalModulesInstall, [ 285 TModule(ListViewModules.Selected.Data).Identification,290 Identification, 286 291 Modules.Implode(',', ModuleToStr)]), 287 292 mtConfirmation, [mbYes, mbNo], 0) = mrYes then 288 TModule(ListViewModules.Selected.Data).Install;289 end else TModule(ListViewModules.Selected.Data).Install;293 Install; 294 end else Install; 290 295 finally 291 296 Modules.Free; … … 305 310 try 306 311 Modules := TListModule.Create; 312 Modules.OwnsObjects := False; 307 313 EnumDependenciesCascade(Modules, [mcNotRunning]); 308 314 if Modules.Count > 0 then begin … … 310 316 Identification, Modules.Implode(',', ModuleToStr)]), 311 317 mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin 312 Enable d := True;318 Enable; 313 319 Start; 314 320 end; 315 321 end else begin 316 Enable d := True;322 Enable; 317 323 Start; 318 324 end; … … 334 340 try 335 341 Modules := TListModule.Create; 336 TModule(ListViewModules.Selected.Data).EnumSuperiorDependenciesCascade(Modules, [mcInstalled]); 342 Modules.OwnsObjects := False; 343 EnumSuperiorDependenciesCascade(Modules, [mcInstalled]); 337 344 if Modules.Count > 0 then begin 338 345 if MessageDlg(Format(SAdditionalModulesUninstall, [ 339 TModule(ListViewModules.Selected.Data).Identification,346 Identification, 340 347 Modules.Implode(',', ModuleToStr)]), 341 348 mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin 342 TModule(ListViewModules.Selected.Data).Stop;343 TModule(ListViewModules.Selected.Data).Enabled := False;349 Stop; 350 Disable; 344 351 end; 345 352 end else begin 346 353 TModule(ListViewModules.Selected.Data).Stop; 347 TModule(ListViewModules.Selected.Data). Enabled := False;354 TModule(ListViewModules.Selected.Data).Disable; 348 355 end; 349 356 finally … … 393 400 7: Result := CompareString(TModule(Item1).Version, TModule( 394 401 Item2).Version); 395 8: Result := CompareString(TModule(Item1).Dependencies.Implode(',', StrToStr), TModule( 396 Item2).Dependencies.Implode(',', StrToStr)); 402 8: Result := CompareString(TModule(Item1).Dependencies.Implode(',', StrToStr), 403 TModule(Item2).Dependencies.Implode(',', StrToStr)); 404 9: Result := CompareString(TModule(Item1).FileName, 405 TModule(Item2).FileName); 406 10: Result := CompareTime(TModule(Item1).StartUpTime, 407 TModule(Item2).StartUpTime); 397 408 end; 398 409 if ListViewSort.Order = soDown then Result := -Result; … … 483 494 ListViewModules.Column[8].Visible := (mloShowDependencies in FOptions); 484 495 ListViewModules.Column[9].Visible := (mloShowFileName in FOptions); 496 ListViewModules.Column[10].Visible := (mloShowStartUpTime in FOptions); 485 497 Memo1.Visible := (mloShowInfoBar in FOptions); 486 498 Splitter1.Visible := (mloShowInfoBar in FOptions);
Note:
See TracChangeset
for help on using the changeset viewer.