Bug #269483 --> more thunderbird smart update work.

Moving update.xul/js/dtd from mozilla/browser/preferences to mozapp/preferences so we can all
share from them. a=ben on moving these files / the toolkit changes
This commit is contained in:
scott%scott-macgregor.org 2005-06-29 21:07:04 +00:00
parent dff8ee3ade
commit d05170a60a
9 changed files with 145 additions and 48 deletions

View File

@ -55,13 +55,17 @@ pref("update.extensions.enabled", true);
// Whether or not app updates are enabled
pref("app.update.enabled", false);
// This preference turns on app.update.mode and allows automatic download and
// install to take place. We use a separate boolean toggle for this to make
// the UI easier to construct.
pref("app.update.auto", true);
// Defines how the Application Update Service notifies the user about updates:
//
// AUM Set to: Minor Releases: Major Releases:
// 0 download no prompt download no prompt
// 1 download no prompt download no prompt if no incompatibilities
// 2 download no prompt prompt
// 3 prompt prompt
//
// See chart in nsUpdateService.js.in for more details
//

View File

@ -81,18 +81,16 @@ var gAdvancedPane = {
var checkNowButton = document.getElementById("checkNowButton");
checkNowButton.disabled = !aus.canUpdate;
this.updateAutoInstallUI();
this.updateAutoPref();
return undefined;
},
updateAutoInstallUI: function ()
updateAutoPref: function ()
{
var autoInstallPref = document.getElementById("app.update.autoInstallEnabled");
var preference = document.getElementById("app.update.auto");
var updateEnabledPref = document.getElementById("app.update.enabled");
var ids = ["autoInstallMode", "updateAnd"];
var disabled = !updateEnabledPref.value || !autoInstallPref.value;
for (var i = 0; i < ids.length; ++i)
document.getElementById(ids[i]).disabled = disabled;
var autoInstallOptions = document.getElementById("autoInstallOptions");
autoInstallOptions.disabled = !preference.value || !updateEnabledPref.value;
return undefined;
},
@ -127,7 +125,13 @@ var gAdvancedPane = {
.createInstance(Components.interfaces.nsIUpdatePrompt);
prompter.checkForUpdates(window);
},
showAutoInstallOptions: function ()
{
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/update.xul",
"", null);
},
showUpdates: function ()
{
var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"]

View File

@ -58,8 +58,7 @@
<preference id="mail.showFolderPaneColumns" name="mail.showFolderPaneColumns" type="bool"/>
<preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/>
<preference id="app.update.enabled" name="app.update.enabled" type="bool"/>
<preference id="app.update.autoInstallEnabled" name="app.update.autoInstallEnabled" type="bool"/>
<preference id="app.update.mode" name="app.update.mode" type="int"/>
<preference id="app.update.auto" name="app.update.auto" type="bool"/>
<preference id="extensions.update.autoUpdateEnabled"
name="extensions.update.autoUpdateEnabled"
type="bool"/>
@ -187,34 +186,23 @@
<label>&softwareupdateinfo.label;</label>
<separator class="thin"/>
<vbox align="start">
<checkbox id="enableSmartUpdate"
label="&enableSmartUpdate.label;"
accesskey="&enableSmartUpdate.accesskey;"
<checkbox id="enableAppUpdate"
label="&enableAppUpdate.label;"
accesskey="&enableAppUpdate.accesskey;"
preference="app.update.enabled"
onsyncfrompreference="return gAdvancedPane.updateAppUpdateUI();"/>
<vbox class="indent" align="start">
<checkbox id="enableAutoInstall"
label="&enableAutoInstall.label;"
accesskey="&enableAutoInstall.accesskey;"
preference="app.update.autoInstallEnabled"
onsyncfrompreference="return gAdvancedPane.updateAutoInstallUI();"/>
<radiogroup id="autoInstallMode" preference="app.update.mode">
<grid class="indent">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row><label id="updateAnd"
preference="app.update.enabled">&updateAnd.label;</label>
<radio label="&autoDownloadAndInstall.label;"
accesskey="&autoDownloadAndInstall.accesskey;" value="0"/></row>
<row><hbox/>
<radio label="&autoDownloadAndPrompt.label;"
accesskey="&autoDownloadAndPrompt.accesskey;" value="1"/></row>
</rows>
</grid>
</radiogroup>
<hbox>
<checkbox id="enableAutoInstall"
label="&enableAutoInstall.label;"
accesskey="&enableAutoInstall.accesskey;"
preference="app.update.auto"
onsyncfrompreference="return gAdvancedPane.updateAutoPref();"/>
<spacer flex="1"/>
<button id="autoInstallOptions"
label="&autoInstallOptions.label;" accesskey="&autoInstallOptions.accesskey;"
oncommand="gAdvancedPane.showAutoInstallOptions();"/>
</hbox>
<separator class="thin"/>
<hbox>
<button id="checkNowButton" label="&checkNow.label;" accesskey="&appCheckNow.accesskey;"
@ -225,9 +213,7 @@
</hbox>
</vbox>
</vbox>
<separator class="thin"/>
<separator class="groove"/>
<separator class="thin"/>
<separator/>
<vbox align="start">
<checkbox id="enableExtensionUpdate"
label="&enableExtensionUpdate.label;"

View File

@ -32,15 +32,12 @@
<!-- Update -->
<!ENTITY softwareupdateinfo.label "Periodically check for updates to:">
<!ENTITY enableSmartUpdate.label "&brandShortName;">
<!ENTITY enableSmartUpdate.accesskey "T">
<!ENTITY enableAutoInstall.label "automatically download updates">
<!ENTITY enableAutoInstall.accesskey "d">
<!ENTITY updateAnd.label "and:">
<!ENTITY autoDownloadAndInstall.label "install them">
<!ENTITY autoDownloadAndInstall.accesskey "i">
<!ENTITY autoDownloadAndPrompt.label "prompt me when ready to install">
<!ENTITY autoDownloadAndPrompt.accesskey "p">
<!ENTITY enableAppUpdate.label "&brandShortName;">
<!ENTITY enableAppUpdate.accesskey "T">
<!ENTITY enableAutoInstall.label "Automatically Download and Install updates">
<!ENTITY enableAutoInstall.accesskey "A">
<!ENTITY autoInstallOptions.label "Advanced...">
<!ENTITY autoInstallOptions.accesskey "d">
<!ENTITY enableExtensionUpdate.label "My Extensions and Themes">
<!ENTITY enableExtensionUpdate.accesskey "M">
<!ENTITY checkNow.label "Check Now...">

View File

@ -0,0 +1,22 @@
<!ENTITY update.title "Automatic Update">
<!ENTITY window.width "30em">
<!ENTITY window.height "25em">
<!ENTITY update.intro "Automatically download and install updates for:">
<!ENTITY ausMode0Name.label "Security/Incremental Updates and New Releases, even if
some of my Extensions and Themes will stop working">
<!ENTITY ausMode0Name.accesskey "S">
<!ENTITY ausMode0Name.info "&brandShortName; will automatically download and install all
Updates and New Releases in the background">
<!ENTITY ausMode1Name.label "Security/Incremental Updates and New Releases, provided
my Extensions and Themes will still work">
<!ENTITY ausMode1Name.accesskey "e">
<!ENTITY ausMode1Name.info "&brandShortName; will ask your permission before downloading
and installing any New Release that will cause some of your
Extensions and/or Themes to stop working">
<!ENTITY ausMode2Name.label "Security/Incremental Updates only">
<!ENTITY ausMode2Name.accesskey "c">
<!ENTITY ausMode2Name.info "&brandShortName; will ask your permission before downloading
any New Release">

View File

@ -84,6 +84,7 @@
locale/@AB_CD@/mozapps/preferences/fontscaling.dtd (%chrome/mozapps/preferences/fontscaling.dtd)
locale/@AB_CD@/mozapps/preferences/changemp.dtd (%chrome/mozapps/preferences/changemp.dtd)
locale/@AB_CD@/mozapps/preferences/removemp.dtd (%chrome/mozapps/preferences/removemp.dtd)
locale/@AB_CD@/mozapps/preferences/update.dtd (%chrome/mozapps/preferences/update.dtd)
locale/@AB_CD@/mozapps/preferences/preferences.properties (%chrome/mozapps/preferences/preferences.properties)
locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd (%chrome/mozapps/profile/createProfileWizard.dtd)
locale/@AB_CD@/mozapps/profile/profileSelection.properties (%chrome/mozapps/profile/profileSelection.properties)

View File

@ -22,6 +22,8 @@ toolkit.jar:
* content/mozapps/preferences/changemp.xul (preferences/changemp.xul)
* content/mozapps/preferences/removemp.js (preferences/removemp.js)
* content/mozapps/preferences/removemp.xul (preferences/removemp.xul)
* content/mozapps/preferences/update.js (preferences/update.js)
* content/mozapps/preferences/update.xul (preferences/update.xul)
* content/mozapps/preferences/preferences.css (preferences/preferences.css)
* content/mozapps/preferences/preferences.xml (preferences/preferences.xml)
* content/mozapps/shared/richview.xml (shared/content/richview.xml)

View File

View File

@ -0,0 +1,81 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Firefox Preferences System.
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org> (Original Author)
#
# 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
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % updateDTD SYSTEM "chrome://mozapps/locale/preferences/update.dtd">
%updateDTD;
]>
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://mozapps/content/update/updates.css"?>
<prefwindow id="UpdateSettingsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&update.title;"
dlgbuttons="accept,cancel"
style="width: &window.width;; height: &window.height;;">
<prefpane id="UpdateSettingsDialogPane">
<preferences id="preferences">
<preference id="app.update.mode" name="app.update.mode" type="int"/>
</preferences>
<description>&update.intro;</description>
<radiogroup id="autoInstallMode" preference="app.update.mode">
<hbox>
<radio label="&ausMode0Name.label;" accesskey="&ausMode0Name.accesskey;"
value="0" flex="1"/>
</hbox>
<description class="updatePrefsInfo" id="ausMode0Info">&ausMode0Name.info;</description>
<hbox>
<radio label="&ausMode1Name.label;" accesskey="&ausMode1Name.accesskey;"
value="1" flex="1"/>
</hbox>
<description class="updatePrefsInfo" id="ausMode1Info">&ausMode1Name.info;</description>
<radio label="&ausMode2Name.label;" accesskey="&ausMode2Name.accesskey;"
value="2"/>
<description class="updatePrefsInfo" id="ausMode2Info">&ausMode2Name.info;</description>
</radiogroup>
<separator/>
<separator/>
</prefpane>
</prefwindow>