more smart update changes

git-svn-id: svn://10.0.0.236/trunk@175286 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scott%scott-macgregor.org
2005-06-29 06:05:05 +00:00
parent 38bb755f3e
commit 810822b4d5
4 changed files with 40 additions and 20 deletions

View File

@@ -51,15 +51,24 @@ pref("update.app.url", "chrome://mozapps/locale/update/update.properties");
pref("update.extensions.enabled", true);
// App-specific update preferences
pref("app.update.logEnabled", true);
pref("app.update.enabled", false); // Whether or not app updates are enabled
// Whether or not automated background app updates are enabled.
pref("app.update.autoInstallEnabled", true);
// If automatic download is enabled, whether or not the Update system should
// automatically install the downloaded updates or just download them and prompt
// the user to install.
pref("app.update.autoInstallMode", 0);
// Whether or not app updates are enabled
pref("app.update.enabled", false);
// Defines how the Application Update Service notifies the user about updates:
//
// AUM Set to: Minor Releases: Major Releases:
// 0 download no prompt download no prompt
// 1 download no prompt download no prompt if no incompatibilities
// 2 download no prompt prompt
// 3 prompt prompt
//
// See chart in nsUpdateService.js.in for more details
//
pref("app.update.mode", 1);
// If set to true, the Update Service will present no UI for any event.
pref("app.update.silent", false);
pref("app.update.logEnabled", true);
// Default service URL for testing.
pref("app.update.url", "chrome://mozapps/locale/update/updates.properties");

View File

@@ -2535,12 +2535,20 @@ function buildHelpMenu()
var um =
Components.classes["@mozilla.org/updates/update-manager;1"].
getService(Components.interfaces.nsIUpdateManager);
var activeUpdate = um.activeUpdate;
// 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)
return;
if (!gMessengerBundle)
gMessengerBundle = document.getElementById("bundle_messenger");
var label = gMessengerBundle.getString("updates_checkForUpdates");
var activeUpdate = um.activeUpdate;
if (activeUpdate)
{
if (updates.isDownloading)
@@ -2558,15 +2566,10 @@ function buildHelpMenu()
label = gMessengerBundle.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 = gPrefBranch.prefIsLocked("app.update.enabled");
}

View File

@@ -74,6 +74,13 @@ var gAdvancedPane = {
{
var preference = document.getElementById("app.update.enabled");
document.getElementById("enableAutoInstall").disabled = !preference.value;
var aus =
Components.classes["@mozilla.org/updates/update-service;1"].
getService(Components.interfaces.nsIApplicationUpdateService);
var checkNowButton = document.getElementById("checkNowButton");
checkNowButton.disabled = !aus.canUpdate;
this.updateAutoInstallUI();
return undefined;
},
@@ -108,8 +115,9 @@ var gAdvancedPane = {
var features = "chrome,centerscreen,dialog,titlebar";
const URI_EXTENSION_UPDATE_DIALOG =
"chrome://mozapps/content/extensions/update.xul";
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
var ww =
Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(window, URI_EXTENSION_UPDATE_DIALOG, "", features, ary);
},

View File

@@ -59,7 +59,7 @@
<preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/>
<preference id="app.update.enabled" name="app.update.enabled" type="bool"/>
<preference id="app.update.autoInstallEnabled" name="app.update.autoInstallEnabled" type="bool"/>
<preference id="app.update.autoInstallMode" name="app.update.autoInstallMode" type="int"/>
<preference id="app.update.mode" name="app.update.mode" type="int"/>
<preference id="extensions.update.autoUpdateEnabled"
name="extensions.update.autoUpdateEnabled"
type="bool"/>
@@ -198,7 +198,7 @@
accesskey="&enableAutoInstall.accesskey;"
preference="app.update.autoInstallEnabled"
onsyncfrompreference="return gAdvancedPane.updateAutoInstallUI();"/>
<radiogroup id="autoInstallMode" preference="app.update.autoInstallMode">
<radiogroup id="autoInstallMode" preference="app.update.mode">
<grid class="indent">
<columns>
<column/>
@@ -217,7 +217,7 @@
</radiogroup>
<separator class="thin"/>
<hbox>
<button label="&checkNow.label;" accesskey="&appCheckNow.accesskey;"
<button id="checkNowButton" label="&checkNow.label;" accesskey="&appCheckNow.accesskey;"
oncommand="gAdvancedPane.checkForUpdates();"
preference="app.update.enabled"/>
<button label="&showUpdates.label;" accesskey="&showUpdates.accesskey;"