Fix for bug #8539; reviwed by sfraser, approved by chofmann

git-svn-id: svn://10.0.0.236/trunk@38863 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
law%netscape.com
1999-07-09 01:25:03 +00:00
parent c3c9d35393
commit a0997e2214
3 changed files with 19 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Saving file"
onunload="onUnload()"
width="425"
height="225">
@@ -75,6 +76,11 @@
data.execute.setAttribute("command","start");
}
function onUnload() {
// Inform underlying C++ object.
data.execute.setAttribute("command","unload");
}
var started = false;
var completed = false;
var startTime;
@@ -176,6 +182,8 @@
}
</html:script>
<html:div flex="100%">
<html:table style="width:100%;">
<html:tr>
@@ -236,4 +244,6 @@
</html:table>
</html:div>
</window>

View File

@@ -57,6 +57,12 @@ nsDownloadProgressDialog::OnClose() {
}
}
void
nsDownloadProgressDialog::OnUnload() {
// Window was closed (or is closing), release it.
mWindow = 0;
}
void
nsDownloadProgressDialog::OnStart() {
// Load source stream into file.
@@ -361,6 +367,8 @@ nsDownloadProgressDialog::AttributeChanged( nsIDocument *aDocument,
OnStop();
} else if ( cmd == "close" ) {
OnClose();
} else if ( cmd == "unload" ) {
OnUnload();
} else {
}
}

View File

@@ -131,6 +131,7 @@ protected:
void OnClose();
void OnStart();
void OnStop();
void OnUnload();
private:
nsCOMPtr<nsIURI> mUrl;