Bug 1481915 - Do not allow converting Local Folders to maildir if the needed pref isn't set (take 2). r=mkmelin,jorgk a=jorgk DONTBUILD
authoraceman <acelists@atlas.sk>
Sun, 18 Nov 2018 15:52:00 +0100
changeset 33507 e9bf46e6e0d0bd323129e8edbb598e30dbce1e11
parent 33506 ec3758df141d1034281f31f9567ddf1d3a1acf70
child 33508 29414bcdaf278f8999b8b839a978d72d464e2d0c
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin, jorgk, jorgk
bugs1481915
Bug 1481915 - Do not allow converting Local Folders to maildir if the needed pref isn't set (take 2). r=mkmelin,jorgk a=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;
 }