Bug 337390: Session restore dialog is scary / confusing. Also fixes bug 342765 (wrong button order in the session restore dialog), patch by Ryan Flint <rflint@dslr.net>, ui-r=beltzner, r=mconnor for the button ordering change

This commit is contained in:
gavin%gavinsharp.com 2006-07-01 22:09:18 +00:00
parent 39df89db5e
commit 658e559208
2 changed files with 10 additions and 7 deletions

View File

@ -271,20 +271,22 @@ SessionStartup.prototype = {
// create prompt strings // create prompt strings
var ssStringBundle = this._getStringBundle("chrome://browser/locale/sessionstore.properties"); var ssStringBundle = this._getStringBundle("chrome://browser/locale/sessionstore.properties");
var restoreTitle = ssStringBundle.formatStringFromName("restoreTitle", [brandShortName], 1); var restoreTitle = ssStringBundle.formatStringFromName("restoreTitle", [brandShortName], 1);
var restoreText = ssStringBundle.formatStringFromName("restoreText", [brandShortName], 1); var restoreText = ssStringBundle.formatStringFromName("restoredText", [brandShortName], 1);
var buttonTitle = ssStringBundle.GetStringFromName("buttonTitle"); var buttonTitle = ssStringBundle.GetStringFromName("buttonTitle");
var cancelTitle = ssStringBundle.GetStringFromName("cancelTitle");
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]. var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"].
getService(Ci.nsIPromptService); getService(Ci.nsIPromptService);
// set the buttons that will appear on the dialog // set the buttons that will appear on the dialog
var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1 + var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0 +
promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_0; promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1 +
promptService.BUTTON_POS_0_DEFAULT;
var buttonChoice = promptService.confirmEx(null, restoreTitle, restoreText, var buttonChoice = promptService.confirmEx(null, restoreTitle, restoreText,
flags, null, buttonTitle, null, flags, buttonTitle, cancelTitle, null,
null, {}); null, {});
recover = (buttonChoice == 1); recover = (buttonChoice == 0);
} }
} }
catch (ex) { dump(ex + "\n"); } // if the prompt fails, recover anyway catch (ex) { dump(ex + "\n"); } // if the prompt fails, recover anyway

View File

@ -1,3 +1,4 @@
restoreTitle= %S - Session Restore restoreTitle= %S - Restore Previous Session
restoreText=%S has recovered from a serious error. One of the pages you were viewing may have caused the problem, so you may experience further problems if you continue with the previous browsing session. restoredText=%S experienced a serious error, and your last session closed unexpectedly. You can restore the tabs and windows from your previous session, or start a new session if the problem continues.
buttonTitle=Restore Session buttonTitle=Restore Session
cancelTitle=Start New Session