Bug 1481915 - Do not allow converting Local Folders to maildir if the needed pref isn't set (take 2). r=mkmelin,jorgk DONTBUILD
authoraceman <acelists@atlas.sk>
Sun, 18 Nov 2018 15:52:00 +0100
changeset 33750 b31bf692d3a11c36a1f25bd6798f9fd6eea2b618
parent 33749 77d43522f4597c01058c879866ca8fece95a7d12
child 33751 8429a12e23afdc625af4543a64113d995529e43a
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersmkmelin, jorgk
bugs1481915
Bug 1481915 - Do not allow converting Local Folders to maildir if the needed pref isn't set (take 2). r=mkmelin,jorgk DONTBUILD
mailnews/base/prefs/content/am-serverwithnoidentities.js
--- a/mailnews/base/prefs/content/am-serverwithnoidentities.js
+++ b/mailnews/base/prefs/content/am-serverwithnoidentities.js
@@ -48,24 +48,27 @@ function changeStoreType(aResponse) {
     // The conversion failed or was cancelled.
     // Restore selected item to what was selected before conversion.
     document.getElementById("server.storeTypeMenulist").value =
       gOriginalStoreType;
   }
 }
 
 function onInit(aPageId, aServerId) {
-
   // UI for account store type
   let storeTypeElement = document.getElementById("server.storeTypeMenulist");
   // set the menuitem to match the account
   let currentStoreID = document.getElementById("server.storeContractID")
                                .getAttribute("value");
   let targetItem = storeTypeElement.getElementsByAttribute("value", currentStoreID);
   storeTypeElement.selectedItem = targetItem[0];
+  // Disable store type change if store has not been used yet.
+  storeTypeElement.setAttribute("disabled",
+    gAccount.incomingServer.getBoolValue("canChangeStoreType") ?
+      "false" : !Services.prefs.getBoolPref("mail.store_conversion_enabled"));
   // Initialise 'gOriginalStoreType' to the item that was originally selected.
   gOriginalStoreType = storeTypeElement.value;
 }
 
 function onPreInit(account, accountValues) {
   gAccount = account;
 }