Bug 302581 Show install dialog for single extension updates as well as multiple. r+a=bsmedberg

This commit is contained in:
rob_strong%exchangecode.com 2005-08-06 00:00:26 +00:00
Родитель e9a575719b
Коммит f377f90c9d
1 изменённых файлов: 16 добавлений и 9 удалений

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

@ -510,22 +510,30 @@ UpdateCheckListener.prototype = {
* See nsIExtensionManager.idl
*/
onUpdateStarted: function() {
LOG("Update Started");
gExtensionsView.setAttribute("update-check", "true");
var command = document.getElementById("cmd_update");
command.setAttribute("disabled", "true");
command = document.getElementById("cmd_update_all");
command.setAttribute("disabled", "true");
},
/**
* See nsIExtensionManager.idl
*/
onUpdateEnded: function() {
LOG("Update Ended");
gExtensionsView.removeAttribute("update-check");
var command = document.getElementById("cmd_update");
gExtensionsViewController.updateCommand(command);
command = document.getElementById("cmd_update_all");
command.removeAttribute("disabled");
// Show message to user listing extensions for which updates are available
// and prompt to install now.
if (this._addons.length > 1) {
if (this._addons.length == 1) {
var element = document.getElementById(PREFIX_ITEM_URI + this._addons[0].id);
gExtensionsView.scrollBoxObject.scrollToElement(element);
}
else if (this._addons.length > 1) {
var strings = document.getElementById("extensionsStrings");
var brandName = document.getElementById("brandStrings").getString("brandShortName");
var params = {
@ -560,7 +568,6 @@ UpdateCheckListener.prototype = {
* See nsIExtensionManager.idl
*/
onAddonUpdateStarted: function(addon) {
LOG("Addon Update Started: " + addon.id);
var element = document.getElementById(PREFIX_ITEM_URI + addon.id);
element.setAttribute("loading", "true");
},
@ -569,7 +576,6 @@ UpdateCheckListener.prototype = {
* See nsIExtensionManager.idl
*/
onAddonUpdateEnded: function(addon, status) {
LOG("Addon Update Ended: " + addon.id + ", status: " + status);
var element = document.getElementById(PREFIX_ITEM_URI + addon.id);
element.removeAttribute("loading");
const nsIAUCL = Components.interfaces.nsIAddonUpdateCheckListener;
@ -891,11 +897,12 @@ var gExtensionsViewController = {
selectedItem.getAttribute("locked") != "true" &&
canWriteToLocation(selectedItem);
case "cmd_update":
return !selectedItem && gExtensionsView.children.length > 0 ||
(selectedItem &&
selectedItem.getAttribute("updateable") != "false");
return selectedItem &&
selectedItem.getAttribute("updateable") != "false" &&
!gExtensionsView.hasAttribute("update-check");
case "cmd_update_all":
return gExtensionsView.children.length > 0;
return gExtensionsView.children.length > 0 &&
!gExtensionsView.hasAttribute("update-check");
case "cmd_reallyEnable":
// controls whether to show Enable or Disable in extensions' context menu
return selectedItem &&