Bug 901360 - (Part 5) Don't allow pausing downloads without partial data. r=margaret

--HG--
extra : rebase_source : c5455e3d650711692af3f97d90dd002845dcc669
This commit is contained in:
Wes Johnston 2014-12-08 11:26:36 -08:00
Родитель 4775f1702f
Коммит 39dc927bd4
2 изменённых файлов: 4 добавлений и 2 удалений

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

@ -53,7 +53,7 @@ let contextMenu = {
deleteDownload(download);
}),
new ContextMenuItem("pause",
download => !download.stopped,
download => !download.stopped && download.hasPartialData,
download => download.cancel().then(null, Cu.reportError)),
new ContextMenuItem("resume",
download => download.canceled && download.hasPartialData,

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

@ -214,7 +214,9 @@ DownloadNotification.prototype = {
if (this.download.currentBytes == 0) {
this._updateOptionsForStatic(options, "alertDownloadsStart2");
} else {
this._updateOptionsForOngoing(options, [kButtons.PAUSE, kButtons.CANCEL]);
let buttons = this.download.hasPartialData ? [kButtons.PAUSE, kButtons.CANCEL] :
[kButtons.CANCEL]
this._updateOptionsForOngoing(options, buttons);
}
} else if (this._paused) {
this._updateOptionsForOngoing(options, [kButtons.RESUME, kButtons.CANCEL]);