From f729f55a48b8ad32f55d35cfe4ccb21a810c8655 Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Wed, 28 Jan 2004 23:18:20 +0000 Subject: [PATCH] Bug 62760 make the helper app dialog always select "Save to disk" if the server sent content-disposition:attachment, not only if we first see this content type r=bzbarsky rs=darin git-svn-id: svn://10.0.0.236/trunk@151988 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/ui/helperAppDlg/nsHelperAppDlg.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js index df4b4fd77b5..c5bebb988ec 100644 --- a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js +++ b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js @@ -408,10 +408,10 @@ nsHelperAppDialog.prototype = { } var useDefault = this.dialogElement( "useSystemDefault" );; - if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault) { + if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault && !this.mForced) { // Open (using system default). useDefault.radioGroup.selectedItem = useDefault; - } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp) { + } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp && !this.mForced) { // Open with given helper app. var openUsing = this.dialogElement( "openUsing" ); openUsing.radioGroup.selectedItem = openUsing; @@ -509,7 +509,9 @@ nsHelperAppDialog.prototype = { var needUpdate = false; // If current selection differs from what's in the mime info object, // then we need to update. - if ( this.dialogElement( "saveToDisk" ).selected ) { + // However, we don't want to change the action all nsIMIMEInfo objects to + // saveToDisk if mForced is true. + if ( this.dialogElement( "saveToDisk" ).selected && !this.mForced ) { needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk; if ( needUpdate ) this.mLauncher.MIMEInfo.preferredAction = this.nsIMIMEInfo.saveToDisk; @@ -517,7 +519,7 @@ nsHelperAppDialog.prototype = { needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.useSystemDefault; if ( needUpdate ) this.mLauncher.MIMEInfo.preferredAction = this.nsIMIMEInfo.useSystemDefault; - } else { + } else if ( this.dialogElement( "openUsing" ).selected ) { // For "open with", we need to check both preferred action and whether the user chose // a new app. needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.useHelperApp || this.appChanged();