Bug 365996: Take advantage of old yes/no constant in nsIPromptService, patch by Ryan Jones <bugs@ryan-jones.com>, r=mscott for /mail, r=neil for /xpfe and /mailnews, r=ctho for /suite, r=me for the rest

This commit is contained in:
gavin%gavinsharp.com 2007-01-09 20:29:09 +00:00
parent c3df5bb2b7
commit bf31d58845
16 changed files with 31 additions and 56 deletions

View File

@ -1101,8 +1101,7 @@ function delayedStartup()
.getService(IPS);
var checkEveryTime = { value: shouldCheck };
var rv = ps.confirmEx(window, promptTitle, promptMessage,
(IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +
(IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
IPS.STD_YES_NO_BUTTONS,
null, null, null, checkboxLabel, checkEveryTime);
if (rv == 0)
shell.setDefaultBrowser(true, false);
@ -2733,8 +2732,7 @@ function openHomeDialog(aURL)
var promptTitle = gNavigatorBundle.getString("droponhometitle");
var promptMsg = gNavigatorBundle.getString("droponhomemsg");
var pressedVal = promptService.confirmEx(window, promptTitle, promptMsg,
(promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1),
promptService.STD_YES_NO_BUTTONS,
null, null, null, null, {value:0});
if (pressedVal == 0) {

View File

@ -441,8 +441,7 @@ var gMainPane = {
promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
[brandShortName]);
var rv = psvc.confirmEx(window, promptTitle, promptMessage,
(IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +
(IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
IPS.STD_YES_NO_BUTTONS,
null, null, null, null, { });
if (rv == 0)
shellSvc.setDefaultBrowser(true, false);

View File

@ -143,8 +143,7 @@ function DeleteConfig()
var bundle = document.getElementById("bundle_cckwizard");
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("deleteConfirm"),
gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1,
gPromptService.STD_YES_NO_BUTTONS,
null, null, null, null, {});
if (button == 0) {
gPrefBranch.deleteBranch("cck.config."+currentconfigname);
@ -267,8 +266,7 @@ function CloseCCKWizard()
var bundle = document.getElementById("bundle_cckwizard");
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("cancelConfirm"),
(gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0) +
(gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1),
gPromptService.STD_YES_NO_BUTTONS,
null, null, null, null, {});
} else {
button = 0;
@ -2054,8 +2052,7 @@ function CCKWriteConfigFile(destdir)
if (!file.exists()) {
var bundle = document.getElementById("bundle_cckwizard");
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("createDir").replace(/%S/g, file.path),
gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1,
gPromptService.STD_YES_NO_BUTTONS,
null, null, null, null, {});
if (button == 0) {
try {
@ -2607,8 +2604,7 @@ function ValidateDir()
if (!file.exists()) {
var bundle = document.getElementById("bundle_cckwizard");
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("createDir").replace(/%S/g, filename),
gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1,
gPromptService.STD_YES_NO_BUTTONS,
null, null, null, null, {});
if (button == 0) {
try {

View File

@ -366,7 +366,7 @@ function AskUserShowPasswords() {
return prompter.confirmEx(window,
null,
kSignonBundle.getString("noMasterPasswordPrompt"),
prompter.BUTTON_TITLE_YES * prompter.BUTTON_POS_0 + prompter.BUTTON_TITLE_NO * prompter.BUTTON_POS_1,
prompter.STD_YES_NO_BUTTONS,
null, null, null, null, dummy) == 0; // 0=="Yes" button
}

View File

@ -248,16 +248,16 @@ function DeleteSignon() {
}
function DeleteAllSignons() {
var prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
// Confirm the user wants to remove all passwords
var dummy = { value: false };
if (prompter.confirmEx(window,
kSignonBundle.getString("removeAllPasswordsTitle"),
kSignonBundle.getString("removeAllPasswordsPrompt"),
prompter.STD_YES_NO_BUTTONS + prompter.BUTTON_POS_1_DEFAULT,
null, null, null, null, dummy) == 1) // 1 == "No" button
var prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
// Confirm the user wants to remove all passwords
var dummy = { value: false };
if (prompter.confirmEx(window,
kSignonBundle.getString("removeAllPasswordsTitle"),
kSignonBundle.getString("removeAllPasswordsPrompt"),
prompter.STD_YES_NO_BUTTONS + prompter.BUTTON_POS_1_DEFAULT,
null, null, null, null, dummy) == 1) // 1 == "No" button
return;
DeleteAllFromTree(signonsTree, signonsTreeView,
@ -283,7 +283,7 @@ function AskUserShowPasswords() {
return prompter.confirmEx(window,
null,
kSignonBundle.getString("noMasterPasswordPrompt"),
prompter.BUTTON_TITLE_YES * prompter.BUTTON_POS_0 + prompter.BUTTON_TITLE_NO * prompter.BUTTON_POS_1,
prompter.STD_YES_NO_BUTTONS,
null, null, null, null, dummy) == 0; // 0=="Yes" button
}

View File

@ -80,7 +80,7 @@ var gFeedSubscriptionsWindow = {
var newsBlogBundle = document.getElementById("bundle_newsblog");
dismissDialog = !(promptService.confirmEx(window, newsBlogBundle.getString('subscribe-cancelSubscriptionTitle'),
newsBlogBundle.getString('subscribe-cancelSubscription'),
(IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) + (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
IPS.STD_YES_NO_BUTTONS,
null, null, null, null, { }));
}
return dismissDialog;
@ -514,8 +514,7 @@ var gFeedSubscriptionsWindow = {
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS);
var abortRemoval = promptService.confirmEx(window, this.mBundle.getString('subsribe-confirmFeedDeletionTitle'),
this.mBundle.getFormattedString('subsribe-confirmFeedDeletion', [itemToRemove.name], 1),
(IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) + (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
null, null, null, null, { });
IPS.STD_YES_NO_BUTTONS, null, null, null, null, { });
if (abortRemoval)
return;

View File

@ -169,8 +169,7 @@ function showNeedSetupInfo()
promptService.confirmEx(window,
gBrandBundle.getString("brandShortName"),
gBundle.getString("NeedSetup"),
(ifps.BUTTON_POS_0 * ifps.BUTTON_TITLE_YES
+ ifps.BUTTON_POS_1 * ifps.BUTTON_TITLE_NO),
ifps.STD_YES_NO_BUTTONS,
0,
0,
0,

View File

@ -82,8 +82,7 @@ var gSmtpServerListWindow =
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(nsIPromptService);
var cancel = promptService.confirmEx(window, this.mBundle.getString('smtpServers-confirmServerDeletionTitle'),
this.mBundle.getFormattedString('smtpServers-confirmServerDeletion', [server.hostname], 1),
(nsIPromptService.BUTTON_TITLE_YES * nsIPromptService.BUTTON_POS_0) +
(nsIPromptService.BUTTON_TITLE_NO * nsIPromptService.BUTTON_POS_1),
nsIPromptService.STD_YES_NO_BUTTONS,
null, null, null, null, { });
if (!cancel)

View File

@ -157,8 +157,7 @@ function showNeedSetupInfo()
promptService.confirmEx(window,
gBrandBundle.getString("brandShortName"),
gBundle.getString("NeedSetup"),
(ifps.BUTTON_POS_0 * ifps.BUTTON_TITLE_YES
+ ifps.BUTTON_POS_1 * ifps.BUTTON_TITLE_NO),
ifps.STD_YES_NO_BUTTONS,
0,
0,
0,

View File

@ -752,10 +752,7 @@ nsresult nsPop3Sink::HandleTempDownloadFailed(nsIMsgWindow *msgWindow)
{
PRInt32 dlgResult = -1;
rv = promptService->ConfirmEx(parentWindow, nsnull, confirmString,
(nsIPromptService::BUTTON_TITLE_YES *
nsIPromptService::BUTTON_POS_0) +
(nsIPromptService::BUTTON_TITLE_NO *
nsIPromptService::BUTTON_POS_1),
nsIPromptService::STD_YES_NO_BUTTONS,
nsnull,
nsnull,
nsnull,

View File

@ -218,10 +218,7 @@ nsMapiRegistry::ShowMailIntegrationDialog(nsIDOMWindow *aParentWindow) {
rv = promptService->ConfirmEx(aParentWindow,
dialogTitle,
dialogText.get(),
(nsIPromptService::BUTTON_TITLE_YES *
nsIPromptService::BUTTON_POS_0) +
(nsIPromptService::BUTTON_TITLE_NO *
nsIPromptService::BUTTON_POS_1),
nsIPromptService::STD_YES_NO_BUTTONS,
nsnull,
nsnull,
nsnull,

View File

@ -343,8 +343,7 @@ function AskChangeDefaultEngine(aSelectedEngine)
var checkbox = {value:0};
var choice = promptSvc.confirmEx(window, title, changeEngineMsg,
(promptSvc.BUTTON_TITLE_YES * promptSvc.BUTTON_POS_0) +
(promptSvc.BUTTON_TITLE_NO * promptSvc.BUTTON_POS_1),
promptSvc.STD_YES_NO_BUTTONS,
null, null, null, dontAskAgainMsg, checkbox);
if (choice == 0)
change = true;

View File

@ -197,8 +197,7 @@ function AskUserShowPasswords() {
// Confirm the user wants to display passwords
return prompter.confirmEx(window,
null,
kSignonBundle.getString("noMasterPasswordPrompt"),
prompter.BUTTON_TITLE_YES * prompter.BUTTON_POS_0 + prompter.BUTTON_TITLE_NO * prompter.BUTTON_POS_1,
kSignonBundle.getString("noMasterPasswordPrompt"), prompter.STD_YES_NO_BUTTONS,
null, null, null, null, dummy) == 0; // 0=="Yes" button
}

View File

@ -825,8 +825,7 @@
var buttonPressed = promptService.confirmEx(window,
this.mStrBundle.GetStringFromName('browsewithcaret.checkWindowTitle'),
this.mStrBundle.GetStringFromName('browsewithcaret.checkLabel'),
(promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1),
promptService.STD_YES_NO_BUTTONS,
null, null, null, this.mStrBundle.GetStringFromName('browsewithcaret.checkMsg'),
checkValue);
if (buttonPressed != 0)

View File

@ -522,11 +522,7 @@ nsAppStartup::CheckAndRemigrateDefunctProfile()
NS_ENSURE_SUCCESS(rv,rv);
PRInt32 buttonPressed;
rv = promptService->ConfirmEx(nsnull, brandName.get(),
dialogText.get(),
(nsIPromptService::BUTTON_POS_0 *
nsIPromptService::BUTTON_TITLE_YES) +
(nsIPromptService::BUTTON_POS_1 *
nsIPromptService::BUTTON_TITLE_NO),
dialogText.get(), nsIPromptService::STD_YES_NO_BUTTONS,
nsnull, nsnull, nsnull, nsnull, nsnull, &buttonPressed);
NS_ENSURE_SUCCESS(rv,rv);

View File

@ -497,8 +497,7 @@
var buttonPressed = promptService.confirmEx(window,
this.mStrBundle.GetStringFromName('browsewithcaret.checkWindowTitle'),
this.mStrBundle.GetStringFromName('browsewithcaret.checkLabel'),
(promptService.BUTTON_TITLE_YES * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_NO * promptService.BUTTON_POS_1),
promptService.STD_YES_NO_BUTTONS,
null, null, null, this.mStrBundle.GetStringFromName('browsewithcaret.checkMsg'),
checkValue);
if (buttonPressed != 0)