From 85761db8d83513396149c877225cac2330dc2a1e Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Thu, 4 Jan 2007 18:48:53 +0000 Subject: [PATCH] Bug 365529: Take advantage of new yes/no constant in nsIPrompt, patch by Ryan Jones , r+sr=biesi for /netwerk, r+sr=neil for mailnews, r=me for the rest git-svn-id: svn://10.0.0.236/trunk@217742 18797224-902f-48f8-a5cc-f745e15eee43 --- .../embedding/browser/gtk/src/EmbedPasswordMgr.cpp | 6 ++---- mozilla/extensions/wallet/src/wallet.cpp | 11 +++-------- mozilla/mailnews/base/util/nsMsgDBFolder.cpp | 3 +-- mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp | 3 +-- .../components/passwordmgr/base/nsPasswordManager.cpp | 3 +-- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/mozilla/embedding/browser/gtk/src/EmbedPasswordMgr.cpp b/mozilla/embedding/browser/gtk/src/EmbedPasswordMgr.cpp index 6d7c72400ef..8a32f1856eb 100644 --- a/mozilla/embedding/browser/gtk/src/EmbedPasswordMgr.cpp +++ b/mozilla/embedding/browser/gtk/src/EmbedPasswordMgr.cpp @@ -1358,10 +1358,8 @@ EmbedPasswordMgr::Notify(nsIContent* aFormNode, formatArgs, 1); PRInt32 selection; - prompt->ConfirmEx(dialogTitle.get(), - dialogText.get(), - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) + - (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1), + prompt->ConfirmEx(dialogTitle.get(), dialogText.get(), + nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, nsnull, nsnull, &selection); if (selection == 0) diff --git a/mozilla/extensions/wallet/src/wallet.cpp b/mozilla/extensions/wallet/src/wallet.cpp index cd5670111fa..e69b6c5d51c 100644 --- a/mozilla/extensions/wallet/src/wallet.cpp +++ b/mozilla/extensions/wallet/src/wallet.cpp @@ -494,9 +494,7 @@ Wallet_ConfirmYN(PRUnichar * szMessage, nsIDOMWindowInternal* window) { PRInt32 buttonPressed = 1; /* in case user exits dialog by clickin X */ PRUnichar * confirm_string = Wallet_Localize("Confirm"); - res = dialog->ConfirmEx(confirm_string, szMessage, - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) + - (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1), + res = dialog->ConfirmEx(confirm_string, szMessage, nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, nsnull, nsnull, &buttonPressed); WALLET_FREE(confirm_string); @@ -519,8 +517,7 @@ Wallet_3ButtonConfirm(PRUnichar * szMessage, nsIDOMWindowInternal* window) res = dialog->ConfirmEx(confirm_string, szMessage, nsIPrompt::BUTTON_POS_1_DEFAULT + - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) + - (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1) + + nsIPrompt::STD_YES_NO_BUTTONS + (nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_2), nsnull, nsnull, never_string, nsnull, nsnull, &buttonPressed); @@ -572,9 +569,7 @@ Wallet_CheckConfirmYN PRInt32 buttonPressed = 1; /* in case user exits dialog by clickin X */ PRUnichar * confirm_string = Wallet_Localize("Confirm"); - res = dialog->ConfirmEx(confirm_string, szMessage, - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) + - (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1), + res = dialog->ConfirmEx(confirm_string, szMessage, nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, szCheckMessage, checkValue, &buttonPressed); if (NS_FAILED(res)) { diff --git a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp index 0649b5aa6e6..270c7cccb44 100644 --- a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp @@ -1622,8 +1622,7 @@ nsMsgDBFolder::AutoCompact(nsIMsgWindow *aWindow) rv = aWindow->GetPromptDialog(getter_AddRefs(dialog)); NS_ENSURE_SUCCESS(rv, rv); - rv = dialog->ConfirmEx(dialogTitle.get(), confirmString.get(), - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0 + nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1), + rv = dialog->ConfirmEx(dialogTitle.get(), confirmString.get(), nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, checkboxText.get(), &checkValue, &buttonPressed); NS_ENSURE_SUCCESS(rv, rv); if (!buttonPressed) diff --git a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp index 0deecb59d05..4f993c62fe7 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -2803,8 +2803,7 @@ nsHttpChannel::ConfirmAuth(const nsString &bundleKey, PRBool doYesNoPrompt) PRInt32 choice; rv = prompt->ConfirmEx(nsnull, msg, nsIPrompt::BUTTON_POS_1_DEFAULT + - nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0 + - nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1, + nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, nsnull, nsnull, &choice); if (NS_FAILED(rv)) return PR_TRUE; diff --git a/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp b/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp index 4a3f30feaee..688aa4b212d 100644 --- a/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp +++ b/mozilla/toolkit/components/passwordmgr/base/nsPasswordManager.cpp @@ -1160,8 +1160,7 @@ nsPasswordManager::Notify(nsIContent* aFormNode, PRInt32 selection; prompt->ConfirmEx(dialogTitle.get(), dialogText.get(), - (nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) + - (nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1), + nsIPrompt::STD_YES_NO_BUTTONS, nsnull, nsnull, nsnull, nsnull, nsnull, &selection);