Bug 342579: Can update an extension meant for uninstalling. r=robstrong

This commit is contained in:
dtownsend@oxymoronical.com 2007-07-09 13:53:20 -07:00
Родитель 7f969e66ca
Коммит e8bc43ded9
4 изменённых файлов: 25 добавлений и 24 удалений

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

@ -312,7 +312,8 @@ function showView(aView) {
["updateURL", "?updateURL"],
["version", "?version"],
["typeName", "update"] ];
types = [ [ ["availableUpdateVersion", "?availableUpdateVersion", null] ] ];
types = [ [ ["availableUpdateVersion", "?availableUpdateVersion", null],
[ "updateable", "true", null ] ] ];
break;
case "installs":
document.getElementById("installs-view").hidden = false;
@ -1345,8 +1346,13 @@ function updateOptionalViews() {
if (!showUpdates) {
var updateURLArc = rdfs.GetResource(PREFIX_NS_EM + "availableUpdateURL");
var updateURL = ds.GetTarget(e, updateURLArc, true);
if (updateURL)
var showUpdates = true;
if (updateURL) {
var updateableArc = rdfs.GetResource(PREFIX_NS_EM + "updateable");
var updateable = ds.GetTarget(e, updateableArc, true);
updateable = updateable.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (updateable.Value == "true")
var showUpdates = true;
}
}
if (showInstalls)
@ -1400,8 +1406,10 @@ function checkUpdatesAll() {
// To support custom views we check the add-ons displayed in the list
var items = [];
var children = gExtensionsView.children;
for (var i = 0; i < children.length; ++i)
items.push(gExtensionManager.getItemForID(getIDFromResourceURI(children[i].id)));
for (var i = 0; i < children.length; ++i) {
if (children[i].getAttribute("updateable") != "false")
items.push(gExtensionManager.getItemForID(getIDFromResourceURI(children[i].id)));
}
if (items.length > 0) {
showProgressBar();
@ -1757,6 +1765,7 @@ var gExtensionsViewController = {
gExtensionsViewController.onCommandUpdate();
updateGlobalCommands();
gExtensionsView.selectedItem.focus();
updateOptionalViews();
},
cmd_disable: function (aSelectedItem)
@ -1789,6 +1798,7 @@ var gExtensionsViewController = {
gExtensionManager.disableItem(id);
gExtensionsViewController.onCommandUpdate();
gExtensionsView.selectedItem.focus();
updateOptionalViews();
},
cmd_enable: function (aSelectedItem)
@ -1796,6 +1806,7 @@ var gExtensionsViewController = {
gExtensionManager.enableItem(getIDFromResourceURI(aSelectedItem.id));
gExtensionsViewController.onCommandUpdate();
gExtensionsView.selectedItem.focus();
updateOptionalViews();
}
}
};

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

@ -8134,9 +8134,7 @@ ExtensionsDataSource.prototype = {
_rdfGet_updateable: function(item, property) {
var id = stripPrefix(item.Value, PREFIX_ITEM_URI);
var opType = this.getItemProperty(id, "opType");
if (opType == OP_NEEDS_INSTALL || opType == OP_NEEDS_UNINSTALL ||
opType == OP_NEEDS_UPGRADE ||
this.getItemProperty(id, "appManaged") == "true")
if (opType != OP_NONE || this.getItemProperty(id, "appManaged") == "true")
return EM_L("false");
if (getPref("getBoolPref", (PREF_EM_ITEM_UPDATE_ENABLED.replace(/%UUID%/, id), false)) == true)

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

@ -67,7 +67,7 @@ richlistbox[focused] richlistitem[selected="true"][isDisabled="true"] {
margin-bottom: 2px;
}
richlistitem[selected="true"][opType="none"] .descriptionCrop {
richlistitem[selected="true"]:not([opType]) .descriptionCrop {
display: none;
}
@ -128,11 +128,13 @@ richlistitem .notifyBadge {
}
.updateBadge,
.updateAvailableBox,
.notifyBadge {
display: none;
}
richlistitem[availableUpdateURL] .updateBadge,
richlistitem[availableUpdateURL][updateable="true"] .updateBadge,
richlistitem[availableUpdateURL][updateable="true"] .updateAvailableBox,
richlistitem[compatible="false"] .notifyBadge,
richlistitem[blocklisted="true"] .notifyBadge,
richlistitem[satisfiesDependencies="false"] .notifyBadge {
@ -205,11 +207,6 @@ richlistitem[opType="needs-uninstall"] .blocklistedBox {
display: none;
}
richlistitem[opType="needs-uninstall"] .updateAvailableBox,
richlistitem[availableUpdateURL="none"] .updateAvailableBox {
display: none;
}
richlistitem[loading="true"] .updateBadge {
display: -moz-box;
width: 16px;
@ -252,7 +249,6 @@ richlistitem[opType="needs-disable"] .needsDisable {
display: -moz-box;
}
richlistitem[opType="needs-uninstall"] .updateBadge,
richlistitem[opType="needs-uninstall"] .notifyBadge {
display: none;
}

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

@ -125,7 +125,7 @@ richlistbox[focused] richlistitem[selected="true"][isDisabled="true"] {
margin-bottom: 2px;
}
richlistitem[selected="true"][opType="none"] .descriptionCrop {
richlistitem[selected="true"]:not([opType]) .descriptionCrop {
display: none;
}
@ -197,11 +197,13 @@ richlistitem .notifyBadge {
}
.updateBadge,
.updateAvailableBox,
.notifyBadge {
display: none;
}
richlistitem[availableUpdateURL] .updateBadge,
richlistitem[availableUpdateURL][updateable="true"] .updateBadge,
richlistitem[availableUpdateURL][updateable="true"] .updateAvailableBox,
richlistitem[compatible="false"] .notifyBadge,
richlistitem[blocklisted="true"] .notifyBadge,
richlistitem[satisfiesDependencies="false"] .notifyBadge {
@ -274,11 +276,6 @@ richlistitem[opType="needs-uninstall"] .blocklistedBox {
display: none;
}
richlistitem[opType="needs-uninstall"] .updateAvailableBox,
richlistitem[availableUpdateURL="none"] .updateAvailableBox {
display: none;
}
richlistitem[loading="true"] .updateBadge {
display: -moz-box;
width: 16px;
@ -321,7 +318,6 @@ richlistitem[opType="needs-disable"] .needsDisable {
display: -moz-box;
}
richlistitem[opType="needs-uninstall"] .updateBadge,
richlistitem[opType="needs-uninstall"] .notifyBadge {
display: none;
}