-
Notifications
You must be signed in to change notification settings - Fork 24
/
Stats.pas
80 lines (70 loc) · 1.84 KB
/
Stats.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
unit Stats;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ASuiteForm;
type
{ TfrmStats }
TfrmStats = class(TASuiteForm)
gbASuite: TGroupBox;
gbSupport: TGroupBox;
gbSystem: TGroupBox;
lbCat: TLabel;
lbCat2: TLabel;
lbNamePc: TLabel;
lbNamePc2: TLabel;
lbOs: TLabel;
lbOs2: TLabel;
lbSize: TLabel;
lbSize2: TLabel;
lbSoftware: TLabel;
lbSoftware2: TLabel;
lbSoftwareGroup: TLabel;
lbSoftwareGroup2: TLabel;
lbSpaceFree: TLabel;
lbSpaceFree2: TLabel;
lbSpaceUsed: TLabel;
lbSpaceUsed2: TLabel;
lbTotal: TLabel;
lbTotal2: TLabel;
lbUser: TLabel;
lbUser2: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmStats: TfrmStats;
implementation
{$R *.dfm}
uses Main, ulCommonUtils, ulTreeView;
procedure TfrmStats.FormCreate(Sender: TObject);
var
Drive: char;
begin
//System
lbOs2.Caption := GetWindowsVersion;
lbNamePc2.Caption := GetComputerName;
lbUser2.Caption := GetCurrentUserName;
//Drive
Drive := StringReplace(ExtractFileDrive(ParamStr(0)), ':', '', [])[1];
gbSupport.Caption := Format(gbSupport.Caption, [Drive]);
lbSize2.Caption := DiskSizeString(Drive, True);
lbSpaceFree2.Caption := DiskFreeString(Drive, True);
lbSpaceUsed2.Caption := DiskUsedString(Drive, True);
//Launcher
with ListStats do
begin
SwCount := 0;
SwGroupCount := 0;
CatCount := 0;
frmMain.vstList.IterateSubtree(nil, IterateSubtreeProcs.UpdateListItemCount, nil, [], False);
lbSoftware2.Caption := IntToStr(SwCount);
lbSoftwareGroup2.Caption := IntToStr(SwGroupCount);
lbCat2.Caption := IntToStr(CatCount);
lbTotal2.Caption := IntToStr(SwCount + SwGroupCount + CatCount);
end;
end;
end.