From 9513b95324a20cd20ea93d07049bb7e9cc7dd886 Mon Sep 17 00:00:00 2001 From: "sspitzer%mozilla.org" Date: Mon, 11 Sep 2006 16:30:32 +0000 Subject: [PATCH] fix for bug #350299: After clicking "Restart Now", the software update wizard can obscure the "confirm close" prompt from browser windows with multiple tabs. additional, after clicking "Restart Now", we need to disable the "Restart Now" and "Later" buttons, so that the user can't click on them again (while they are dealing with the "confirm close" prompts. finally, improve the prompt scenario (by first focusing the wizard) where the user has paused in the middle downloading a software update, minimized the software update wizard, and then quit the app. r=gavin.sharp, sr=mconnor --- toolkit/content/widgets/tabbrowser.xml | 6 ++++++ toolkit/mozapps/update/content/updates.js | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/toolkit/content/widgets/tabbrowser.xml b/toolkit/content/widgets/tabbrowser.xml index 0ebd1249cf8..ba715a9c927 100644 --- a/toolkit/content/widgets/tabbrowser.xml +++ b/toolkit/content/widgets/tabbrowser.xml @@ -1277,6 +1277,12 @@ var messageKey = (tabsToClose == 1) ? "tabs.closeWarningOne" : "tabs.closeWarningMultiple"; var closeKey = (tabsToClose == 1) ? "tabs.closeButtonOne" : "tabs.closeButtonMultiple"; + // focus the window before prompting. + // this will raise any minimized window, which will + // make it obvious which window the prompt is for and will + // solve the problem of windows "obscuring" the prompt. + // see bug #350299 for more details + window.focus(); var buttonPressed = promptService.confirmEx(window, bundle.getString('tabs.closeWarningTitle'), bundle.getFormattedString(messageKey, [tabsToClose]), diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index acab24ebe4d..8c7468fd91c 100755 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -1288,6 +1288,12 @@ var gDownloadingPage = { var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var flags = ps.STD_YES_NO_BUTTONS; + // focus the software update wizard before prompting. + // this will raise the software update wizard if it is minimized + // making it more obvious what the prompt is for and will + // solve the problem of windows "obscuring" the prompt. + // see bug #350299 for more details + window.focus(); var rv = ps.confirmEx(window, title, message, flags, null, null, null, null, { }); if (rv == 1) { downloadInBackground = false; @@ -1595,6 +1601,18 @@ var gFinishedPage = { // Do the restart LOG("UI:FinishedPage" , "onWizardFinish: Restarting Application..."); + // disable the "finish" (Restart) and "cancel" (Later) buttons + // because the Software Update wizard is still up at the point, + // and will remain up until we return and we close the + // window with a |window.close()| in wizard.xml + // (it was the firing the "wizardfinish" event that got us here.) + // This prevents the user from switching back + // to the Software Update dialog and clicking "Restart" or "Later" + // when dealing with the "confirm close" prompts. + // See bug #350299 for more details. + gUpdates.wiz.getButton("finish").disabled = true; + gUpdates.wiz.getButton("cancel").disabled = true; + // This process is *extremely* broken. There should be some nice // integrated system for determining whether or not windows are allowed // to close or not, and what happens when that happens. We need to