followup to Bug 407875 - prevent multiple update prompts for manual update notification. r=dtownsend, a=beltzner

This commit is contained in:
Robert Strong 2009-11-19 11:38:56 -08:00
Родитель 522ab49ac7
Коммит 7ccda2884f
2 изменённых файлов: 23 добавлений и 8 удалений

Просмотреть файл

@ -223,7 +223,7 @@ var gUpdates = {
//
// Encode version since it could be a non-ascii string (bug 359093)
var neverPrefName = PREF_UPDATE_NEVER_BRANCH +
encodeURIComponent(gUpdates.update.version);
encodeURIComponent(gUpdates.update.version);
gPref.setBoolPref(neverPrefName, true);
this.wiz.cancel();
},
@ -762,6 +762,13 @@ var gManualUpdatePage = {
manualUpdateLinkLabel.value = manualURL;
manualUpdateLinkLabel.setAttribute("url", manualURL);
// Prevent multiple notifications for the same update when the user is
// unable to apply updates.
// Encode version since it could be a non-ascii string (bug 359093)
var neverPrefName = PREF_UPDATE_NEVER_BRANCH +
encodeURIComponent(gUpdates.update.version);
gPref.setBoolPref(neverPrefName, true);
gUpdates.setButtons(null, null, "okButton", true);
gUpdates.wiz.getButton("finish").focus();
}

Просмотреть файл

@ -1325,6 +1325,21 @@ UpdateService.prototype = {
// Encode version since it could be a non-ascii string (bug 359093)
var neverPrefName = PREF_UPDATE_NEVER_BRANCH +
encodeURIComponent(update.version);
if (!gCanApplyUpdates) {
if (getPref("getBoolPref", neverPrefName, false)) {
LOG("Checker:_selectAndInstallUpdate - the user is unable to apply " +
"updates. Not prompting because the preference " + neverPrefName +
" is true");
}
else {
LOG("Checker:_selectAndInstallUpdate - the user is unable to apply " +
"updates... prompting");
this._showPrompt(update);
}
return;
}
if (update.type == "major" &&
getPref("getBoolPref", neverPrefName, false)) {
LOG("Checker:_selectAndInstallUpdate - not prompting because this is a " +
@ -1357,13 +1372,6 @@ UpdateService.prototype = {
return;
}
if (!gCanApplyUpdates) {
LOG("Checker:_selectAndInstallUpdate - prompting because the user is " +
"unable to apply updates");
this._showPrompt(update);
return;
}
if (!getPref("getBoolPref", PREF_APP_UPDATE_AUTO, true)) {
LOG("Checker:_selectAndInstallUpdate - prompting because silent " +
"install is disabled");