Bug 1254762 - Remove the Edit Keyword button of the Manage Search Engines dialog. r=aleth
authoraybukeozdemir <aybuke.147@gmail.com>
Fri, 01 Apr 2016 08:24:00 +0200
changeset 24753 ea2aa3bf1ffa4a0a107d51747e26fcc7bdac9d01
parent 24752 0e4f93f7092b9636d53625a2ac8118c17c61d363
child 24754 ba30dd5df13d6c0ec3adb79f07b7a3bc4d9064a5
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth
bugs1254762
Bug 1254762 - Remove the Edit Keyword button of the Manage Search Engines dialog. r=aleth
im/content/engineManager.js
im/content/engineManager.xul
im/locales/en-US/chrome/instantbird/engineManager.dtd
--- a/im/content/engineManager.js
+++ b/im/content/engineManager.js
@@ -105,77 +105,32 @@ var gEngineManagerDialog = {
 
     gEngineView.invalidate();
     gEngineView.selection.select(newIndex);
     gEngineView.ensureRowIsVisible(newIndex);
     this.showRestoreDefaults(true);
     document.getElementById("engineList").focus();
   },
 
-  editKeyword: function engineManager_editKeyword() {
-    var selectedEngine = gEngineView.selectedEngine;
-    if (!selectedEngine)
-      return;
-
-    var prompt = Cc["@mozilla.org/embedcomp/prompt-service;1"].
-                 getService(Ci.nsIPromptService);
-    var alias = { value: selectedEngine.alias };
-    var strings = document.getElementById("engineManagerBundle");
-    var title = strings.getString("editTitle");
-    var msg = strings.getFormattedString("editMsg", [selectedEngine.name]);
-
-    while (prompt.prompt(window, title, msg, alias, null, { })) {
-      var eduplicate = false;
-
-      if (alias.value != "") {
-        // Check for duplicates in changes we haven't committed yet
-        let engines = gEngineView._engineStore.engines;
-        for (let engine of engines) {
-          if (engine.alias == alias.value &&
-              engine.name != selectedEngine.name) {
-            eduplicate = true;
-            break;
-          }
-        }
-      }
-
-      // Notify the user if they have chosen an existing engine keyword
-      if (eduplicate) {
-        var dtitle = strings.getString("duplicateTitle");
-        var emsg = strings.getFormattedString("duplicateEngineMsg",
-                                              [engine.name]);
-
-        prompt.alert(window, dtitle, emsg);
-      } else {
-        gEngineView._engineStore.changeEngine(selectedEngine, "alias",
-                                              alias.value);
-        gEngineView.invalidate();
-        break;
-      }
-    }
-  },
-
   onSelect: function engineManager_onSelect() {
     // buttons only work if an engine is selected and it's not the last engine
     var disableButtons = (gEngineView.selectedIndex == -1) ||
                          (gEngineView.lastIndex == 0);
     var lastSelected = (gEngineView.selectedIndex == gEngineView.lastIndex);
     var firstSelected = (gEngineView.selectedIndex == 0);
     var noSelection = (gEngineView.selectedIndex == -1);
 
     document.getElementById("cmd_remove").setAttribute("disabled",
                                                        disableButtons);
 
     document.getElementById("cmd_moveup").setAttribute("disabled",
                                             disableButtons || firstSelected);
 
     document.getElementById("cmd_movedown").setAttribute("disabled",
                                              disableButtons || lastSelected);
-    document.getElementById("cmd_editkeyword").setAttribute("disabled",
-                                                            noSelection);
   }
 };
 
 var gDragObserver = {
   onDragStart: function (aEvent, aXferData, aDragAction) {
     var selectedIndex = gEngineView.selectedIndex;
     if (selectedIndex == -1)
       return;
@@ -458,18 +413,16 @@ EngineView.prototype = {
     if (column.id == "engineName" && this._engineStore.engines[index].iconURI)
       return this._engineStore.engines[index].iconURI.spec;
     return "";
   },
 
   getCellText: function(index, column) {
     if (column.id == "engineName")
       return this._engineStore.engines[index].name;
-    else if (column.id == "engineKeyword")
-      return this._engineStore.engines[index].alias;
     return "";
   },
 
   setTree: function(tree) {
     this.tree = tree;
   },
 
   canDrop: function(targetIndex, orientation) {
--- a/im/content/engineManager.xul
+++ b/im/content/engineManager.xul
@@ -32,19 +32,16 @@
              oncommand="gEngineManagerDialog.remove();"
              disabled="true"/>
     <command id="cmd_moveup"
              oncommand="gEngineManagerDialog.bump(1);"
              disabled="true"/>
     <command id="cmd_movedown"
              oncommand="gEngineManagerDialog.bump(-1);"
              disabled="true"/>
-    <command id="cmd_editkeyword"
-             oncommand="gEngineManagerDialog.editKeyword();"
-             disabled="true"/>
   </commandset>
 
   <keyset id="engineManagerKeyset">
     <key id="delete" keycode="VK_DELETE" command="cmd_remove"/>
   </keyset>
 
   <stringbundleset id="engineManagerBundleset">
     <stringbundle id="engineManagerBundle" src="chrome://instantbird/locale/engineManager.properties"/>
@@ -54,25 +51,20 @@
   <separator class="thin"/>
   <hbox flex="1">
     <tree id="engineList" flex="1" rows="10" hidecolumnpicker="true"
           seltype="single" onselect="gEngineManagerDialog.onSelect();">
       <treechildren id="engineChildren" flex="1"
                     ondragstart="nsDragAndDrop.startDrag(event, gDragObserver);"/>
       <treecols>
         <treecol id="engineName" flex="4" label="&columnLabel.name;"/>
-        <treecol id="engineKeyword" flex="1" label="&columnLabel.keyword;"/>
       </treecols>
     </tree>
     <vbox>
       <spacer flex="1"/>
-      <button id="edit"
-              label="&edit.label;"
-              accesskey="&edit.accesskey;"
-              command="cmd_editkeyword"/>
       <button id="up"
               label="&up.label;"
               accesskey="&up.accesskey;"
               command="cmd_moveup"/>
       <button id="dn"
               label="&dn.label;"
               accesskey="&dn.accesskey;"
               command="cmd_movedown"/>
--- a/im/locales/en-US/chrome/instantbird/engineManager.dtd
+++ b/im/locales/en-US/chrome/instantbird/engineManager.dtd
@@ -2,25 +2,21 @@
    - 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/. -->
 
 <!ENTITY  engineManager.title       "Manage Search Engine List">
 <!ENTITY  engineManager.style       "min-width: 35em;">
 <!ENTITY  engineManager.intro       "You have the following search engines installed:">
 
 <!ENTITY  columnLabel.name          "Name">
-<!ENTITY  columnLabel.keyword       "Keyword">
-
 <!-- Buttons -->
 <!ENTITY  up.label                  "Move Up">
 <!ENTITY  up.accesskey              "U">
 <!ENTITY  dn.label                  "Move Down">
 <!ENTITY  dn.accesskey              "D">
 <!ENTITY  remove.label              "Remove">
 <!ENTITY  remove.accesskey          "R">
-<!ENTITY  edit.label                "Edit Keyword…">
-<!ENTITY  edit.accesskey            "t">
 
 <!ENTITY  addEngine.label           "Get more search engines…">
 <!ENTITY  addEngine.accesskey       "A">
 
 <!ENTITY  restoreDefaults.label     "Restore Defaults">
 <!ENTITY  restoreDefaults.accesskey "e">