Loading xpfe/AppCores/src/nsBrowserAppCore.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1177,7 +1177,10 @@ nsFileDownloadDialog::AttributeChanged( nsIDocument *aDocument, if ( id == "data.execute" ) { nsString cmd; nsCOMPtr<nsIAtom> atomCommand = nsDontQueryInterface<nsIAtom>( NS_NewAtom("command") ); // Get requested command. aContent->GetAttribute( kNameSpaceID_None, atomCommand, cmd ); // Reset (immediately, to prevent feedback loop). aContent->SetAttribute( kNameSpaceID_None, atomCommand, "", PR_FALSE ); if ( cmd == "ok" ) { OnOK( aContent ); } else if ( cmd == "start" ) { Loading @@ -1188,7 +1191,6 @@ nsFileDownloadDialog::AttributeChanged( nsIDocument *aDocument, OnClose(); } else { } aContent->SetAttribute( kNameSpaceID_None, atomCommand, "", PR_FALSE ); } return rv; Loading xpfe/browser/src/downloadProgress.xul +16 −7 Original line number Diff line number Diff line Loading @@ -57,16 +57,22 @@ data.execute.setAttribute("command","start"); } function stop() { // Stop the download. data.execute.setAttribute("command","stop"); } var started = false; var completed = false; var startTime; var interval = 1000; // Update every 1000 milliseconds. var lastUpdate = -interval; // Update initially. function stop() { if ( started && !completed ) { // Stop the download. data.execute.setAttribute( "command", "stop" ); } else { // Close the window. data.execute.setAttribute( "command", "close" ); } } function onProgress() { // Check for first time. if ( !started ) { Loading Loading @@ -140,7 +146,10 @@ } function onCompletion() { dialog.cancel.setAttribute( "disabled", "" ); if ( !completed ) { completed = true; data.execute.setAttribute( "command", "close" ); } } </html:script> Loading Loading @@ -198,7 +207,7 @@ <html:tr> <html:td align="center" colspan="2"> <html:button id="dialog.cancel" onclick="stop()" disabled="">Cancel</html:button> <html:button id="dialog.cancel" onclick="stop()">Cancel</html:button> </html:td> </html:tr> Loading Loading
xpfe/AppCores/src/nsBrowserAppCore.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1177,7 +1177,10 @@ nsFileDownloadDialog::AttributeChanged( nsIDocument *aDocument, if ( id == "data.execute" ) { nsString cmd; nsCOMPtr<nsIAtom> atomCommand = nsDontQueryInterface<nsIAtom>( NS_NewAtom("command") ); // Get requested command. aContent->GetAttribute( kNameSpaceID_None, atomCommand, cmd ); // Reset (immediately, to prevent feedback loop). aContent->SetAttribute( kNameSpaceID_None, atomCommand, "", PR_FALSE ); if ( cmd == "ok" ) { OnOK( aContent ); } else if ( cmd == "start" ) { Loading @@ -1188,7 +1191,6 @@ nsFileDownloadDialog::AttributeChanged( nsIDocument *aDocument, OnClose(); } else { } aContent->SetAttribute( kNameSpaceID_None, atomCommand, "", PR_FALSE ); } return rv; Loading
xpfe/browser/src/downloadProgress.xul +16 −7 Original line number Diff line number Diff line Loading @@ -57,16 +57,22 @@ data.execute.setAttribute("command","start"); } function stop() { // Stop the download. data.execute.setAttribute("command","stop"); } var started = false; var completed = false; var startTime; var interval = 1000; // Update every 1000 milliseconds. var lastUpdate = -interval; // Update initially. function stop() { if ( started && !completed ) { // Stop the download. data.execute.setAttribute( "command", "stop" ); } else { // Close the window. data.execute.setAttribute( "command", "close" ); } } function onProgress() { // Check for first time. if ( !started ) { Loading Loading @@ -140,7 +146,10 @@ } function onCompletion() { dialog.cancel.setAttribute( "disabled", "" ); if ( !completed ) { completed = true; data.execute.setAttribute( "command", "close" ); } } </html:script> Loading Loading @@ -198,7 +207,7 @@ <html:tr> <html:td align="center" colspan="2"> <html:button id="dialog.cancel" onclick="stop()" disabled="">Cancel</html:button> <html:button id="dialog.cancel" onclick="stop()">Cancel</html:button> </html:td> </html:tr> Loading