Bug 606482 - Reorganized the Software Installation preferences panel. r=IanN ui-r=Neil
authorEdmund Wong <ewong@pw-wspx.org>
Fri, 11 Mar 2011 06:24:00 +0100
changeset 7337 3d14636e266f4c32657504482fc646b42ea85cfd
parent 7336 bbb735ecdb1b78f9ee473926cbf67706d2b71d2b
child 7338 06d9e044fd7a807d0cdca8aa8df6f73e36dc566a
push idunknown
push userunknown
push dateunknown
reviewersIanN, Neil
bugs606482
Bug 606482 - Reorganized the Software Installation preferences panel. r=IanN ui-r=Neil
suite/common/pref/pref-smartupdate.js
suite/common/pref/pref-smartupdate.xul
suite/locales/en-US/chrome/common/pref/pref-smartupdate.dtd
--- a/suite/common/pref/pref-smartupdate.js
+++ b/suite/common/pref/pref-smartupdate.js
@@ -17,16 +17,17 @@
  *
  * The Initial Developer of the Original Code is
  * Netscape Communications Corporation.
  * Portions created by the Initial Developer are Copyright (C) 1998-2007
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Mark Banner <bugzilla@standard8.plus.com>
+ *   Edmund Wong <ewong@pw-wspx.org>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either of 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
@@ -58,80 +59,65 @@ function Startup()
  * extensions.update.enabled
  * - boolean:
  * - true if updates to extensions and themes are enabled, false otherwise
  * app.update.auto
  * - true if updates should be automatically downloaded and installed,
  *   possibly with a warning if incompatible extensions are installed (see
  *   app.update.mode); false if the user should be asked what he wants to do
  *   when an update is available
- * app.update.mode
- * - an integer:
- *   mode:  Minor Releases:                       Major Releases:
- *   0      download and install, never prompt    always prompt
- *
- *   1,2    download and install,                 always prompt
- *          no prompt if no incompatible add-ons
- *
- * The app.update.mode preference is converted into a true/false value for
- * use in determining whether the "Warn me if this will disable extensions
- * or themes" checkbox is checked. Unlike other toolkit applications we
- * don't care about supporting legacy mode 2.
- *
- * app.update.mode    Checkbox State    Meaning
- * 0                  Unchecked         Warn if the update is major
- * 1,2                Checked           Warn if there are incompatibilities
- *                                      or the update is major
  */
 function UpdateAddonsItems()
 {
-  document.getElementById("extensionsUpdatesEnabled").disabled =
-    !document.getElementById("xpinstall.enabled").value ||
+  var addOnsCheck = !document.getElementById("xpinstall.enabled").value;
+
+  document.getElementById("addOnsUpdatesEnabled").disabled =
+    addOnsCheck ||
     document.getElementById("extensions.update.enabled").locked;
 
-  document.getElementById("extensionsUpdateFrequency").disabled =
+  document.getElementById("addOnsUpdateFrequency").disabled =
     !document.getElementById("xpinstall.enabled").value ||
     !document.getElementById("extensions.update.enabled").value ||
     document.getElementById("extensions.update.interval").locked;
+
+  document.getElementById("allowedSitesButton").disabled =
+    addOnsCheck;
+
+  document.getElementById("addOnsModeAutoEnabled").disabled =
+    addOnsCheck ||
+    !document.getElementById("extensions.update.enabled").value ||
+    document.getElementById("extensions.update.enabled").locked;
 }
 
 function UpdateAppItems()
 {
   var enabledPref = document.getElementById("app.update.enabled");
 
   document.getElementById("appUpdatesEnabled").disabled =
     !gCanCheckForUpdates || enabledPref.locked;
 
   document.getElementById("appUpdateFrequency").disabled =
     !enabledPref.value || !gCanCheckForUpdates ||
     document.getElementById("app.update.interval").locked;
+
+  document.getElementById("appModeAutoEnabled").disabled =
+    !enabledPref.value || !gCanCheckForUpdates ||
+    document.getElementById("app.update.mode").locked;
+
   UpdateAutoItems();
 }
 
 /**
  * Enables/disables UI for "when updates are found" based on the values,
  * and "locked" states of associated preferences.
  */
 function UpdateAutoItems()
 {
-  var disabled = !gCanCheckForUpdates||
-                 !document.getElementById("app.update.enabled").value ||
-                 document.getElementById("app.update.auto").locked;
-  document.getElementById("updateModeLabel").disabled = disabled;
-  document.getElementById("updateMode").disabled = disabled;
-  UpdateModeItems();
-}
-
-/**
- * Enables/disables the "warn if incompatible extensions/themes exist" UI
- * based on the values and "locked" states of various preferences.
- */
-function UpdateModeItems()
-{
-  document.getElementById("warnIncompatible").disabled =
+  document.getElementById("appWarnIncompatible").disabled =
+    !gCanCheckForUpdates ||
     !document.getElementById("app.update.enabled").value ||
     !document.getElementById("app.update.auto").value ||
     document.getElementById("app.update.mode").locked;
 }
 
 /**
  * Displays the history of installed updates.
  */
