Skip to content

Commit

Permalink
Show addon version in addon manager addon list
Browse files Browse the repository at this point in the history
Restores addon version numbers in addon list in addon manager
  • Loading branch information
PandaCodex committed May 17, 2018
1 parent bd915a6 commit c64501c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions toolkit/mozapps/extensions/content/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@
<xul:label anonid="name" class="name" crop="end" flex="1"
tooltip="addonitem-tooltip" xbl:inherits="value=name"/>
<xul:label anonid="legacy"/>
<xul:label anonid="version" class="version"/>
<xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
<xul:label class="update-postfix" value="&addon.update.postfix;"/>
<xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
Expand Down Expand Up @@ -1024,6 +1025,9 @@
document.getAnonymousElementByAttribute(this, "anonid",
"info");
</field>
<field name="_version">
document.getAnonymousElementByAttribute(this, "anonid", "version");
</field>
<field name="_experimentState">
document.getAnonymousElementByAttribute(this, "anonid", "experiment-state");
</field>
Expand Down Expand Up @@ -1162,6 +1166,11 @@
else
this._icon.src = "";
if (shouldShowVersionNumber(this.mAddon))
this._version.value = this.mAddon.version;
else
this._version.hidden = true;
if (this.mAddon.description)
this._description.value = this.mAddon.description;
else
Expand Down Expand Up @@ -1460,6 +1469,14 @@
]]></body>
</method>

<method name="_updateUpgradeInfo">
<body><![CDATA[
// Only update the version string if we're displaying the upgrade info
if (this.hasAttribute("upgrade") && shouldShowVersionNumber(this.mAddon))
this._version.value = this.mManualUpdate.version;
]]></body>
</method>

<method name="_fetchReleaseNotes">
<parameter name="aURI"/>
<body><![CDATA[
Expand Down Expand Up @@ -1752,6 +1769,7 @@
this.mManualUpdate = aInstall;
this._showStatus("update-available");
this._updateUpgradeInfo();
]]></body>
</method>

Expand Down Expand Up @@ -1954,6 +1972,7 @@
<xul:vbox class="fade name-outer-container" flex="1">
<xul:hbox class="name-container">
<xul:label anonid="name" class="name" crop="end" tooltip="addonitem-tooltip"/>
<xul:label anonid="version" class="version" hidden="true"/>
</xul:hbox>
</xul:vbox>
<xul:vbox class="install-status-container">
Expand All @@ -1975,6 +1994,9 @@
<field name="_name">
document.getAnonymousElementByAttribute(this, "anonid", "name");
</field>
<field name="_version">
document.getAnonymousElementByAttribute(this, "anonid", "version");
</field>
<field name="_warning">
document.getAnonymousElementByAttribute(this, "anonid", "warning");
</field>
Expand Down Expand Up @@ -2002,6 +2024,14 @@
this._icon.src = this.mAddon.iconURL ||
(this.mInstall ? this.mInstall.iconURL : "");
this._name.value = this.mAddon.name;
if (this.mAddon.version) {
this._version.value = this.mAddon.version;
this._version.hidden = false;
} else {
this._version.hidden = true;
}
} else {
this._icon.src = this.mInstall.iconURL;
// AddonInstall.name isn't always available - fallback to filename
Expand All @@ -2015,6 +2045,13 @@
url.QueryInterface(Components.interfaces.nsIURL);
this._name.value = url.fileName;
}
if (this.mInstall.version) {
this._version.value = this.mInstall.version;
this._version.hidden = false;
} else {
this._version.hidden = true;
}
}
if (this.mInstall.state == AddonManager.STATE_DOWNLOAD_FAILED) {
Expand Down

0 comments on commit c64501c

Please sign in to comment.