Bug 1481915 - Backed out changeset 93768af94f66a9d6e66e07042f9ed333772acabb to make way for the correct solution. a=backout
authorJorg K <jorgk@jorgk.com>
Wed, 21 Nov 2018 08:47:24 +0100
changeset 33506 ec3758df141d1034281f31f9567ddf1d3a1acf70
parent 33505 73dcb0c167eaa05273c6e01dc4634f1d9c4cdf73
child 33507 e9bf46e6e0d0bd323129e8edbb598e30dbce1e11
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersbackout
bugs1481915
Bug 1481915 - Backed out changeset 93768af94f66a9d6e66e07042f9ed333772acabb to make way for the correct solution. a=backout
mailnews/base/prefs/content/am-serverwithnoidentities.js
--- a/mailnews/base/prefs/content/am-serverwithnoidentities.js
+++ b/mailnews/base/prefs/content/am-serverwithnoidentities.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
 
-var gServer;
+var gAccount;
 var gOriginalStoreType;
 
 /**
  * Called when the store type menu is clicked.
  * @param {Object} aStoreTypeElement - store type menu list element.
  */
 function clickStoreTypeMenu(aStoreTypeElement) {
   if (aStoreTypeElement.value == gOriginalStoreType) {
@@ -18,17 +18,18 @@ function clickStoreTypeMenu(aStoreTypeEl
   }
 
   // Response from migration dialog modal. If the conversion is complete
   // 'response.newRootFolder' will hold the path to the new account root folder,
   // otherwise 'response.newRootFolder' will be null.
   let response = { newRootFolder: null };
   // Send 'response' as an argument to converterDialog.xhtml.
   window.openDialog("converterDialog.xhtml","mailnews:mailstoreconverter",
-                    "modal,centerscreen,width=800,height=180", gServer,
+                    "modal,centerscreen,width=800,height=180",
+                    gAccount.incomingServer,
                     aStoreTypeElement.value, response);
   changeStoreType(response);
 }
 
 /**
  * Revert store type to the original store type if converter modal closes
  * before migration is complete, otherwise change original store type to
  * currently selected store type.
@@ -47,33 +48,30 @@ 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",
-    gServer.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) {
-  gServer = account.incomingServer;
+  gAccount = account;
 }
 
 function onSave()
 {
   let storeContractID = document.getElementById("server.storeTypeMenulist")
                                 .selectedItem
                                 .value;
   document.getElementById("server.storeContractID")