Now handles gigabyte file sizes and also file flags are in the prompts now
This commit is contained in:
parent
59f2c129cb
commit
f63c272764
|
@ -1768,27 +1768,32 @@ Var
|
||||||
UpdateBatch;
|
UpdateBatch;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function GetFileListSize : String;
|
Function GetFileListSize (SizeInfo: String) : String;
|
||||||
Var
|
Var
|
||||||
A : LongInt;
|
A : Cardinal;
|
||||||
|
S : String;
|
||||||
Begin
|
Begin
|
||||||
If FDir.Flags And FDirOffline <> 0 Then
|
If FDir.Flags And FDirOffline <> 0 Then
|
||||||
GetFileListSize := 'OFFLINE' //++lang
|
GetFileListSize := strWordGet(1, SizeInfo, ' ')
|
||||||
Else
|
Else
|
||||||
If FDir.Flags And FDirFailed <> 0 Then
|
If FDir.Flags And FDirFailed <> 0 Then
|
||||||
GetFileListSize := 'FAILED' //++lang
|
GetFileListSize := strWordGet(2, SizeInfo, ' ')
|
||||||
Else
|
Else
|
||||||
If FDir.Flags And FDirInvalid <> 0 Then
|
If FDir.Flags And FDirInvalid <> 0 Then
|
||||||
GetFileListSize := 'UNVALID' //++lang
|
GetFileListSize := strWordGet(3, SizeInfo, ' ')
|
||||||
Else
|
Else
|
||||||
|
If FDir.Size >= 10240000 Then Begin
|
||||||
|
A := (FDir.Size DIV 1024) DIV 1024;
|
||||||
|
GetFileListSize := strI2S(A DIV 1000) + '.' + Copy(strI2S(A MOD 1000), 1, 2) + strWordGet(4, SizeInfo, ' ')
|
||||||
|
End Else
|
||||||
If FDir.Size >= 1024000 Then Begin
|
If FDir.Size >= 1024000 Then Begin
|
||||||
A := FDir.Size DIV 1024;
|
A := FDir.Size DIV 1024;
|
||||||
GetFileListSize := strI2S(A DIV 1000) + '.' + Copy(strI2S(A MOD 1000), 1, 2) + 'MB'; //++lang
|
GetFileListSize := strI2S(A DIV 1000) + '.' + Copy(strI2S(A MOD 1000), 1, 2) + strWordGet(5, SizeInfo, ' ')
|
||||||
End Else
|
End Else
|
||||||
If FDir.Size >= 1024 Then
|
If FDir.Size >= 1024 Then
|
||||||
GetFileListSize := strI2S(FDir.Size DIV 1024) + 'KB' //++lang
|
GetFileListSize := strI2S(FDir.Size DIV 1024) + strWordGet(6, SizeInfo, ' ')
|
||||||
Else
|
Else
|
||||||
GetFileListSize := strI2S(FDir.Size) + 'B'; //++lang
|
GetFileListSize := strI2S(FDir.Size) + strWordGet(7, SizeInfo, ' ');
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure HeaderCheck;
|
Procedure HeaderCheck;
|
||||||
|
@ -1820,12 +1825,14 @@ Var
|
||||||
|
|
||||||
Procedure DrawPage;
|
Procedure DrawPage;
|
||||||
Var
|
Var
|
||||||
OK : Boolean;
|
OK : Boolean;
|
||||||
Str : String;
|
Str : String;
|
||||||
A : SmallInt;
|
A : SmallInt;
|
||||||
|
SizeStr : String;
|
||||||
Begin
|
Begin
|
||||||
ListSize := 0;
|
ListSize := 0;
|
||||||
Lines := 0;
|
Lines := 0;
|
||||||
|
SizeStr := Session.GetPrompt(491);
|
||||||
|
|
||||||
Seek (FDirFile, TopPage);
|
Seek (FDirFile, TopPage);
|
||||||
If TopDesc <> 0 Then Read (FDirFile, FDir);
|
If TopDesc <> 0 Then Read (FDirFile, FDir);
|
||||||
|
@ -1846,7 +1853,7 @@ Var
|
||||||
Session.io.PromptInfo[1] := strZero(ListSize + 1);
|
Session.io.PromptInfo[1] := strZero(ListSize + 1);
|
||||||
Session.io.PromptInfo[2] := FDir.FileName;
|
Session.io.PromptInfo[2] := FDir.FileName;
|
||||||
Session.io.PromptInfo[3] := ' ';
|
Session.io.PromptInfo[3] := ' ';
|
||||||
Session.io.PromptInfo[4] := GetFileListSize;
|
Session.io.PromptInfo[4] := GetFileListSize(SizeStr);
|
||||||
Session.io.PromptInfo[5] := DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType);
|
Session.io.PromptInfo[5] := DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType);
|
||||||
Session.io.PromptInfo[6] := strI2S(FDir.Downloads);
|
Session.io.PromptInfo[6] := strI2S(FDir.Downloads);
|
||||||
|
|
||||||
|
@ -1888,7 +1895,7 @@ Var
|
||||||
If Mode = 3 Then SearchHighlight(Str);
|
If Mode = 3 Then SearchHighlight(Str);
|
||||||
|
|
||||||
If A = 1 Then Begin
|
If A = 1 Then Begin
|
||||||
Session.io.PromptInfo[1] := GetFileListSize;
|
Session.io.PromptInfo[1] := GetFileListSize(SizeStr);
|
||||||
Session.io.PromptInfo[2] := DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType);
|
Session.io.PromptInfo[2] := DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType);
|
||||||
Session.io.PromptInfo[3] := strI2S(FDir.Downloads);
|
Session.io.PromptInfo[3] := strI2S(FDir.Downloads);
|
||||||
Session.io.PromptInfo[4] := Str;
|
Session.io.PromptInfo[4] := Str;
|
||||||
|
|
Loading…
Reference in New Issue