зеркало из https://github.com/mozilla/pjs.git
Bug 224918 When not using Download Manager, closing progress dialogs doesn't cancel download r=biesi sr=bz
This commit is contained in:
Родитель
327a0e8cf6
Коммит
96c031d72b
|
@ -135,9 +135,14 @@ interface nsIDownloadManager : nsISupports {
|
|||
* display progress for.
|
||||
*
|
||||
* @param aParent The parent, or opener, of the front end (optional).
|
||||
*
|
||||
* @param aCancelDownloadOnClose Whether closing the dialog
|
||||
* should cancel the download.
|
||||
*/
|
||||
|
||||
void openProgressDialogFor(in AUTF8String aTargetPath, in nsIDOMWindow aParent);
|
||||
void openProgressDialogFor(in AUTF8String aTargetPath,
|
||||
in nsIDOMWindow aParent,
|
||||
in boolean aCancelDownloadOnClose);
|
||||
|
||||
/**
|
||||
* Called when the download manager front end is closed. Useful for
|
||||
|
|
|
@ -206,7 +206,7 @@ var downloadViewController = {
|
|||
case "cmd_properties":
|
||||
selectedItem = getSelectedItem();
|
||||
if (selectedItem && gDownloadManager.getDownload(selectedItem.id))
|
||||
gDownloadManager.openProgressDialogFor(selectedItem.id, window);
|
||||
gDownloadManager.openProgressDialogFor(selectedItem.id, window, false);
|
||||
break;
|
||||
case "cmd_openfile":
|
||||
selectedItem = getSelectedItem();
|
||||
|
|
|
@ -744,7 +744,7 @@ nsDownloadManager::Open(nsIDOMWindow* aParent, nsIDownload* aDownload)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDownloadManager::OpenProgressDialogFor(const nsACString & aTargetPath, nsIDOMWindow* aParent)
|
||||
nsDownloadManager::OpenProgressDialogFor(const nsACString & aTargetPath, nsIDOMWindow* aParent, PRBool aCancelDownloadOnClose)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCStringKey key(aTargetPath);
|
||||
|
@ -774,7 +774,7 @@ nsDownloadManager::OpenProgressDialogFor(const nsACString & aTargetPath, nsIDOMW
|
|||
nsCOMPtr<nsIProgressDialog> dialog(do_CreateInstance("@mozilla.org/progressdialog;1", &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
dialog->SetCancelDownloadOnClose(PR_FALSE);
|
||||
dialog->SetCancelDownloadOnClose(aCancelDownloadOnClose);
|
||||
|
||||
nsCOMPtr<nsIDownload> dl = do_QueryInterface(dialog);
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
NS_ConvertUCS2toUTF8 utf8Path(path);
|
||||
return dm->OpenProgressDialogFor(utf8Path, nsnull);
|
||||
return dm->OpenProgressDialogFor(utf8Path, nsnull, PR_TRUE);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче