Bug 640714 - Add dictionaries from the mail context menu should open a content tab when possible r=standard8
authorJonathan Protzenko <jonathan.protzenko@gmail.com>
Fri, 11 Mar 2011 18:04:33 +0100
changeset 7326 48607b9988f322906b4b3f4f9e34152074d5da5a
parent 7325 325c8df6ba18fdef77f2d235406e922d0becde91
child 7327 3b55dfd8506eb206c8145d81ef7d835f78418e2e
push idunknown
push userunknown
push dateunknown
reviewersstandard8
bugs640714
Bug 640714 - Add dictionaries from the mail context menu should open a content tab when possible r=standard8
mail/base/content/nsContextMenu.js
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -36,23 +36,19 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
-var gSpellChecker = new InlineSpellChecker();
+Components.utils.import("resource:///modules/MailUtils.js");
 
-function getDictionaryURL() {
-  let formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
-                  .getService(Components.interfaces.nsIURLFormatter);
-  return formatter.formatURLPref("spellchecker.dictionaries.download.url");
-}
+var gSpellChecker = new InlineSpellChecker();
 
 function nsContextMenu(aXulMenu) {
   this.target         = null;
   this.menu           = null;
   this.onTextInput    = false;
   this.onImage        = false;
   this.onLoadedImage  = false;
   this.onCanvas       = false;
@@ -103,17 +99,17 @@ nsContextMenu.prototype = {
     this.initClipboardItems();
     this.initMediaPlayerItems();
     this.initBrowserItems();
     this.initMessageItems();
     this.initSpellingItems();
     this.initSeparators();
   },
   addDictionaries: function CM_addDictionaries() {
-    openURL(getDictionaryURL());
+    openDictionaryList();
   },
   initSpellingItems: function CM_initSpellingItems() {
     let canSpell = gSpellChecker.canSpellCheck;
     let onMisspelling = gSpellChecker.overMisspelling;
     this.showItem("mailContext-spell-check-enabled", canSpell);
     this.showItem("mailContext-spell-separator", canSpell || this.onEditableArea);
     if (canSpell) {
       document.getElementById("mailContext-spell-check-enabled")