Bug 1339668 - Show account creation rows correctly in Account Central for a new profile. r=aceman a=jorgk
authoralta88 <alta88@gmail.com>
Tue, 14 Feb 2017 18:53:53 -0700
changeset 26990 5a493ed511c448d732f611197658e3c7d750905d
parent 26989 fc0070ab1372eacf3489fddce8923a856d60701d
child 26991 c042c72ed340fc7a0e869aa0c4acf84ef663c12e
push idunknown
push userunknown
push dateunknown
reviewersaceman, jorgk
bugs1339668
Bug 1339668 - Show account creation rows correctly in Account Central for a new profile. r=aceman a=jorgk
mailnews/base/content/msgAccountCentral.js
mailnews/base/content/msgAccountCentral.xul
--- a/mailnews/base/content/msgAccountCentral.js
+++ b/mailnews/base/content/msgAccountCentral.js
@@ -37,17 +37,22 @@ function OnInit()
             msgFolder = GetSelectedMsgFolder();
             ArrangeAccountCentralItems(selectedServer, msgFolder);
 
             let acctName = msgFolder.prettyName;
             // Display and collapse items presented to the user based on account type
             title = messengerBundle.getFormattedString("acctCentralTitleFormat",
                                                        [brandName, acctType, acctName]);
         } else {
-            title = brandName;
+          // If there is no selectedServer, we are in a brand new profile with
+          // no accounts - show the create account rows.
+          title = brandName;
+          SetItemDisplay("AccountsHeader", true);
+          SetItemDisplay("CreateAccount", true);
+          SetItemDisplay("CreateAccounts", true);
         }
 
         // Set the title for the document
         document.getElementById("AccountCentralTitle").setAttribute("value", title);
     }
     catch(ex) {
         Components.utils.reportError("Error getting selected account: " + ex + "\n");
     }
@@ -147,16 +152,17 @@ function ArrangeAccountCentralItems(serv
     SetItemDisplay("AccountSettings", canShowAccountSettings);
 
     // Show New Mail Account Wizard if not prohibited by pref
     let canShowCreateAccount = false;
     try {
         canShowCreateAccount = !Services.prefs
           .prefIsLocked("mail.disable_new_account_addition");
         SetItemDisplay("CreateAccount", canShowCreateAccount);
+        SetItemDisplay("CreateAccounts", canShowCreateAccount);
     } catch (e) { exceptions.push(e); }
 
     // Display Accounts header, only if any of the items are displayed
     let displayAccountsHeader = canShowAccountSettings || canShowCreateAccount;
     SetItemDisplay("AccountsHeader", canShowCreateAccount);
 
     /***** Accounts : End *****/
 
--- a/mailnews/base/content/msgAccountCentral.xul
+++ b/mailnews/base/content/msgAccountCentral.xul
@@ -161,17 +161,17 @@
           <label class="acctCentralText acctCentralLinkText"
                  value="&newAcctLink.label;"
                  chromedir="&locale.dir;"
                  onclick="CreateNewAccount();"/>
 #endif
         </hbox>
       </row>
 #ifdef MOZ_THUNDERBIRD
-      <row id="CreateAccounts" class="acctCentralRow" collapsed="false">
+      <row id="CreateAccounts" class="acctCentralRow" collapsed="true">
         <vbox id="CreateAccountsList">
           <label id="CreateAccountMail"
                  class="acctCentralNewAcctText acctCentralLinkText"
                  value="&emailSectionHdr.label;"
                  chromedir="&locale.dir;"
                  onclick="CreateNewAccountTB('mail');"/>
           <label id="CreateAccountChat"
                  class="acctCentralNewAcctText acctCentralLinkText"