Bug #33156 --> finish new nsIWebProgress work --> implement real progress as a percentage of the document download.

This commit is contained in:
mscott%netscape.com 2000-04-25 05:50:23 +00:00
Родитель 126ffef6a2
Коммит 0e3dc8a1b8
1 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -199,6 +199,22 @@ nsXULBrowserWindow.prototype =
overLink = link;
UpdateStatusField();
},
onProgress : function (channel, current, max)
{
if(!statusMeter)
statusMeter = document.getElementById("statusbar-icon");
var percentage = 0;
if (max > 0)
{
percentage = (current * 100) / max ;
statusMeter.setAttribute("mode", "normal");
statusMeter.value = percentage;
statusMeter.progresstext = Math.round(percentage) + "%";
}
else
statusMeter.setAttribute("mode","undetermined");
},
onStatusChange : function(channel, status)
{
if(!throbberElement)
@ -227,8 +243,10 @@ nsXULBrowserWindow.prototype =
defaultStatus = msg;
UpdateStatusField();
window.XULBrowserWindow.setDefaultStatus(msg);
// Turn progress meter off.
statusMeter.setAttribute("mode","normal");
// Turn progress meter off.
statusMeter.setAttribute("mode","normal");
statusMeter.value = 0; // be sure to clear the progress bar
statusMeter.progresstext = "";
throbberElement.setAttribute("busy", false);
}
else if(status & Components.interfaces.nsIWebProgress.flag_net_dns)