Bug 536078 - Check for updates menuitem and automatically check prefs UI disabled, r=Standard8
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 20 Dec 2009 13:08:00 -0800
changeset 4577 1ae4759269e2a56e90c171f53743ecd58b9d89fe
parent 4576 a02bc393512e1af9322180f2b151b01b4a40d96e
child 4578 c87ebb61ec415f9ba8a884ace4e5c8a8480df68f
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs536078
Bug 536078 - Check for updates menuitem and automatically check prefs UI disabled, r=Standard8
mail/base/content/utilityOverlay.js
mail/components/preferences/advanced.js
--- a/mail/base/content/utilityOverlay.js
+++ b/mail/base/content/utilityOverlay.js
@@ -223,27 +223,31 @@ function checkForUpdates()
  * 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"].
+#ifdef MOZILLA_1_9_2_BRANCH
+      getService(Components.interfaces.nsIApplicationUpdateService2);
+#else
       getService(Components.interfaces.nsIApplicationUpdateService);
+#endif
   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 canUpdate = updates.canUpdate;
-  checkForUpdates.setAttribute("disabled", !canUpdate);
-  if (!canUpdate)
+  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) {
--- a/mail/components/preferences/advanced.js
+++ b/mail/components/preferences/advanced.js
@@ -227,22 +227,26 @@ var gAdvancedPane = {
    *             iii 0/1/2   t         true   
    *
    */
 #ifdef MOZ_UPDATER
   updateAppUpdateItems: function () 
   {
     var aus = 
         Components.classes["@mozilla.org/updates/update-service;1"].
+#ifdef MOZILLA_1_9_2_BRANCH
+        getService(Components.interfaces.nsIApplicationUpdateService2);
+#else
         getService(Components.interfaces.nsIApplicationUpdateService);
+#endif
 
     var enabledPref = document.getElementById("app.update.enabled");
     var enableAppUpdate = document.getElementById("enableAppUpdate");
 
-    enableAppUpdate.disabled = !aus.canUpdate || enabledPref.locked;
+    enableAppUpdate.disabled = !aus.canCheckForUpdates || enabledPref.locked;
   },
 
   updateAutoItems: function () 
   {
     var enabledPref = document.getElementById("app.update.enabled");
     var autoPref = document.getElementById("app.update.auto");
 
     var updateModeLabel = document.getElementById("updateModeLabel");