From b97854d11b2ea213397b76d1ff07d4eee55428bf Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Fri, 24 Jun 2005 23:52:42 +0000 Subject: [PATCH] Start adding some nicer error messages git-svn-id: svn://10.0.0.236/trunk@175133 18797224-902f-48f8-a5cc-f745e15eee43 --- .../browser/base/content/utilityOverlay.js | 6 ++- .../components/preferences/advanced.js | 23 +++++----- .../components/preferences/advanced.xul | 18 ++------ .../en-US/chrome/mozapps/update/updates.dtd | 4 +- .../chrome/mozapps/update/updates.properties | 7 ++++ .../mozapps/update/content/updates.css | 1 + .../toolkit/mozapps/update/content/updates.js | 35 +++++++++++++--- .../update/public/nsIUpdateService.idl | 29 ++++++++++--- .../mozapps/update/src/nsUpdateService.js.in | 42 ++++++++++++++----- 9 files changed, 115 insertions(+), 50 deletions(-) diff --git a/mozilla/browser/base/content/utilityOverlay.js b/mozilla/browser/base/content/utilityOverlay.js index cce241bd5a8..c372c27b6b4 100644 --- a/mozilla/browser/base/content/utilityOverlay.js +++ b/mozilla/browser/base/content/utilityOverlay.js @@ -482,12 +482,16 @@ function buildHelpMenu() label = strings.getString("updates_resumeDownloadingFallback"); } } - + var checkForUpdates = document.getElementById("checkForUpdates"); checkForUpdates.label = label; if (um.activeUpdate && updates.isDownloading) checkForUpdates.setAttribute("loading", "true"); else checkForUpdates.removeAttribute("loading"); + + // Disable the UI if the update enabled pref has been locked by the + // administrator. + checkForUpdates.disabled = gPrefService.prefIsLocked("app.update.enabled"); } diff --git a/mozilla/browser/components/preferences/advanced.js b/mozilla/browser/components/preferences/advanced.js index bc17c676405..113f5cb27d7 100644 --- a/mozilla/browser/components/preferences/advanced.js +++ b/mozilla/browser/components/preferences/advanced.js @@ -93,27 +93,28 @@ var gAdvancedPane = { updateAppUpdateUI: function () { - var preference = document.getElementById("app.update.autoUpdateEnabled"); - var ids = ["enableAutoInstall", "autoInstallMode", "updateAnd"]; - if (!preference.value) - for (var i = 0; i < ids.length; ++i) - document.getElementById(ids[i]).disabled = true; - else { - document.getElementById("enableAutoInstall").disabled = false; - this.updateAutoInstallUI(); - } + var preference = document.getElementById("app.update.enabled"); + document.getElementById("enableAutoInstall").disabled = !preference.value; + this.updateAutoInstallUI(); return undefined; }, updateAutoInstallUI: function () { - var preference = document.getElementById("app.update.autoInstallEnabled"); + var autoInstallPref = document.getElementById("app.update.autoInstallEnabled"); + var updateEnabledPref = document.getElementById("app.update.enabled"); var ids = ["autoInstallMode", "updateAnd"]; + var disabled = !updateEnabledPref.value || !autoInstallPref.value; for (var i = 0; i < ids.length; ++i) - document.getElementById(ids[i]).disabled = !preference.value; + document.getElementById(ids[i]).disabled = disabled; return undefined; }, + checkForAddonUpdates: function () + { + goats + }, + checkForUpdates: function () { var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"] diff --git a/mozilla/browser/components/preferences/advanced.xul b/mozilla/browser/components/preferences/advanced.xul index fc35ffa11c4..ba1adb16c3d 100644 --- a/mozilla/browser/components/preferences/advanced.xul +++ b/mozilla/browser/components/preferences/advanced.xul @@ -81,15 +81,6 @@ - - -