bug 305182 - Adds about:config and advanced tab to Sunbird. r=ctalbert,jminta

This commit is contained in:
mattwillis%gmail.com 2006-10-27 02:53:51 +00:00
Родитель 4f67221183
Коммит 1c70977f59
11 изменённых файлов: 442 добавлений и 26 удалений

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

@ -0,0 +1,194 @@
/**
* ***** BEGIN LICENSE BLOCK *****
* 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 Thunderbird preferences
*
* The Initial Developer of the Original Code is
* Scott MacGregor
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matthew Willis <lilmatt@mozilla.com>
*
* 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 *****
*/
var gAdvancedPane = {
_inited: false,
init: function advPaneInit() {
this._inited = true;
this._initMasterPasswordUI();
var advancedPrefs = document.getElementById("advancedPrefs");
var preference = document.getElementById("calendar.preferences.advanced.selectedTabIndex");
if (preference.value === null) {
return;
}
advancedPrefs.selectedIndex = preference.value;
},
tabSelectionChanged: function advPaneTabSelectionChanged() {
if (!this._inited) {
return;
}
var advancedPrefs = document.getElementById("advancedPrefs");
var preference = document.getElementById("calendar.preferences.advanced.selectedTabIndex");
preference.valueFromPreferences = advancedPrefs.selectedIndex;
},
showConnections: function advPaneShowConnections() {
var url = "chrome://calendar/content/preferences/connection.xul";
document.documentElement.openSubDialog(url, "", "chrome,dialog");
},
showConfigEdit: function advPaneShowConfigEdit() {
document.documentElement.openWindow("Preferences:ConfigManager",
"chrome://global/content/config.xul",
"", null);
},
/**
* Caches the security module service for multiple use.
*/
__secModDb: null,
get _secModDb() {
if (!this.__secModDb) {
this.__secModDb =
Components.classes["@mozilla.org/security/pkcs11moduledb;1"]
.getService(Components.interfaces.nsIPKCS11ModuleDB);
}
return this.__secModDb;
},
/**
* Initializes Master Password UI: the "Use Master Password" checkbox,
* selects the Master Password button to show, and enables/disables it as
* necessary. The Master Password is controlled by various bits of NSS
* functionality, so the UI for it can't be controlled by the normal
* preference bindings.
*/
_initMasterPasswordUI: function advPaneInitMasterPassword() {
var noMP = !this._masterPasswordSet();
var button = document.getElementById("changeMasterPassword");
button.disabled = noMP;
var checkbox = document.getElementById("useMasterPassword");
checkbox.checked = !noMP;
},
/**
* Returns true if the user has a Master Password set and false otherwise.
*/
_masterPasswordSet: function advPaneMasterPasswordSet() {
var slot = this._secModDb.findSlotByName("");
if (slot) {
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
var status = slot.status;
// Does the user have a Master Password set?
return ((status != nsIPKCS11Slot.SLOT_UNINITIALIZED) &&
(status != nsIPKCS11Slot.SLOT_READY));
} else {
return false;
}
},
/**
* Enables/disables the Master Password button depending on the state of
* the "Use Master Password" checkbox, and prompts for Master Password
* removal if one is set. This function is called when the "Use Master
* Password" checkbox is changed.
*/
updateMasterPasswordButton: function advPaneUpdateMasterPasswordButton() {
var checkbox = document.getElementById("useMasterPassword");
var button = document.getElementById("changeMasterPassword");
button.disabled = !checkbox.checked;
// Unchecking the checkbox should try to immediately remove the Master
// Password, because it's impossible to non-destructively remove the
// Master Password used to encrypt all the passwords without providing
// it (by design), and it would be extremely odd to pop up that dialog
// when the user closes the prefwindow and saves his settings.
if (!checkbox.checked) {
this._removeMasterPassword();
} else {
this.changeMasterPassword();
}
},
/**
* Displays the "Remove Master Password" dialog to allow the user to
* remove the current Master Password. When the dialog is dismissed,
* the Master Password UI is automatically updated.
*/
_removeMasterPassword: function advRemoveMasterPassword() {
if (this._secmodDB.isFIPSEnabled) {
var bundle = document.getElementById("bundlePreferences");
var promptSvc = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptSvc.alert(window,
bundle.getString("pw_change_failed_title"),
bundle.getString("pw_change2empty_in_fips_mode"));
} else {
var url = "chrome://mozapps/content/preferences/removemp.xul";
document.documentElement.openSubDialog(url, "", null);
}
this._initMasterPasswordUI();
},
/**
* Displays a dialog in which the Master Password may be changed.
*/
changeMasterPassword: function advPaneChangeMasterPassword() {
var url = "chrome://mozapps/content/preferences/changemp.xul";
document.documentElement.openSubDialog(url, "", null);
this._initMasterPasswordUI();
},
/**
* Shows the sites where the user has saved passwords and the associated
* login information.
*/
viewPasswords: function advPaneViewPasswords() {
var url = "chrome://passwordmgr/content/passwordManager.xul";
document.documentElement.openWindow("Toolkit:PasswordManager", url,
"", null);
},
/**
* The Extensions checkbox and button are disabled only if the enable
* Addon update preference is locked.
*/
updateAddonUpdateUI: function advPaneUpdateAddonUpdateUI() {
var enabledPref = document.getElementById("extensions.update.enabled");
var enableAddonUpdate = document.getElementById("enableAddonUpdate");
enableAddonUpdate.disabled = enabledPref.locked;
}
};

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

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- 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 Thunderbird preferences
-
- The Initial Developer of the Original Code is
- Scott MacGregor
- Portions created by the Initial Developer are Copyright (C) 2005
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Matthew Willis <lilmatt@mozilla.com>
-
- 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 LGPL or the GPL. 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % advancedDTD SYSTEM "chrome://calendar/locale/preferences/advanced.dtd">
<!ENTITY % connectionDTD SYSTEM "chrome://calendar/locale/preferences/connection.dtd">
<!ENTITY % globalDTD SYSTEM "chrome://calendar/locale/global.dtd">
<!ENTITY % preferencesDTD SYSTEM "chrome://calendar/locale/preferences/preferences.dtd">
%brandDTD;
%advancedDTD;
%connectionDTD;
%globalDTD;
%preferencesDTD;
]>
<overlay id="AdvancedPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">
<script type="application/x-javascript"
src="chrome://calendar/content/preferences/advanced.js"/>
<preferences>
<preference id="calendar.preferences.advanced.selectedTabIndex"
name="calendar.preferences.advanced.selectedTabIndex"
type="int"/>
<preference id="signon.rememberSignons"
name="signon.rememberSignons"
type="bool"/>
<preference id="pref.privacy.disable_button.view_passwords"
name="pref.privacy.disable_button.view_passwords"
type="bool"/>
<preference id="extensions.update.enabled"
name="extensions.update.enabled"
type="bool"
onchange="gAdvancedPane.updateAddonUpdateUI();"/>
</preferences>
<tabbox id="advancedPrefs"
flex="1"
onselect="gAdvancedPane.tabSelectionChanged();">
<tabs>
<tab label="&pref.calendar.advanced.generalTab.label;"/>
<tab label="&pref.calendar.advanced.passwordsTab.label;"/>
<tab label="&pref.calendar.advanced.updateTab.label;"/>
</tabs>
<tabpanels flex="1">
<!-- General -->
<tabpanel orient="vertical">
<hbox align="center" pack="start">
<description flex="1">&pref.proxiesInfo.label;</description>
<button id="catProxiesButton"
label="&pref.showConnections.label;"
accesskey="&pref.showConnections.accesskey;"
oncommand="gAdvancedPane.showConnections();"/>
</hbox>
<separator/>
<hbox align="center" pack="start">
<description flex="1">&pref.calendar.advanced.configEdit.caption;</description>
<button id="configEditor"
label="&pref.calendar.advanced.configEdit.button;"
accesskey="&pref.calendar.advanced.configEdit.accesskey;"
oncommand="gAdvancedPane.showConfigEdit();"/>
</hbox>
<separator/>
</tabpanel>
<!-- Passwords -->
<tabpanel orient="vertical" align="start">
<description>&pref.calendar.advanced.savedPasswords.intro;</description>
<checkbox id="useMasterPassword"
label="&pref.calendar.advanced.useMasterPassword.label;"
accesskey="&pref.calendar.advanced.useMasterPassword.accesskey;"
oncommand="gAdvancedPane.updateMasterPasswordButton();"
class="indent"
flex="1"/>
<separator/>
<hbox align="start">
<description flex="1">&pref.calendar.advanced.masterPassword.intro;</description>
<vbox>
<button id="changeMasterPassword"
label="&pref.calendar.advanced.changeMasterPassword.label;"
accesskey="&pref.calendar.advanced.changeMasterPassword.accesskey;"
oncommand="gAdvancedPane.changeMasterPassword();"/>
</vbox>
</hbox>
<separator flex="1"/>
<hbox>
<button id="viewPasswords"
label="&pref.calendar.advanced.viewPasswords.label;"
accesskey="&pref.calendar.advanced.viewPasswords.accesskey;"
oncommand="gAdvancedPane.viewPasswords();"
preference="pref.privacy.disable_button.view_passwords"/>
</hbox>
</tabpanel>
<!-- Update -->
<tabpanel orient="vertical" align="start">
<!-- This is indented like this so we don't hose cvs blame
- when we add the rest of the aus stuff. -->
<vbox class="indent">
<checkbox id="enableAddonUpdate"
label="&pref.calendar.advanced.update.enableAddonUpdate.label;"
accesskey="&pref.calendar.advanced.update.enableAddonUpdate.accesskey;"
preference="extensions.update.enabled"/>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</overlay>

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

@ -58,11 +58,5 @@ var gGeneralPane = {
var selectedIndex = dateFormatMenuList.selectedIndex;
dateFormatMenuList.selectedIndex = -1;
dateFormatMenuList.selectedIndex = selectedIndex;
},
showConnections: function () {
var url = "chrome://calendar/content/preferences/connection.xul";
document.documentElement.openSubDialog(url, "", "chrome,dialog");
}
};

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

@ -41,10 +41,6 @@
<!ENTITY % generalDTD SYSTEM "chrome://calendar/locale/preferences/general.dtd">
<!ENTITY % globalDTD SYSTEM "chrome://calendar/locale/global.dtd">
<!ENTITY % preferencesDTD SYSTEM "chrome://calendar/locale/preferences/preferences.dtd">
#ifdef MOZ_SUNBIRD
<!ENTITY % connectionDTD SYSTEM "chrome://calendar/locale/preferences/connection.dtd">
%connectionDTD;
#endif
%brandDTD;
%generalDTD;
%globalDTD;
@ -121,19 +117,6 @@
</groupbox>
#ifdef MOZ_SUNBIRD
<groupbox>
<caption label="&pref.connectionsInfo.caption;"/>
<hbox align="center">
<caption flex="1" label="&pref.proxiesInfo.label;"/>
<button id="catProxiesButton"
label="&pref.showConnections.label;"
accesskey="&pref.showConnections.accesskey;"
oncommand="gGeneralPane.showConnections();"/>
</hbox>
</groupbox>
#endif
<separator/>
</prefpane>

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

@ -90,5 +90,8 @@
<prefpane id="paneTimezones"
label="&paneTimezones.title;"
src="chrome://calendar/content/preferences/timezones.xul"/>
<prefpane id="paneAdvanced"
label="&paneAdvanced.title;"
src="chrome://calendar/content/preferences/advanced.xul"/>
</prefwindow>

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

@ -188,3 +188,7 @@ prefpane description {
-moz-margin-start: 10px;
}
tabpanels {
padding: 18px 10px 10px 10px;
margin: 0 6px 6px 6px;
}

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

@ -266,3 +266,18 @@ next1=next
next2=next
last1=last
last2=last
# Master Password
setMasterPassword=Set Master Password…
changeMasterPassword=Change Master Password…
password_not_set=(not set)
failed_pw_change=Unable to change Master Password.
incorrect_pw=You did not enter the correct current Master Password. Please try again.
pw_change_ok=Master Password successfully changed.
pw_erased_ok=You have deleted your Master Password.
pw_not_wanted=Warning! You have decided not to use a Master Password.
pw_empty_warning=Your stored email passwords will not be protected.
pw_change2empty_in_fips_mode=You are currently in FIPS mode. FIPS requires a non-empty Master Password.
pw_change_success_title=Password Change Succeeded
pw_change_failed_title=Password Change Failed
pw_remove_button=Remove

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

