-
Notifications
You must be signed in to change notification settings - Fork 38
/
uprogress.pas
executable file
·74 lines (57 loc) · 1.78 KB
/
uprogress.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
unit uProgress;
{$mode objfpc}{$H+} // {$H+} ensures strings are of unlimited size
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, ExtCtrls;
type
{ TfrmProgress }
TfrmProgress = class(TForm)
btnAbortHashing: TButton;
GroupBox1: TGroupBox;
lblProgressTimeTaken: TLabel;
lblProgressEndedAt: TLabel;
lblProgressStartTime: TLabel;
lblPercent: TLabel;
lblResult: TLabel;
lblStatus: TLabel;
lblTotalBytesSource: TLabel;
lblTotalBytesRead: TLabel;
ProgressBar1: TProgressBar;
procedure btnAbortHashingClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
frmProgress: TfrmProgress;
implementation
uses
diskmodule;
{$R *.lfm}
{ TfrmProgress }
procedure TfrmProgress.FormCreate(Sender: TObject);
begin
// Reset labels if run again before exiting QuickHash
lblProgressStartTime.Caption := 'Started at : ';
lblProgressEndedAt.Caption := 'Ended at: ';
lblProgressTimeTaken.Caption := 'Time taken: ';
end;
procedure TfrmProgress.btnAbortHashingClick(Sender: TObject);
begin
diskmodule.Stop := true; // Stops any further buffer reads
frmDiskHashingModule.ledtComputedHash.Text := 'Aborted';
frmProgress.Close;
end;
procedure TfrmProgress.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
lblStatus.Caption:= 'Aborting...';
// Reset labels if run again before exiting QuickHash
lblProgressStartTime.Caption := 'Started at : ';
lblProgressEndedAt.Caption := 'Ended at: ';
lblProgressTimeTaken.Caption := 'Time taken: ';
end;
end.