From 1d5b5ef7c19edd51bc895027dd91a704b5b8f38d Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 13 Mar 2002 01:41:10 +0000 Subject: [PATCH] additional fix for #128962. pref UI work for MDN (return receipts) NOT PART OF THE BUILD (yet) fix the global prefs to match the 4.x global prefs so that migration is a no-brainer. fix the per account prefs to be correct (wrt server or identity). fix certain prefs to be booleans, instead of ints. r=shuelan, sr=bienvenu, a=shaver git-svn-id: svn://10.0.0.236/trunk@116454 18797224-902f-48f8-a5cc-f745e15eee43 --- .../prefs/resources/content/AccountManager.js | 9 ++++++++ .../prefs/resources/content/pref-receipts.js | 2 +- .../prefs/resources/content/pref-receipts.xul | 6 ++--- .../mdn/resources/content/am-mdn.js | 6 ++--- .../mdn/resources/content/am-mdn.xul | 22 +++++++++---------- .../extensions/mdn/resources/content/mdn.js | 4 ++-- mozilla/mailnews/mailnews.js | 3 +-- mozilla/modules/libpref/src/init/mailnews.js | 3 +-- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/mozilla/mailnews/base/prefs/resources/content/AccountManager.js b/mozilla/mailnews/base/prefs/resources/content/AccountManager.js index 93e14a55f39..4cdb7838d76 100644 --- a/mozilla/mailnews/base/prefs/resources/content/AccountManager.js +++ b/mozilla/mailnews/base/prefs/resources/content/AccountManager.js @@ -472,6 +472,15 @@ function saveAccount(accountValues, account) dest.setCharAttribute(slot, typeArray[slot]); break; case "bool": + // in some cases + // like for radiogroups of type boolean + // the value will be "false" instead of false + // we need to convert it. + if (typeArray[slot] == "false") + typeArray[slot] = false; + else if (typeArray[slot] == "true") + typeArray[slot] = true; + if (dest.getBoolAttribute(slot) != typeArray[slot]) dest.setBoolAttribute(slot, typeArray[slot]); break; diff --git a/mozilla/mailnews/base/prefs/resources/content/pref-receipts.js b/mozilla/mailnews/base/prefs/resources/content/pref-receipts.js index 48ccb6dbcba..1f95d889d57 100644 --- a/mozilla/mailnews/base/prefs/resources/content/pref-receipts.js +++ b/mozilla/mailnews/base/prefs/resources/content/pref-receipts.js @@ -55,7 +55,7 @@ function Startup() { } function EnableDisableAllowedReceipts() { - if (receiptSend && (receiptSend.getAttribute("value") == 0)) { + if (receiptSend && (receiptSend.getAttribute("value") == "false")) { notInToCcPref.setAttribute("disabled", "true"); notInToCcLabel.setAttribute("disabled", "true"); outsideDomainPref.setAttribute("disabled", "true"); diff --git a/mozilla/mailnews/base/prefs/resources/content/pref-receipts.xul b/mozilla/mailnews/base/prefs/resources/content/pref-receipts.xul index 637e97c8a0a..918feaa22bd 100644 --- a/mozilla/mailnews/base/prefs/resources/content/pref-receipts.xul +++ b/mozilla/mailnews/base/prefs/resources/content/pref-receipts.xul @@ -71,9 +71,9 @@ &requestMDN.label; - - - + + + diff --git a/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.js b/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.js index 068499e25ec..6250c131cde 100644 --- a/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.js +++ b/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.js @@ -40,7 +40,7 @@ function onInit() requestReceipt = document.getElementById("identity.request_return_receipt_on"); leaveInInbox = document.getElementById("leave_in_inbox"); moveToSent = document.getElementById("move_to_sent"); - receiptSend = document.getElementById("identity.return_some_receipts"); + receiptSend = document.getElementById("server.mdn_report_enabled"); neverReturn = document.getElementById("never_return"); returnSome = document.getElementById("return_some"); notInToCcPref = document.getElementById("server.mdn_not_in_to_cc"); @@ -63,7 +63,7 @@ function onSave() } function EnableDisableCustomSettings() { - if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == 0)) { + if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == "false")) { requestReceipt.setAttribute("disabled", "true"); leaveInInbox.setAttribute("disabled", "true"); moveToSent.setAttribute("disabled", "true"); @@ -87,7 +87,7 @@ function EnableDisableCustomSettings() { function EnableDisableAllowedReceipts() { if (receiptSend) { - if (!neverReturn.getAttribute("disabled") && (receiptSend.getAttribute("value") != 0)) { + if (!neverReturn.getAttribute("disabled") && (receiptSend.getAttribute("value") != "false")) { notInToCcPref.removeAttribute("disabled"); notInToCcLabel.removeAttribute("disabled"); outsideDomainPref.removeAttribute("disabled"); diff --git a/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.xul b/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.xul index 07e51db1d96..0ef59681c6c 100644 --- a/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.xul +++ b/mozilla/mailnews/extensions/mdn/resources/content/am-mdn.xul @@ -38,10 +38,10 @@ Rights Reserved. - - + + @@ -53,7 +53,7 @@ Rights Reserved. &receiptArrive.label; + preftype="int" prefstring="mail.server.%serverkey%.incorporate_return_receipt"> @@ -61,11 +61,11 @@ Rights Reserved. &requestMDN.label; - - - + + @@ -75,7 +75,7 @@ Rights Reserved. + preftype="int" prefstring="mail.server.%serverkey%.mdn_not_in_to_cc"> @@ -86,7 +86,7 @@ Rights Reserved. + preftype="int" prefstring="mail.server.%serverkey%.mdn_outside_domain"> @@ -97,7 +97,7 @@ Rights Reserved. + preftype="int" prefstring="mail.server.%serverkey%.mdn_other"> diff --git a/mozilla/mailnews/extensions/mdn/resources/content/mdn.js b/mozilla/mailnews/extensions/mdn/resources/content/mdn.js index 12cc5504173..0a32f898daa 100644 --- a/mozilla/mailnews/extensions/mdn/resources/content/mdn.js +++ b/mozilla/mailnews/extensions/mdn/resources/content/mdn.js @@ -2,13 +2,13 @@ * default prefs for mdn */ -pref("mail.identity.default.use_custom_prefs", 0); // 0: Use global 1: Use custom +pref("mail.identity.default.use_custom_prefs", true); // false: Use global true: Use custom pref("mail.identity.default.request_return_receipt_on", false); pref("mail.server.default.incorporate_return_receipt", 0); // 0: Inbox/filter 1: Sent folder -pref("mail.identity.default.return_some_receipts", 1); // 0: Never return receipts 1: Return some receipts +pref("mail.server.default.mdn_report_enabled", false); // false: Never return receipts true: Return some receipts pref("mail.server.default.mdn_not_in_to_cc", 2); // 0: Never 1: Always 2: Ask me 3: Denial pref("mail.server.default.mdn_outside_domain", 2); diff --git a/mozilla/mailnews/mailnews.js b/mozilla/mailnews/mailnews.js index afe1060d3c6..d818dfccb7e 100644 --- a/mozilla/mailnews/mailnews.js +++ b/mozilla/mailnews/mailnews.js @@ -141,8 +141,7 @@ pref("mail.incorporate.return_receipt", 0); // 0: Inbox/filter 1: Sen pref("mail.request.return_receipt", 2); // 1: DSN 2: MDN 3: Both pref("mail.receipt.request_header_type", 0); // 0: MDN-DNT header 1: RRT header 2: Both (MC) pref("mail.receipt.request_return_receipt_on", false); -pref("mail.receipt.return_some_receipts", 1); // 0: Never send 1: Send sometimes - +pref("mail.mdn.report.enabled", false); // false: Never send true: Send sometimes pref("news.default_cc", ""); pref("news.default_fcc", ""); // mailbox:URL or Imap://Host/OnlineFolderName diff --git a/mozilla/modules/libpref/src/init/mailnews.js b/mozilla/modules/libpref/src/init/mailnews.js index afe1060d3c6..d818dfccb7e 100644 --- a/mozilla/modules/libpref/src/init/mailnews.js +++ b/mozilla/modules/libpref/src/init/mailnews.js @@ -141,8 +141,7 @@ pref("mail.incorporate.return_receipt", 0); // 0: Inbox/filter 1: Sen pref("mail.request.return_receipt", 2); // 1: DSN 2: MDN 3: Both pref("mail.receipt.request_header_type", 0); // 0: MDN-DNT header 1: RRT header 2: Both (MC) pref("mail.receipt.request_return_receipt_on", false); -pref("mail.receipt.return_some_receipts", 1); // 0: Never send 1: Send sometimes - +pref("mail.mdn.report.enabled", false); // false: Never send true: Send sometimes pref("news.default_cc", ""); pref("news.default_fcc", ""); // mailbox:URL or Imap://Host/OnlineFolderName