@ -0,0 +1,64 @@
<!-- ***** BEGIN LICENSE BLOCK *****
- 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 Thunderbird Preferences System
-
- The Initial Developer of the Original Code is
- Scott MacGregor
- Portions created by the Initial Developer are Copyright (C) 2005
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Matthew Willis <lilmatt@mozilla.com>
-
- 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 LGPL or the GPL. 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 ***** -->
<!-- WARNING! This file contains UTF-8 encoded characters!
- If this ==> <== doesn't look like an ellipsis (three dots in a row),
- your editor isn't using UTF-8 encoding and may munge up the document!
-->
<!ENTITY pref.calendar.advanced.generalTab.label "General">
<!ENTITY pref.calendar.advanced.passwordsTab.label "Passwords">
<!ENTITY pref.calendar.advanced.updateTab.label "Update">
<!-- General -->
<!ENTITY pref.calendar.advanced.configEdit.caption "Advanced Configuration">
<!ENTITY pref.calendar.advanced.configEdit.button "Config Editor…">
<!ENTITY pref.calendar.advanced.configEdit.accesskey "g">
<!-- Passwords -->
<!ENTITY pref.calendar.advanced.savedPasswords.intro "&brandShortName; can remember password information for all of your calendars so you don't need to re-enter your login details.">
<!ENTITY pref.calendar.advanced.useMasterPassword.label "Use a Master Password to encrypt stored passwords">
<!ENTITY pref.calendar.advanced.useMasterPassword.accesskey "P">
<!ENTITY pref.calendar.advanced.masterPassword.intro "When set, the Master Password protects all your passwords, but you must enter it once per session.">
<!ENTITY pref.calendar.advanced.changeMasterPassword.label "Change Master Password…">
<!ENTITY pref.calendar.advanced.changeMasterPassword.accesskey "M">
<!ENTITY pref.calendar.advanced.viewPasswords.label "View Saved Passwords…">
<!ENTITY pref.calendar.advanced.viewPasswords.accesskey "V">
<!-- Update -->
<!ENTITY pref.calendar.advanced.update.enableAddonUpdate.label "Automatically check for updates to installed Add-ons">
<!ENTITY pref.calendar.advanced.update.enableAddonUpdate.accesskey "A">

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

@ -41,8 +41,7 @@
<!ENTITY pref.showConnections.label "Connection Settings…">
<!ENTITY pref.showConnections.accesskey "o">
<!ENTITY pref.proxiesInfo.label "Determine how &brandShortName; connects to the Internet.">
<!ENTITY pref.connectionsInfo.caption "Connection">
<!ENTITY pref.proxiesInfo.label "Determine how &brandShortName; connects to the Internet">
<!ENTITY connectionsDialog.title "Connection Settings">
<!ENTITY window.width "37em">

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

@ -26,6 +26,7 @@ calendar-@AB_CD@.jar:
locale/@AB_CD@/calendar/global.dtd (%chrome/calendar/global.dtd)
locale/@AB_CD@/calendar/menuOverlay.dtd (%chrome/calendar/menuOverlay.dtd)
locale/@AB_CD@/calendar/overlay.dtd (%chrome/calendar/overlay.dtd)
locale/@AB_CD@/calendar/preferences/advanced.dtd (%chrome/calendar/preferences/advanced.dtd)
locale/@AB_CD@/calendar/preferences/alarms.dtd (%chrome/calendar/preferences/alarms.dtd)
locale/@AB_CD@/calendar/preferences/categories.dtd (%chrome/calendar/preferences/categories.dtd)
* locale/@AB_CD@/calendar/preferences/connection.dtd (%chrome/calendar/preferences/connection.dtd)

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

@ -38,6 +38,8 @@ calendar.jar:
content/calendar/datetimepickers/datetimepickers.xml (content/datetimepickers/datetimepickers.xml)
content/calendar/datetimepickers/minimonth.css (content/datetimepickers/minimonth.css)
content/calendar/datetimepickers/minimonth.xml (content/datetimepickers/minimonth.xml)
content/calendar/preferences/advanced.js (/calendar/base/content/preferences/advanced.js)
content/calendar/preferences/advanced.xul (/calendar/base/content/preferences/advanced.xul)
content/calendar/preferences/alarms.xul (/calendar/base/content/preferences/alarms.xul)
content/calendar/preferences/alarms.js (/calendar/base/content/preferences/alarms.js)
content/calendar/preferences/categories.xul (/calendar/base/content/preferences/categories.xul)
@ -45,7 +47,7 @@ calendar.jar:
* content/calendar/preferences/connection.xul (/calendar/base/content/preferences/connection.xul)
* content/calendar/preferences/connection.js (/calendar/base/content/preferences/connection.js)
content/calendar/preferences/general.js (/calendar/base/content/preferences/general.js)
* content/calendar/preferences/general.xul (/calendar/base/content/preferences/general.xul)
content/calendar/preferences/general.xul (/calendar/base/content/preferences/general.xul)
* content/calendar/preferences/preferences.xul (/calendar/base/content/preferences/preferences.xul)
content/calendar/preferences/timezones.js (/calendar/base/content/preferences/timezones.js)
content/calendar/preferences/timezones.xul (/calendar/base/content/preferences/timezones.xul)