Skip to content

Commit

Permalink
Improve status line display for unknown-size downloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote authored and abcdefg30 committed Sep 14, 2018
1 parent 3f4d5fa commit 7438af8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ void ShowDownloadDialog()
if (i.TotalBytesToReceive < 0)
{
dataTotal = float.NaN;
dataReceived = i.BytesReceived;
dataSuffix = SizeSuffixes[0];
mag = (int)Math.Log(i.BytesReceived, 1024);
dataReceived = i.BytesReceived / (float)(1L << (mag * 10));
dataSuffix = SizeSuffixes[mag];
getStatusText = () => "Downloading from {2} {0:0.00} {1} (unknown size)".F(dataReceived,
getStatusText = () => "Downloading from {2} {0:0.00} {1}".F(dataReceived,
dataSuffix,
downloadHost ?? "unknown host");
progressBar.Indeterminate = true;
Expand Down

0 comments on commit 7438af8

Please sign in to comment.