Rev 6 | Rev 8 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6 | Rev 7 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | Label4: TLabel; |
18 | Label4: TLabel; |
19 | Button1: TButton; |
19 | Button1: TButton; |
20 | OpenDialog1: TOpenDialog; |
20 | OpenDialog1: TOpenDialog; |
21 | procedure Button1Click(Sender: TObject); |
21 | procedure Button1Click(Sender: TObject); |
22 | procedure FormShow(Sender: TObject); |
22 | procedure FormShow(Sender: TObject); |
- | 23 | procedure FormKeyPress(Sender: TObject; var Key: Char); |
|
23 | private |
24 | private |
24 | FChecksumFile: string; |
25 | FChecksumFile: string; |
25 | public |
26 | public |
26 | function ParamChecksumFile: string; |
27 | function ParamChecksumFile: string; |
27 | procedure LoadSFV; |
28 | procedure LoadSFV; |
Line 42... | Line 43... | ||
42 | begin |
43 | begin |
43 | SaveSFV; |
44 | SaveSFV; |
44 | LoadSFV; |
45 | LoadSFV; |
45 | end; |
46 | end; |
46 | 47 | ||
- | 48 | procedure TForm3.FormKeyPress(Sender: TObject; var Key: Char); |
|
- | 49 | begin |
|
- | 50 | if Key = #27 then Close; |
|
- | 51 | end; |
|
- | 52 | ||
47 | procedure TForm3.FormShow(Sender: TObject); |
53 | procedure TForm3.FormShow(Sender: TObject); |
48 | begin |
54 | begin |
49 | Caption := ParamChecksumFile; |
55 | Caption := ParamChecksumFile; |
50 | LoadSFV; |
56 | LoadSFV; |
51 | end; |
57 | end; |
Line 91... | Line 97... | ||
91 | try |
97 | try |
92 | // Read SFV/MD5 file |
98 | // Read SFV/MD5 file |
93 | csman.ToStringList(slSFV); |
99 | csman.ToStringList(slSFV); |
94 | 100 | ||
95 | // List existing files |
101 | // List existing files |
96 | IsFound := FindFirst(ADirectory + '*', faAnyFile, SR) = 0; |
102 | IsFound := FindFirst(ADirectory + '*', faAnyFile xor faDirectory, SR) = 0; |
97 | while IsFound do |
103 | while IsFound do |
98 | begin |
104 | begin |
99 | if (SR.Name <> '.') and (SR.Name <> '..') then |
105 | if (SR.Name <> '.') and (SR.Name <> '..') then |
100 | begin |
106 | begin |
101 | existingFiles.Add(LowerCase(SR.Name)); |
107 | existingFiles.Add(LowerCase(SR.Name)); |
Line 141... | Line 147... | ||
141 | begin |
147 | begin |
142 | IstChecksum := CalcFileCRC32(IncludeTrailingPathDelimiter(ADirectory) + TestFilename); |
148 | IstChecksum := CalcFileCRC32(IncludeTrailingPathDelimiter(ADirectory) + TestFilename); |
143 | Memo4.Lines.Add(csman.MergeLine(TestFileName, IstChecksum)); |
149 | Memo4.Lines.Add(csman.MergeLine(TestFileName, IstChecksum)); |
144 | end; |
150 | end; |
145 | end; |
151 | end; |
- | 152 | ||
- | 153 | if (Memo2.Text = '') and (Memo3.Text = '') and (Memo4.Text = '') then |
|
- | 154 | Color := clMoneyGreen |
|
- | 155 | else if (Memo2.Text <> '') then |
|
- | 156 | Color := clRed |
|
- | 157 | else |
|
- | 158 | Color := clYellow; |
|
146 | finally |
159 | finally |
147 | FreeAndNil(slSFV); |
160 | FreeAndNil(slSFV); |
148 | FreeAndNil(existingFiles); |
161 | FreeAndNil(existingFiles); |
149 | FreeAndNil(csman); |
162 | FreeAndNil(csman); |
150 | end; |
163 | end; |