--- a/suite/common/pref/pref-smartupdate.xul
+++ b/suite/common/pref/pref-smartupdate.xul
@@ -17,16 +17,17 @@
 
  The Initial Developer of the Original Code is
  Netscape Communications Corporation.
  Portions created by the Initial Developer are Copyright (C) 1998-2007
  the Initial Developer. All Rights Reserved.
 
  Contributor(s):
    Mark Banner <bugzilla@standard8.plus.com>
+   Edmund Wong <ewong@pw-wspx.org>
 
  Alternatively, the contents of this file may be used under the terms of
  either of 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
@@ -58,118 +59,120 @@
                   onchange="UpdateAddonsItems();"/>
       <preference id="extensions.update.enabled"
                   name="extensions.update.enabled"
                   type="bool"
                   onchange="UpdateAddonsItems();"/>
       <preference id="extensions.update.interval"
                   name="extensions.update.interval"
                   type="int"/>
-
+      <preference id="extensions.update.autoUpdateDefault"
+                  name="extensions.update.autoUpdateDefault"
+                  type="bool"/>
       <preference id="app.update.enabled"
                   name="app.update.enabled"
                   type="bool"
                   onchange="UpdateAppItems();"/>
       <preference id="app.update.auto"
                   name="app.update.auto"
                   type="bool"
-                  onchange="UpdateAutoItems();"/>
+                  onchange="UpdateAppItems();"/>
       <preference id="app.update.mode"
                   name="app.update.mode"
-                  type="int"
-                  onchange="UpdateModeItems();"/>
+                  type="int"/>
       <preference id="app.update.interval"
                   name="app.update.interval"
                   type="int"/>
       <preference id="app.update.disable_button.showUpdateHistory"
                   name="app.update.disable_button.showUpdateHistory"
                   type="bool"/>
     </preferences>
 
     <groupbox>
-      <caption label="&smartTitle.label;"/>
-      <hbox align="center">
-        <checkbox id="XPInstallEnabled" label="&enableSU.label;" flex="1"
-                  accesskey="&enableSU.accesskey;" preference="xpinstall.enabled"/>
-        <button id="allowedSitesButton"
-                label="&viewPermissions.label;"
-                accesskey="&viewPermissions.accesskey;"
-                oncommand="toDataManager('|permissions');"/>
-      </hbox>
+      <caption label="&addOnsTitle.label;"/>
+        <hbox align="center">
+          <checkbox id="XPInstallEnabled"
+                    label="&addOnsAllow.label;"
+                    flex="1"
+                    accesskey="&addOnsAllow.accesskey;"
+                    preference="xpinstall.enabled"/>
+          <button id="allowedSitesButton"
+                  label="&allowedWebsites.label;"
+                  accesskey="&allowedWebsites.accesskey;"
+                  oncommand="toDataManager('|permissions');"/>
+        </hbox>
+        <hbox class="indent">
+           <checkbox id="addOnsUpdatesEnabled"
+                     label="&autoAddOnsUpdates.label;"
+                     accesskey="&autoAddOnsUpdates.accesskey;"
+                     preference="extensions.update.enabled"/>
+           <radiogroup id="addOnsUpdateFrequency"
+                       orient="horizontal"
+                       preference="extensions.update.interval">
+             <radio id="addOnsFreqDaily"
+                    label="&daily.label;"
+                    accesskey="&addOnsDaily.accesskey;"
+                    value="86400"/>
+             <radio id="addOnsFreqWeekly"
+                    label="&weekly.label;"
+                    accesskey="&addOnsWeekly.accesskey;"
+                    value="604800"/>
+           </radiogroup>
+        </hbox>
+        <hbox class="indent">
+          <checkbox id="addOnsModeAutoEnabled"
+                    class="indent"
+                    label="&addOnsModeAutomatic.label;"
+                    flex="1"
+                    accesskey="&addOnsModeAutomatic.accesskey;"
+                    preference="extensions.update.autoUpdateDefault"/>
+        </hbox>
+        <hbox pack="end">
+          <button id="startAddonManager"
+                  oncommand="toEM('addons://list/extensions');"
+                  label="&addonManagerButton.label;"
+                  accesskey="&addonManagerButton.accesskey;"/>
+        </hbox>
     </groupbox>
 
     <groupbox>
