Bug 1560402 - Pass the wanted account manager pane via openPreferencesTab() properly. r=jorgk
authoraceman <acelists@atlas.sk>
Thu, 20 Jun 2019 22:27:00 +0200
changeset 35913 0ad5f1f559f7e8ca396e208db772a41f16a34ea6
parent 35912 fdd1ee5faf324b84805f120eb6fdb1e3a577febe
child 35914 e9bc2e1580a08c373d4e5cc40802ccd3c71d06c1
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1560402
Bug 1560402 - Pass the wanted account manager pane via openPreferencesTab() properly. r=jorgk
mailnews/base/content/msgAccountCentral.js
mailnews/base/prefs/content/AccountManager.js
mailnews/base/prefs/content/accountUtils.js
--- a/mailnews/base/content/msgAccountCentral.js
+++ b/mailnews/base/content/msgAccountCentral.js
@@ -263,17 +263,17 @@ function ComposeAMessage(event) {
 /**
  * Open AccountManager to view settings for a given account
  * @param selectPage  the xul file name for the viewing page,
  *                    null for the account main page, other pages are
  *                    'am-server.xul', 'am-copies.xul', 'am-offline.xul',
  *                    'am-addressing.xul', 'am-smtp.xul'
  */
 function ViewSettings(selectPage) {
-  window.parent.MsgAccountManager(selectPage);
+  window.parent.MsgAccountManager(selectPage, selectedServer);
 }
 
 // Open AccountWizard to create an account
 function CreateNewAccount() {
   window.parent.msgOpenAccountWizard();
 }
 
 function CreateNewAccountTB(type) {
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -1508,16 +1508,17 @@ var gAccountTree = {
     }
     // Retrieve the persisted value from XULStore.json.
     // It is stored under the URI of the current document and ID of the XUL element.
     return this._dataStore
                .getValue(document.documentURI, aAccountKey, "open");
   },
 
   _build() {
+    currentAccount = currentPageId = null;
     var bundle = document.getElementById("bundle_prefs");
     function getString(aString) { return bundle.getString(aString); }
     var panels = [{string: getString("prefPanel-server"), src: "am-server.xul"},
                   {string: getString("prefPanel-copies"), src: "am-copies.xul"},
                   {string: getString("prefPanel-synchronization"), src: "am-offline.xul"},
                   {string: getString("prefPanel-diskspace"), src: "am-offline.xul"},
                   {string: getString("prefPanel-addressing"), src: "am-addressing.xul"},
                   {string: getString("prefPanel-junk"), src: "am-junk.xul"}];
--- a/mailnews/base/prefs/content/accountUtils.js
+++ b/mailnews/base/prefs/content/accountUtils.js
@@ -234,17 +234,17 @@ function MsgAccountManager(aSelectPage, 
       let folder = window.GetDefaultAccountRootFolder();
       if (folder instanceof Ci.nsIMsgFolder)
         aServer = folder.server;
     }
   }
 
   if (AppConstants.MOZ_APP_NAME == "thunderbird") {
     // Load the Account Manager in a tab.
-    openPreferencesTab("paneAccount", aServer ? aServer.key : null, aSelectPage);
+    openPreferencesTab("paneAccount", aServer ? aServer.key : null, { subdialog: aSelectPage });
   } else {
     // If the Account Manager is already running, just focus the right server.
     let existingAccountManager = Services.wm.getMostRecentWindow("mailnews:accountmanager");
     if (existingAccountManager) {
       existingAccountManager.focus();
       existingAccountManager.selectServer(aServer);
     } else {
       // Load the Account Manager in a standalone dialog.