mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 595888 - Show file size when attempting to download a file. r=sdwilsh, r=dolske, ui-r=faaborg
This commit is contained in:
parent
a32551add5
commit
332ca401eb
@ -22,6 +22,7 @@
|
||||
# Contributor(s):
|
||||
# Ben Goodger <ben@bengoodger.com>
|
||||
# Rich Walsh <dragtext@e-vertise.com>
|
||||
# Kailas Patil <patilkr24@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -49,6 +50,8 @@ selectDownloadDir=Select Download Folder
|
||||
unknownAccept.label=Save File
|
||||
unknownCancel.label=Cancel
|
||||
fileType=%S file
|
||||
# LOCALIZATION NOTE (fileSizeWithType): first %S is type, second %S is size, and third %S is unit
|
||||
fileSizeWithType=%1S (%2S %3S)
|
||||
|
||||
# LOCALIZATION NOTE (wpsDefaultOS2): OS/2 only, WPS refers to the Workplace Shell and should probably not be translated
|
||||
wpsDefaultOS2=WPS Default
|
||||
|
@ -29,6 +29,7 @@
|
||||
# Dan Mosedale <dmose@mozilla.org>
|
||||
# Jim Mathies <jmathies@mozilla.com>
|
||||
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
# Kailas Patil <patilkr24@gmail.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -139,6 +140,7 @@ const nsITimer = Components.interfaces.nsITimer;
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/DownloadLastDir.jsm");
|
||||
Components.utils.import("resource://gre/modules/DownloadPaths.jsm");
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
||||
/* ctor
|
||||
*/
|
||||
@ -609,8 +611,16 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
else
|
||||
typeString = mimeInfo.MIMEType;
|
||||
}
|
||||
|
||||
type.value = typeString;
|
||||
if (this.mLauncher.contentLength) {
|
||||
let [size, unit] = DownloadUtils.
|
||||
convertByteUnits(this.mLauncher.contentLength);
|
||||
type.value = this.dialogElement("strings")
|
||||
.getFormattedString("fileSizeWithType",
|
||||
[typeString, size, unit]);
|
||||
}
|
||||
else {
|
||||
type.value = typeString;
|
||||
}
|
||||
},
|
||||
|
||||
_blurred: false,
|
||||
|
Loading…
Reference in New Issue
Block a user