Bug 1364653 - Port bug 1356507 to TB [Show version and updater in the preferences update pane]. r=jorgk
This commit is contained in:
Родитель
ea6451bce3
Коммит
768142010c
|
@ -2,7 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Note: this file is included in aboutDialog.xul if MOZ_UPDATER is defined.
|
||||
// Note: this file is included in aboutDialog.xul and preferences/advanced.xul
|
||||
// if MOZ_UPDATER is defined.
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
@ -164,6 +165,14 @@ appUpdater.prototype =
|
|||
if (button) {
|
||||
if (aChildID == "downloadAndInstall") {
|
||||
let updateVersion = gAppUpdater.update.displayVersion;
|
||||
// Include the build ID if this is an "a#" (nightly) build
|
||||
if (/a\d+$/.test(updateVersion)) {
|
||||
let buildID = gAppUpdater.update.buildID;
|
||||
let year = buildID.slice(0, 4);
|
||||
let month = buildID.slice(4, 6);
|
||||
let day = buildID.slice(6, 8);
|
||||
updateVersion += ` (${year}-${month}-${day})`;
|
||||
}
|
||||
button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion], 1);
|
||||
button.accessKey = this.bundle.GetStringFromName("update.downloadAndInstallButton.accesskey");
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Load DownloadUtils module for convertByteUnits
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
var gAdvancedPane = {
|
||||
mPane: null,
|
||||
|
@ -85,6 +86,47 @@ var gAdvancedPane = {
|
|||
this.mShellServiceWorking = false;
|
||||
}
|
||||
|
||||
let distroId = Services.prefs.getCharPref("distribution.id" , "");
|
||||
if (distroId) {
|
||||
let distroVersion = Services.prefs.getCharPref("distribution.version");
|
||||
|
||||
let distroIdField = document.getElementById("distributionId");
|
||||
distroIdField.value = distroId + " - " + distroVersion;
|
||||
distroIdField.style.display = "block";
|
||||
|
||||
let distroAbout = Services.prefs.getStringPref("distribution.about", "");
|
||||
if (distroAbout) {
|
||||
let distroField = document.getElementById("distribution");
|
||||
distroField.value = distroAbout;
|
||||
distroField.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
|
||||
|
||||
// Include the build ID and display warning if this is an "a#" (nightly) build
|
||||
if (/a\d+$/.test(version)) {
|
||||
let buildID = Services.appinfo.appBuildID;
|
||||
let year = buildID.slice(0, 4);
|
||||
let month = buildID.slice(4, 6);
|
||||
let day = buildID.slice(6, 8);
|
||||
version += ` (${year}-${month}-${day})`;
|
||||
}
|
||||
|
||||
// Append "(32-bit)" or "(64-bit)" build architecture to the version number:
|
||||
let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
|
||||
let archResource = Services.appinfo.is64Bit
|
||||
? "aboutDialog.architecture.sixtyFourBit"
|
||||
: "aboutDialog.architecture.thirtyTwoBit";
|
||||
let arch = bundle.GetStringFromName(archResource);
|
||||
version += ` (${arch})`;
|
||||
|
||||
document.getElementById("version").textContent = version;
|
||||
|
||||
if (AppConstants.MOZ_UPDATER) {
|
||||
gAppUpdater = new appUpdater();
|
||||
}
|
||||
|
||||
if (this._loadInContent) {
|
||||
gSubDialog.init();
|
||||
}
|
||||
|
|
|
@ -21,11 +21,18 @@
|
|||
%searchIntegrationDefaultDTD;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MOZ_UPDATER
|
||||
<!ENTITY % aboutDialogDTD SYSTEM "chrome://messenger/locale/aboutDialog.dtd" >
|
||||
%aboutDialogDTD;
|
||||
#endif
|
||||
]>
|
||||
|
||||
<overlay id="AdvancedPaneOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">
|
||||
#ifdef MOZ_UPDATER
|
||||
<script type="application/javascript" src="chrome://messenger/content/aboutDialog-appUpdater.js"/>
|
||||
#endif
|
||||
<script type="application/javascript" src="chrome://messenger/content/preferences/advanced.js"/>
|
||||
<script type="application/javascript" src="chrome://communicator/content/utilityOverlay.js"/>
|
||||
|
||||
|
@ -349,35 +356,122 @@ type="bool"/>
|
|||
|
||||
#ifdef MOZ_UPDATER
|
||||
<!-- Update -->
|
||||
<tabpanel orient="vertical" align="start">
|
||||
<tabpanel orient="vertical">
|
||||
<groupbox id="updateApp">
|
||||
<caption label="&updateApp.label;"/>
|
||||
<caption label="&updateApp2.label;"/>
|
||||
<hbox align="center">
|
||||
<vbox>
|
||||
<description>
|
||||
&updateApp.version.pre;<label id="version"/>&updateApp.version.post;
|
||||
#ifndef NIGHTLY_BUILD
|
||||
#expand <label id="releasenotes" class="text-link" href="https://www.mozilla.org/thunderbird/__MOZ_APP_VERSION__/releasenotes/">&releaseNotes.link;</label>
|
||||
#endif
|
||||
</description>
|
||||
<description id="distribution" class="text-blurb" hidden="true"/>
|
||||
<description id="distributionId" class="text-blurb" hidden="true"/>
|
||||
</vbox>
|
||||
<spacer flex="1"/>
|
||||
<vbox>
|
||||
<button id="showUpdateHistory"
|
||||
label="&updateHistory.label;"
|
||||
accesskey="&updateHistory.accesskey;"
|
||||
preference="app.update.disable_button.showUpdateHistory"
|
||||
oncommand="gAdvancedPane.showUpdates();"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox id="updateBox">
|
||||
<deck id="updateDeck" orient="vertical">
|
||||
<hbox id="checkForUpdates" align="center">
|
||||
<spacer flex="1"/>
|
||||
<button id="checkForUpdatesButton" align="start"
|
||||
label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
oncommand="gAppUpdater.checkForUpdates();"/>
|
||||
</hbox>
|
||||
<hbox id="downloadAndInstall" align="center">
|
||||
<spacer flex="1"/>
|
||||
<button id="downloadAndInstallButton"
|
||||
oncommand="gAppUpdater.startDownload();"/>
|
||||
<!-- label and accesskey will be filled by JS -->
|
||||
</hbox>
|
||||
<hbox id="apply" align="center">
|
||||
<spacer flex="1"/>
|
||||
<button id="updateButton"
|
||||
label="&update.updateButton.label3;"
|
||||
accesskey="&update.updateButton.accesskey;"
|
||||
oncommand="gAppUpdater.buttonRestartAfterDownload();"/>
|
||||
</hbox>
|
||||
<hbox id="checkingForUpdates" align="center">
|
||||
<image class="update-throbber"/><label>&update.checkingForUpdates;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
<hbox id="downloading" align="center">
|
||||
<image class="update-throbber"/><label>&update.downloading.start;</label><label id="downloadStatus"/><label>&update.downloading.end;</label>
|
||||
</hbox>
|
||||
<hbox id="applying" align="center">
|
||||
<image class="update-throbber"/><label>&update.applying;</label>
|
||||
</hbox>
|
||||
<hbox id="downloadFailed" align="center">
|
||||
<label>&update.failed.start;</label><label id="failedLink" class="text-link">&update.failed.linkText;</label><label>&update.failed.end;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
oncommand="gAppUpdater.checkForUpdates();"/>
|
||||
</hbox>
|
||||
<hbox id="adminDisabled" align="center">
|
||||
<label>&update.adminDisabled;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
<hbox id="noUpdatesFound" align="center">
|
||||
<label>&update.noUpdatesFound;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
oncommand="gAppUpdater.checkForUpdates();"/>
|
||||
</hbox>
|
||||
<hbox id="otherInstanceHandlingUpdates" align="center">
|
||||
<label>&update.otherInstanceHandlingUpdates;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
<hbox id="manualUpdate" align="center">
|
||||
<label>&update.manual.start;</label><label id="manualLink" class="text-link">&update.manual.linkText;</label><label>&update.manual.end;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
<hbox id="unsupportedSystem" align="center">
|
||||
<label>&update.unsupported.start;</label><label id="unsupportedLink" class="text-link">&update.unsupported.linkText;</label><label>&update.unsupported.end;</label>
|
||||
<spacer flex="1"/>
|
||||
<button label="&update.checkForUpdatesButton.label;"
|
||||
accesskey="&update.checkForUpdatesButton.accesskey;"
|
||||
disabled="true"/>
|
||||
</hbox>
|
||||
</deck>
|
||||
</vbox>
|
||||
<separator/>
|
||||
<radiogroup id="updateRadioGroup"
|
||||
align="start"
|
||||
oncommand="gAdvancedPane.updateWritePrefs();">
|
||||
<radio value="auto"
|
||||
label="&updateAuto.label;"
|
||||
accesskey="&updateAuto.accesskey;"/>
|
||||
<hbox>
|
||||
<radio value="checkOnly"
|
||||
label="&updateCheck.label;"
|
||||
accesskey="&updateCheck.accesskey;"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<radio value="manual"
|
||||
label="&updateManual.label;"
|
||||
accesskey="&updateManual.accesskey;"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
<radio value="checkOnly"
|
||||
label="&updateCheck.label;"
|
||||
accesskey="&updateCheck.accesskey;"/>
|
||||
<radio value="manual"
|
||||
label="&updateManual.label;"
|
||||
accesskey="&updateManual.accesskey;"/>
|
||||
</radiogroup>
|
||||
|
||||
<hbox>
|
||||
<button id="showUpdateHistory"
|
||||
label="&updateHistory.label;"
|
||||
accesskey="&updateHistory.accesskey;"
|
||||
preference="app.update.disable_button.showUpdateHistory"
|
||||
oncommand="gAdvancedPane.showUpdates();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
#ifdef MOZ_MAINTENANCE_SERVICE
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<!ENTITY aboutDialog.title "About &brandFullName;">
|
||||
|
||||
|
||||
<!-- LOCALIZATION NOTE (update.*):
|
||||
# These strings are also used in the update pane of preferences.
|
||||
# See about:preferences#advanced.
|
||||
-->
|
||||
<!-- LOCALIZATION NOTE (update.checkForUpdatesButton.*, update.updateButton.*):
|
||||
# Only one button is present at a time.
|
||||
# The button when displayed is located directly under the Thunderbird version in
|
||||
|
|
|
@ -52,7 +52,19 @@
|
|||
<!ENTITY crashReporterLearnMore.label "Learn More">
|
||||
|
||||
<!-- Update -->
|
||||
<!ENTITY updateApp.label "&brandShortName; updates:">
|
||||
<!-- LOCALIZATION NOTE (updateApp.label):
|
||||
Strings from aboutDialog.dtd are displayed in this section of the preferences.
|
||||
Please check for possible accesskey conflicts.
|
||||
-->
|
||||
<!ENTITY updateApp2.label "&brandShortName; Updates">
|
||||
<!-- LOCALIZATION NOTE (updateApp.version.*): updateApp.version.pre is
|
||||
followed by a version number, keep the trailing space or replace it with
|
||||
a different character as needed. updateApp.version.post is displayed after
|
||||
the version number, and is empty on purpose for English. You can use it
|
||||
if required by your language.
|
||||
-->
|
||||
<!ENTITY updateApp.version.pre "Version ">
|
||||
<!ENTITY updateApp.version.post "">
|
||||
<!ENTITY updateAuto.label "Automatically install updates (recommended: improved security)">
|
||||
<!ENTITY updateAuto.accesskey "A">
|
||||
<!ENTITY updateCheck.label "Check for updates, but let me choose whether to install them">
|
||||
|
|
|
@ -239,3 +239,16 @@ a {
|
|||
#provider-account-settings {
|
||||
-moz-box-flex: 0;
|
||||
}
|
||||
|
||||
.update-throbber {
|
||||
width: 16px;
|
||||
min-height: 16px;
|
||||
margin-inline-start: 6px;
|
||||
list-style-image: url("chrome://global/skin/icons/loading.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 1.1dppx) {
|
||||
.update-throbber {
|
||||
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,6 +262,19 @@ a {
|
|||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.update-throbber {
|
||||
width: 16px;
|
||||
min-height: 16px;
|
||||
margin-inline-start: 6px;
|
||||
list-style-image: url("chrome://global/skin/icons/loading.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 1.1dppx) {
|
||||
.update-throbber {
|
||||
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
|
||||
}
|
||||
}
|
||||
|
||||
#provider-space-visuals {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
|
|
|
@ -231,6 +231,15 @@ tabs {
|
|||
border-color: #424e5a;
|
||||
}
|
||||
|
||||
.update-throbber {
|
||||
margin-inline-start: 0;
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
|
||||
#releasenotes {
|
||||
margin-inline-start: 6px !important;
|
||||
}
|
||||
|
||||
#telemetryLearnMore,
|
||||
#crashReporterLearnMore {
|
||||
margin-inline-end: 4px !important;
|
||||
|
|
|
@ -240,3 +240,16 @@ a {
|
|||
#provider-account-settings {
|
||||
-moz-box-flex: 0;
|
||||
}
|
||||
|
||||
.update-throbber {
|
||||
width: 16px;
|
||||
min-height: 16px;
|
||||
margin-inline-start: 6px;
|
||||
list-style-image: url("chrome://global/skin/icons/loading.png");
|
||||
}
|
||||
|
||||
@media (min-resolution: 1.1dppx) {
|
||||
.update-throbber {
|
||||
list-style-image: url("chrome://global/skin/icons/loading@2x.png");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче