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
Родитель f9254c5f95
Коммит 6c31e9dfec
4 изменённых файлов: 25 добавлений и 24 удалений

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

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

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

@ -8134,9 +8134,7 @@ ExtensionsDataSource.prototype = {
_rdfGet_updateable: function(item, property) { _rdfGet_updateable: function(item, property) {
var id = stripPrefix(item.Value, PREFIX_ITEM_URI); var id = stripPrefix(item.Value, PREFIX_ITEM_URI);
var opType = this.getItemProperty(id, "opType"); var opType = this.getItemProperty(id, "opType");
if (opType == OP_NEEDS_INSTALL || opType == OP_NEEDS_UNINSTALL || if (opType != OP_NONE || this.getItemProperty(id, "appManaged") == "true")
opType == OP_NEEDS_UPGRADE ||
this.getItemProperty(id, "appManaged") == "true")
return EM_L("false"); return EM_L("false");
if (getPref("getBoolPref", (PREF_EM_ITEM_UPDATE_ENABLED.replace(/%UUID%/, id), false)) == true) 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; margin-bottom: 2px;
} }
richlistitem[selected="true"][opType="none"] .descriptionCrop { richlistitem[selected="true"]:not([opType]) .descriptionCrop {
display: none; display: none;
} }
@ -128,11 +128,13 @@ richlistitem .notifyBadge {
} }
.updateBadge, .updateBadge,
.updateAvailableBox,
.notifyBadge { .notifyBadge {
display: none; display: none;
} }
richlistitem[availableUpdateURL] .updateBadge, richlistitem[availableUpdateURL][updateable="true"] .updateBadge,
richlistitem[availableUpdateURL][updateable="true"] .updateAvailableBox,
richlistitem[compatible="false"] .notifyBadge, richlistitem[compatible="false"] .notifyBadge,
richlistitem[blocklisted="true"] .notifyBadge, richlistitem[blocklisted="true"] .notifyBadge,
richlistitem[satisfiesDependencies="false"] .notifyBadge { richlistitem[satisfiesDependencies="false"] .notifyBadge {
@ -205,11 +207,6 @@ richlistitem[opType="needs-uninstall"] .blocklistedBox {
display: none; display: none;
} }
richlistitem[opType="needs-uninstall"] .updateAvailableBox,
richlistitem[availableUpdateURL="none"] .updateAvailableBox {
display: none;
}
richlistitem[loading="true"] .updateBadge { richlistitem[loading="true"] .updateBadge {
display: -moz-box; display: -moz-box;
width: 16px; width: 16px;
@ -252,7 +249,6 @@ richlistitem[opType="needs-disable"] .needsDisable {
display: -moz-box; display: -moz-box;
} }
richlistitem[opType="needs-uninstall"] .updateBadge,
richlistitem[opType="needs-uninstall"] .notifyBadge { richlistitem[opType="needs-uninstall"] .notifyBadge {
display: none; display: none;
} }

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

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