Bug 739677 - No way to access the "Add Contact" and "Join Chat" actions of the IM feature with the keyboard, r+ui-r=bwinton. AURORA_BASE_20120604
authorFlorian Quèze <florian@queze.net>
Mon, 04 Jun 2012 21:20:50 +0200
changeset 12330 b0b2a0e4aec2007206f8fe48a05782d0302c865b
parent 12329 5d613926d4170336588e20454b874a69cf9b15be
child 12331 502c8da32657f0cb06cce1a532df89a7eeaca817
push idunknown
push userunknown
push dateunknown
bugs739677
Bug 739677 - No way to access the "Add Contact" and "Join Chat" actions of the IM feature with the keyboard, r+ui-r=bwinton.
mail/base/content/mailWindowOverlay.xul
mail/components/im/content/chat-messenger-overlay.js
mail/locales/en-US/chrome/messenger/messenger.dtd
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -977,16 +977,20 @@
                         accesskey="&newIMAccountCmd.accesskey;"
                         oncommand="openIMAccountWizard();"/>
               <menuitem id="newAccountMenuItem"
                         label="&newOtherAccountsCmd.label;"
                         accesskey="&newOtherAccountsCmd.accesskey;"
                         oncommand="MsgAccountWizard();"/>
               <menuseparator id="newPopupMenuSeparator"/>
               <menuitem id="menu_newCard"/>
+              <menuitem id="newIMContactMenuItem"
+                        label="&newIMContactCmd.label;"
+                        accesskey="&newIMContactCmd.accesskey;"
+                        oncommand="chatHandler.addBuddy();"/>
             </menupopup>
           </menu>
           <menuitem id="openMessageFileMenuitem" label="&openMessageFileCmd.label;"
             accesskey="&openMessageFileCmd.accesskey;"
             oncommand="MsgOpenFromFile();"/>
           <menu id="fileAttachmentMenu" label="&openAttachmentCmd.label;" accesskey="&openAttachmentCmd.accesskey;" disabled="true" persist="hidden">
             <menupopup id="attachmentMenuList" onpopupshowing="FillAttachmentListPopup(this);"/>
           </menu>
@@ -1633,16 +1637,20 @@
             <menuitem id="imStatusAvailable" status="available" label="&imStatus.available;" class="menuitem-iconic"/>
             <menuitem id="imStatusUnavailable" status="unavailable" label="&imStatus.unavailable;" class="menuitem-iconic"/>
             <menuseparator id="imStatusOfflineSeparator"/>
             <menuitem id="imStatusOffline" status="offline" label="&imStatus.offline;" class="menuitem-iconic"/>
             <menuseparator id="imStatusShowAccountsSeparator"/>
             <menuitem id="imStatusShowAccounts" label="&imStatus.showAccounts;"/>
           </menupopup>
         </menu>
+        <menuitem id="joinChatMenuItem"
+                  label="&joinChatCmd.label;"
+                  accesskey="&joinChatCmd.accesskey;"
+                  oncommand="chatHandler.joinChat();"/>
 
         <menuseparator id="devToolsSeparator"/>
         <menuitem id="filtersCmd" label="&filtersCmd.label;"
                   accesskey="&filtersCmd.accesskey;"
                   command="cmd_displayMsgFilters"/>
         <menuitem id="applyFilters"
                   label="&filtersApply.label;"
                   accesskey="&filtersApply.accesskey;"
