diff --git a/mozilla/xpfe/components/ucth/resources/helperAppDldProgress.js b/mozilla/xpfe/components/ucth/resources/helperAppDldProgress.js index 912a159d2f1..9c03b8e39ad 100644 --- a/mozilla/xpfe/components/ucth/resources/helperAppDldProgress.js +++ b/mozilla/xpfe/components/ucth/resources/helperAppDldProgress.js @@ -77,12 +77,16 @@ var progressListener = { if (!gRestartChecked) { gRestartChecked = true; - // right now, all that supports restarting downloads is ftp (rfc959) - ftpChannel = aRequest.QueryInterface(Components.interfaces.nsIFTPChannel); - if (ftpChannel) { + try + { + // right now, all that supports restarting downloads is ftp (rfc959) + ftpChannel = aRequest.QueryInterface(Components.interfaces.nsIFTPChannel); + if (ftpChannel) { dialog.pause.setAttribute("hidden", false); dialog.pause.setAttribute("label", getString("pause")); + } } + catch (ex) {} } // this is so that we don't clobber the status text if @@ -118,7 +122,7 @@ var progressListener = { // Calculate percentage. var percent; - if ( aMaxTotalProgress != "-1" ) + if ( aMaxTotalProgress > 0) { percent = parseInt( (overallProgress*100)/aMaxTotalProgress + .5 ); if ( percent > 100 ) @@ -129,7 +133,7 @@ var progressListener = { } else { - percent = "??"; + percent = -1; // Progress meter should be barber-pole in this case. dialog.progress.setAttribute( "mode", "undetermined" ); @@ -183,20 +187,25 @@ var progressListener = { // Update status msg. dialog.status.setAttribute("value", status); - // Update percentage label on progress meter. - var percentMsg = getString( "percentMsg" ); - percentMsg = replaceInsert( percentMsg, 1, percent ); - dialog.progressText.setAttribute("value", percentMsg); + // Update percentage label on progress meter. + if (percent < 0) + dialog.progressText.setAttribute("value", ""); + else + { + var percentMsg = getString( "percentMsg" ); + percentMsg = replaceInsert( percentMsg, 1, percent ); + dialog.progressText.setAttribute("value", percentMsg); + } // Update time remaining. - if ( rate && aMaxTotalProgress != "-1" ) + if ( rate && (aMaxTotalProgress > 0) ) { var rem = ( aMaxTotalProgress - aCurTotalProgress ) / rate; - rem = parseInt( rem + .5 ); - dialog.timeLeft.setAttribute("value", formatSeconds( rem )); + rem = parseInt( rem + .5 ); + dialog.timeLeft.setAttribute("value", formatSeconds( rem )); } else - dialog.timeLeft.setAttribute("value", getString( "unknownTime" )); + dialog.timeLeft.setAttribute("value", getString( "unknownTime" )); }, onLocationChange: function(aWebProgress, aRequest, aLocation) { diff --git a/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.dtd b/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.dtd index 85306a9e6a6..50b5d2da91b 100644 --- a/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.dtd +++ b/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.dtd @@ -29,7 +29,7 @@ - +