Bug 397493 - Add-ons Update should skip "Continue" if all updates have been successful. ui-r=boriss, r=dtownsend

This commit is contained in:
Dão Gottwald 2008-10-15 15:56:25 +02:00
Родитель b877d7abc3
Коммит 6049b9b6a4
2 изменённых файлов: 17 добавлений и 13 удалений

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

@ -329,7 +329,6 @@ function showView(aView) {
var showCheckUpdatesAll = true;
var showInstallUpdatesAll = false;
var showSkip = false;
var showContinue = false;
switch (aView) {
case "search":
var bindingList = [ [ ["action", "?action"],
@ -406,8 +405,6 @@ function showView(aView) {
showInstallFile = false;
showCheckUpdatesAll = false;
showInstallUpdatesAll = false;
if (gUpdatesOnly)
showContinue = true;
bindingList = [ [ ["aboutURL", "?aboutURL"],
["addonID", "?addonID"],
["availableUpdateURL", "?availableUpdateURL"],
@ -469,7 +466,6 @@ function showView(aView) {
document.getElementById("checkUpdatesAllButton").hidden = !showCheckUpdatesAll;
document.getElementById("installUpdatesAllButton").hidden = !showInstallUpdatesAll;
document.getElementById("skipDialogButton").hidden = !showSkip;
document.getElementById("continueDialogButton").hidden = !showContinue;
document.getElementById("themePreviewArea").hidden = !isThemes;
document.getElementById("themeSplitter").hidden = !isThemes;
document.getElementById("showUpdateInfoButton").hidden = aView != "updates";
@ -488,11 +484,6 @@ function showView(aView) {
} else
document.getElementById("installUpdatesAllButton").removeAttribute("default");
if (showContinue)
document.getElementById("continueDialogButton").setAttribute("default", "true");
else
document.getElementById("continueDialogButton").removeAttribute("default");
if (isThemes)
onAddonSelect();
updateGlobalCommands();
@ -1342,8 +1333,12 @@ XPInstallDownloadManager.prototype = {
{
},
_failed: false,
onInstallEnded: function(aAddon, aStatus)
{
if (aStatus < 0)
this._failed = true;
// From nsInstall.h
// USER_CANCELLED = -210
// All other xpinstall errors are <= -200
@ -1371,8 +1366,15 @@ XPInstallDownloadManager.prototype = {
gInstalling = false;
gExtensionManager.sortTypeByProperty(nsIUpdateItem.TYPE_ANY, "name", true);
if (gUpdatesOnly) {
setElementDisabledByID("cmd_continue", false);
document.getElementById("continueDialogButton").focus();
if (this._failed) {
let continueButton = document.getElementById("continueDialogButton");
setElementDisabledByID("cmd_continue", false);
continueButton.hidden = false;
continueButton.setAttribute("default", "true");
continueButton.focus();
} else {
setTimeout(closeEM, 2000);
}
}
else {
updateOptionalViews();

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

@ -267,7 +267,8 @@
<button id="continueDialogButton" label="&cmd.continue.label;"
accesskey="&cmd.continue.accesskey;"
tooltiptext="&cmd.continue.tooltip;"
command="cmd_continue"/>
command="cmd_continue"
hidden="true"/>
<button id="installUpdatesAllButton" label="&cmd.installUpdatesAll.label;"
accesskey="&cmd.installUpdatesAll.accesskey;"
tooltiptext="&cmd.installUpdatesAll.tooltip;"
@ -282,7 +283,8 @@
<button id="continueDialogButton" label="&cmd.continue.label;"
accesskey="&cmd.continue.accesskey;"
tooltiptext="&cmd.continue.tooltip;"
command="cmd_continue"/>
command="cmd_continue"
hidden="true"/>
<button id="installUpdatesAllButton" label="&cmd.installUpdatesAll.label;"
accesskey="&cmd.installUpdatesAll.accesskey;"
tooltiptext="&cmd.installUpdatesAll.tooltip;"