--- a/mail/components/im/content/chat-messenger-overlay.js
+++ b/mail/components/im/content/chat-messenger-overlay.js
@@ -650,18 +650,26 @@ var chatHandler = {
       connected || !hasAccount;
     if (connected) {
       delete this._placeHolderButtonId;
     }
     else {
       this._placeHolderButtonId =
         hasAccount ? "openIMAccountManagerButton" : "openIMAccountWizardButton";
     }
-    document.getElementById("button-add-buddy").disabled = !connected;
-    document.getElementById("button-join-chat").disabled = !canJoinChat;
+    for each (let id in ["button-add-buddy", "newIMContactMenuItem"]) {
+      let elt = document.getElementById(id);
+      if (elt)
+        elt.disabled = !connected;
+    }
+    for each (let id in ["button-join-chat", "joinChatMenuItem"]) {
+      let elt = document.getElementById(id);
+      if (elt)
+        elt.disabled = !canJoinChat;
+    }
     let groupIds = ["conversations", "onlinecontacts", "offlinecontacts"];
     let contactlist = document.getElementById("contactlistbox");
     if (!hasAccount || !connected && groupIds.every(function(id)
         document.getElementById(id + "Group").contacts.length)) {
       contactlist.disabled = true;
     }
     else {
       contactlist.disabled = false;
@@ -842,17 +850,18 @@ var chatHandler = {
     imServices.obs.addObserver(this, "account-connected", false);
     imServices.obs.addObserver(this, "account-disconnected", false);
     imServices.obs.addObserver(this, "account-added", false);
     imServices.obs.addObserver(this, "account-removed", false);
   },
   init: function() {
     if (!Services.prefs.getBoolPref("mail.chat.enabled")) {
       ["button-chat", "menu_goChat", "goChatSeparator",
-       "imAccountsStatus", "newIMAccountMenuItem"].forEach(function(aId) {
+       "imAccountsStatus", "joinChatMenuItem",
+       "newIMAccountMenuItem", "newIMContactMenuItem"].forEach(function(aId) {
          let elt = document.getElementById(aId);
          if (elt)
            elt.hidden = true;
        });
       document.getElementById("key_goChat").disabled = true;
       return;
     }
 
--- a/mail/locales/en-US/chrome/messenger/messenger.dtd
+++ b/mail/locales/en-US/chrome/messenger/messenger.dtd
@@ -27,16 +27,18 @@
 <!ENTITY newOtherAccountsCmd.label "Other Accounts…">
 <!ENTITY newOtherAccountsCmd.accesskey "O">
 <!ENTITY newCreateEmailAccountCmd.label "Get a New Mail Account…">
 <!ENTITY newCreateEmailAccountCmd.accesskey "G">
 <!ENTITY newExistingEmailAccountCmd.label "Existing Mail Account…">
 <!ENTITY newExistingEmailAccountCmd.accesskey "E">
 <!ENTITY newIMAccountCmd.label "Chat Account…">
 <!ENTITY newIMAccountCmd.accesskey "C">
+<!ENTITY newIMContactCmd.label "Chat Contact…">
+<!ENTITY newIMContactCmd.accesskey "h">
 <!ENTITY openMessageFileCmd.label "Open Saved Message…">
 <!ENTITY openMessageFileCmd.accesskey "O">
 <!ENTITY openAttachmentCmd.label "Attachments">
 <!ENTITY openAttachmentCmd.accesskey "A">
 <!ENTITY saveAsMenu.label "Save As">
 <!ENTITY saveAsMenu.accesskey "S">
 <!ENTITY saveAsFileCmd.label "File">
 <!ENTITY saveAsFileCmd.accesskey "F">
@@ -478,16 +480,18 @@ you can use these alternative items. Oth
 <!ENTITY activitymanager.label "Activity Manager">
 <!ENTITY activitymanager.accesskey "v">
 <!ENTITY imAccountsStatus.label "Chat status">
 <!ENTITY imAccountsStatus.accesskey "C">
 <!ENTITY imStatus.available          "Available">
 <!ENTITY imStatus.unavailable        "Unavailable">
 <!ENTITY imStatus.offline            "Offline">
 <!ENTITY imStatus.showAccounts       "Show Accounts…">
+<!ENTITY joinChatCmd.label "Join Chat…">
+<!ENTITY joinChatCmd.accesskey "o">
 <!ENTITY savedFiles.label "Saved Files">
 <!ENTITY savedFiles.accesskey "l">
 <!ENTITY savedFiles.key "j">
 <!ENTITY filtersCmd.label "Message Filters…">
 <!ENTITY filtersCmd.accesskey "F">
 <!ENTITY filtersApply.label "Run Filters on Folder">
 <!ENTITY filtersApply.accesskey "R">
 <!ENTITY filtersApplyToSelection.label "Run Filters on Selected Messages">