mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Fixes:
Spun off from bug 335757, after an extension update fails the update remains in the installs view with a progress bar with a small amount of progress to it. Also the restart app button isn't correctly updated on extension install. (Checked in for Mossop.) bug=341166 r=Rob Strong
This commit is contained in:
parent
ee46dbbfa6
commit
f5ab1767ae
@ -105,3 +105,4 @@
|
||||
<!ENTITY installWaiting.label "Waiting...">
|
||||
<!ENTITY installIncompatibleUpdate.label "Checking compatibility...">
|
||||
<!ENTITY installFinishing.label "Installing...">
|
||||
<!ENTITY installFailure.label "Install failed.">
|
||||
|
@ -631,7 +631,8 @@ XPInstallDownloadManager.prototype = {
|
||||
{
|
||||
const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog;
|
||||
var element = this.getElementForAddon(aAddon);
|
||||
if (!element) return;
|
||||
if (!element && aState != nsIXPIProgressDialog.DIALOG_CLOSE)
|
||||
return;
|
||||
switch (aState) {
|
||||
case nsIXPIProgressDialog.DOWNLOAD_START:
|
||||
case nsIXPIProgressDialog.DOWNLOAD_DONE:
|
||||
@ -1272,20 +1273,26 @@ function updateGlobalCommands() {
|
||||
}
|
||||
else {
|
||||
var children = gExtensionsView.children;
|
||||
var appCanRestart = true;
|
||||
var appNeedsRestart = false;
|
||||
for (var i = 0; i < children.length; ++i) {
|
||||
var child = children[i];
|
||||
if (disableUpdateCheck && child.getAttribute("updateable") == "true")
|
||||
disableUpdateCheck = false;
|
||||
if (disableInstallUpdate && child.getAttribute("availableUpdateURL") != "none")
|
||||
disableInstallUpdate = false;
|
||||
if (!disableAppRestart && child.hasAttribute("state")) {
|
||||
if (appCanRestart && !appNeedsRestart && child.hasAttribute("state")) {
|
||||
var state = child.getAttribute("state");
|
||||
if (state != "success" && state != "failure")
|
||||
disableAppRestart = true;
|
||||
if (state == "success")
|
||||
appNeedsRestart = true;
|
||||
else if (state != "failure")
|
||||
appCanRestart = false;
|
||||
}
|
||||
if (!disableUpdateCheck && !disableInstallUpdate && disableAppRestart)
|
||||
if (!disableUpdateCheck && !disableInstallUpdate &&
|
||||
!appCanRestart && appNeedsRestart)
|
||||
break;
|
||||
}
|
||||
disableAppRestart = !(appCanRestart && appNeedsRestart);
|
||||
}
|
||||
setElementDisabledByID("cmd_checkUpdatesAll", disableUpdateCheck);
|
||||
setElementDisabledByID("cmd_installUpdatesAll", disableInstallUpdate);
|
||||
|
@ -452,6 +452,12 @@
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="addon-install-fail">
|
||||
<content>
|
||||
<xul:label value="&installFailure.label;" flex="1" crop="end"/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="addon-install-restart">
|
||||
<content>
|
||||
<xul:label value="&installSuccessRestart.label;" flex="1" crop="end"/>
|
||||
|
@ -23,6 +23,7 @@
|
||||
* Benjamin Smedberg <benjamin@smedbergs.us>
|
||||
* Jens Bannmann <jens.b@web.de>
|
||||
* Robert Strong <robert.bugzilla@gmail.com>
|
||||
* Dave Townsend <dave.townsend@blueprintit.co.uk>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -5620,6 +5621,14 @@ ExtensionManager.prototype = {
|
||||
break;
|
||||
case nsIXPIProgressDialog.INSTALL_DONE:
|
||||
--this._downloadCount;
|
||||
// From nsInstall.h
|
||||
// SUCCESS = 0
|
||||
// REBOOT_NEEDED = 999
|
||||
// USER_CANCELLED = -210
|
||||
if (value != 0 && value != 999 && value != -210 && id != addon.xpiURL) {
|
||||
ds.updateDownloadState(id, "failure");
|
||||
ds.updateDownloadProgress(id, null);
|
||||
}
|
||||
this.removeDownload(addon.xpiURL);
|
||||
break;
|
||||
case nsIXPIProgressDialog.DIALOG_CLOSE:
|
||||
|
Loading…
Reference in New Issue
Block a user