Bug 429144 - If downloaded file is removed, but saved dir still exists, then "Open Containing Folder" menu item should be disabled. r=sdwilsh, a1.9=beltzner

This commit is contained in:
edward.lee@engineering.uiuc.edu 2008-04-15 22:28:59 -07:00
Родитель 99d32fb769
Коммит 88e034bf8f
2 изменённых файлов: 8 добавлений и 4 удалений

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

@ -669,9 +669,14 @@ var gDownloadViewController = {
switch (aCommand) {
case "cmd_cancel":
return dl.inProgress;
case "cmd_open":
case "cmd_open": {
let file = getLocalFileFromNativePathOrUrl(dl.getAttribute("file"));
return dl.openable && file.exists();
}
case "cmd_show": {
let file = getLocalFileFromNativePathOrUrl(dl.getAttribute("file"));
return file.exists();
}
case "cmd_pause":
download = gDownloadManager.getDownload(dl.getAttribute("dlid"));
return dl.inProgress && !dl.paused && download.resumable;
@ -686,7 +691,6 @@ var gDownloadViewController = {
case "cmd_removeFromList":
case "cmd_retry":
return dl.removable;
case "cmd_show":
case "cmd_copyLocation":
return true;
}

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

@ -137,7 +137,7 @@ function test()
resume: [0, "Resumed no downloads"],
cancel: [0, "Canceled no downloads"],
open: [0, "Opened no downloads"],
show: [1, "Showed one download"],
show: [0, "Showed no downloads"],
retry: [1, "Retried one download"],
openReferrer: [1, "Opened one referrer"],
copyLocation: ["http://ed.agadak.net/file", "Copied one location"],
@ -148,7 +148,7 @@ function test()
resume: [0, "Resumed neither download"],
cancel: [0, "Canceled neither download"],
open: [0, "Opened neither download"],
show: [2, "Showed both downloads"],
show: [0, "Showed neither download"],
retry: [2, "Retried both downloads"],
openReferrer: [2, "Opened both referrers"],
copyLocation: ["http://mozilla.org/file\nhttp://mozilla.com/file", "Copied both locations"],