зеркало из https://github.com/mozilla/gecko-dev.git
Bug 901360 - (Part 5) Don't allow pausing downloads without partial data. r=margaret
--HG-- extra : rebase_source : c5455e3d650711692af3f97d90dd002845dcc669
This commit is contained in:
Родитель
4775f1702f
Коммит
39dc927bd4
|
@ -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]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче