Bug 655962 - Drop the check for updates menuitem now that the functionality is in the about dialog. r=protz
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 10 May 2011 10:47:19 +0100
changeset 7746 2693feb6095add068516f315bd7b09e85b31730b
parent 7745 d16d001e41503fd6d6563bc2005f15d46aa45390
child 7747 ccb90765df6984275f318cffadf206c16f3364dd
push id5946
push userbugzilla@standard8.plus.com
push dateTue, 10 May 2011 09:47:55 +0000
treeherdercomm-central@2693feb6095a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersprotz
bugs655962
Bug 655962 - Drop the check for updates menuitem now that the functionality is in the about dialog. r=protz
mail/base/content/baseMenuOverlay.xul
mail/base/content/utilityOverlay.js
mail/base/jar.mn
mail/locales/en-US/chrome/messenger/baseMenuOverlay.dtd
mail/themes/gnomestripe/mail/mailWindow1.css
mail/themes/qute/mail/mailWindow1.css
--- a/mail/base/content/baseMenuOverlay.xul
+++ b/mail/base/content/baseMenuOverlay.xul
@@ -54,17 +54,17 @@
 
 #ifdef XP_WIN
   <menu id="helpMenu"
         label="&helpMenuWin.label;" accesskey="&helpMenuWin.accesskey;">
 #else
   <menu id="helpMenu"
         label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
 #endif
-    <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
+    <menupopup id="menu_HelpPopup">
 #ifdef XP_MACOSX
       <menuitem id="menu_openHelp"
                 label="&openHelpMac.label;" key="key_openHelp"
                 oncommand="openSupportURL();"/>
 #else
       <menuitem id="menu_openHelp"
                 label="&openHelp.label;" accesskey="&openHelp.accesskey;"
                 oncommand="openSupportURL();"
@@ -80,24 +80,16 @@
       <menuitem id="featureConfigurator"
                 label="&featureConfiguratorCmd.label;"
                 accesskey="&featureConfiguratorCmd.accesskey;"
                 oncommand="openFeatureConfigurator(false);"/>
       <menuitem id="helpSafeMode"
                 label="&helpSafeMode.label;"
                 accesskey="&helpSafeMode.accesskey;"
                 oncommand="safeModeRestart();"/>
-      <menuseparator id="updateSeparator"/>
-      <menuitem id="checkForUpdates" class="menuitem-iconic"
-#ifdef MOZ_UPDATER
-                label="&updateCmd.label;"
-                oncommand="checkForUpdates();"/>
-#else
-                hidden="true"/>
-#endif
 #ifndef XP_MACOSX
       <menuseparator id="aboutSeparator"/>
 #endif
       <menuitem id="aboutName"
                 label="&aboutMenuCmd.label;"
                 accesskey="&aboutMenuCmd.accesskey;"
                 oncommand="openAboutDialog();"/>
     </menupopup>
--- a/mail/base/content/utilityOverlay.js
+++ b/mail/base/content/utilityOverlay.js
@@ -193,118 +193,16 @@ function goToggleToolbar( id, elementID 
     toolbar.setAttribute("hidden", !isHidden);
     if ( element )
       element.setAttribute("checked", isHidden)
     document.persist(id, 'hidden');
     document.persist(elementID, 'checked');
   }
 }
 
-#ifdef MOZ_UPDATER
-/**
- * Opens the update manager and checks for updates to the application.
- */
-function checkForUpdates()
-{
-  var um =
-      Components.classes["@mozilla.org/updates/update-manager;1"].
-      getService(Components.interfaces.nsIUpdateManager);
-  var prompter =
-      Components.classes["@mozilla.org/updates/update-prompt;1"].
-      createInstance(Components.interfaces.nsIUpdatePrompt);
-
-  // If there's an update ready to be applied, show the "Update Downloaded"
-  // UI instead and let the user know they have to restart the application for
-  // the changes to be applied.
-  if (um.activeUpdate && um.activeUpdate.state == "pending")
-    prompter.showUpdateDownloaded(um.activeUpdate);
-  else
-    prompter.checkForUpdates();
-}
-#endif
-
-/**
- * Set up the help menu software update items to show proper status,
- * also disabling the items if update is disabled.
- */
-function buildHelpMenu()
-{
-#ifdef MOZ_UPDATER
-  var updates =
-      Components.classes["@mozilla.org/updates/update-service;1"].
-      getService(Components.interfaces.nsIApplicationUpdateService);
-  var um =
-      Components.classes["@mozilla.org/updates/update-manager;1"].
-      getService(Components.interfaces.nsIUpdateManager);
-
-  // Disable the UI if the update enabled pref has been locked by the
-  // administrator or if we cannot update for some other reason.
-  var checkForUpdates = document.getElementById("checkForUpdates");
-  var canCheckForUpdates = updates.canCheckForUpdates;
-  checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
-  if (!canCheckForUpdates)
-    return;
-
-  var strings = document.getElementById("bundle_messenger");
-  var activeUpdate = um.activeUpdate;
-
-  // If there's an active update, substitute its name into the label
-  // we show for this item, otherwise display a generic label.
-  function getStringWithUpdateName(key) {
-    if (activeUpdate && activeUpdate.name)
-      return strings.getFormattedString(key, [activeUpdate.name]);
-    return strings.getString(key + "Fallback");
-  }
-
-  // By default, show "Check for Updates..." from updatesItem_default or
-  // updatesItem_defaultFallback
-  var key = "default";
-  if (activeUpdate) {
-    switch (activeUpdate.state) {
-    case "downloading":
-      // If we're downloading an update at present, show the text:
-      // "Downloading Thunderbird x.x..." from updatesItem_downloading or
-      // updatesItem_downloadingFallback, otherwise we're paused, and show
-      // "Resume Downloading Thunderbird x.x..." from updatesItem_resume or
-      // updatesItem_resumeFallback
-      key = updates.isDownloading ? "downloading" : "resume";
-      break;
-    case "pending":
-      // If we're waiting for the user to restart, show: "Apply Downloaded
-      // Updates Now..." from updatesItem_pending or
-      // updatesItem_pendingFallback
-      key = "pending";
-      break;
-    }
-  }
-
-  checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
-  // updatesItem_default.accesskey, updatesItem_downloading.accesskey,
-  // updatesItem_resume.accesskey or updatesItem_pending.accesskey
-  checkForUpdates.accessKey = strings.getString("updatesItem_" + key +
-                                                ".accesskey");
-  if (um.activeUpdate && updates.isDownloading)
-    checkForUpdates.setAttribute("loading", "true");
-  else
-    checkForUpdates.removeAttribute("loading");
-#else
-#ifndef XP_MACOSX
-  // Some extensions may rely on these being present so only hide the about
-  // separator when there are no elements besides the check for updates menuitem
-  // in between the about separator and the updates separator.
-  var updatesSeparator = document.getElementById("updatesSeparator");
-  var aboutSeparator = document.getElementById("aboutSeparator");
-  var checkForUpdates = document.getElementById("checkForUpdates");
-  if (updatesSeparator.nextSibling === checkForUpdates &&
-      checkForUpdates.nextSibling === aboutSeparator)
-    updatesSeparator.hidden = true;
-#endif
-#endif
-}
-
 // openUILink handles clicks on UI elements that cause URLs to load.
 // Firefox and SeaMonkey have a function with the same name,
 // so extensions can use this everywhere to open links.
 // We currently only react to left click in Thunderbird.
 function openUILink(url, event)
 {
   if (!event.button)
     messenger.launchExternalURL(url);
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -117,13 +117,13 @@ messenger.jar:
 # the following files are mail-specific overrides
 *+  content/messenger/license.html                  (/mozilla/toolkit/content/license.html)
 % override chrome://global/content/license.html chrome://messenger/content/license.html
 
 comm.jar:
 % content communicator %content/communicator/
 *  content/communicator/contentAreaClick.js         (content/contentAreaClick.js)
 *  content/communicator/utilityOverlay.xul          (content/utilityOverlay.xul)
-*  content/communicator/utilityOverlay.js           (content/utilityOverlay.js)
+   content/communicator/utilityOverlay.js           (content/utilityOverlay.js)
 
 toolkit.jar:
 % overlay chrome://global/content/customizeToolbar.xul chrome://messenger/content/customizeToolbarOverlay.xul
 % overlay chrome://mozapps/content/downloads/downloads.xul chrome://messenger/content/downloadsOverlay.xul
--- a/mail/locales/en-US/chrome/messenger/baseMenuOverlay.dtd
+++ b/mail/locales/en-US/chrome/messenger/baseMenuOverlay.dtd
@@ -17,11 +17,10 @@
 <!ENTITY featureConfiguratorCmd.accesskey "M">
 <!ENTITY openHelp.label "Help Contents">
 <!ENTITY openHelp.accesskey "H">
 <!ENTITY openHelp.commandkey "VK_F1">
 <!ENTITY openHelpMac.label "&brandShortName; Help">
 <!ENTITY openHelpMac2.commandkey   "?">
 <!ENTITY openHelpMac2.modifiers    "accel">
 
-<!ENTITY updateCmd.label "Check for Updates…">
 <!ENTITY aboutMenuCmd.label "About &brandShortName;">
 <!ENTITY aboutMenuCmd.accesskey "A">
--- a/mail/themes/gnomestripe/mail/mailWindow1.css
+++ b/mail/themes/gnomestripe/mail/mailWindow1.css
@@ -333,22 +333,16 @@ treechildren::-moz-tree-image(subjectCol
 #quotaPanel[alert="critical"] .progress-bar {
   background-color: red;
   -moz-appearance: none;
 }
 #quotaLabel {
   text-align: center;
 }
 
-/* ..... update notifications ..... */
-
-#checkForUpdates[loading="true"] {
-  list-style-image: url("chrome://global/skin/icons/loading_16.png");
-}
-
 #threadTree > treechildren::-moz-tree-row(odd) {
   background-color: -moz-oddtreerow;
 }
 
 #threadTree > treechildren::-moz-tree-row(selected) {
   color: -moz-cellhighlighttext;
   background-color: -moz-cellhighlight;
 }
--- a/mail/themes/qute/mail/mailWindow1.css
+++ b/mail/themes/qute/mail/mailWindow1.css
@@ -344,22 +344,16 @@ treechildren::-moz-tree-image(subjectCol
 #quotaPanel[alert="critical"] .progress-bar {
   background-color: red;
   -moz-appearance: none;
 }
 #quotaLabel {
   text-align: center;
 }
 
-/* ..... update notifications ..... */
-
-#checkForUpdates[loading="true"] {
-  list-style-image: url("chrome://global/skin/icons/loading_16.png");
-}
-
 #threadTree treechildren::-moz-tree-row(odd) {
   background-image: url("chrome://messenger/skin/icons/row.png");
   background-position: bottom;
   background-repeat: repeat-x;
 }
 
 .tabmail-tab[type="message"] {
   list-style-image: url("chrome://messenger/skin/icons/server.png");