Bug 934191 - The title of the "Quit SeaMonkey" dialog is misleading when closing just the Browser. r=Neil
authorTony Mechelynck [:tonymec] <antoine.mechelynck@gmail.com>
Tue, 12 Nov 2013 17:07:52 -0500
changeset 16892 97eeebff7f37793f0ff0957899baa44bf90ddee8
parent 16891 1f9de62b2409405e87fd6616cfd7c3cb8730d42f
child 16893 e78d12404a63783bfe4cd4d5f8f59b455c26b06b
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs934191
Bug 934191 - The title of the "Quit SeaMonkey" dialog is misleading when closing just the Browser. r=Neil
suite/common/src/nsSuiteGlue.js
suite/locales/en-US/chrome/common/quitDialog.properties
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -477,17 +477,17 @@ SuiteGlue.prototype = {
       if (tabbrowser)
         pagecount += tabbrowser.browsers.length;
     }
 
     this._saveSession = false;
     if (pagecount < 2)
       return;
 
-    if (aQuitType != "restart")
+    if (aQuitType != "restart" && aQuitType != "lastwindow")
       aQuitType = "quit";
 
     var showPrompt = true;
     try {
       // browser.warnOnQuit is a hidden global boolean to override all quit prompts
       // browser.warnOnRestart specifically covers app-initiated restarts where we restart the app
       // browser.tabs.warnOnClose is the global "warn when closing multiple tabs" pref
       if (Services.prefs.getIntPref("browser.startup.page") == 3 ||
@@ -507,39 +507,40 @@ SuiteGlue.prototype = {
       var appName = brandBundle.GetStringFromName("brandShortName");
       var quitDialogTitle = quitBundle.formatStringFromName(aQuitType + "DialogTitle",
                                                               [appName], 1);
 
       var message;
       if (aQuitType == "restart")
         message = quitBundle.formatStringFromName("messageRestart",
                                                   [appName], 1);
-      else if (windowcount == 1)
+      else if (windowcount == 1)    /* close browser only, or quit application with only 1 browser window */
         message = quitBundle.formatStringFromName("messageNoWindows",
                                                   [appName], 1);
-      else
+      else                          /* quit application with 2 or more windows */
         message = quitBundle.formatStringFromName("message",
                                                   [appName], 1);
 
       var flags = Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
                   Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1 +
                   Services.prompt.BUTTON_POS_0_DEFAULT;
 
       var neverAsk = {value:false};
       var button0Title, button1Title, button2Title;
       var neverAskText = quitBundle.GetStringFromName("neverAsk");
 
       if (aQuitType == "restart") {
         button0Title = quitBundle.GetStringFromName("restartNowTitle");
         button1Title = quitBundle.GetStringFromName("restartLaterTitle");
       } else {
         flags += Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_2;
-        button0Title = quitBundle.GetStringFromName("saveTitle");
+        button0Title = quitBundle.GetStringFromName(
+                        (aQuitType == "quit" ? "saveTitle" : "savelastwindowTitle"));
         button1Title = quitBundle.GetStringFromName("cancelTitle");
-        button2Title = quitBundle.GetStringFromName("quitTitle");
+        button2Title = quitBundle.GetStringFromName(aQuitType + "Title"); /* "quitTitle" or "lastwindowTitle" */
       }
 
       var mostRecentBrowserWindow = Services.wm.getMostRecentWindow("navigator:browser");
       var buttonChoice = Services.prompt.confirmEx(mostRecentBrowserWindow, quitDialogTitle, message,
                                                    flags, button0Title, button1Title, button2Title,
                                                    neverAskText, neverAsk);
 
       switch (buttonChoice) {
--- a/suite/locales/en-US/chrome/common/quitDialog.properties
+++ b/suite/locales/en-US/chrome/common/quitDialog.properties
@@ -1,16 +1,29 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+# Strings for the Quit, Restart, and Close-browser dialogs
+# used by _onQuitRequest() in nsSuiteGlue.js
+
+# LOCALIZATION NOTE:
+# %S (also in the messages further down)
+# is the application's short name (e.g. SeaMonkey)
+# from the brand.properties file
 quitDialogTitle=Quit %S
+lastwindowDialogTitle=Close %S Browser
 restartDialogTitle=Restart %S
 
 restartNowTitle=&Restart Now
 restartLaterTitle=Restart &Later
 quitTitle=&Quit
+lastwindowTitle=Close &Browser
 cancelTitle=&Cancel
+# LOCALIZATION NOTE:
+# The following two strings are labels for the same button, depending on
+# whether we are quitting the whole Suite, or only the Browser
 saveTitle=&Save and Quit
+savelastwindowTitle=&Save and Close
 neverAsk=&Do not ask next time
 message=Do you want %S to save your tabs and windows for the next time it starts?
 messageNoWindows=Do you want %S to save your tabs for the next time it starts?
 messageRestart=%S will try to restore your tabs and windows when it restarts.