From 1ebda7a0d27068f014425eab2f92501446e14f33 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 12 Feb 2002 03:52:03 +0000 Subject: [PATCH] Opening the "Advanced" dialog and cancelling it should not change the helper app dialog contents. Bug 124723, r=law, sr=jag git-svn-id: svn://10.0.0.236/trunk@114243 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/ui/helperAppDlg/nsHelperAppDlg.js | 10 +++++++--- .../resources/content/pref-applications-edit.xul | 3 +++ .../resources/content/pref-applications-new.js | 6 +++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js index f41b0108ef8..7c8f5d0c7c4 100644 --- a/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js +++ b/mozilla/embedding/components/ui/helperAppDlg/nsHelperAppDlg.js @@ -62,6 +62,7 @@ function nsHelperAppDialog() { this.givenDefaultApp = false; this.strings = new Array; this.elements = new Array; + this.updateSelf = true; } nsHelperAppDialog.prototype = { @@ -502,14 +503,17 @@ nsHelperAppDialog.prototype = { } // Open whichever dialog is appropriate, passing this dialog object as argument. + this.updateSelf = false; // dialog will reset to true onOK this.mDialog.openDialog( dlgUrl, "_blank", "chrome,modal=yes,resizable=no", this ); - // Refresh dialog with updated info about the default action. - this.initIntro(); - this.initAppAndSaveToDiskValues(); + if (this.updateSelf) { + // Refresh dialog with updated info about the default action. + this.initIntro(); + this.initAppAndSaveToDiskValues(); + } }, // updateMIMEInfo: This is called from the pref-applications-edit dialog when the user diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul b/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul index b41a890453f..ea0dd3edfde 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul @@ -282,6 +282,9 @@ } else { info.preferredAction = Components.interfaces.nsIMIMEInfo.handleInternally; } + + // tell the helper app dialog to update itself + gHelperAppDlg.updateSelf = true; } window.opener.gUpdateTypeRV = true; diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-new.js b/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-new.js index 6de9c722852..63356b3396a 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-new.js +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-applications-new.js @@ -45,7 +45,8 @@ function Startup() gDescriptionField.value = info.Description; gExtensionField.value = info.primaryExtension; gMIMEField.value = info.MIMEType; - var app = info.preferredApplicationHandler; + // an app may have been selected in the opening dialog but not in the mimeinfo + var app = info.preferredApplicationHandler || window.arguments[0].chosenApp; if ( app ) { gAppPath.value = app.unicodePath; } @@ -169,6 +170,9 @@ function onOK() info.Description = gDescriptionField.value; info.preferredApplicationHandler = file; info.applicationDescription = handlerInfo.appDisplayName; + + // Tell the nsIHelperAppLauncherDialog to update to the changes + window.arguments[0].updateSelf = true; } window.opener.gNewTypeRV = gMIMEField.value;