-      <caption label="&verifyUpdates.caption;"/>
-      <description>&autoUpdates.label;</description>
-      <grid>
-        <columns>
-          <column/>
-          <column/>
-        </columns>
-
-        <rows>
-          <row>
-            <checkbox id="appUpdatesEnabled" label="&appUpdates.label;"
-                      accesskey="&appUpdates.accesskey;"
-                      preference="app.update.enabled"/>
-            <radiogroup id="appUpdateFrequency" orient="horizontal" 
-                        preference="app.update.interval">
-              <radio id="appFreqDaily" label="&daily.label;"
-                     accesskey="&appDaily.accesskey;" value="86400"/>
-              <radio id="appFreqWeekly" label="&weekly.label;"
-                     accesskey="&appWeekly.accesskey;" value="604800"/>
-            </radiogroup>
-          </row>
-          <row>
-            <checkbox id="extensionsUpdatesEnabled"
-                      label="&extensionsUpdates.label;"
-                      accesskey="&extensionsUpdates.accesskey;"
-                      preference="extensions.update.enabled"/>
-            <radiogroup id="extensionsUpdateFrequency" orient="horizontal" 
-                        preference="extensions.update.interval">
-              <radio id="extensionsFreqDaily" label="&daily.label;"
-                     accesskey="&extensionsDaily.accesskey;" value="86400"/>
-              <radio id="extensionsFreqWeekly" label="&weekly.label;"
-                     accesskey="&extensionsWeekly.accesskey;" value="604800"/>
-            </radiogroup>
-          </row>
-        </rows>
-      </grid>
-      <vbox align="end">
-        <button id="startAddonManager"
-                oncommand="toEM('addons://list/extensions');"
-                label="&addonManagerButton.label;"
-                accesskey="&addonManagerButton.accesskey;"/>
-      </vbox>
-    </groupbox>
-
-    <groupbox>
-      <caption id="updateModeLabel"
-               label="&whenUpdatesFound.label;"
-               control="updateMode"/>
-      <radiogroup id="updateMode"
-                  preference="app.update.auto">
-        <radio id="updateModeAsk"
-               label="&askMe.label;"
-               accesskey="&askMe.accesskey;"
-               value="false"/>
-        <radio id="updateModeAutomatic"
-               label="&modeAutomatic.label;"
-               accesskey="&modeAutomatic.accesskey;"
-               value="true"/>
-        <checkbox id="warnIncompatible"
-                  class="indent"
-                  label="&modeAutoAddonWarn.label;"
-                  accesskey="&modeAutoAddonWarn.accesskey;"
-                  preference="app.update.mode"
-                  onsynctopreference="return this.checked ? 1 : 0;"/>
-      </radiogroup>
-
-      <hbox pack="end">
-        <button id="showUpdateHistory"
-                label="&updateHistory.label;"
-                accesskey="&updateHistory.accesskey;"
-                preference="app.update.disable_button.showUpdateHistory"
-                oncommand="ShowUpdateHistory();"/>
-      </hbox>
+      <caption label="&appUpdates.caption;"/>
+         <hbox>
+           <checkbox id="appUpdatesEnabled"
+                     label="&autoAppUpdates.label;"
+                     accesskey="&autoAppUpdates.accesskey;"
+                     preference="app.update.enabled"/>
+           <radiogroup id="appUpdateFrequency"
+                       orient="horizontal"
+                       preference="app.update.interval">
+             <radio id="appFreqDaily"
+                    label="&daily.label;"
+                    accesskey="&appDaily.accesskey;"
+                    value="86400"/>
+             <radio id="appFreqWeekly"
+                    label="&weekly.label;"
+                    accesskey="&appWeekly.accesskey;"
+                    value="604800"/>
+           </radiogroup>
+        </hbox>
+        <vbox class="indent">
+          <checkbox id="appModeAutoEnabled"
+                    label="&appModeAutomatic.label;"
+                    flex="1"
+                    accesskey="&appModeAutomatic.accesskey;"
+                    preference="app.update.auto"/>
+          <checkbox id="appWarnIncompatible"
+                    class="indent"
+                    label="&appModeAutoAddonWarn.label;"
+                    accesskey="&appModeAutoAddonWarn.accesskey;"
+                    preference="app.update.mode"
+                    onsynctopreference="return this.checked ? 1 : 0;"/>
+        </vbox> 
+        <hbox pack="end">
+          <button id="showUpdateHistory"
+                  label="&updateHistory.label;"
+                  accesskey="&updateHistory.accesskey;"
+                  preference="app.update.disable_button.showUpdateHistory"
+                  oncommand="ShowUpdateHistory();"/>
+        </hbox>
     </groupbox>
   </prefpane>
 </overlay>
