Bug 950357: The About dialog shouldn't check for updates without asking if the 'Never check for updates' option is selected. Instead, present a 'Check for Updates' button. r=felipe

This commit is contained in:
Steffen Wilberg 2013-12-16 22:55:44 +01:00
parent 3568e33c2c
commit 246e3cf4a5
3 changed files with 35 additions and 10 deletions

View File

@ -133,15 +133,21 @@ function appUpdater()
return;
}
// If app.update.enabled is false, we don't pop up an update dialog
// automatically, but opening the About dialog is considered manually
// checking for updates, so we always check.
// If app.update.auto is false, we ask before downloading though,
// in onCheckComplete.
this.selectPanel("checkingForUpdates");
this.isChecking = true;
this.checker.checkForUpdates(this.updateCheckListener, true);
// after checking, onCheckComplete() is called
// Honor the "Never check for updates" option by not only disabling background
// update checks, but also in the About dialog, by presenting a
// "Check for updates" button.
// If updates are found, the user is then asked if he wants to "Update to <version>".
if (!this.updateEnabled) {
this.selectPanel("checkForUpdates");
return;
}
// That leaves the options
// "Check for updates, but let me choose whether to install them", and
// "Automatically install updates".
// In both cases, we check for updates without asking.
// In the "let me choose" case, we ask before downloading though, in onCheckComplete.
this.checkForUpdates();
}
appUpdater.prototype =
@ -234,6 +240,16 @@ appUpdater.prototype =
}
},
/**
* Check for updates
*/
checkForUpdates: function() {
this.selectPanel("checkingForUpdates");
this.isChecking = true;
this.checker.checkForUpdates(this.updateCheckListener, true);
// after checking, onCheckComplete() is called
},
/**
* Check for addon compat, or start the download right away
*/

View File

@ -50,6 +50,13 @@
<vbox id="updateBox">
#ifdef MOZ_UPDATER
<deck id="updateDeck" orient="vertical">
<hbox id="checkForUpdates" align="center">
<button id="checkForUpdatesButton" align="start"
label="&update.checkForUpdatesButton.label;"
accesskey="&update.checkForUpdatesButton.accesskey;"
oncommand="gAppUpdater.checkForUpdates();"/>
<spacer flex="1"/>
</hbox>
<hbox id="downloadAndInstall" align="center">
<button id="downloadAndInstallButton" align="start"
oncommand="gAppUpdater.doUpdate();"/>

View File

@ -3,11 +3,13 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY aboutDialog.title "About &brandFullName;">
<!-- LOCALIZATION NOTE update.applyButton.*, update.upgradeButton.*):
<!-- LOCALIZATION NOTE (update.checkForUpdatesButton.*, update.updateButton.*, update.applyButtonBillboard.*):
# Only one button is present at a time.
# The button when displayed is located directly under the Firefox version in
# the about dialog (see bug 596813 for screenshots).
-->
<!ENTITY update.checkForUpdatesButton.label "Check for updates">
<!ENTITY update.checkForUpdatesButton.accesskey "C">
<!ENTITY update.updateButton.label "Restart to Update">
<!ENTITY update.updateButton.accesskey "R">
<!ENTITY update.applyButtonBillboard.label "Apply Update…">