Improve status line display for unknown-size downloads.
This commit is contained in:
@@ -82,11 +82,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (i.TotalBytesToReceive < 0)
|
if (i.TotalBytesToReceive < 0)
|
||||||
{
|
{
|
||||||
dataTotal = float.NaN;
|
mag = (int)Math.Log(i.BytesReceived, 1024);
|
||||||
dataReceived = i.BytesReceived;
|
dataReceived = i.BytesReceived / (float)(1L << (mag * 10));
|
||||||
dataSuffix = SizeSuffixes[0];
|
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,
|
dataSuffix,
|
||||||
downloadHost ?? "unknown host");
|
downloadHost ?? "unknown host");
|
||||||
progressBar.Indeterminate = true;
|
progressBar.Indeterminate = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user