--- a/suite/locales/en-US/chrome/common/pref/pref-smartupdate.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-smartupdate.dtd
@@ -1,32 +1,29 @@
 <!--LOCALIZATION NOTE : FILE UI for Software Updates prefs -->
 <!ENTITY pref.smartUpdate.title               "Software Installation">
-<!ENTITY smartTitle.label                     "Manage Software Installations and Updates">
-<!ENTITY enableSU.label                       "Allow websites to install extensions and updates">
-<!ENTITY enableSU.accesskey                   "x">
-<!ENTITY viewPermissions.label                "Manage Permissions">
-<!ENTITY viewPermissions.accesskey            "P">
-
-<!ENTITY verifyUpdates.caption                "Updates">
-<!ENTITY autoUpdates.label                    "Automatically check for updates to:">
-<!ENTITY appUpdates.label                     "&brandShortName;">
-<!ENTITY appUpdates.accesskey                 "S">
+<!ENTITY addOnsTitle.label                    "Add-ons">
+<!ENTITY addOnsAllow.label                    "Allow websites to install add-ons and updates">
+<!ENTITY addOnsAllow.accesskey                "b">
+<!ENTITY allowedWebsites.label                "Allowed Websites">
+<!ENTITY allowedWebsites.accesskey            "W">
+<!ENTITY autoAddOnsUpdates.label              "Automatically check for updates">
+<!ENTITY autoAddOnsUpdates.accesskey          "o">
 <!ENTITY daily.label                          "daily">
-<!ENTITY appDaily.accesskey                   "d">
+<!ENTITY addOnsDaily.accesskey                "d">
 <!ENTITY weekly.label                         "weekly">
-<!ENTITY appWeekly.accesskey                  "w">
-<!ENTITY extensionsUpdates.label              "Installed Add-ons">
-<!ENTITY extensionsUpdates.accesskey          "o">
-<!ENTITY extensionsDaily.accesskey            "a">
-<!ENTITY extensionsWeekly.accesskey           "k">
+<!ENTITY addOnsWeekly.accesskey               "k">
+<!ENTITY addOnsModeAutomatic.label            "Automatically download and install the updates">
+<!ENTITY addOnsModeAutomatic.accesskey        "c">
 <!ENTITY addonManagerButton.label             "Add-on Manager">
 <!ENTITY addonManagerButton.accesskey         "M">
 
-<!ENTITY whenUpdatesFound.label               "When updates to &brandShortName; are found">
-<!ENTITY askMe.label                          "Ask me what I want to do">
-<!ENTITY askMe.accesskey                      "n">
-<!ENTITY modeAutomatic.label                  "Automatically download and install the update">
-<!ENTITY modeAutomatic.accesskey              "c">
-<!ENTITY modeAutoAddonWarn.label              "Warn me if this will disable any of my add-ons">
-<!ENTITY modeAutoAddonWarn.accesskey          "b">
+<!ENTITY appUpdates.caption                   "&brandShortName;">
+<!ENTITY autoAppUpdates.label                 "Automatically check for updates">
+<!ENTITY autoAppUpdates.accesskey             "t">
+<!ENTITY appDaily.accesskey                   "a">
+<!ENTITY appWeekly.accesskey                  "e">
+<!ENTITY appModeAutomatic.label               "Automatically download and install the update">
+<!ENTITY appModeAutomatic.accesskey           "u">
+<!ENTITY appModeAutoAddonWarn.label           "Warn me if this will disable any of my add-ons">
+<!ENTITY appModeAutoAddonWarn.accesskey       "n">
 <!ENTITY updateHistory.label                  "Show Update History">
-<!ENTITY updateHistory.accesskey              "u">
+<!ENTITY updateHistory.accesskey              "S">