Bug #284144 --> Consolidate the new preferences UI directory.

This commit is contained in:
scott%scott-macgregor.org 2005-03-15 06:24:32 +00:00
Родитель 155cf0c37d
Коммит eb1765b03c
66 изменённых файлов: 5892 добавлений и 2 удалений

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

@ -42,7 +42,5 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = content
include $(topsrcdir)/config/rules.mk

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

@ -0,0 +1,63 @@
# -*- 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 Download Actions Manager.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are
# Copyright (C) 2000, 2001, 2003, 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
const FILEACTION_SAVE_TO_DISK = 1;
const FILEACTION_OPEN_INTERNALLY = 2;
const FILEACTION_OPEN_DEFAULT = 3;
const FILEACTION_OPEN_CUSTOM = 4;
const FILEACTION_OPEN_PLUGIN = 5;
function FileAction ()
{
}
FileAction.prototype = {
type : "",
extension : "",
hasExtension: true,
editable : true,
smallIcon : "",
bigIcon : "",
typeName : "",
action : "",
mimeInfo : null,
customHandler : "",
handleMode : false,
pluginAvailable : false,
pluginEnabled : false,
handledOnlyByPlugin : false
};

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

@ -0,0 +1,126 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 = {
mPane: null,
mInitialized: false,
init: function ()
{
this.mPane = document.getElementById("paneAdvanced");
this.updateMarkAsReadTextbox(false);
var preference = document.getElementById("mail.preferences.advanced.selectedTabIndex");
if (preference.value)
document.getElementById("advancedPrefs").selectedIndex = preference.value;
this.mInitialized = true;
},
tabSelectionChanged: function ()
{
if (this.mInitialized)
{
var preference = document.getElementById("mail.preferences.advanced.selectedTabIndex");
preference.valueFromPreferences = document.getElementById("advancedPrefs").selectedIndex;
}
},
showCertificates: function ()
{
document.documentElement.openSubDialog("chrome://pippki/content/certManager.xul",
"width=600,height=400", null);
},
showCRLs: function ()
{
document.documentElement.openSubDialog("chrome://pippki/content/crlManager.xul",
"width=600,height=400", null);
},
showOCSP: function ()
{
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/ocsp.xul",
"", null);
},
showSecurityDevices: function ()
{
document.documentElement.openSubDialog("chrome://pippki/content/device_manager.xul",
"width=600,height=400", null);
},
updateAppUpdateUI: function ()
{
var preference = document.getElementById("app.update.autoUpdateEnabled");
var ids = ["enableAutoInstall", "autoInstallMode", "updateAnd"];
if (!preference.value)
for (var i = 0; i < ids.length; ++i)
document.getElementById(ids[i]).disabled = true;
else
{
document.getElementById("enableAutoInstall").disabled = false;
this.updateAutoInstallUI();
}
return undefined;
},
updateAutoInstallUI: function ()
{
var preference = document.getElementById("app.update.autoInstallEnabled");
var ids = ["autoInstallMode", "updateAnd"];
for (var i = 0; i < ids.length; ++i)
document.getElementById(ids[i]).disabled = !preference.value;
return undefined;
},
checkForUpdates: function (aType)
{
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates([], 0, aType,
Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
null);
},
updateMarkAsReadTextbox: function(aFocusTextBox)
{
var textbox = document.getElementById('markAsReadDelay');
var checkbox = document.getElementById('markAsRead');
textbox.disabled = !checkbox.checked;
if (!textbox.disabled && aFocusTextBox)
textbox.focus();
},
};

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

@ -0,0 +1,190 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % advancedDTD SYSTEM "chrome://messenger/locale/preferences/advanced.dtd">
%brandDTD;
%advancedDTD;
]>
<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://messenger/content/preferences/advanced.js"/>
<preferences>
<preference id="mail.preferences.advanced.selectedTabIndex"
name="mail.preferences.advanced.selectedTabIndex" type="int"/>
<preference id="mail.showCondensedAddresses" name="mail.showCondensedAddresses" type="bool"/>
<preference id="mailnews.remember_selected_message" name="mailnews.remember_selected_message" type="bool"/>
<preference id="mailnews.mark_message_read.delay" name="mailnews.mark_message_read.delay" type="bool"/>
<preference id="mailnews.mark_message_read.delay.interval" name="mailnews.mark_message_read.delay.interval" type="int"/>
<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.autoUpdateEnabled" name="app.update.autoUpdateEnabled" type="bool"/>
<preference id="extensions.update.autoUpdateEnabled" name="extensions.update.autoUpdateEnabled" type="bool"/>
<preference id="security.disable_button.openCertManager"
name="security.disable_button.openCertManager"
type="bool"/>
<preference id="security.OCSP.disable_button.managecrl"
name="security.OCSP.disable_button.managecrl"
type="bool"/>
<preference id="security.disable_button.openDeviceManager"
name="security.disable_button.openDeviceManager"
type="bool"/>
</preferences>
<tabbox id="advancedPrefs" flex="1" onselect="gAdvancedPane.tabSelectionChanged();">
<tabs>
<tab label="&itemGeneral.label;"/>
<tab label="&itemUpdate.label;"/>
<tab label="&itemSecurity.label;"/>
</tabs>
<tabpanels flex="1">
<!-- General -->
<tabpanel orient="vertical">
<hbox align="center" pack="start">
<checkbox id="showCondensedAddresses" label="&showCondensedAddresses.label;"
accesskey="&showCondensedAddresses.accesskey;" preference="mail.showCondensedAddresses"/>
</hbox>
<hbox align="center" pack="start">
<checkbox id="markAsRead" label="&markAsRead.label;" accesskey="&markAsRead.accesskey;"
preference="mailnews.mark_message_read.delay"
oncommand="gAdvancedPane.updateMarkAsReadTextbox(true);"/>
<textbox id="markAsReadDelay" size="2" preference="mailnews.mark_message_read.delay.interval"/>
<label value="&markAsReadEnd.label;" accesskey="&markAsReadEnd.accesskey;" control="markAsReadDelay"/>
</hbox>
<hbox align="center" pack="start">
<checkbox id="mailRememberLastMsg" label="&rememberLastMsg.label;"
preference="mailnews.remember_selected_message"
accesskey="&rememberLastMsg.accesskey;"/>
</hbox>
<hbox align="center" pack="start">
<checkbox id="showFolderPaneColumns" label="&showFolderColumns.label;"
accesskey="&showFolderColumns.accesskey;" preference="mail.showFolderPaneColumns"/>
</hbox>
<separator class="thin"/>
<vbox>
<hbox align="center" pack="start">
<label value="&reuseExp.label;"/>
</hbox>
<hbox class="indent">
<radiogroup id="mailnewsDoubleClick2NewWindow" preference="mailnews.reuse_message_window" orient="horizontal">
<radio value="false" label="&reuseExpRadio0.label;" accesskey="&reuseExpRadio0.accesskey;" id="new"/>
<radio value="true" label="&reuseExpRadio1.label;" accesskey="&reuseExpRadio1.accesskey;" id="existing"/>
</radiogroup>
</hbox>
</vbox>
</tabpanel>
<!-- Update -->
<tabpanel orient="vertical">
<vbox>
<label>&softwareupdateinfo.label;</label>
<separator class="thin"/>
<vbox align="start">
<checkbox id="enableSmartUpdate"
label="&enableSmartUpdate.label;"
accesskey="&enableSmartUpdate.accesskey;"
preference="app.update.autoUpdateEnabled"
onpreferenceread="return gAdvancedPane.updateAppUpdateUI();"/>
<separator class="thin"/>
<hbox class="indent">
<button label="&checkNow.label;" accesskey="&appCheckNow.accesskey;"
oncommand="gAdvancedPane.checkForUpdates(Components.interfaces.nsIUpdateItem.TYPE_APP);"
preference="pref.update.disable_button.update_app"/>
</hbox>
</vbox>
<separator class="thin"/>
<separator class="groove"/>
<separator class="thin"/>
<vbox align="start">
<checkbox id="enableExtensionUpdate"
label="&enableExtensionUpdate.label;"
accesskey="&enableExtensionUpdate.accesskey;"
preference="extensions.update.autoUpdateEnabled"/>
<separator class="thin"/>
<hbox class="indent">
<button label="&checkNow.label;" accesskey="&extensionsCheckNow.accesskey;"
oncommand="gAdvancedPane.checkForUpdates(Components.interfaces.nsIUpdateItem.TYPE_ADDON);"
preference="pref.update.disable_button.update_addons"/>
</hbox>
</vbox>
</vbox>
</tabpanel>
<!-- Security -->
<tabpanel orient="vertical">
<groupbox>
<caption label="&certificates.label;"/>
<description>&certificatesInfo.label;</description>
<separator class="thin"/>
<description>
<button label="&viewCertificates.label;" accesskey="&viewCertificates.accesskey;"
oncommand="gAdvancedPane.showCertificates();"
preference="security.disable_button.openCertManager"/>
<button label="&viewCRLs.label;" accesskey="&viewCRLs.accesskey;"
oncommand="gAdvancedPane.showCRLs();"
preference="security.OCSP.disable_button.managecrl"/>
<button label="&viewOCSP.label;" accesskey="&viewOCSP.accesskey;"
oncommand="gAdvancedPane.showOCSP();"/>
<button label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
oncommand="gAdvancedPane.showSecurityDevices();"
preference="security.disable_button.openDeviceManager"/>
</description>
</groupbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</overlay>

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

@ -0,0 +1,223 @@
# -*- 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 Download Actions Manager.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are
# Copyright (C) 2000, 2001, 2003, 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 gChangeActionDialog = {
_item : null,
_bundle : null,
_lastSelectedMode : null,
_lastSelectedSave : null,
init: function ()
{
this._item = window.arguments[0];
this._bundle = document.getElementById("bundlePreferences");
var typeField = document.getElementById("typeField");
typeField.value = this._item.typeName;
var extensionField = document.getElementById("extensionField");
var ext = "." + this._item.extension.toLowerCase();
var contentType = this._item.type;
extensionField.value = this._bundle.getFormattedString("extensionStringFormat", [ext, contentType]);
var typeIcon = document.getElementById("typeIcon");
typeIcon.src = this._item.bigIcon;
// Custom App Handler Path - this must be set before we set the selected
// radio button because the selection event handler for the radio group
// requires the extapp handler field to be non-empty for the extapp radio
// button to be selected.
var customApp = document.getElementById("customApp");
if (this._item.customHandler)
customApp.file = this._item.customHandler;
else
customApp.file = null;
var defaultApp = document.getElementById("defaultApp");
var defaultAppIcon = null;
var fallbackIconURL = "moz-icon://goat?contentType=" + this._item.type + "&size=16";
if (this._item.mimeInfo instanceof Components.interfaces.nsIPropertyBag) {
try {
defaultAppIcon = this._item.mimeInfo.getProperty("defaultApplicationIconURL");
}
catch (e) { }
if (defaultAppIcon)
defaultAppIcon += "?size=16";
}
defaultApp.image = defaultAppIcon || fallbackIconURL;
defaultApp.label = this._item.mimeInfo.defaultDescription;
// Selected Action Radiogroup
var handlerGroup = document.getElementById("handlerGroup");
if (this._item.handleMode == FILEACTION_OPEN_DEFAULT)
handlerGroup.selectedItem = document.getElementById("openDefault");
else if (this._item.handleMode == FILEACTION_SAVE_TO_DISK)
handlerGroup.selectedItem = document.getElementById("saveToDisk");
else
handlerGroup.selectedItem = document.getElementById("openApplication");
this._lastSelectedMode = handlerGroup.selectedItem;
// Figure out the last selected Save As mode
var saveToOptions = document.getElementById("saveToOptions");
this._lastSelectedSave = saveToOptions.selectedItem;
// We don't let users open .exe files or random binary data directly
// from the browser at the moment because of security concerns.
var mimeType = this._item.mimeInfo.MIMEType;
if (mimeType == "application/object-stream" ||
mimeType == "application/x-msdownload") {
document.getElementById("openApplication").disabled = true;
document.getElementById("openDefault").disabled = true;
handlerGroup.selectedItem = document.getElementById("saveToDisk");
}
},
onAccept: function ()
{
var contentType = this._item.mimeInfo.MIMEType;
var handlerGroup = document.getElementById("handlerGroup");
switch (handlerGroup.selectedItem.value) {
case "system":
this._item.handledOnlyByPlugin = false;
this._item.handleMode = FILEACTION_OPEN_DEFAULT;
var defaultDescr = this._item.mimeInfo.defaultDescription;
this._item.action = this._bundle.getFormattedString("openWith", [defaultDescr]);
break;
case "app":
this._item.handledOnlyByPlugin = false;
this._item.handleMode = FILEACTION_OPEN_CUSTOM;
var customApp = document.getElementById("customApp");
this._item.action = this._bundle.getFormattedString("openWith", [customApp.label]);
break;
case "save":
this._item.handledOnlyByPlugin = false;
this._item.handleMode = FILEACTION_SAVE_TO_DISK;
this._item.action = this._bundle.getString("saveToDisk");
break;
}
// The opener uses the modifications to the FileAction item to update the
// datasource.
return true;
},
doEnabling: function (aSelectedItem)
{
var defaultApp = document.getElementById("defaultApp");
var saveToDefault = document.getElementById("saveToDefault");
var saveToCustom = document.getElementById("saveToCustom");
var customDownloadFolder = document.getElementById("customDownloadFolder");
var chooseCustomDownloadFolder = document.getElementById("chooseCustomDownloadFolder");
var saveToAskMe = document.getElementById("saveToAskMe");
var changeApp = document.getElementById("changeApp");
var customApp = document.getElementById("customApp");
switch (aSelectedItem.id) {
case "openDefault":
changeApp.disabled = customApp.disabled = saveToDefault.disabled = saveToCustom.disabled = customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = saveToAskMe.disabled = true;
defaultApp.disabled = false;
break;
case "openApplication":
defaultApp.disabled = saveToDefault.disabled = saveToCustom.disabled = customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = saveToAskMe.disabled = true;
changeApp.disabled = customApp.disabled = false;
if (!customApp.file && !this.changeApp()) {
this._lastSelectedMode.click();
return;
}
break;
case "saveToDisk":
changeApp.disabled = customApp.disabled = defaultApp.disabled = true;
var saveToOptions = document.getElementById("saveToOptions");
customDownloadFolder.disabled = chooseCustomDownloadFolder.disabled = !(saveToOptions.selectedItem.id == "saveToCustom");
saveToDefault.disabled = saveToCustom.disabled = saveToAskMe.disabled = false;
break;
}
this._lastSelectedMode = aSelectedItem;
},
doSaveToDiskEnabling: function (aSelectedItem)
{
var isSaveToCustom = aSelectedItem.id == "saveToCustom";
var customDownloadFolder = document.getElementById("customDownloadFolder");
var chooseCustomDownloadFolder = document.getElementById("chooseCustomDownloadFolder");
chooseCustomDownloadFolder.disabled = customDownloadFolder.disabled = !isSaveToCustom;
if (isSaveToCustom &&
!customDownloadFolder.file && !this.changeCustomFolder()) {
this._lastSelectedSave.click();
return;
}
this._lastSelectedSave = aSelectedItem;
},
changeApp: function ()
{
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
var winTitle = this._bundle.getString("fpTitleChooseApp");
fp.init(window, winTitle, nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterApps);
if (fp.show() == nsIFilePicker.returnOK && fp.file) {
var customApp = document.getElementById("customApp");
customApp.file = fp.file;
this._item.customHandler = fp.file;
return true;
}
return false;
},
changeCustomFolder: function ()
{
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
// extract the window title
var winTitle = this._bundle.getString("fpTitleChooseDL");
fp.init(window, winTitle, nsIFilePicker.modeGetFolder);
if (fp.show() == nsIFilePicker.returnOK && fp.file) {
var customDownloadFolder = document.getElementById("customDownloadFolder");
customDownloadFolder.file = fp.file;
customDownloadFolder.label = fp.file.path;
return true;
}
return false;
},
};

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

@ -0,0 +1,101 @@
<?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 Download Actions Manager.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are
# Copyright (C) 2000, 2001, 2003, 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://messenger/content/preferences/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/preferences/changeaction.dtd">
<dialog id="ChangeActionDialog" title="&changeAction.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="gChangeActionDialog.init();"
ondialogaccept="return gChangeActionDialog.onAccept();"
style="width: 36em;"
persist="screenX screenY">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/preferences/changeaction.js"/>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<hbox id="changeActionHeader" align="center" class="indent">
<image id="typeIcon"/>
<vbox flex="1">
<label id="typeField" crop="right"/>
<label id="extensionField" crop="right"/>
</vbox>
</hbox>
<vbox id="changeActionContent" flex="1">
<label>&whenDownloading.label;</label>
<radiogroup id="handlerGroup" onselect="gChangeActionDialog.doEnabling(this.selectedItem);" flex="1">
<separator class="thin"/>
<radio id="openDefault" value="system"
label="&openDefault.label;" accesskey="&openDefault.accesskey;"/>
<filefield class="indent" id="defaultApp" disabled="true"/>
<separator class="thin"/>
<radio id="openApplication" value="app"
label="&openApplication.label;" accesskey="&openApplication.accesskey;"/>
<hbox align="center">
<filefield id="customApp" class="indent" flex="1" disabled="true"/>
<button id="changeApp" oncommand="gChangeActionDialog.changeApp();"
label="&changeApp.label;" accesskey="&changeApp.accesskey;"
disabled="true"/>
</hbox>
<separator class="thin"/>
<radio id="saveToDisk" value="save"
label="&saveToDisk.label;" accesskey="&saveToDisk.accesskey;"/>
<radiogroup id="saveToOptions" class="indent" onselect="gChangeActionDialog.doSaveToDiskEnabling(this.selectedItem);"
hidden="true">
<radio id="saveToDefault" value="default" selected="true"
label="&saveToDefaultFolder.label;" accesskey="&saveToDefaultFolder.accesskey;"/>
<radio id="saveToCustom" value="custom"
label="&saveToThisFolder.label;" accesskey="&saveToThisFolder.accesskey;"/>
<hbox align="center" class="indent">
<filefield id="customDownloadFolder" flex="1"/>
<button id="chooseCustomDownloadFolder" oncommand="gChangeActionDialog.changeCustomFolder();"
label="&chooseFolder.label;" accesskey="&chooseFolder.accesskey;"/>
</hbox>
<radio id="saveToAskMe" value="ask"
label="&saveToAskMe.label;" accesskey="&saveToAskMe.accesskey;"/>
</radiogroup>
</radiogroup>
</vbox>
</dialog>

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

@ -0,0 +1,255 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
const kLDAPPrefContractID="@mozilla.org/ldapprefs-service;1";
var gRefresh = false; // leftover hack from the old preferences dialog
var gComposePane = {
mInitialized: false,
mDirectories: null,
mLDAPPrefsService: null,
init: function ()
{
if (kLDAPPrefContractID in Components.classes)
this.mLDAPPrefsService = Components.classes[kLDAPPrefContractID].getService(Components.interfaces.nsILDAPPrefsService);
this.createDirectoriesList();
this.enableAutocomplete();
var preference = document.getElementById("mail.preferences.compose.selectedTabIndex");
if (preference.value)
document.getElementById("composePrefs").selectedIndex = preference.value;
this.mInitialized = true;
},
tabSelectionChanged: function ()
{
if (this.mInitialized)
{
var preference = document.getElementById("mail.preferences.compose.selectedTabIndex");
preference.valueFromPreferences = document.getElementById("composePrefs").selectedIndex;
}
},
showReturnReceipts: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/receipts.xul",
"", null);
},
sendOptionsDialog: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/sendoptions.xul","", null);
},
htmlComposeDialog: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/htmlcompose.xul","", null);
},
enableAutocomplete: function()
{
var directoriesList = document.getElementById("directoriesList");
var directoriesListPopup = document.getElementById("directoriesListPopup");
var editButton = document.getElementById("editButton");
if (document.getElementById("autocompleteLDAP").checked)
{
editButton.removeAttribute("disabled");
directoriesList.removeAttribute("disabled");
directoriesListPopup.removeAttribute("disabled");
}
else
{
directoriesList.setAttribute("disabled", true);
directoriesListPopup.setAttribute("disabled", true);
editButton.setAttribute("disabled", true);
}
// if we do not have any directories disable the dropdown list box
if (!this.mDirectories || (this.mDirectories < 1))
directoriesList.setAttribute("disabled", true);
},
createDirectoriesList: function()
{
var directoriesListPopup = document.getElementById("directoriesListPopup");
if (directoriesListPopup)
this.loadDirectories(directoriesListPopup);
},
loadDirectories: function(aPopup)
{
var prefCount = {value:0};
var description = "";
var item;
var j=0;
var arrayOfDirectories;
var position;
var dirType;
var directoriesList;
var prefService;
prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (!this.mDirectories)
{
try
{
if (this.mLDAPPrefsService)
arrayOfDirectories = this.mLDAPPrefsService.getServerList(prefService, prefCount);
}
catch (ex) {}
if (arrayOfDirectories)
{
this.mDirectories = new Array();
for (var i = 0; i < prefCount.value; i++)
{
if ((arrayOfDirectories[i] != "ldap_2.servers.pab") &&
(arrayOfDirectories[i] != "ldap_2.servers.history"))
{
try
{
position = prefService.getIntPref(arrayOfDirectories[i]+".position");
}
catch(ex)
{
position = 1;
}
try
{
dirType = prefService.getIntPref(arrayOfDirectories[i]+".dirType");
}
catch(ex)
{
dirType = 1;
}
if ((position != 0) && (dirType == 1))
{
try
{
description = prefService.getComplexValue(arrayOfDirectories[i]+".description",
Components.interfaces.nsISupportsString).data;
}
catch(ex)
{
description="";
}
if (description != "")
{
if (aPopup)
{
item = document.createElement("menuitem");
item.setAttribute("label", description);
item.setAttribute("value", arrayOfDirectories[i]);
aPopup.appendChild(item);
}
this.mDirectories[j++] = {value:arrayOfDirectories[i], label:description};
}
}
}
}
var value;
if (aPopup)
{
directoriesList = document.getElementById("directoriesList");
if (gRefresh)
{
// gRefresh is true if user edits, removes or adds a directory.
value = directoriesList.value;
directoriesList.selectedItem = null;
directoriesList.value = value;
if (!directoriesList.selectedItem)
directoriesList.selectedIndex = 0;
if (!directoriesList.selectedItem)
{
directoriesList.value = "";
directoriesList.disabled = true;
}
else if (!prefService.prefIsLocked("ldap_2.autoComplete.directoryServer"))
directoriesList.disabled = false;
return;
}
var pref_string_title = "ldap_2.autoComplete.directoryServer";
try
{
var directoryServer = prefService.getCharPref(pref_string_title);
directoriesList.value = directoryServer;
if (!directoriesList.selectedItem)
directoriesList.selectedIndex = 0;
if (!directoriesList.selectedItem)
directoriesList.value = "";
}
catch (ex)
{
directoriesList.selectedItem = null;
}
}
}
}
},
editDirectories: function()
{
var args = {fromGlobalPref: true};
window.openDialog("chrome://messenger/content/addressbook/pref-editdirectories.xul",
"editDirectories", "chrome,modal=yes,resizable=no", args);
if (gRefresh)
{
var popup = document.getElementById("directoriesListPopup");
if (popup)
while (popup.hasChildNodes())
popup.removeChild(popup.lastChild);
}
this.mDirectories = null;
this.loadDirectories(popup);
gRefresh = false;
}
};

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

@ -0,0 +1,194 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % composeDTD SYSTEM "chrome://messenger/locale/preferences/compose.dtd">
%brandDTD;
%composeDTD;
]>
<overlay id="ComposePaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<prefpane id="paneCompose" onpaneload="gComposePane.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/compose.js"/>
<preferences>
<preference id="mail.preferences.compose.selectedTabIndex" name="mail.preferences.compose.selectedTabIndex" type="int"/>
<preference id="mail.forward_message_mode" name="mail.forward_message_mode" type="int"/>
<preference id="mail.SpellCheckBeforeSend" name="mail.SpellCheckBeforeSend" type="bool"/>
<preference id="mail.spellcheck.inline" name="mail.spellcheck.inline" type="bool"/>
<preference id="mail.strictly_mime" name="mail.strictly_mime" type="bool"/>
<preference id="mail.warn_on_send_accel_key" name="mail.warn_on_send_accel_key" type="bool"/>
<preference id="mail.compose.autosave" name="mail.compose.autosave" type="bool"/>
<preference id="mail.compose.autosaveinterval" name="mail.compose.autosaveinterval" type="int"/>
<preference id="mailnews.wraplength" name="mailnews.wraplength" type="int"/>
<preference id="mail.enable_autocomplete" name="mail.enable_autocomplete" type="bool"/>
<preference id="ldap_2.autoComplete.useDirectory" name="ldap_2.autoComplete.useDirectory" type="bool"/>
<preference id="ldap_2.autoComplete.directoryServer" name="ldap_2.autoComplete.directoryServer" type="string"/>
<preference id="mail.collect_email_address_outgoing" name="mail.collect_email_address_outgoing" type="bool"/>
<preference id="mail.collect_addressbook" name="mail.collect_addressbook" type="string"/>
</preferences>
<tabbox id="composePrefs" flex="1" onselect="gComposePane.tabSelectionChanged();">
<tabs>
<tab label="&itemGeneral.label;"/>
<tab label="&itemAutoComplete.label;"/>
<tab label="&itemSpellCheck.label;"/>
</tabs>
<tabpanels flex="1">
<tabpanel orient="vertical">
<hbox align="center">
<label value="&forwardMsg.label;" accesskey="&forwardMsg.accesskey;" control="forwardMessageMode"/>
<menulist id="forwardMessageMode" preference="mail.forward_message_mode">
<menupopup>
<menuitem value="2" label="&inline.label;" accesskey="&inline.accesskey;"/>
<menuitem value="0" label="&asAttachment.label;" accesskey="&asAttachment.accesskey;"/>
</menupopup>
</menulist>
</hbox>
<checkbox id="strictlyMime" label="&useMIME.label;"
preference="mail.strictly_mime"
accesskey="&useMIME.accesskey;"/>
<checkbox id="mailWarnOnSendAccelKey" label="&warnOnSendAccelKey.label;"
preference="mail.warn_on_send_accel_key"
accesskey="&warnOnSendAccelKey.accesskey;"/>
<hbox align="center" pack="start">
<checkbox id="autoSave" label="&autoSave.label;" preference="mail.compose.autosave"
accesskey="&autoSave.accesskey;"/>
<textbox id="autoSaveInterval" size="2" preference="mail.compose.autosaveinterval"/>
<label value="&autoSaveEnd.label;" accesskey="&autoSaveEnd.accesskey;" control="autoSaveInterval"/>
</hbox>
<hbox align="center">
<label value="&wrapOutMsg.label;" accesskey="&wrapOutMsg.accesskey;" control="wrapLength"/>
<textbox id="wrapLength" size="3" preference="mailnews.wraplength"/>
<label value="&char.label;"/>
</hbox>
<hbox align="center">
<description flex="1">&sendOptionsDescription.label;</description>
<button label="&sendOptions.label;"
accesskey="&sendOptions.accesskey;"
oncommand="gComposePane.sendOptionsDialog();"/>
</hbox>
<hbox align="center">
<description flex="1">&htmlComposeDescription.label;</description>
<button label="&htmlCompose.label;"
accesskey="&htmlCompose.accesskey;"
oncommand="gComposePane.htmlComposeDialog();"/>
</hbox>
<hbox align="center">
<description flex="1">&returnReceiptsInfo.label;</description>
<button label="&showReturnReceipts.label;"
accesskey="&showReturnReceipts.accesskey;"
oncommand="gComposePane.showReturnReceipts();"/>
</hbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<!-- Address Autocomplete -->
<caption label="&addressingTitle.label;"/>
<description>&autocompleteText.label;</description>
<hbox align="center">
<checkbox id="addressingAutocomplete" label="&addressingEnable.label;"
preference="mail.enable_autocomplete"
accesskey="&addressingEnable.accesskey;"/>
</hbox>
<hbox align="center">
<checkbox id="autocompleteLDAP" label="&directories.label;"
preference="ldap_2.autoComplete.useDirectory"
oncommand="gComposePane.enableAutocomplete();"
accesskey="&directories.accesskey;"/>
<menulist id="directoriesList" flex="1"
preference="ldap_2.autoComplete.directoryServer">
<menupopup id="directoriesListPopup">
</menupopup>
</menulist>
<button id="editButton" label="&editDirectories.label;"
preference="pref.ldap.disable_button.edit_directories"
oncommand="gComposePane.editDirectories();"
accesskey="&editDirectories.accesskey;"/>
</hbox>
</groupbox>
<separator class="thin"/>
<hbox align="center" pack="start">
<checkbox id="emailCollectionOutgoing" label="&emailCollectionPicker.label;"
accesskey="&emailCollectionPicker.accesskey;" preference="mail.collect_email_address_outgoing"/>
<menulist id="localDirectoriesList" preference="mail.collect_addressbook" flex="1">
<menupopup id="abPopup-menupopup" ref="moz-abdirectory://" datasources="rdf:addressdirectory" sortActive="true"
sortDirection="ascending" sortResource="http://home.netscape.com/NC-rdf#DirTreeNameSort">
<template>
<rule nc:IsWriteable="false"/>
<rule nc:IsMailList="false">
<menuitem uri="..." label="rdf:http://home.netscape.com/NC-rdf#DirName" value="rdf:http://home.netscape.com/NC-rdf#DirUri"/>
</rule>
</template>
</menupopup>
</menulist>
</hbox>
</tabpanel>
<tabpanel orient="vertical">
<checkbox id="spellCheckBeforeSend" label="&spellCheck.label;"
preference="mail.SpellCheckBeforeSend"
accesskey="&spellCheck.accesskey;"/>
<checkbox id="inlineSpellCheck" label="&spellCheckInline.label;"
preference="mail.spellcheck.inline"
accesskey="&spellCheckInline.accesskey;"/>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</overlay>

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

@ -0,0 +1,178 @@
# -*- 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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gConnectionsDialog = {
beforeAccept: function ()
{
var proxyTypePref = document.getElementById("network.proxy.type");
if (proxyTypePref.value != 1)
return true;
var httpProxyURLPref = document.getElementById("network.proxy.http");
var httpProxyPortPref = document.getElementById("network.proxy.http_port");
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
if (shareProxiesPref.value) {
var proxyPrefs = ["ssl", "socks"];
for (var i = 0; i < proxyPrefs.length; ++i) {
var proxyServerURLPref = document.getElementById("network.proxy." + proxyPrefs[i]);
var proxyPortPref = document.getElementById("network.proxy." + proxyPrefs[i] + "_port");
var backupServerURLPref = document.getElementById("network.proxy.backup." + proxyPrefs[i]);
var backupPortPref = document.getElementById("network.proxy.backup." + proxyPrefs[i] + "_port");
backupServerURLPref.value = proxyServerURLPref.value;
backupPortPref.value = proxyPortPref.value;
proxyServerURLPref.value = httpProxyURLPref.value;
proxyPortPref.value = httpProxyPortPref.value;
}
}
return true;
},
proxyTypeChanged: function ()
{
var proxyTypePref = document.getElementById("network.proxy.type");
// Update http
var httpProxyURLPref = document.getElementById("network.proxy.http");
httpProxyURLPref.disabled = proxyTypePref.value != 1;
var httpProxyPortPref = document.getElementById("network.proxy.http_port");
httpProxyPortPref.disabled = proxyTypePref.value != 1;
// Now update the other protocols
this.updateProtocolPrefs();
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
shareProxiesPref.disabled = proxyTypePref.value != 1;
var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
noProxiesPref.disabled = proxyTypePref.value != 1;
var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url");
autoconfigURLPref.disabled = proxyTypePref.value != 2;
var disableReloadPref = document.getElementById("pref.advanced.proxies.disable_button.reload");
disableReloadPref.disabled = proxyTypePref.value != 2;
},
readProxyType: function ()
{
this.proxyTypeChanged();
return undefined;
},
updateProtocolPrefs: function ()
{
var proxyTypePref = document.getElementById("network.proxy.type");
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
var proxyPrefs = ["ssl", "socks"];
for (var i = 0; i < proxyPrefs.length; ++i) {
var proxyServerURLPref = document.getElementById("network.proxy." + proxyPrefs[i]);
var proxyPortPref = document.getElementById("network.proxy." + proxyPrefs[i] + "_port");
// Restore previous per-proxy custom settings, if present.
if (!shareProxiesPref.value) {
var backupServerURLPref = document.getElementById("network.proxy.backup." + proxyPrefs[i]);
var backupPortPref = document.getElementById("network.proxy.backup." + proxyPrefs[i] + "_port");
if (backupServerURLPref.hasUserValue) {
proxyServerURLPref.value = backupServerURLPref.value;
backupServerURLPref.reset();
}
if (backupPortPref.hasUserValue) {
proxyPortPref.value = backupPortPref.value;
backupPortPref.reset();
}
}
proxyServerURLPref.updateElements();
proxyPortPref.updateElements();
proxyServerURLPref.disabled = proxyTypePref.value != 1 || shareProxiesPref.value;
proxyPortPref.disabled = proxyServerURLPref.disabled;
}
var socksVersionPref = document.getElementById("network.proxy.socks_version");
socksVersionPref.disabled = proxyTypePref.value != 1 || shareProxiesPref.value;
return undefined;
},
readProxyProtocolPref: function (aProtocol, aIsPort)
{
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
if (shareProxiesPref.value) {
var pref = document.getElementById("network.proxy.http" + (aIsPort ? "_port" : ""));
return pref.value;
}
var backupPref = document.getElementById("network.proxy.backup." + aProtocol + (aIsPort ? "_port" : ""));
return backupPref.hasUserValue ? backupPref.value : undefined;
},
reloadPAC: function ()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var pps = Components.classesByID["{e9b301c0-e0e4-11D3-a1a8-0050041caf44}"]
.getService(Components.interfaces.nsIProtocolProxyService);
pps.configureFromPAC(autoURL.value);
},
writeAutoconfigURL: function ()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(Components.interfaces.nsIURIFixup);
try {
return URIFixup.createFixupURI(autoURL.value, 0).spec;
}
catch(ex) {
}
return undefined;
},
readHTTPProxyServer: function ()
{
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
if (shareProxiesPref.value)
this.updateProtocolPrefs();
return undefined;
},
readHTTPProxyPort: function ()
{
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
if (shareProxiesPref.value)
this.updateProtocolPrefs();
return undefined;
},
};

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

@ -0,0 +1,170 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
# Scott MacGregor <mscott@mozilla.org>
#
# 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 SYSTEM "chrome://messenger/locale/preferences/connection.dtd">
<?xml-stylesheet href="chrome://global/skin/"?>
<prefwindow id="ConnectionsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&connectionsDialog.title;"
dlgbuttons="accept,cancel"
onbeforeaccept="return gConnectionsDialog.beforeAccept();"
style="width: 37em !important;">
<prefpane id="ConnectionsDialogPane">
<preferences>
<preference id="network.proxy.type" name="network.proxy.type" type="int" onchange="gConnectionsDialog.proxyTypeChanged();"/>
<preference id="network.proxy.http" name="network.proxy.http" type="string"/>
<preference id="network.proxy.http_port" name="network.proxy.http_port" type="int"/>
<preference id="network.proxy.ssl" name="network.proxy.ssl" type="string"/>
<preference id="network.proxy.ssl_port" name="network.proxy.ssl_port" type="int"/>
<preference id="network.proxy.socks" name="network.proxy.socks" type="string"/>
<preference id="network.proxy.socks_port" name="network.proxy.socks_port" type="int"/>
<preference id="network.proxy.socks_version" name="network.proxy.socks_version" type="int"/>
<preference id="network.proxy.no_proxies_on" name="network.proxy.no_proxies_on" type="string"/>
<preference id="network.proxy.autoconfig_url" name="network.proxy.autoconfig_url" type="string"/>
<preference id="network.proxy.share_proxy_settings"
name="network.proxy.share_proxy_settings"
type="bool"/>
<preference id="pref.advanced.proxies.disable_button.reload"
name="pref.advanced.proxies.disable_button.reload"
type="bool"/>
<preference id="network.proxy.backup.ssl" name="network.proxy.backup.ssl" type="string"/>
<preference id="network.proxy.backup.ssl_port" name="network.proxy.backup.ssl_port" type="int"/>
<preference id="network.proxy.backup.socks" name="network.proxy.backup.socks" type="string"/>
<preference id="network.proxy.backup.socks_port" name="network.proxy.backup.socks_port" type="int"/>
</preferences>
<script type="application/x-javascript" src="chrome://messenger/content/preferences/connection.js"/>
<groupbox>
<caption label="&proxyTitle.label;"/>
<radiogroup id="networkProxyType" preference="network.proxy.type"
onpreferenceread="return gConnectionsDialog.readProxyType();">
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;"/>
<radio value="4" label="&WPADTypeRadio.label;" accesskey="&WPADTypeRadio.accesskey;"/>
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox pack="end">
<label value="&http.label;" accesskey="&http.accesskey;" control="networkProxyHTTP"/>
</hbox>
<hbox align="center">
<textbox id="networkProxyHTTP" flex="1"
preference="network.proxy.http" onpreferenceread="return gConnectionsDialog.readHTTPProxyServer();"/>
<label value="&port.label;" accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port"/>
<textbox id="networkProxyHTTP_Port" size="5"
preference="network.proxy.http_port" onpreferenceread="return gConnectionsDialog.readHTTPProxyPort();"/>
</hbox>
</row>
<row>
<hbox/>
<hbox>
<checkbox id="shareAllProxies" label="&shareproxy.label;" accesskey="&shareproxy.accesskey;"
preference="network.proxy.share_proxy_settings"
onpreferenceread="return gConnectionsDialog.updateProtocolPrefs();"/>
</hbox>
</row>
<row align="center">
<hbox pack="end">
<label value="&ssl.label;" accesskey="&ssl.accesskey;" control="networkProxySSL"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySSL" flex="1" preference="network.proxy.ssl"
onpreferenceread="return gConnectionsDialog.readProxyProtocolPref('ssl', false);"/>
<label value="&port.label;" accesskey="&SSLport.accesskey;" control="networkProxySSL_Port"/>
<textbox id="networkProxySSL_Port" size="5" preference="network.proxy.ssl_port"
onpreferenceread="return gConnectionsDialog.readProxyProtocolPref('ssl', true);"/>
</hbox>
</row>
<row align="center">
<hbox pack="end">
<label value="&socks.label;" accesskey="&socks.accesskey;" control="networkProxySOCKS"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySOCKS" flex="1" preference="network.proxy.socks"
onpreferenceread="return gConnectionsDialog.readProxyProtocolPref('socks', false);"/>
<label value="&port.label;" accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port"/>
<textbox id="networkProxySOCKS_Port" size="5" preference="network.proxy.socks_port"
onpreferenceread="return gConnectionsDialog.readProxyProtocolPref('socks', true);"/>
</hbox>
</row>
<row>
<spacer/>
<radiogroup id="networkProxySOCKSVersion" orient="horizontal"
preference="network.proxy.socks_version">
<radio id="networkProxySOCKSVersion4" value="4" label="&socks4.label;" accesskey="&socks4.accesskey;" />
<radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;" />
</radiogroup>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
</hbox>
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on"/>
</row>
<row>
<spacer/>
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
</row>
</rows>
</grid>
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
<hbox class="indent" flex="1" align="center">
<textbox id="networkProxyAutoconfigURL" flex="1" preference="network.proxy.autoconfig_url"
onpreferencewrite="return gConnectionsDialog.writeAutoconfigURL();"/>
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
oncommand="gConnectionsDialog.reloadPAC();"
preference="pref.advanced.proxies.disable_button.reload"/>
</hbox>
</radiogroup>
</groupbox>
</prefpane>
</prefwindow>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -0,0 +1,90 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gDisplayPane = {
mInitialized: false,
init: function ()
{
var preference = document.getElementById("mail.preferences.display.selectedTabIndex");
if (preference.value)
document.getElementById("displayPrefs").selectedIndex = preference.value;
this.mInitialized = true;
},
tabSelectionChanged: function ()
{
if (this.mInitialized)
{
var preference = document.getElementById("mail.preferences.display.selectedTabIndex");
preference.valueFromPreferences = document.getElementById("displayPrefs").selectedIndex;
}
},
restoreDefaultLabels: function()
{
for (var index = 1; index <= 5; index++)
{
// reset throws an exception if the pref value is already the default so
// work around that with some try/catch exception handling
try {
document.getElementById('mailnews.labels.description.' + index ).reset();
} catch (ex) {}
try {
document.getElementById('mailnews.labels.color.' + index ).reset();
} catch (ex) {}
}
},
fontOptionsDialog: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/fonts.xul", "", null);
},
mCharsetMenuInitialized: false,
readDefaultCharset: function()
{
if (!this.mCharsetMenuInitialized)
{
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
os.notifyObservers(null, "charsetmenu-selected", "mailedit");
this.mCharsetMenuInitialized = true;
}
return undefined;
},
};

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

@ -0,0 +1,269 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % displayDTD SYSTEM "chrome://messenger/locale/preferences/display.dtd" >
%brandDTD;
%displayDTD;
]>
<overlay id="DisplayPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<prefpane id="paneDisplay" onpaneload="gDisplayPane.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/display.js"/>
<preferences>
<preference id="mail.preferences.display.selectedTabIndex" name="mail.preferences.display.selectedTabIndex" type="int"/>
<preference id="mail.wrap_long_lines" name="mail.wrap_long_lines" type="bool"/>
<preference id="mail.display_glyph" name="mail.display_glyph" type="bool"/>
<preference id="mail.fixed_width_messages" name="mail.fixed_width_messages" type="bool"/>
<preference id="mail.quoted_style" name="mail.quoted_style" type="int"/>
<preference id="mail.quoted_size" name="mail.quoted_size" type="int"/>
<preference id="mail.citation_color" name="mail.citation_color" type="string"/>
<preference id="browser.display.foreground_color" name="browser.display.foreground_color" type="string"/>
<preference id="browser.display.background_color" name="browser.display.background_color" type="string"/>
<preference id="mailnews.labels.description.1" name="mailnews.labels.description.1" type="wstring"/>
<preference id="mailnews.labels.color.1" name="mailnews.labels.color.1" type="string"/>
<preference id="mailnews.labels.description.2" name="mailnews.labels.description.2" type="wstring"/>
<preference id="mailnews.labels.color.2" name="mailnews.labels.color.2" type="string"/>
<preference id="mailnews.labels.description.3" name="mailnews.labels.description.3" type="wstring"/>
<preference id="mailnews.labels.color.3" name="mailnews.labels.color.3" type="string"/>
<preference id="mailnews.labels.description.4" name="mailnews.labels.description.4" type="wstring"/>
<preference id="mailnews.labels.color.4" name="mailnews.labels.color.4" type="string"/>
<preference id="mailnews.labels.description.5" name="mailnews.labels.description.5" type="wstring"/>
<preference id="mailnews.labels.color.5" name="mailnews.labels.color.5" type="string"/>
<preference id="mailnews.send_default_charset" name="mailnews.send_default_charset" type="wstring"/>
<preference id="mailnews.view_default_charset" name="mailnews.view_default_charset" type="wstring"/>
<preference id="mailnews.force_charset_override" name="mailnews.force_charset_override" type="bool"/>
<preference id="mailnews.reply_in_default_charset" name="mailnews.reply_in_default_charset" type="bool"/>
</preferences>
<tabbox id="displayPrefs" flex="1" onselect="gDisplayPane.tabSelectionChanged();">
<tabs>
<tab label="&itemFormatting.label;"/>
<tab label="&itemLabels.label;"/>
<tab label="&itemFonts.label;"/>
</tabs>
<tabpanels flex="1">
<!-- Plain Text and HTML Formatting -->
<tabpanel orient="vertical">
<groupbox>
<caption label="&displayWidth.label;"/>
<description>&viewingPlainText.label;</description>
<vbox class="indent" align="start">
<checkbox id="wrapLongLines" label="&wrapInMsg.label;"
preference="mail.wrap_long_lines" accesskey="&wrapInMsg.accesskey;"/>
<checkbox id="displayGlyph" label="&convertEmoticons.label;"
preference="mail.display_glyph" accesskey="&convertEmoticons.accesskey;"/>
</vbox>
<separator class="thin"/>
<hbox align="center">
<description>&plainText.label;</description>
<radiogroup id="mailFixedWidthMessages" orient="horizontal" class="indent"
preference="mail.fixed_width_messages">
<radio value="true" label="&fixedWidth.label;" accesskey="&fixedWidth.accesskey;"/>
<radio value="false" label="&variableWidth.label;" accesskey="&variableWidth.accesskey;"/>
</radiogroup>
</hbox>
<separator class="thin"/>
<description>&displayText.label;</description>
<hbox class="indent" align="center">
<label value="&style.label;" accesskey="&style.accesskey;" control="mailQuotedStyle"/>
<menulist id="mailQuotedStyle" preference="mail.quoted_style">
<menupopup>
<menuitem value="0" label="&regularStyle.label;"/>
<menuitem value="1" label="&bold.label;"/>
<menuitem value="2" label="&italic.label;"/>
<menuitem value="3" label="&boldItalic.label;"/>
</menupopup>
</menulist>
<label value="&size.label;" accesskey="&size.accesskey;" control="mailQuotedSize"/>
<menulist id="mailQuotedSize" preference="mail.quoted_size">
<menupopup>
<menuitem value="0" label="&regularSize.label;"/>
<menuitem value="1" label="&bigger.label;"/>
<menuitem value="2" label="&smaller.label;"/>
</menupopup>
</menulist>
<label value="&color.label;" accesskey="&color.accesskey;" control="citationmenu"/>
<colorpicker type="button" id="citationmenu" palettename="standard" preference="mail.citation_color"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&htmlColors.label;"/>
<description>&overrideSender.label;</description>
<hbox align="center" class="indent">
<label value="&textColor.label;" accesskey="&textColor.accesskey;" control="foregroundtextmenu"/>
<colorpicker type="button" id="foregroundtextmenu" palettename="standard" preference="browser.display.foreground_color"/>
<spacer style="width: 25px"/>
<label value="&backgroundColor.label;" accesskey="&backgroundColor.accesskey;" control="backgroundmenu"/>
<colorpicker type="button" id="backgroundmenu" palettename="standard" preference="browser.display.background_color"/>
</hbox>
</groupbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<caption label="&labelsSettings.label;"/>
<description>&displayLabelsText.label;</description>
<hbox align="top">
<vbox>
<!-- label color: 1 (default red) -->
<hbox class="indent" align="center">
<textbox id="label1TextBox" preference="mailnews.labels.description.1" />
<colorpicker class="small-margin" type="button" id="labelColorPicker1"
palettename="standard" preference="mailnews.labels.color.1"/>
</hbox>
<!-- label color: 2 (default orange) -->
<hbox class="indent" align="center">
<textbox id="label2TextBox" preference="mailnews.labels.description.2" />
<colorpicker class="small-margin" type="button" id="labelColorPicker2"
palettename="standard" preference="mailnews.labels.color.2"/>
</hbox>
<!-- label color: 3 (default green) -->
<hbox class="indent" align="center">
<textbox id="label3TextBox" preference="mailnews.labels.description.3" />
<colorpicker class="small-margin" type="button" id="labelColorPicker3"
palettename="standard" preference="mailnews.labels.color.3"/>
</hbox>
</vbox>
<vbox>
<!-- label color: 4 (default blue) -->
<hbox class="indent" align="center">
<textbox id="label4TextBox" preference="mailnews.labels.description.4" />
<colorpicker class="small-margin" type="button" id="labelColorPicker4"
palettename="standard" preference="mailnews.labels.color.4"/>
</hbox>
<!-- label color: 5 (default purple) -->
<hbox class="indent" align="center">
<textbox id="label5TextBox" preference="mailnews.labels.description.5" />
<colorpicker class="small-margin" type="button" id="labelColorPicker5"
palettename="standard" preference="mailnews.labels.color.5"/>
</hbox>
</vbox>
</hbox>
<hbox pack="end">
<button label="&restoreDefaults.label;" accesskey="&restoreDefaults.accesskey;"
oncommand="gDisplayPane.restoreDefaultLabels();"/>
</hbox>
</groupbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<caption label="&fontsCaption.label;"/>
<hbox align="center">
<description flex="1">&fontsDescription.label;</description>
<button label="&fontOptions.label;"
accesskey="&fontOptions.accesskey;"
oncommand="gDisplayPane.fontOptionsDialog();"/>
</hbox>
</groupbox>
<groupbox align="start">
<caption label="&languagesTitle.label;"/>
<label value="&composingDescription.label;"/>
<separator class="thin"/>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center" class="indent">
<label control="sendDefaultCharsetList"
value="&sendDefaultCharset.label;" accesskey="&sendDefaultCharset.accesskey;"/>
<menulist id="sendDefaultCharsetList" ref="NC:MaileditCharsetMenuRoot" datasources="rdf:charset-menu"
preference="mailnews.send_default_charset" onpreferenceread="return gDisplayPane.readDefaultCharset();">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
</menupopup>
</template>
</menulist>
</row>
<row align="center" class="indent">
<label control="viewDefaultCharsetList"
value="&viewDefaultCharsetList.label;" accesskey="&viewDefaultCharsetList.accesskey;"/>
<menulist id="viewDefaultCharsetList" ref="NC:DecodersRoot" datasources="rdf:charset-menu"
preference="mailnews.view_default_charset">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
</menupopup>
</template>
</menulist>
</row>
</rows>
</grid>
<separator class="thin"/>
<checkbox id="forceCharsetOverride" label="&forceCharsetOverride.label;"
preference="mailnews.force_charset_override"
accesskey="&forceCharsetOverride.accesskey;"/>
<checkbox id="replyInDefaultCharset" label="&replyInDefaultCharset.label;"
preference="mailnews.reply_in_default_charset"
accesskey="&replyInDefaultCharset.accesskey;"/>
</groupbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</overlay>

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

@ -0,0 +1,768 @@
# -*- 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 Download Actions Manager.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are
# Copyright (C) 2000, 2001, 2003, 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
const kRootTypePrefix = "urn:mimetype:";
///////////////////////////////////////////////////////////////////////////////
// MIME Types Datasource RDF Utils
function NC_URI(aProperty)
{
return "http://home.netscape.com/NC-rdf#" + aProperty;
}
function MIME_URI(aType)
{
return "urn:mimetype:" + aType;
}
function HANDLER_URI(aHandler)
{
return "urn:mimetype:handler:" + aHandler;
}
function APP_URI(aType)
{
return "urn:mimetype:externalApplication:" + aType;
}
var gDownloadActionsWindow = {
_tree : null,
_editButton : null,
_removeButton : null,
_actions : [],
_plugins : {},
_bundle : null,
_pref : Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch),
_mimeSvc : Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"]
.getService(Components.interfaces.nsIMIMEService),
_excludingPlugins : false,
_excludingMissingExtensions : false,
init: function ()
{
(this._editButton = document.getElementById("editFileHandler")).disabled = true;
(this._removeButton = document.getElementById("removeFileHandler")).disabled = true;
// Initialize the File Type list
this._bundle = document.getElementById("bundlePreferences");
this._tree = document.getElementById("fileHandlersList");
this._loadView();
// Determine any exclusions being applied - e.g. don't show types for which
// only a plugin handler exists, don't show types lacking extensions, etc.
this._view._rowCount = this._updateExclusions();
this._tree.treeBoxObject.view = this._view;
var indexToSelect = parseInt(this._tree.getAttribute("lastSelected"));
if (indexToSelect < this._tree.view.rowCount)
this._tree.view.selection.select(indexToSelect);
this._tree.focus();
},
_loadView: function ()
{
// Reset ALL the collections and state flags, because we can call this after
// the window has initially displayed by resetting the filter.
this._actions = [];
this._plugins = {};
this._view._filtered = false;
this._view._filterSet = [];
this._view._usingExclusionSet = false;
this._view._exclusionSet = [];
this._view._filterValue = "";
this._loadPluginData();
this._loadMIMERegistryData();
},
_updateRowCount: function (aNewRowCount)
{
var oldCount = this._view._rowCount;
this._view._rowCount = 0;
this._tree.treeBoxObject.rowCountChanged(0, -oldCount);
this._view._rowCount = aNewRowCount;
this._tree.treeBoxObject.rowCountChanged(0, aNewRowCount);
},
uninit: function ()
{
},
_updateExclusions: function ()
{
this._excludingPlugins = true;
this._excludingMissingExtensions = true;
this._view._exclusionSet = [].concat(this._actions);
if (this._excludingMissingExtensions) {
this._view._usingExclusionSet = true;
for (var i = 0; i < this._view._exclusionSet.length;) {
if (!this._view._exclusionSet[i].hasExtension)
this._view._exclusionSet.splice(i, 1);
else
++i;
}
}
if (this._excludingPlugins) {
this._view._usingExclusionSet = true;
for (i = 0; i < this._view._exclusionSet.length;) {
if (this._view._exclusionSet[i].handledOnlyByPlugin)
this._view._exclusionSet.splice(i, 1);
else
++i
}
}
return this._view._usingExclusionSet ? this._view._exclusionSet.length
: this._view._filtered ? this._view._filterSet.length
: this._actions.length;
},
_loadPluginData: function ()
{
},
_createAction: function (aMIMEType, aActionName,
aIsEditable, aHandleMode, aCustomHandler,
aPluginAvailable, aPluginEnabled,
aHandledOnlyByPlugin)
{
var newAction = !(aMIMEType in this._plugins);
var action = newAction ? new FileAction() : this._plugins[aMIMEType];
action.type = aMIMEType;
var info = this._mimeSvc.getFromTypeAndExtension(action.type, null);
// File Extension
try {
action.extension = info.primaryExtension;
}
catch (e) {
action.extension = this._bundle.getString("extensionNone");
action.hasExtension = false;
}
// Large and Small Icon
try {
action.smallIcon = "moz-icon://goat." + info.primaryExtension + "?size=16";
action.bigIcon = "moz-icon://goat." + info.primaryExtension + "?size=32";
}
catch (e) {
action.smallIcon = "moz-icon://goat?size=16&contentType=" + info.MIMEType;
action.bigIcon = "moz-icon://goat?contentType=" + info.MIMEType + "&size=32";
}
// Pretty Type Name
if (info.description == "") {
try {
action.typeName = this._bundle.getFormattedString("fileEnding", [info.primaryExtension.toUpperCase()]);
}
catch (e) {
// Wow, this sucks, just show the MIME type as a last ditch effort to display
// the type of file that this is.
action.typeName = info.MIMEType;
}
}
else
action.typeName = info.description;
// Pretty Action Name
if (aActionName)
action.action = aActionName;
action.pluginAvailable = aPluginAvailable;
action.pluginEnabled = aPluginEnabled;
action.editable = aIsEditable;
action.handleMode = aHandleMode;
action.customHandler = aCustomHandler;
action.mimeInfo = info;
action.handledOnlyByPlugin = aHandledOnlyByPlugin
if (newAction && !(action.handledOnlyByPlugin && !action.pluginEnabled)) {
this._actions.push(action);
this._plugins[action.type] = action;
}
return action;
},
_loadMIMEDS: function ()
{
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var file = fileLocator.get("UMimTyp", Components.interfaces.nsIFile);
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var fileHandler = ioService.getProtocolHandler("file")
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
this._mimeDS = this._rdf.GetDataSourceBlocking(fileHandler.getURLSpecFromFile(file));
},
_getLiteralValue: function (aResource, aProperty)
{
var property = this._rdf.GetResource(NC_URI(aProperty));
var value = this._mimeDS.GetTarget(aResource, property, true);
if (value)
return value.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
return "";
},
_getChildResource: function (aResource, aProperty)
{
var property = this._rdf.GetResource(NC_URI(aProperty));
return this._mimeDS.GetTarget(aResource, property, true);
},
_getDisplayNameForFile: function (aFile)
{
#ifdef XP_WIN
if (aFile instanceof Components.interfaces.nsILocalFileWin)
return aFile.getVersionInfoField("FileDescription");
#else
// XXXben - Read the bundle name on OS X.
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var url = ios.newFileURI(aFile).QueryInterface(Components.interfaces.nsIURL);
return url.fileName;
#endif
},
_loadMIMERegistryData: function ()
{
this._rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
this._loadMIMEDS();
var root = this._rdf.GetResource("urn:mimetypes:root");
var container = Components.classes["@mozilla.org/rdf/container;1"]
.createInstance(Components.interfaces.nsIRDFContainer);
container.Init(this._mimeDS, root);
var elements = container.GetElements();
while (elements.hasMoreElements()) {
var type = elements.getNext();
if (!(type instanceof Components.interfaces.nsIRDFResource))
break;
var editable = this._getLiteralValue(type, "editable") == "true";
if (!editable)
continue;
var handler = this._getChildResource(type, "handlerProp");
var alwaysAsk = this._getLiteralValue(handler, "alwaysAsk") == "true";
if (alwaysAsk)
continue;
var saveToDisk = this._getLiteralValue(handler, "saveToDisk") == "true";
var useSystemDefault = this._getLiteralValue(handler, "useSystemDefault") == "true";
var editable = this._getLiteralValue(type, "editable") == "true";
var handledInternally = this._getLiteralValue(handler, "handleInternal") == "true";
var externalApp = this._getChildResource(handler, "externalApplication");
var externalAppPath = this._getLiteralValue(externalApp, "path");
try {
var customHandler = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
customHandler.initWithPath(externalAppPath);
}
catch (e) {
customHandler = null;
}
var mimeType = this._getLiteralValue(type, "value");
var typeInfo = this._mimeSvc.getFromTypeAndExtension(mimeType, null);
// Determine the pretty name of the associated action.
var actionName = "";
var handleMode = 0;
if (saveToDisk) {
// Save the file to disk
actionName = this._bundle.getString("saveToDisk");
handleMode = FILEACTION_SAVE_TO_DISK;
}
else if (useSystemDefault) {
// Use the System Default handler
actionName = this._bundle.getFormattedString("openWith",
[typeInfo.defaultDescription]);
handleMode = FILEACTION_OPEN_DEFAULT;
}
else {
// Custom Handler
if (customHandler) {
actionName = this._bundle.getFormattedString("openWith",
[this._getDisplayNameForFile(customHandler)]);
handleMode = FILEACTION_OPEN_CUSTOM;
}
else {
// Corrupt datasource, invalid custom handler path. Revert to default.
actionName = this._bundle.getFormattedString("openWith",
[typeInfo.defaultDescription]);
handleMode = FILEACTION_OPEN_DEFAULT;
}
}
if (handledInternally)
handleMode = FILEACTION_OPEN_INTERNALLY;
var pluginAvailable = mimeType in this._plugins && this._plugins[mimeType].pluginAvailable;
var pluginEnabled = pluginAvailable && this._plugins[mimeType].pluginEnabled;
if (pluginEnabled) {
handleMode = FILEACTION_OPEN_PLUGIN;
actionName = null;
}
var action = this._createAction(mimeType, actionName, editable, handleMode,
customHandler, pluginAvailable, pluginEnabled,
false);
}
},
_view: {
_filtered : false,
_filterSet : [],
_usingExclusionSet : false,
_exclusionSet : [],
_filterValue : "",
_rowCount: 0,
get rowCount()
{
return this._rowCount;
},
get activeCollection ()
{
return this._filtered ? this._filterSet
: this._usingExclusionSet ? this._exclusionSet
: gDownloadActionsWindow._actions;
},
getItemAtIndex: function (aIndex)
{
return this.activeCollection[aIndex];
},
getCellText: function (aIndex, aColumn)
{
switch (aColumn.id) {
case "fileExtension":
return this.getItemAtIndex(aIndex).extension.toUpperCase();
case "fileType":
return this.getItemAtIndex(aIndex).typeName;
case "fileMIMEType":
return this.getItemAtIndex(aIndex).type;
case "fileHandler":
return this.getItemAtIndex(aIndex).action;
}
return "";
},
getImageSrc: function (aIndex, aColumn)
{
if (aColumn.id == "fileExtension")
return this.getItemAtIndex(aIndex).smallIcon;
return "";
},
_selection: null,
get selection () { return this._selection; },
set selection (val) { this._selection = val; return val; },
getRowProperties: function (aIndex, aProperties) {},
getCellProperties: function (aIndex, aColumn, aProperties) {},
getColumnProperties: function (aColumn, aProperties) {},
isContainer: function (aIndex) { return false; },
isContainerOpen: function (aIndex) { return false; },
isContainerEmpty: function (aIndex) { return false; },
isSeparator: function (aIndex) { return false; },
isSorted: function (aIndex) { return false; },
canDrop: function (aIndex, aOrientation) { return false; },
drop: function (aIndex, aOrientation) {},
getParentIndex: function (aIndex) { return -1; },
hasNextSibling: function (aParentIndex, aIndex) { return false; },
getLevel: function (aIndex) { return 0; },
getProgressMode: function (aIndex, aColumn) {},
getCellValue: function (aIndex, aColumn) {},
setTree: function (aTree) {},
toggleOpenState: function (aIndex) { },
cycleHeader: function (aColumn) {},
selectionChanged: function () {},
cycleCell: function (aIndex, aColumn) {},
isEditable: function (aIndex, aColumn) { return false; },
setCellValue: function (aIndex, aColumn, aValue) {},
setCellText: function (aIndex, aColumn, aValue) {},
performAction: function (aAction) {},
performActionOnRow: function (aAction, aIndex) {},
performActionOnCell: function (aAction, aindex, aColumn) {}
},
removeFileHandler: function ()
{
var selection = this._tree.view.selection;
if (selection.count < 1)
return;
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var flags = promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0;
flags += promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1;
var title = this._bundle.getString("removeTitle" + (selection.count > 1 ? "Multiple" : "Single"));
var message = this._bundle.getString("removeMessage" + (selection.count > 1 ? "Multiple" : "Single"));
var button = this._bundle.getString("removeButton" + (selection.count > 1 ? "Multiple" : "Single"));
rv = promptService.confirmEx(window, title, message, flags, button,
null, null, null, { value: 0 });
if (rv != 0)
return;
var rangeCount = selection.getRangeCount();
var lastSelected = 0;
var mimeDSDirty = false;
for (var i = 0; i < rangeCount; ++i) {
var min = { }; var max = { };
selection.getRangeAt(i, min, max);
for (var j = min.value; j <= max.value; ++j) {
var item = this._view.getItemAtIndex(j);
if (!item.handledOnlyByPlugin) {
// There is data for this type in the MIME registry, so make sure we
// remove it from the MIME registry. We don't disable the plugin here because
// if we do there's currently no way through the UI to re-enable it. We may
// come up with some sort of solution for that at a later date.
var typeRes = this._rdf.GetResource(MIME_URI(item.type));
var handlerRes = this._getChildResource(typeRes, "handlerProp");
var extAppRes = this._getChildResource(handlerRes, "externalApplication");
this._cleanResource(extAppRes);
this._cleanResource(handlerRes);
this._cleanResource(typeRes);
mimeDSDirty = true;
}
lastSelected = (j + 1) >= this._view.rowCount ? j-1 : j;
}
}
if (mimeDSDirty &&
this._mimeDS instanceof Components.interfaces.nsIRDFRemoteDataSource)
this._mimeDS.Flush();
// Just reload the list to make sure deletions are respected
this._loadView();
this._updateRowCount(this._updateExclusions());
selection.select(lastSelected);
},
_cleanResource: function (aResource)
{
var labels = this._mimeDS.ArcLabelsOut(aResource);
while (labels.hasMoreElements()) {
var arc = labels.getNext();
if (!(arc instanceof Components.interfaces.nsIRDFResource))
break;
var target = this._mimeDS.GetTarget(aResource, arc, true);
this._mimeDS.Unassert(aResource, arc, target);
}
},
_disablePluginForItem: function (aItem)
{
},
_enablePluginForItem: function (aItem)
{
},
_ensureMIMERegistryEntry: function (aItem)
{
var root = this._rdf.GetResource("urn:mimetypes:root");
var container = Components.classes["@mozilla.org/rdf/container;1"]
.createInstance(Components.interfaces.nsIRDFContainer);
container.Init(this._mimeDS, root);
var itemResource = this._rdf.GetResource(MIME_URI(aItem.type));
var handlerResource = null;
if (container.IndexOf(itemResource) == -1) {
container.AppendElement(itemResource);
this._setLiteralValue(itemResource, "editable", "true");
this._setLiteralValue(itemResource, "value", aItem.type);
handlerResource = this._rdf.GetResource(HANDLER_URI(aItem.type));
this._setLiteralValue(handlerResource, "alwaysAsk", "false");
var handlerProp = this._rdf.GetResource(NC_URI("handlerProp"));
this._mimeDS.Assert(itemResource, handlerProp, handlerResource, true);
var extAppResource = this._rdf.GetResource(APP_URI(aItem.type));
this._setLiteralValue(extAppResource, "path", "");
var extAppProp = this._rdf.GetResource(NC_URI("externalApplication"));
this._mimeDS.Assert(handlerResource, extAppProp, extAppResource, true);
}
else
handlerResource = this._getChildResource(itemResource, "handlerProp");
return handlerResource;
},
_setLiteralValue: function (aResource, aProperty, aValue)
{
var property = this._rdf.GetResource(NC_URI(aProperty));
var newValue = this._rdf.GetLiteral(aValue);
var oldValue = this._mimeDS.GetTarget(aResource, property, true);
if (oldValue)
this._mimeDS.Change(aResource, property, oldValue, newValue);
else
this._mimeDS.Assert(aResource, property, newValue, true);
},
editFileHandler: function ()
{
var selection = this._tree.view.selection;
if (selection.count != 1)
return;
var item = this._view.getItemAtIndex(selection.currentIndex);
openDialog("chrome://messenger/content/preferences/changeaction.xul",
"_blank", "modal,centerscreen", item);
// Update the database
switch (item.handleMode) {
case FILEACTION_OPEN_PLUGIN:
this._enablePluginForItem(item);
// We don't need to adjust the database because plugin settings always
// supercede whatever is in the db, leaving it untouched allows the last
// user setting(s) to be preserved if they ever revert.
break;
case FILEACTION_OPEN_DEFAULT:
this._disablePluginForItem(item);
var handlerRes = this._ensureMIMERegistryEntry(item);
this._setLiteralValue(handlerRes, "useSystemDefault", "true");
this._setLiteralValue(handlerRes, "saveToDisk", "false");
break;
case FILEACTION_OPEN_CUSTOM:
this._disablePluginForItem(item);
var handlerRes = this._ensureMIMERegistryEntry(item);
this._setLiteralValue(handlerRes, "useSystemDefault", "false");
this._setLiteralValue(handlerRes, "saveToDisk", "false");
var extAppRes = this._getChildResource(handlerRes, "externalApplication");
this._setLiteralValue(extAppRes, "path", item.customHandler.path);
break;
case FILEACTION_SAVE_TO_DISK:
this._disablePluginForItem(item);
var handlerRes = this._ensureMIMERegistryEntry(item);
this._setLiteralValue(handlerRes, "useSystemDefault", "false");
this._setLiteralValue(handlerRes, "saveToDisk", "true");
break;
}
if (this._mimeDS instanceof Components.interfaces.nsIRDFRemoteDataSource)
this._mimeDS.Flush();
// Update the view
this._tree.treeBoxObject.invalidateRow(selection.currentIndex);
},
onSelectionChanged: function ()
{
if (this._tree.view.rowCount == 0)
return;
var selection = this._tree.view.selection;
var selected = selection.count;
this._removeButton.disabled = selected == 0;
this._editButton.disabled = selected != 1;
var stringKey = selected > 1 ? "removeButtonMultiple" : "removeButtonSingle";
this._removeButton.label = this._bundle.getString(stringKey);
var canRemove = true;
var canEdit = true;
var rangeCount = selection.getRangeCount();
var min = { }, max = { };
var setLastSelected = false;
for (var i = 0; i < rangeCount; ++i) {
selection.getRangeAt(i, min, max);
for (var j = min.value; j <= max.value; ++j) {
if (!setLastSelected) {
// Set the last selected index to the first item in the selection
this._tree.setAttribute("lastSelected", j);
setLastSelected = true;
}
var item = this._view.getItemAtIndex(j);
if (item &&
(!item.editable || item.handleMode == FILEACTION_OPEN_INTERNALLY))
canEdit = false;
if (item &&
(!item.editable || item.handleMode == FILEACTION_OPEN_INTERNALLY ||
item.handledOnlyByPlugin))
canRemove = false;
}
}
if (!canRemove)
this._removeButton.disabled = true;
if (!canEdit)
this._editButton.disabled = true;
},
_lastSortProperty : "",
_lastSortAscending: false,
sort: function (aProperty)
{
var ascending = (aProperty == this._lastSortProperty) ? !this._lastSortAscending : true;
function sortByProperty(a, b)
{
return a[aProperty].toLowerCase().localeCompare(b[aProperty].toLowerCase());
}
function sortByExtension(a, b)
{
if (!a.hasExtension && b.hasExtension)
return 1;
if (!b.hasExtension && a.hasExtension)
return -1;
return a.extension.toLowerCase().localeCompare(b.extension.toLowerCase());
}
// Sort the Filtered List, if in Filtered mode
if (!this._view._filtered) {
this._view.activeCollection.sort(aProperty == "extension" ? sortByExtension : sortByProperty);
if (!ascending)
this._view.activeCollection.reverse();
}
this._view.selection.clearSelection();
this._view.selection.select(0);
this._tree.treeBoxObject.invalidate();
this._tree.treeBoxObject.ensureRowIsVisible(0);
this._lastSortAscending = ascending;
this._lastSortProperty = aProperty;
},
clearFilter: function ()
{
// Clear the Filter and the Tree Display
document.getElementById("filter").value = "";
this._view._filtered = false;
this._view._filterSet = [];
// Just reload the list to make sure deletions are respected
this._loadView();
this._updateRowCount(this._updateExclusions());
// Restore selection
this._view.selection.clearSelection();
for (i = 0; i < this._lastSelectedRanges.length; ++i) {
var range = this._lastSelectedRanges[i];
this._view.selection.rangedSelect(range.min, range.max, true);
}
this._lastSelectedRanges = [];
document.getElementById("actionsIntro").value = this._bundle.getString("actionsAll");
document.getElementById("clearFilter").disabled = true;
},
_actionMatchesFilter: function (aAction)
{
return aAction.extension.toLowerCase().indexOf(this._view._filterValue) != -1 ||
aAction.typeName.toLowerCase().indexOf(this._view._filterValue) != -1 ||
aAction.type.toLowerCase().indexOf(this._view._filterValue) != -1 ||
aAction.action.toLowerCase().indexOf(this._view._filterValue) != -1;
},
_filterActions: function (aFilterValue)
{
this._view._filterValue = aFilterValue;
var actions = [];
var collection = this._view._usingExclusionSet ? this._view._exclusionSet : this._actions;
for (var i = 0; i < collection.length; ++i) {
var action = collection[i];
if (this._actionMatchesFilter(action))
actions.push(action);
}
return actions;
},
_lastSelectedRanges: [],
_saveState: function ()
{
// Save selection
var seln = this._view.selection;
this._lastSelectedRanges = [];
var rangeCount = seln.getRangeCount();
for (var i = 0; i < rangeCount; ++i) {
var min = {}; var max = {};
seln.getRangeAt(i, min, max);
this._lastSelectedRanges.push({ min: min.value, max: max.value });
}
},
_filterTimeout: -1,
onFilterInput: function ()
{
if (this._filterTimeout != -1)
clearTimeout(this._filterTimeout);
function filterActions()
{
var filter = document.getElementById("filter").value;
if (filter == "") {
gDownloadActionsWindow.clearFilter();
return;
}
var view = gDownloadActionsWindow._view;
view._filterSet = gDownloadActionsWindow._filterActions(filter);
if (!view._filtered) {
// Save Display Info for the Non-Filtered mode when we first
// enter Filtered mode.
gDownloadActionsWindow._saveState();
view._filtered = true;
}
// Clear the display
gDownloadActionsWindow._updateRowCount(view._filterSet.length);
view.selection.select(0);
document.getElementById("actionsIntro").value = gDownloadActionsWindow._bundle.getString("actionsFiltered");
document.getElementById("clearFilter").disabled = false;
}
window.filterActions = filterActions;
this._filterTimeout = setTimeout("filterActions();", 500);
},
onFilterKeyPress: function (aEvent)
{
if (aEvent.keyCode == 27) // ESC key
this.clearFilter();
},
focusFilterBox: function ()
{
var filter = document.getElementById("filter");
filter.focus();
filter.select();
}
};

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

@ -0,0 +1,124 @@
<?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 Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css"?>
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % downloadactionsDTD SYSTEM "chrome://messenger/locale/preferences/downloadactions.dtd">
%brandDTD;
%downloadactionsDTD;
]>
<window id="DownloadActionsWindow" class="windowDialog"
windowtype="Preferences:DownloadActions"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="gDownloadActionsWindow.init();"
onunload="gDownloadActionsWindow.uninit();"
title="&downloadactionsWindow.title;"
width="480" height="310" persist="width height screenX screenY">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/actionsshared.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/preferences/downloadactions.js"/>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<keyset>
<key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
<key key="&focusSearch1.key;" modifiers="accel" oncommand="gDownloadActionsWindow.focusFilterBox();"/>
<key key="&focusSearch2.key;" modifiers="accel" oncommand="gDownloadActionsWindow.focusFilterBox();"/>
</keyset>
<vbox flex="1" class="contentPane">
<hbox align="center">
<label accesskey="&filter.accesskey;" control="filter">&filter.label;</label>
<textbox id="filter" flex="1" oninput="gDownloadActionsWindow.onFilterInput();"
onkeypress="gDownloadActionsWindow.onFilterKeyPress(event);"/>
<button id="clearFilter" label="&clear.label;" accesskey="&clear.accesskey;"
oncommand="gDownloadActionsWindow.clearFilter();" disabled="true"/>
</hbox>
<separator class="thin"/>
<label id="actionsIntro">&fileTypesDescription.label;</label>
<separator class="thin"/>
<tree id="fileHandlersList" flex="1"
lastSelected="0" persist="lastSelected"
onselect="gDownloadActionsWindow.onSelectionChanged();"
ondblclick="gDownloadActionsWindow.editFileHandler();">
<treechildren id="extensionChildren"/>
<treecols>
<treecol id="fileExtension" ignoreincolumnpicker="true"
class="sortDirectionIndicator" persist="width"
label="&fileExtensionColumn.label;" accesskey="&fileExtensionColumn.accesskey;"
onclick="gDownloadActionsWindow.sort('extension');"/>
<treecol id="fileType" flex="1"
class="sortDirectionIndicator" persist="width"
label="&fileTypeColumn.label;" accesskey="&fileTypeColumn.accesskey;"
onclick="gDownloadActionsWindow.sort('typeName');"/>
<splitter class="tree-splitter" />
<treecol id="fileMIMEType" flex="1" hidden="true"
class="sortDirectionIndicator" persist="width"
label="&fileMIMETypeColumn.label;" accesskey="&fileMIMETypeColumn.accesskey;"
onclick="gDownloadActionsWindow.sort('type');"/>
<splitter class="tree-splitter" />
<treecol id="fileHandler" flex="1"
class="sortDirectionIndicator" persist="width"
label="&fileHandlerColumn.label;" accesskey="&fileHandlerColumn.accesskey;"
onclick="gDownloadActionsWindow.sort('action');"/>
</treecols>
</tree>
</vbox>
<separator class="thin"/>
<hbox>
<hbox flex="1" class="actionButtons">
<button id="removeFileHandler"
label="&remove.label;" accesskey="&remove.accesskey;"
oncommand="gDownloadActionsWindow.removeFileHandler();"/>
<button id="editFileHandler"
label="&edit.label;" accesskey="&edit.accesskey;"
oncommand="gDownloadActionsWindow.editFileHandler();"/>
<spacer flex="1"/>
#ifndef XP_MACOSX
<button oncommand="close();"
label="&button.close.label;" accesskey="&button.close.accesskey;"/>
#endif
</hbox>
<resizer dir="bottomright"/>
</hbox>
</window>

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

@ -0,0 +1,178 @@
# -*- 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 Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
# Dan Mosedale <dmose@mozilla.org>
#
# 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 gDownloadsPane = {
chooseFolder: function ()
{
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
var bundlePreferences = document.getElementById("bundlePreferences");
var title = bundlePreferences.getString("chooseDownloadFolderTitle");
fp.init(window, title, nsIFilePicker.modeGetFolder);
const nsILocalFile = Components.interfaces.nsILocalFile;
var customDirPref = document.getElementById("browser.download.dir");
if (customDirPref.value)
fp.displayDirectory = customDirPref.value;
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
var file = fp.file.QueryInterface(nsILocalFile);
var currentDirPref = document.getElementById("browser.download.downloadDir");
customDirPref.value = currentDirPref.value = file;
var folderListPref = document.getElementById("browser.download.folderList");
folderListPref.value = this._fileToIndex(file);
}
},
onReadUseDownloadDir: function ()
{
var downloadFolder = document.getElementById("downloadFolder");
var chooseFolder = document.getElementById("chooseFolder");
var preference = document.getElementById("browser.download.useDownloadDir");
downloadFolder.disabled = !preference.value;
chooseFolder.disabled = !preference.value;
return undefined;
},
_fileToIndex: function (aFile)
{
if (!aFile || aFile.equals(this._getDownloadsFolder("Desktop")))
return 0;
else if (aFile.equals(this._getDownloadsFolder("Downloads")))
return 1;
return 2;
},
_indexToFile: function (aIndex)
{
switch (aIndex) {
case 0:
return this._getDownloadsFolder("Desktop");
case 1:
return this._getDownloadsFolder("Downloads");
}
var customDirPref = document.getElementById("browser.download.dir");
return customDirPref.value;
},
_getSpecialFolderKey: function (aFolderType)
{
#ifdef XP_WIN
return aFolderType == "Desktop" ? "DeskP" : "Pers";
#endif
#ifdef XP_MACOSX
return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs";
#endif
#ifdef XP_OS2
return aFolderType == "Desktop" ? "Desk" : "Home";
#endif
return "Home";
},
_getDownloadsFolder: function (aFolder)
{
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var dir = fileLocator.get(this._getSpecialFolderKey(aFolder),
Components.interfaces.nsILocalFile);
if (aFolder != "Desktop")
dir.append("My Downloads");
return dir;
},
_getDisplayNameOfFile: function (aFolder)
{
// TODO: would like to add support for 'Downloads on Macintosh HD'
// for OS X users.
return aFolder ? aFolder.path : "";
},
readDownloadDirPref: function ()
{
var folderListPref = document.getElementById("browser.download.folderList");
var bundlePreferences = document.getElementById("bundlePreferences");
var downloadFolder = document.getElementById("downloadFolder");
var customDirPref = document.getElementById("browser.download.dir");
var customIndex = customDirPref.value ? this._fileToIndex(customDirPref.value) : 0;
if (folderListPref.value == 0 || customIndex == 0)
downloadFolder.label = bundlePreferences.getString("desktopFolderName");
else if (folderListPref.value == 1 || customIndex == 1)
downloadFolder.label = bundlePreferences.getString("myDownloadsFolderName");
else
downloadFolder.label = this._getDisplayNameOfFile(customDirPref.value);
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var fph = ios.getProtocolHandler("file")
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
var currentDirPref = document.getElementById("browser.download.downloadDir");
var downloadDir = currentDirPref.value || this._indexToFile(folderListPref.value);
var urlspec = fph.getURLSpecFromFile(downloadDir);
downloadFolder.image = "moz-icon://" + urlspec + "?size=16";
return undefined;
},
writeFolderList: function ()
{
var currentDirPref = document.getElementById("browser.download.downloadDir");
return this._fileToIndex(currentDirPref.value);
},
showWhenStartingPrefChanged: function ()
{
var showWhenStartingPref = document.getElementById("browser.download.manager.showWhenStarting");
var closeWhenDonePref = document.getElementById("browser.download.manager.closeWhenDone");
closeWhenDonePref.disabled = !showWhenStartingPref.value;
},
readShowWhenStartingPref: function ()
{
this.showWhenStartingPrefChanged();
return undefined;
},
showFileTypeActions: function ()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/downloadactions.xul",
"", null);
},
};

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

@ -0,0 +1,106 @@
<?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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
# Scott MacGregor <mscott@mozilla.org>
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % downloadsDTD SYSTEM "chrome://messenger/locale/preferences/downloads.dtd">
%brandDTD;
%downloadsDTD;
]>
<overlay id="DownloadsPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneDownloads">
<preferences>
<preference id="browser.download.useDownloadDir" name="browser.download.useDownloadDir" type="bool"/>
<preference id="browser.download.folderList" name="browser.download.folderList" type="int"/>
<preference id="browser.download.downloadDir" name="browser.download.downloadDir" type="file"/>
<preference id="browser.download.dir" name="browser.download.dir" type="file"/>
<preference id="pref.downloads.disable_button.edit_actions"
name="pref.downloads.disable_button.edit_actions"
type="bool"/>
</preferences>
<script type="application/x-javascript" src="chrome://messenger/content/preferences/downloads.js"/>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<groupbox>
<caption label="&askOnSave.label;"/>
<radiogroup id="askOnSave" flex="1"
preference="browser.download.useDownloadDir"
onpreferenceread="return gDownloadsPane.onReadUseDownloadDir();">
<radio id="alwaysAsk" label="&alwaysAsk.label;" accesskey="&alwaysAsk.accesskey;" value="false"/>
<vbox flex="1">
<radio id="neverAsk" label="&neverAsk.label;" accesskey="&neverAsk.accesskey;" value="true"/>
<hbox class="indent" align="center">
<filefield id="downloadFolder" flex="1"
preference="browser.download.folderList"
preference-editable="true"
onpreferenceread="return gDownloadsPane.readDownloadDirPref();"
onpreferencewrite="return gDownloadsPane.writeFolderList()"/>
<button id="chooseFolder" oncommand="gDownloadsPane.chooseFolder();"
preference="browser.download.folderList"
onpreferencewrite="return gDownloadsPane.writeFolderList()"
#ifdef XP_MACSOX
accesskey="&chooseFolderMac.accesskey;" label="&chooseFolderMac.label;"/>
#else
accesskey="&chooseFolderWin.accesskey;" label="&chooseFolderWin.label;"/>
#endif
</hbox>
</vbox>
</radiogroup>
</groupbox>
<groupbox>
<caption label="&fileTypes.label;"/>
<description>&fileTypesDescription.label;</description>
<separator class="thin"/>
<hbox>
<button label="&configureActions.label;" accesskey="&configureActions.accesskey;"
oncommand="gDownloadsPane.showFileTypeActions();"
preference="pref.downloads.disable_button.edit_actions"/>
</hbox>
</groupbox>
</prefpane>
</overlay>

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

@ -0,0 +1,220 @@
# -*- Mode: Java; tab-width: 2; 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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
const kDefaultFontType = "font.default.%LANG%";
const kFontNameFmtSerif = "font.name.serif.%LANG%";
const kFontNameFmtSansSerif = "font.name.sans-serif.%LANG%";
const kFontNameFmtMonospace = "font.name.monospace.%LANG%";
const kFontNameListFmtSerif = "font.name-list.serif.%LANG%";
const kFontNameListFmtSansSerif = "font.name-list.sans-serif.%LANG%";
const kFontNameListFmtMonospace = "font.name-list.monospace.%LANG%";
const kFontSizeFmtVariable = "font.size.variable.%LANG%";
const kFontSizeFmtFixed = "font.size.fixed.%LANG%";
const kFontMinSizeFmt = "font.minimum-size.%LANG%";
var gFontsDialog = {
_selectLanguageGroup: function (aLanguageGroup)
{
var prefs = [{ format: kDefaultFontType, type: "string", element: "defaultFontType", fonttype: null},
{ format: kFontNameFmtSerif, type: "unichar", element: "serif", fonttype: "serif" },
{ format: kFontNameFmtSansSerif, type: "unichar", element: "sans-serif", fonttype: "sans-serif" },
{ format: kFontNameFmtMonospace, type: "unichar", element: "monospace", fonttype: "monospace" },
{ format: kFontNameListFmtSerif, type: "unichar", element: null, fonttype: "serif" },
{ format: kFontNameListFmtSansSerif, type: "unichar", element: null, fonttype: "sans-serif" },
{ format: kFontNameListFmtMonospace, type: "unichar", element: null, fonttype: "monospace" },
{ format: kFontSizeFmtVariable, type: "int", element: "sizeVar", fonttype: null },
{ format: kFontSizeFmtFixed, type: "int", element: "sizeMono", fonttype: null },
{ format: kFontMinSizeFmt, type: "int", element: "minSize", fonttype: null }];
var preferences = document.getElementById("fontPreferences");
for (var i = 0; i < prefs.length; ++i) {
var preference = document.getElementById(prefs[i].format.replace(/%LANG%/, aLanguageGroup));
if (!preference) {
preference = document.createElement("preference");
var name = prefs[i].format.replace(/%LANG%/, aLanguageGroup);
preference.id = name;
preference.setAttribute("name", name);
preference.setAttribute("type", prefs[i].type);
preferences.appendChild(preference);
}
if (!prefs[i].element)
continue;
var element = document.getElementById(prefs[i].element);
if (element) {
element.setAttribute("preference", preference.id);
if (prefs[i].fonttype)
FontBuilder.buildFontList(aLanguageGroup, prefs[i].fonttype, element);
preference.setElementValue(element);
}
}
},
readFontLanguageGroup: function ()
{
var languagePref = document.getElementById("font.language.group");
this._selectLanguageGroup(languagePref.value);
return undefined;
},
readFontSelection: function (aElement)
{
// Determine the appropriate value to select, for the following cases:
// - there is no setting
// - the font selected by the user is no longer present (e.g. deleted from
// fonts folder)
var preference = document.getElementById(aElement.getAttribute("preference"));
if (preference.value) {
var fontItems = aElement.getElementsByAttribute("value", preference.value);
// There is a setting that actually is in the list. Respect it.
if (fontItems.length > 0)
return undefined;
}
var defaultValue = aElement.firstChild.firstChild.getAttribute("value");
var languagePref = document.getElementById("font.language.group");
preference = document.getElementById("font.name-list." + aElement.id + "." + languagePref.value);
if (!preference || !preference.hasUserValue)
return defaultValue;
var fontNames = preference.value.split(",");
var stripWhitespace = /^\s*(.*)\s*$/;
for (var i = 0; i < fontNames.length; ++i) {
var fontName = fontNames[i].replace(stripWhitespace, "$1");
fontItems = aElement.getElementsByAttribute("value", fontName);
if (fontItems.length)
break;
}
if (fontItems.length)
return fontItems[0].getAttribute("value");
return defaultValue;
},
readUseDocumentFonts: function ()
{
var preference = document.getElementById("browser.display.use_document_fonts");
return preference.value == 1;
},
writeUseDocumentFonts: function ()
{
var useDocumentFonts = document.getElementById("useDocumentFonts");
return useDocumentFonts.checked ? 1 : 0;
},
readScreenResolution: function ()
{
// Initialize the display names of the default values the first time
// the preference is read. We can NOT do this in the init function since
// that is called after preference loading.
var defaultResolution = document.getElementById("defaultResolution");
if (defaultResolution.label == "") {
var bundlePreferences = document.getElementById("bundlePreferences");
var otherResolution = document.getElementById("otherResolution");
otherResolution.label = bundlePreferences.getFormattedString("fontScalingResolutionFormat",
[otherResolution.getAttribute("value")]);
defaultResolution.label = bundlePreferences.getFormattedString("fontScalingResolutionFormat",
[defaultResolution.getAttribute("value")]);
}
return undefined;
},
changeScreenResolution: function (aMenulist)
{
var userResolution = document.getElementById("userResolution");
var screenResolution = document.getElementById("screenResolution");
var lastSelected = screenResolution.getElementsByAttribute("lastSelected", "true")
if (lastSelected.length > 0)
lastSelected = lastSelected[0];
else {
var preference = document.getElementById("browser.display.screen_resolution");
lastSelected = screenResolution.getElementsByAttribute("value", preference.value);
if (lastSelected.length > 0)
lastSelected = lastSelected[0];
else
lastSelected = document.getElementById("defaultResolution");
}
if (aMenulist.selectedItem.value == "choose") {
var rv = { newdpi: -1 };
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/fontscaling.xul",
"", rv);
if (rv.newdpi != -1) {
this._setResolution(rv.newdpi);
lastSelected.removeAttribute("lastSelected");
screenResolution.selectedItem.setAttribute("lastSelected", "true");
}
else
screenResolution.selectedItem = lastSelected;
}
else if (!(screenResolution.value == userResolution.value)) {
// User has selected one of the hard-coded resolutions
userResolution.hidden = true;
lastSelected.removeAttribute("lastSelected");
screenResolution.selectedItem.setAttribute("lastSelected", "true");
}
},
_setResolution: function (aResolution)
{
// Given a number, if it's equal to a hard-coded resolution we use that,
// otherwise we set the userResolution field.
var screenResolution = document.getElementById("screenResolution");
var userResolution = document.getElementById("userResolution");
var items = screenResolution.getElementsByAttribute("value", aResolution);
if (items[0]) {
// If it's one of the hard-coded values, we'll select it directly
screenResolution.selectedItem = items[0];
userResolution.hidden = true;
}
else {
// Otherwise we need to set up the userResolution field
var bundlePreferences = document.getElementById("bundlePreferences");
var label = bundlePreferences.getFormattedString("fontScalingResolutionFormat",
[aResolution]);
userResolution.value = aResolution;
userResolution.label = label;
userResolution.hidden = false;
screenResolution.selectedItem = userResolution;
}
}
};

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

@ -0,0 +1,279 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<!DOCTYPE prefwindow [
<!ENTITY % fontsDTD SYSTEM "chrome://messenger/locale/preferences/fonts.dtd" >
%fontsDTD;
]>
<prefwindow id="FontsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&fontsDialog.title;"
dlgbuttons="accept,cancel"
style="width: 39em !important;">
<prefpane id="FontsDialogPane">
<preferences id="fontPreferences">
<preference id="font.language.group" name="font.language.group" type="wstring"/>
<preference id="browser.display.screen_resolution"
name="browser.display.screen_resolution"
type="int"/>
<preference id="browser.display.use_document_fonts"
name="browser.display.use_document_fonts"
type="int"/>
<preference id="intl.charset.default" name="intl.charset.default" type="wstring"/>
</preferences>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<script type="application/x-javascript" src="chrome://mozapps/content/preferences/fontbuilder.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/preferences/fonts.js"/>
<groupbox>
<caption>
<hbox align="center">
<label value="&language.label;" accesskey="&language.accesskey;" control="selectLangs"/>
</hbox>
<menulist id="selectLangs" onpreferenceread="return gFontsDialog.readFontLanguageGroup();"
preference="font.language.group">
<menupopup>
<menuitem value="x-western" label="&font.langGroup.latin1;"/>
<menuitem value="x-central-euro" label="&font.langGroup.latin2;"/>
<menuitem value="ja" label="&font.langGroup.japanese;"/>
<menuitem value="zh-TW" label="&font.langGroup.trad-chinese;"/>
<menuitem value="zh-CN" label="&font.langGroup.simpl-chinese;"/>
<menuitem value="zh-HK" label="&font.langGroup.trad-chinese-hk;"/>
<menuitem value="ko" label="&font.langGroup.korean;"/>
<menuitem value="x-cyrillic" label="&font.langGroup.cyrillic;"/>
<menuitem value="x-baltic" label="&font.langGroup.baltic;"/>
<menuitem value="el" label="&font.langGroup.el;"/>
<menuitem value="tr" label="&font.langGroup.turkish;"/>
<menuitem value="x-unicode" label="&font.langGroup.unicode;"/>
<menuitem value="x-user-def" label="&font.langGroup.user-def;"/>
<menuitem value="th" label="&font.langGroup.thai;"/>
<menuitem value="he" label="&font.langGroup.hebrew;"/>
<menuitem value="ar" label="&font.langGroup.arabic;"/>
<menuitem value="x-devanagari" label="&font.langGroup.devanagari;"/>
<menuitem value="x-tamil" label="&font.langGroup.tamil;"/>
</menupopup>
</menulist>
</caption>
<separator class="thin"/>
<grid>
<columns>
<column/>
<column flex="1"/>
<column/>
<column/>
</columns>
<rows>
<row>
<separator class="thin"/>
</row>
<row align="center">
<hbox align="center" pack="end">
<label accesskey="&proportional.accesskey;" control="proportionalFont">&proportional.label;</label>
</hbox>
<menulist id="defaultFontType" flex="1" style="width: 0px;">
<menupopup>
<menuitem value="serif" label="&useDefaultFontSerif.label;"/>
<menuitem value="sans-serif" label="&useDefaultFontSansSerif.label;"/>
</menupopup>
</menulist>
<hbox align="center" pack="end">
<label value="&sizes.label;"/>
</hbox>
<menulist id="sizeVar" class="small-margin">
<menupopup>
<menuitem value="8" label="8"/>
<menuitem value="9" label="9"/>
<menuitem value="10" label="10"/>
<menuitem value="11" label="11"/>
<menuitem value="12" label="12"/>
<menuitem value="13" label="13"/>
<menuitem value="14" label="14"/>
<menuitem value="15" label="15"/>
<menuitem value="16" label="16"/>
<menuitem value="17" label="17"/>
<menuitem value="18" label="18"/>
<menuitem value="20" label="20"/>
<menuitem value="22" label="22"/>
<menuitem value="24" label="24"/>
<menuitem value="26" label="26"/>
<menuitem value="28" label="28"/>
<menuitem value="30" label="30"/>
<menuitem value="32" label="32"/>
<menuitem value="34" label="34"/>
<menuitem value="36" label="36"/>
<menuitem value="40" label="40"/>
<menuitem value="44" label="44"/>
<menuitem value="48" label="48"/>
<menuitem value="56" label="56"/>
<menuitem value="64" label="64"/>
<menuitem value="72" label="72"/>
</menupopup>
</menulist>
</row>
<row align="center">
<hbox align="center" pack="end">
<label accesskey="&serif.accesskey;" control="serif">&serif.label;</label>
</hbox>
<menulist id="serif" flex="1" style="width: 0px;"
onpreferenceread="return gFontsDialog.readFontSelection(document.getElementById('serif'));"/>
<spacer/>
</row>
<row align="center">
<hbox align="center" pack="end">
<label accesskey="&sans-serif.accesskey;" control="sans-serif">&sans-serif.label;</label>
</hbox>
<menulist id="sans-serif" flex="1" style="width: 0px;"
onpreferenceread="return gFontsDialog.readFontSelection(document.getElementById('sans-serif'));"/>
<spacer/>
</row>
<row align="center">
<hbox align="center" pack="end">
<label accesskey="&monospace.accesskey;" control="monospace">&monospace.label;</label>
</hbox>
<menulist id="monospace" flex="1" style="width: 0px;" crop="right"
onpreferenceread="return gFontsDialog.readFontSelection(document.getElementById('monospace'));"/>
<hbox align="center" pack="end">
<label>&sizes.label;</label>
</hbox>
<menulist id="sizeMono" class="small-margin">
<menupopup>
<menuitem value="8" label="8"/>
<menuitem value="9" label="9"/>
<menuitem value="10" label="10"/>
<menuitem value="11" label="11"/>
<menuitem value="12" label="12"/>
<menuitem value="13" label="13"/>
<menuitem value="14" label="14"/>
<menuitem value="15" label="15"/>
<menuitem value="16" label="16"/>
<menuitem value="17" label="17"/>
<menuitem value="18" label="18"/>
<menuitem value="20" label="20"/>
<menuitem value="22" label="22"/>
<menuitem value="24" label="24"/>
<menuitem value="26" label="26"/>
<menuitem value="28" label="28"/>
<menuitem value="30" label="30"/>
<menuitem value="32" label="32"/>
<menuitem value="34" label="34"/>
<menuitem value="36" label="36"/>
<menuitem value="40" label="40"/>
<menuitem value="44" label="44"/>
<menuitem value="48" label="48"/>
<menuitem value="56" label="56"/>
<menuitem value="64" label="64"/>
<menuitem value="72" label="72"/>
</menupopup>
</menulist>
</row>
</rows>
</grid>
<separator class="thin"/>
<hbox flex="1">
<hbox align="center" pack="end">
<label accesskey="&resolution.accesskey;" control="screenResolution">&resolution.label;</label>
<menulist id="screenResolution"
oncommand="gFontsDialog.changeScreenResolution(this)"
preference="browser.display.screen_resolution"
onpreferenceread="return gFontsDialog.readScreenResolution();">
<menupopup>
<menuitem id="otherResolution" value="72"/>
<menuitem id="defaultResolution" value="96"/>
#ifdef XP_UNIX
#ifndef XP_MACOSX
<menuitem id="systemResolution" value="0" label="&resolution.system.label;"/>
#endif
#endif
<menuseparator id="resolutionSeparator"/>
<menuitem id="userResolution" hidden="true"/>
<menuitem id="chooseUserResolution" value="choose" label="&resolution.other;"/>
</menupopup>
</menulist>
</hbox>
<spacer flex="1"/>
<hbox align="center" pack="end">
<label accesskey="&minSize.accesskey;" control="minSize">&minSize.label;</label>
<menulist id="minSize">
<menupopup>
<menuitem value="0" label="&minSize.none;"/>
<menuitem value="9" label="9"/>
<menuitem value="10" label="10"/>
<menuitem value="11" label="11"/>
<menuitem value="12" label="12"/>
<menuitem value="13" label="13"/>
<menuitem value="14" label="14"/>
<menuitem value="15" label="15"/>
<menuitem value="16" label="16"/>
<menuitem value="17" label="17"/>
<menuitem value="18" label="18"/>
<menuitem value="20" label="20"/>
<menuitem value="22" label="22"/>
<menuitem value="24" label="24"/>
</menupopup>
</menulist>
</hbox>
</hbox>
<separator class="thin"/>
<hbox>
<checkbox id="useDocumentFonts"
label="&useDocumentFonts.label;" accesskey="&useDocumentFonts.accesskey;"
preference="browser.display.use_document_fonts"
onpreferenceread="return gFontsDialog.readUseDocumentFonts();"
onpreferencewrite="return gFontsDialog.writeUseDocumentFonts();"/>
</hbox>
</groupbox>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,203 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gGeneralPane = {
mPane: null,
mMapiBundle: null,
mBrandBundle: null,
mSound: null,
init: function ()
{
this.mPane = document.getElementById("paneGeneral");
this.mBrandBundle = document.getElementById("brandBundle");
this.mMapiBundle = document.getElementById("mapiBundle");
#ifdef XP_WIN
this.onReadDefaultMailPref();
this.onReadDefaultNewsPref();
this.onReadDefaultFeedPref();
#endif
#ifdef XP_MACOSX
document.getElementById("defaultClientBox").hidden = true;
#endif
#ifdef MOZ_WIDGET_GTK2
// first check whether GNOME is available. if it's not, hide the whole
// default mail/news app section.
var mapiReg;
try {
mapiReg = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
} catch (e) {}
if (!mapiReg)
document.getElementById("defaultClientBox").hidden = true;
#endif
},
#ifdef XP_WIN
onReadDefaultMailPref: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
document.getElementById('defaultMailClient').checked = mapiRegistry.isDefaultMailClient;
return mapiRegistry.isDefaultMailClient;
},
onWriteDefaultMailPref: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
var makeDefaultMailClient = document.getElementById('mail.checkDefaultMail').value;
if (mapiRegistry.isDefaultMailClient != makeDefaultMailClient)
mapiRegistry.isDefaultMailClient = makeDefaultMailClient;
},
onReadDefaultNewsPref: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
document.getElementById('defaultNewsClient').checked = mapiRegistry.isDefaultNewsClient;
return mapiRegistry.isDefaultNewsClient;
},
onWriteDefaultNewsPref: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
var makeDefaultNewsClient = document.getElementById('mail.checkDefaultNews').value;
if (mapiRegistry.isDefaultNewsClient != makeDefaultNewsClient)
mapiRegistry.isDefaultNewsClient = makeDefaultNewsClient;
},
onReadDefaultFeedPref: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
document.getElementById('defaultFeedClient').checked = mapiRegistry.isDefaultFeedClient;
return mapiRegistry.isDefaultFeedClient;
},
onWriteDefaultFeed: function()
{
var mapiRegistry = Components.classes["@mozilla.org/mapiregistry;1"].getService(Components.interfaces.nsIMapiRegistry);
var makeDefaultFeedClient = document.getElementById('mail.checkDefaultFeed').value;
if (mapiRegistry.isDefaultFeedClient != makeDefaultFeedClient)
mapiRegistry.isDefaultFeedClient = makeDefaultFeedClient;
},
#endif
#ifdef MOZ_WIDGET_GTK2
checkDefaultMailNow: function (isNews)
{
var mapiReg = Components.classes["@mozilla.org/mapiregistry;1"]
.getService(Components.interfaces.nsIMapiRegistry);
var brandShortName = this.mBrandBundle.getString("brandRealShortName");
var promptTitle = this.mMapiBundle.getFormattedString("dialogTitle",
[brandShortName]);
var promptMessage;
var IPS = Components.interfaces.nsIPromptService;
var prompt = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS);
var isDefault;
var str;
if (isNews)
{
isDefault = mapiReg.isDefaultNewsClient;
str = "News";
}
else
{
isDefault = mapiReg.isDefaultMailClient;
str = "Mail";
}
if (!isDefault)
{
promptMessage = this.mMapiBundle.getFormattedString("setDefault" + str,
[brandShortName]);
var rv = prompt.confirmEx(window, promptTitle, promptMessage,
(IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +
(IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
null, null, null, null, { });
if (rv == 0)
{
if (isNews)
mapiReg.isDefaultNewsClient = true;
else
mapiReg.isDefaultMailClient = true;
}
}
else
{
promptMessage = this.mMapiBundle.getFormattedString("alreadyDefault" + str,
[brandShortName]);
prompt.alert(window, promptTitle, promptMessage);
}
},
#endif
startPageCheck: function()
{
document.getElementById("mailnewsStartPageUrl").disabled = !document.getElementById("mailnewsStartPageEnabled").checked;
},
setHomePageToDefaultPage: function ()
{
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var pref = prefService.getDefaultBranch(null);
var url = pref.getComplexValue("mailnews.start_page.url",
Components.interfaces.nsIPrefLocalizedString).data;
var startPageUrlField = document.getElementById("mailnewsStartPageUrl");
startPageUrlField.value = url;
this.mPane.userChangedValue(startPageUrlField);
},
showConnections: function ()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/connection.xul",
"", null);
},
showAdvancedSound: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/notifications.xul",
"", null);
},
};

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

@ -0,0 +1,191 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % generalDTD SYSTEM "chrome://messenger/locale/preferences/general.dtd" >
%generalDTD;
]>
<overlay id="GeneralPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneGeneral" onpaneload="gGeneralPane.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/general.js"/>
<preferences>
<preference id="mail.checkDefaultMail"
name="mail.checkDefaultMail"
onchange="return gGeneralPane.onWriteDefaultMailPref();"
type="bool"/>
<preference id="mail.checkDefaultNews"
name="mail.checkDefaultNews"
onchange="return gGeneralPane.onWriteDefaultNewsPref();"
type="bool"/>
<preference id="mail.checkDefaultFeed"
name="mail.checkDefaultFeed"
onchange="return gGeneralPane.onWriteDefaultFeed();"
type="bool"/>
<preference id="mail.pane_config.dynamic" name="mail.pane_config.dynamic" type="int"/>
<preference id="mailnews.reuse_message_window" name="mailnews.reuse_message_window" type="bool"/>
<preference id="mailnews.start_page.enabled" name="mailnews.start_page.enabled" type="bool"/>
<preference id="mailnews.start_page.url" name="mailnews.start_page.url" type="wstring"/>
<preference id="mail.biff.show_alert" name="mail.biff.show_alert" type="bool"/>
<preference id="mail.biff.play_sound" name="mail.biff.play_sound" type="bool"/>
#ifdef XP_MACOSX
<preference id="mail.biff.animate_dock_icon" name="mail.biff.animate_dock_icon" type="bool"/>
#endif
</preferences>
<stringbundle id="mapiBundle" src="chrome://messenger-mapi/locale/mapi.properties"/>
<stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
<groupbox align="start" id="defaultClientBox">
<caption label="&generalSettings.caption;"/>
#ifdef XP_WIN
<label value="&generalSettings.label;"/>
<hbox class="indent">
<checkbox id="defaultMailClient" label="&setDefaultMailClient.label;"
accesskey="&setDefaultMailClient.accesskey;"
preference="mail.checkDefaultMail"/>
<checkbox id="defaultNewsClient" label="&setDefaultNewsClient.label;"
preference="mail.checkDefaultNews"
accesskey="&setDefaultNewsClient.accesskey;"/>
<checkbox id="defaultFeedClient" label="&setDefaultFeedClient.label;"
preference="mail.checkDefaultFeed"
accesskey="&setDefaultFeedClient.accesskey;"/>
</hbox>
#endif
#ifdef MOZ_WIDGET_GTK2
<vbox align="left">
<label value="&whenStartingCheck.label;"/>
<grid flex="1" style="margin-left: 20px;">
<columns>
<column/>
<column flex="1" align="left"/>
</columns>
<rows>
<row>
<checkbox id="checkDefaultMail" preference="mail.checkDefaultMail"
label="&mailApplication.label;"
accesskey="&checkDefaultMail.accesskey;"/>
<button label="&checkNow.label;" accesskey="&checkNow.accesskey;"
oncommand="gGeneralPane.checkDefaultMailNow(false)"/>
</row>
<row>
<checkbox id="checkDefaultNews" preference="mail.checkDefaultNews"
label="&newsApplication.label;"
accesskey="&checkDefaultNews.accesskey;"/>
<button label="&checkNow.label;" accesskey="&checkNow.accesskey;"
oncommand="gGeneralPane.checkDefaultMailNow(true)"/>
</row>
</rows>
</grid>
</vbox>
#endif
</groupbox>
<!--
<groupbox>
<caption label="&windowSettings.label;"/>
<label value="&selectWindowLayout.label;" accesskey="&selectWindowLayout.accesskey;" control="mailPaneConfig"/>
<hbox align="center" class="indent">
<radiogroup id="mailPaneConfig" preference="mail.pane_config.dynamic" orient="horizontal">
<radio class="mailPaneConfigIcon" value="0" id="classic"/>
<radio class="mailPaneConfigIcon" value="1" id="wide"/>
<radio class="mailPaneConfigIcon" value="2" id="vertical"/>
</radiogroup>
</hbox>
</groupbox>
-->
<groupbox>
<caption label="&messengerStartPage.label;"/>
<hbox align="start">
<checkbox id="mailnewsStartPageEnabled" label="&enableStartPage.label;"
preference="mailnews.start_page.enabled" oncommand="gGeneralPane.startPageCheck();"
accesskey="&enableStartPage.accesskey;"/>
</hbox>
<hbox align="center">
<label value="&location.label;" accesskey="&location.accesskey;" control="mailnewsStartPageUrl"/>
<textbox id="mailnewsStartPageUrl" flex="1" preference="mailnews.start_page.url"/>
<button label="&useDefault.label;" accesskey="&useDefault.accesskey;"
oncommand="gGeneralPane.setHomePageToDefaultPage();">
<observes element="mailnewsStartPageUrl" attribute="disabled"/>
</button>
</hbox>
</groupbox>
<groupbox flex="1">
<caption label="&newMessagesArrive.label;"/>
<checkbox id="newMailNotificationAlert" label="&showAnimatedAlert.label;"
preference="mail.biff.show_alert"
accesskey="&showAnimatedAlert.accesskey;"/>
#ifdef XP_MACOSX
<checkbox id="newMailNotificationBounce" label="&bounceSystemDockIcon.label;"
preference="mail.biff.animate_dock_icon"
accesskey="&bounceSystemDockIcon.accesskey;"/>
#endif
<hbox align="center" flex="1">
<checkbox id="newMailNotification" accesskey="&playSound.accesskey;"
preference="mail.biff.play_sound" label="&playSound.label;" flex="1"/>
<button label="&soundbutton.label;" accesskey="&soundbutton.accesskey;"
oncommand="gGeneralPane.showAdvancedSound();"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&connectionsInfo.caption;"/>
<hbox align="center">
<description flex="1">&proxiesInfo.label;</description>
<button id="catProxiesButton" label="&showConnections.label;"
accesskey="&showConnections.accesskey;"
oncommand="gGeneralPane.showConnections();"/>
</hbox>
</groupbox>
<separator/>
</prefpane>
</overlay>

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

@ -0,0 +1,82 @@
# -*- Mode: Java; tab-width: 2; 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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gHTMLComposeDialog = {
init: function ()
{
this.populateFonts();
},
populateFonts: function()
{
var fontsList = document.getElementById("FontSelect");
try
{
var enumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
.getService(Components.interfaces.nsIFontEnumerator);
var localFontCount = { value: 0 }
var localFonts = enumerator.EnumerateAllFonts(localFontCount);
for (var i = 0; i < localFonts.length; ++i)
{
if (localFonts[i] != "")
fontsList.appendItem(localFonts[i], localFonts[i]);
}
}
catch(e) { }
},
restoreDefaults: function()
{
// reset throws an exception if the pref value is already the default so
// work around that with some try/catch exception handling
try {
document.getElementById('msgcompose.font_face').reset();
} catch (ex) {}
try {
document.getElementById('msgcompose.font_size').reset();
} catch (ex) {}
try {
document.getElementById('msgcompose.text_color').reset();
} catch (ex) {}
try {
document.getElementById('msgcompose.background_color').reset();
} catch (ex) {}
},
};

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

@ -0,0 +1,118 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE prefwindow [
<!ENTITY % htmlComposeDTD SYSTEM "chrome://messenger/locale/preferences/htmlcompose.dtd">
%htmlComposeDTD;
<!ENTITY % editorOverlayDTD SYSTEM "chrome://editor/locale/editorOverlay.dtd">
%editorOverlayDTD;
]>
<prefwindow id="HTMLComposeDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel"
title="&dialog.title;">
<prefpane id="HTMLComposeDialogPane" onpaneload="gHTMLComposeDialog.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/htmlcompose.js"/>
<preferences>
<preference id="msgcompose.font_face" name="msgcompose.font_face" type="string"/>
<preference id="msgcompose.font_size" name="msgcompose.font_size" type="string"/>
<preference id="msgcompose.text_color" name="msgcompose.text_color" type="string"/>
<preference id="msgcompose.background_color" name="msgcompose.background_color" type="string"/>
</preferences>
<groupbox align="start">
<caption label="&defaultMessagesHeader.label;"/>
<vbox>
<hbox align="center">
<label control="FontSelect" value="&font.label;" accesskey="&font.accesskey;"/>
<menulist id="FontSelect" preference="msgcompose.font_face">
<menupopup>
<menuitem value="" label="&fontVarWidth.label;"/>
<menuitem value="tt" label="&fontFixedWidth.label;"/>
<menuseparator/>
<menuitem value="Helvetica, Arial, sans-serif" label="&fontHelveticaFont.label;"/>
<menuitem value="Times New Roman, Times, serif" label="&fontTimes.label;"/>
<menuitem value="Courier New, Courier, monospace" label="&fontCourier.label;"/>
<menuseparator/>
</menupopup>
</menulist>
</hbox>
<separator class="thin"/>
<hbox align="center">
<label control="fontSizeSelect" value="&size.label;" accesskey="&size.accesskey;"/>
<menulist id="fontSizeSelect" preference="msgcompose.font_size">
<menupopup>
<menuitem value="x-small" label="&size-x-smallCmd.label;"/>
<menuitem value="small" label="&size-smallCmd.label;"/>
<menuitem value="medium" label="&size-mediumCmd.label;"/>
<menuitem value="large" label="&size-largeCmd.label;"/>
<menuitem value="x-large" label="&size-x-largeCmd.label;"/>
<menuitem value="xx-large" label="&size-xx-largeCmd.label;"/>
</menupopup>
</menulist>
</hbox>
<separator class="thin"/>
<hbox align="center">
<label control="textColorButton" value="&fontColor.label;" accesskey="&fontColor.accesskey;"/>
<colorpicker type="button" id="textColorButton" preference="msgcompose.text_color"/>
<spring flex="1"/>
<label control="backgroundColorButton" value="&bgColor.label;" accesskey="&bgColor.accesskey;"/>
<colorpicker type="button" id="backgroundColorButton" preference="msgcompose.background_color"/>
</hbox>
<separator/>
<hbox align="center">
<description>&restoreDefaultsDescription.label;</description>
<spring flex="1"/>
<button label="&restoreDefaults.label;"
accesskey="&restoreDefaults.accesskey;"
oncommand="gHTMLComposeDialog.restoreDefaults();"/>
</hbox>
</vbox>
</groupbox>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,32 @@
messenger.jar:
* content/messenger/preferences/preferences.xul
* content/messenger/preferences/general.xul
* content/messenger/preferences/general.js
* content/messenger/preferences/display.xul
* content/messenger/preferences/display.js
* content/messenger/preferences/compose.xul
* content/messenger/preferences/compose.js
* content/messenger/preferences/sendoptions.xul
* content/messenger/preferences/sendoptions.js
* content/messenger/preferences/htmlcompose.xul
* content/messenger/preferences/htmlcompose.js
* content/messenger/preferences/privacy.xul
* content/messenger/preferences/privacy.js
* content/messenger/preferences/viewpasswords.js
* content/messenger/preferences/viewpasswords.xul
* content/messenger/preferences/advanced.js
* content/messenger/preferences/advanced.xul
* content/messenger/preferences/receipts.xul
* content/messenger/preferences/connection.js
* content/messenger/preferences/connection.xul
* content/messenger/preferences/downloads.js
* content/messenger/preferences/downloads.xul
* content/messenger/preferences/downloadactions.js
* content/messenger/preferences/downloadactions.xul
* content/messenger/preferences/actionsshared.js
* content/messenger/preferences/changeaction.js
* content/messenger/preferences/changeaction.xul
* content/messenger/preferences/fonts.js
* content/messenger/preferences/fonts.xul
* content/messenger/preferences/notifications.xul
* content/messenger/preferences/notifications.js

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

@ -0,0 +1,112 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gNotificationsDialog = {
mSound: null,
init: function()
{
},
convertURLToLocalFile: function(aFileURL)
{
// convert the file url into a nsILocalFile
if (aFileURL)
{
var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var fph = ios.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler);
return fph.getFileFromURLSpec(aFileURL);
}
else
return null;
},
readSoundLocation: function()
{
var soundUrlLocation = document.getElementById('soundUrlLocation');
soundUrlLocation.value = document.getElementById("mail.biff.play_sound.url").value;
soundUrlLocation.label = this.convertURLToLocalFile(soundUrlLocation.value).leafName;
soundUrlLocation.image = "moz-icon://" + soundUrlLocation.label + "?size=16";
return undefined;
},
previewSound: function ()
{
if (!this.mSound)
this.mSound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
var soundLocation;
soundLocation = document.getElementById('newMailNotificationType').value == 1 ?
document.getElementById("soundUrlLocation").value : "_moz_mailbeep"
if (soundLocation.indexOf("file://") == -1)
this.mSound.playSystemSound(soundLocation);
else
{
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
this.mSound.play(ioService.newURI(soundLocation, null, null));
}
},
browseForSoundFile: function ()
{
const nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
// if we already have a sound file, then use the path for that sound file
// as the initial path in the dialog.
var localFile = this.convertURLToLocalFile(document.getElementById('soundUrlLocation').value);
if (localFile)
fp.displayDirectory = localFile;
// XXX todo, persist the last sound directory and pass it in
// XXX todo filter by .wav
fp.init(window, document.getElementById("bundlePreferences").getString("soundFilePickerTitle"), nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterAll);
var ret = fp.show();
if (ret == nsIFilePicker.returnOK)
{
var mailnewsSoundFileUrl = document.getElementById("soundUrlLocation");
// convert the nsILocalFile into a nsIFile url
// mailnewsSoundFileUrl.value = fp.fileURL.spec;
document.getElementById("mail.biff.play_sound.url").value = fp.fileURL.spec;
this.readSoundLocation(); // XXX We shouldn't have to be doing this by hand
}
},
};

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

@ -0,0 +1,95 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://messenger/content/preferences/preferences.css"?>
<!DOCTYPE prefwindow [
<!ENTITY % notificationsDTD SYSTEM "chrome://messenger/locale/preferences/notifications.dtd">
%notificationsDTD;
]>
<prefwindow id="SoundNotificationsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel"
style="width: 30em !important;"
title="&notificationsDialog.title;">
<prefpane id="NotificationsDialogPane" onpaneload="gNotificationsDialog.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/notifications.js"/>
<preferences>
<preference id="mail.biff.play_sound.type" name="mail.biff.play_sound.type" type="int"/>
<preference id="mail.biff.play_sound.url" name="mail.biff.play_sound.url" type="string"/>
</preferences>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<groupbox>
<caption label="&soundNotification.caption;"/>
<radiogroup id="newMailNotificationType" preference="mail.biff.play_sound.type" orient="vertical">
<radio value="0" label="&systemsound.label;"
accesskey="&systemsound.accesskey;" id="system"/>
<radio value="1" label="&customsound.label;"
accesskey="&customsound.accesskey;" id="custom"/>
</radiogroup>
<vbox>
<spacer flex="1"/>
<hbox class="indent">
<filefield id="soundUrlLocation" flex="1" preference="mail.biff.play_sound.url"
preference-editable="true"
onpreferenceread="return gNotificationsDialog.readSoundLocation();"/>
<button id="browse" label="&browse.label;"
accesskey="&browse.accesskey;" oncommand="gNotificationsDialog.browseForSoundFile();"/>
</hbox>
<separator class="thin"/>
<hbox align="right">
<button id="preview" label="&preview.label;"
accesskey="&preview.accesskey;" oncommand="gNotificationsDialog.previewSound();"/>
</hbox>
</vbox>
</groupbox>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,85 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % preferencesDTD SYSTEM "chrome://messenger/locale/preferences/preferences.dtd">
%brandDTD;
%preferencesDTD;
]>
<prefwindow type="prefwindow"
id="MailPreferences"
windowtype="Mail:Preferences"
#ifdef XP_WIN
title="&prefWindow.titleWin;"
#else
#ifdef XP_UNIX
#ifndef XP_MACOSX
title="&prefWindow.titleGNOME;"
#endif
#endif
#endif
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
#ifdef XP_WIN
style="&prefWindow.styleWin;">
#else
#ifdef XP_MACOSX
style="&prefWindow.styleMac;">
#else
style="&prefWindow.styleUnix;">
#endif
#endif
<prefpane id="paneGeneral" label="&paneGeneral.title;"
src="chrome://messenger/content/preferences/general.xul"/>
<prefpane id="paneDisplay" label="&paneDisplay.title;"
src="chrome://messenger/content/preferences/display.xul"/>
<prefpane id="paneCompose" label="&paneComposition.title;"
src="chrome://messenger/content/preferences/compose.xul"/>
<prefpane id="panePrivacy" label="&panePrivacy.title;"
src="chrome://messenger/content/preferences/privacy.xul"/>
<prefpane id="paneDownloads" label="&paneAttachments.title;"
src="chrome://messenger/content/preferences/downloads.xul"/>
<prefpane id="paneAdvanced" label="&paneAdvanced.title;"
src="chrome://messenger/content/preferences/advanced.xul"/>
</prefwindow>

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

@ -0,0 +1,140 @@
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gPrivacyPane = {
mPane: null,
mInitialized: false,
init: function ()
{
this.mPane = document.getElementById("panePrivacy");
this.updateRemoteImagesState();
// Update the MP buttons
this.updateMasterPasswordButton();
var preference = document.getElementById("mail.preferences.privacy.selectedTabIndex");
if (preference.value)
document.getElementById("privacyPrefs").selectedIndex = preference.value;
this.mInitialized = true;
},
tabSelectionChanged: function ()
{
if (this.mInitialized)
{
var preference = document.getElementById("mail.preferences.privacy.selectedTabIndex");
preference.valueFromPreferences = document.getElementById("privacyPrefs").selectedIndex;
}
},
updateRemoteImagesState: function()
{
var checkbox = document.getElementById('networkImageDisableImagesInMailNews');
if (checkbox.checked)
{
document.getElementById('useWhiteList').removeAttribute('disabled');
document.getElementById('whiteListAbURI').removeAttribute('disabled');
}
else
{
document.getElementById('useWhiteList').setAttribute('disabled', 'true');
document.getElementById('whiteListAbURI').setAttribute('disabled', 'true');
}
},
initReencryptCallback: function()
{
var wallet = Components.classes['@mozilla.org/wallet/wallet-service;1'];
wallet = wallet.getService().QueryInterface(Components.interfaces.nsIWalletService);
wallet.WALLET_InitReencryptCallback(window);
},
viewPasswords: function()
{
document.documentElement.openSubDialog("chrome://messenger/content/preferences/viewpasswords.xul",
"", null);
},
changeMasterPassword: function ()
{
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/changemp.xul",
"", null);
this.updateMasterPasswordButton();
},
updateMasterPasswordButton: function ()
{
// See if there's a master password and set the button label accordingly
var secmodDB = Components.classes["@mozilla.org/security/pkcs11moduledb;1"]
.getService(Components.interfaces.nsIPKCS11ModuleDB);
var slot = secmodDB.findSlotByName("");
if (slot) {
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
var status = slot.status;
var noMP = status == nsIPKCS11Slot.SLOT_UNINITIALIZED ||
status == nsIPKCS11Slot.SLOT_READY;
var bundle = document.getElementById("bundlePreferences");
var button = document.getElementById("setMasterPassword");
button.label = bundle.getString(noMP ? "setMasterPassword" : "changeMasterPassword");
var removeButton = document.getElementById("removeMasterPassword");
removeButton.disabled = noMP;
}
},
removeMasterPassword: function ()
{
var secmodDB = Components.classes["@mozilla.org/security/pkcs11moduledb;1"]
.getService(Components.interfaces.nsIPKCS11ModuleDB);
if (secmodDB.isFIPSEnabled)
{
var bundle = document.getElementById("bundlePreferences");
promptService.alert(window,
bundle.getString("pw_change_failed_title"),
bundle.getString("pw_change2empty_in_fips_mode"));
}
else
{
document.documentElement.openSubDialog("chrome://mozapps/content/preferences/removemp.xul",
"", null);
this.updateMasterPasswordButton();
document.getElementById("setMasterPassword").focus();
}
},
};

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

@ -0,0 +1,169 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org
#
# 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 overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
<!ENTITY % privacyDTD SYSTEM "chrome://messenger/locale/preferences/privacy.dtd">
%brandDTD;
%privacyDTD;
]>
<overlay id="PrivacyPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<prefpane id="panePrivacy" onpaneload="gPrivacyPane.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/privacy.js"/>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<preferences>
<preference id="mail.preferences.privacy.selectedTabIndex"
name="mail.preferences.privacy.selectedTabIndex" type="int"/>
<preference id="mailnews.message_display.disable_remote_image"
name="mailnews.message_display.disable_remote_image"
type="bool"/>
<preference id="mailnews.message_display.disable_remote_images.useWhitelist"
name="mailnews.message_display.disable_remote_images.useWhitelist"
type="bool"/>
<preference id="mailnews.message_display.disable_remote_images.whiteListAbURI"
name="mailnews.message_display.disable_remote_images.whiteListAbURI"
type="string"/>
<preference id="javascript.allow.mailnews"
name="javascript.allow.mailnews" inverted="true"
type="bool"/>
<preference id="mail.phishing.detection.enabled"
name="mail.phishing.detection.enabled"
type="bool"/>
<preference id="wallet.crypto"
name="wallet.crypto"
type="bool"/>
<preference id="pref.privacy.disable_button.view_passwords"
name="pref.privacy.disable_button.view_passwords"
type="bool"/>
</preferences>
<tabbox id="privacyPrefs" flex="1" onselect="gPrivacyPane.tabSelectionChanged();">
<tabs>
<tab label="&itemGeneral.label;"/>
<tab label="&itemPhishing.label;"/>
<tab label="&itemPasswords.label;"/>
</tabs>
<tabpanels flex="1">
<!-- General -->
<tabpanel orient="vertical">
<checkbox id="networkImageDisableImagesInMailNews"
label="&disableImageInMailNews.label;" accesskey="&disableImageInMailNews.accesskey;"
preference="mailnews.message_display.disable_remote_image"
oncommand="gPrivacyPane.updateRemoteImagesState();"/>
<hbox class="indent">
<checkbox id="useWhiteList"
preference="mailnews.message_display.disable_remote_images.useWhitelist"
label="&allowRemoteImagesForFriends.label;" accesskey="&allowRemoteImagesForFriends.accesskey;"/>
<menulist id="whiteListAbURI" flex="1"
preference="mailnews.message_display.disable_remote_images.whiteListAbURI">
<menupopup id="abPopup-menupopup" ref="moz-abdirectory://"
datasources="rdf:addressdirectory"
sortActive="true"
sortDirection="ascending"
sortResource="http://home.netscape.com/NC-rdf#DirTreeNameSort">
<template>
<rule nc:IsWriteable="false"/>
<rule nc:IsMailList="false">
<menuitem uri="..."
label="rdf:http://home.netscape.com/NC-rdf#DirName"
value="rdf:http://home.netscape.com/NC-rdf#DirUri"/>
</rule>
</template>
</menupopup>
</menulist>
</hbox>
<separator class="thin"/>
<checkbox id="javascriptAllowMailNews"
label="&enbJsCheckMailNews.label;" accesskey="&enbJsCheckMailNews.accesskey;"
preference="javascript.allow.mailnews"/>
</tabpanel>
<!-- Phishing Detector -->
<tabpanel orient="vertical">
<description>&phishingDetector.intro;</description>
<class separator="thin"/>
<checkbox id="enablePhishingDetector"
label="&enablePhishingDetector.label;" accesskey="&enablePhishingDetector.accesskey;"
preference="mail.phishing.detection.enabled"/>
</tabpanel>
<!-- Password -->
<tabpanel orient="vertical">
<description>&savedPasswords.intro;</description>
<checkbox id="encryptEnabled" label="&encryptEnabled.label;" accesskey="&encryptEnabled.accesskey;"
preference="wallet.crypto" oncommand="gPrivacyPane.initReencryptCallback();"/>
<separator/>
<hbox align="start">
<description flex="1">&masterPassword.intro;</description>
<vbox>
<button id="setMasterPassword"
label="&setMasterPassword.label;" accesskey="&setMasterPassword.accesskey;"
oncommand="gPrivacyPane.changeMasterPassword();"/>
<button id="removeMasterPassword"
label="&removeMasterPassword.label;" accesskey="&removeMasterPassword.accesskey;"
oncommand="gPrivacyPane.removeMasterPassword();"/>
</vbox>
</hbox>
<separator flex="1"/>
<hbox>
<button label="&viewPasswords.label;" accesskey="&viewPasswords.accesskey;"
oncommand="gPrivacyPane.viewPasswords();"
preference="pref.privacy.disable_button.view_passwords"/>
</hbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</overlay>

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

@ -0,0 +1,129 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE prefwindow [
<!ENTITY % receiptsDTD SYSTEM "chrome://messenger/locale/preferences/receipts.dtd">
%receiptsDTD;
]>
<prefwindow id="ReturnReceiptsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel"
title="&dialog.title;">
<prefpane id="ReturnReceiptsDialogPane">
<preferences>
<preference id="mail.receipt.request_return_receipt_on" name="mail.receipt.request_return_receipt_on" type="bool"/>
<preference id="mail.incorporate.return_receipt" name="mail.incorporate.return_receipt" type="int"/>
<preference id="mail.mdn.report.enabled" name="mail.mdn.report.enabled" type="bool"/>
<preference id="mail.mdn.report.not_in_to_cc" name="mail.mdn.report.not_in_to_cc" type="int"/>
<preference id="mail.mdn.report.outside_domain" name="mail.mdn.report.outside_domain" type="int"/>
<preference id="mail.mdn.report.other" name="mail.mdn.report.other" type="int"/>
</preferences>
<vbox id="returnReceiptSettings" align="start">
<checkbox id="alwaysRequest" label="&requestReceipt.label;"
preference="mail.receipt.request_return_receipt_on"
accesskey="&requestReceipt.accesskey;"/>
</vbox>
<separator class="thin"/>
<separator class="groove"/>
<separator class="thin"/>
<description>&receiptArrive.label;</description>
<radiogroup id="receiptFolder" class="indent" preference="mail.incorporate.return_receipt">
<radio value="0" label="&leaveIt.label;" accesskey="&leaveIt.accesskey;"/>
<radio value="1" label="&moveToSent.label;" accesskey="&moveToSent.accesskey;"/>
</radiogroup>
<separator class="thin"/>
<separator class="groove"/>
<separator class="thin"/>
<description>&requestMDN.label;</description>
<radiogroup id="receiptSend" class="indent" preference="mail.mdn.report.enabled" oncommand="EnableDisableAllowedReceipts();">
<radio value="false" label="&never.label;" accesskey="&never.accesskey;"/>
<radio value="true" label="&returnSome.label;" accesskey="&returnSome.accesskey;"/>
<grid class="indent">
<columns>
<column/>
<column/>
</columns>
<rows>
<row align="center">
<label id="notInToCcLabel" accesskey="&notInToCc.accesskey;" control="notInToCcPref" value="&notInToCc.label;"/>
<menulist id="notInToCcPref" preference="mail.mdn.report.not_in_to_cc">
<menupopup>
<menuitem value="0" label="&neverSend.label;"/>
<menuitem value="1" label="&alwaysSend.label;"/>
<menuitem value="2" label="&askMe.label;"/>
</menupopup>
</menulist>
</row>
<row align="center">
<label id="outsideDomainLabel" accesskey="&outsideDomain.accesskey;"
control="outsideDomainPref" value="&outsideDomain.label;"/>
<menulist id="outsideDomainPref" preference="mail.mdn.report.outside_domain">
<menupopup>
<menuitem value="0" label="&neverSend.label;"/>
<menuitem value="1" label="&alwaysSend.label;"/>
<menuitem value="2" label="&askMe.label;"/>
</menupopup>
</menulist>
</row>
<row align="center">
<label id="otherCasesLabel" accesskey="&otherCases.accesskey;" control="otherCasesPref"
value="&otherCases.label;"/>
<menulist id="otherCasesPref" preference="mail.mdn.report.other">
<menupopup>
<menuitem value="0" label="&neverSend.label;"/>
<menuitem value="1" label="&alwaysSend.label;"/>
<menuitem value="2" label="&askMe.label;"/>
</menupopup>
</menulist>
</row>
</rows>
</grid>
</radiogroup>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,151 @@
# -*- Mode: Java; tab-width: 2; 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 Thunderbird Preferences System.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 gSendOptionsDialog = {
mPrefsBundle: null,
mHTMLListBox: null,
mPlainTextListBox: null,
init: function ()
{
this.mPrefsBundle = document.getElementById('bundlePreferences');
this.mHTMLListBox = document.getElementById('html_domains');
this.mPlainTextListBox = document.getElementById('plaintext_domains');
var htmlDomainPrefString = document.getElementById('mailnews.html_domains').value;
this.loadDomains(document.getElementById('mailnews.html_domains').value,
this.mHTMLListBox);
this.loadDomains(document.getElementById('mailnews.plaintext_domains').value,
this.mPlainTextListBox);
},
saveDomainPref: function(aHTML)
{
var listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
var num_domains = 0;
var pref_string = "";
for (var item = listbox.firstChild; item != null; item = item.nextSibling)
{
var domainid = item.getAttribute('label');
if (domainid.length > 1)
{
num_domains++;
//separate >1 domains by commas
if (num_domains > 1)
pref_string = pref_string + "," + domainid;
else
pref_string = domainid;
}
}
return pref_string;
},
loadDomains: function (aPrefString, aListBox)
{
var arrayOfPrefs = aPrefString.split(',');
if (arrayOfPrefs)
for (var i = 0; i < arrayOfPrefs.length; i++)
{
var str = arrayOfPrefs[i].replace(/ /g,"");
if (str)
this.addItemToDomainList(aListBox, str);
}
},
removeDomains: function(aHTML)
{
var listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
var currentIndex = listbox.currentIndex;
while (listbox.selectedItems.length > 0)
listbox.removeChild(listbox.selectedItems[0]);
document.getElementById('SendOptionsDialogPane').userChangedValue(listbox);
},
addDomain: function (aHTML)
{
var listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
var domainName;
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
if (promptService)
{
var result = {value:null};
if (promptService.prompt(window, this.mPrefsBundle.getString(listbox.id + 'AddDomainTitle'),
this.mPrefsBundle.getString(listbox.id + 'AddDomain'), result, null, {value:0}))
domainName = result.value.replace(/ /g,"");
}
if (domainName && !this.domainAlreadyPresent(domainName))
{
this.addItemToDomainList(listbox, domainName);
document.getElementById('SendOptionsDialogPane').userChangedValue(listbox);
}
},
domainAlreadyPresent: function(aDomainName)
{
var matchingDomains = this.mHTMLListBox.getElementsByAttribute('label', aDomainName);
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
if (!matchingDomains.length)
matchingDomains = this.mPlainTextListBox.getElementsByAttribute('label', aDomainName);
if (matchingDomains.length)
{
promptService.alert(window, this.mPrefsBundle.getString('domainNameErrorTitle'),
this.mPrefsBundle.getFormattedString("domainDuplicationError", [aDomainName]));
}
return matchingDomains.length;
},
addItemToDomainList: function (aListBox, aDomainTitle)
{
var item = document.createElement('listitem');
item.setAttribute('label', aDomainTitle);
aListBox.appendChild(item);
},
};

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

@ -0,0 +1,130 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 2; 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 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):
# Scott MacGregor <mscott@mozilla.org>
#
# 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 *****
<?xml-stylesheet href="chrome://global/skin/"?>
<!DOCTYPE prefwindow [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % sendOptionsDTD SYSTEM "chrome://messenger/locale/preferences/sendoptions.dtd" >
%sendOptionsDTD;
]>
<prefwindow id="SendOptionsDialog" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel"
style="height: 33em;"
title="&dialog.title;">
<prefpane id="SendOptionsDialogPane" onpaneload="gSendOptionsDialog.init();">
<script type="application/x-javascript" src="chrome://messenger/content/preferences/sendoptions.js"/>
<stringbundle id="bundlePreferences" src="chrome://messenger/locale/preferences/preferences.properties"/>
<preferences>
<preference id="mail.default_html_action" name="mail.default_html_action" type="int"/>
<preference id="mailnews.html_domains" name="mailnews.html_domains" type="string"/>
<preference id="mailnews.plaintext_domains" name="mailnews.plaintext_domains" type="string"/>
</preferences>
<groupbox>
<caption label="&sendMail.title;"/>
<description width="1">&sendMaildesc.label;</description>
<hbox class="indent" id="thenBox">
<menulist id="mailDefaultHTMLAction" preftype="int" preference="mail.default_html_action">
<menupopup>
<menuitem value="0" label="&askMe.label;" accesskey="&askMe.accesskey;"/>
<menuitem value="1" label="&convertPlain.label;" accesskey="&convertPlain.accesskey;"/>
<menuitem value="2" label="&sendHTML.label;" accesskey="&sendHTML.accesskey;"/>
<menuitem value="3" label="&sendBoth.label;" accesskey="&sendBoth.accesskey;"/>
</menupopup>
</menulist>
</hbox>
<separator class="thin"/>
<description>&override.label;</description>
</groupbox>
<separator class="thin"/>
<tabbox>
<tabs id="sendOptionsTabs">
<tab label="&HTMLTab.label;" accesskey="&HTMLTab.accesskey;"/>
<tab label="&PlainTextTab.label;" accesskey="&PlainTextTab.accesskey;"/>
</tabs>
<tabpanels id="sendOptionsTabsPanels" flex="1">
<vbox index="HTML">
<description width="1">&domaindesc.label;</description>
<hbox>
<listbox id="html_domains" flex="1" seltype="multiple" rows="5"
preference="mailnews.html_domains" onpreferencewrite="return gSendOptionsDialog.saveDomainPref(true);"
onkeypress="if (event.keyCode == 8 || event.keyCode == 46) gSendOptionsDialog.removeDomains(true);"/>
<vbox>
<button label="&AddButton.label;" oncommand="gSendOptionsDialog.addDomain(true);" accesskey="&AddHtmlDomain.accesskey;"/>
<button label="&DeleteButton.label;" oncommand="gSendOptionsDialog.removeDomains(true);" accesskey="&DeleteHtmlDomain.accesskey;"/>
</vbox>
</hbox>
</vbox>
<vbox index="plainText">
<description width="1">&domaindesc.label;</description>
<hbox>
<listbox id="plaintext_domains" flex="1" seltype="multiple" rows="5"
preference="mailnews.plaintext_domains" onpreferencewrite="return gSendOptionsDialog.saveDomainPref(false);"
onkeypress="if (event.keyCode == 8 || event.keyCode == 46) gSendOptionsDialog.removeDomains(false);"/>
<vbox>
<button label="&AddButton.label;" oncommand="gSendOptionsDialog.addDomain(false);" accesskey="&AddPlainText.accesskey;"/>
<button label="&DeleteButton.label;" oncommand="gSendOptionsDialog.removeDomains(false);" accesskey="&DeletePlainText.accesskey;"/>
</vbox>
</hbox>
</vbox>
</tabpanels>
</tabbox>
<separator/>
</prefpane>
</prefwindow>

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

@ -0,0 +1,600 @@
# -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
#
# ***** 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 Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben "Count XULula" Goodger
# Brian Ryner <bryner@brianryner.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 *****
/*** =================== INITIALISATION CODE =================== ***/
var kObserverService;
var kSignonBundle;
var gSelectUserInUse = false;
// interface variables
var passwordmanager = null;
// password-manager lists
var signons = [];
var rejects = [];
var deletedSignons = [];
var deletedRejects = [];
var showingPasswords = false;
function Startup() {
// xpconnect to password manager interfaces
passwordmanager = Components.classes["@mozilla.org/passwordmanager;1"].getService(Components.interfaces.nsIPasswordManager);
kSignonBundle = document.getElementById("signonBundle");
// be prepared to reload the display if anything changes
kObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
kObserverService.addObserver(signonReloadDisplay, "signonChanged", false);
// be prepared to disable the buttons when selectuser dialog is in use
kObserverService.addObserver(signonReloadDisplay, "signonSelectUser", false);
signonsTree = document.getElementById("signonsTree");
rejectsTree = document.getElementById("rejectsTree");
// set initial password-manager tab
var tabBox = document.getElementById("tabbox");
tabBox.selectedTab = document.getElementById("signonsTab");
// label the show/hide password button and the close button
document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords");
document.documentElement.getButton("accept").label = kSignonBundle.getString("close");
// load password manager items
if (!LoadSignons()) {
return; /* user failed to unlock the database */
}
LoadRejects();
}
function Shutdown() {
kObserverService.removeObserver(signonReloadDisplay, "signonChanged");
kObserverService.removeObserver(signonReloadDisplay, "signonSelectUser");
}
var signonReloadDisplay = {
observe: function(subject, topic, state) {
if (topic == "signonChanged") {
if (state == "signons") {
signons.length = 0;
if (lastSignonSortColumn == "host") {
lastSignonSortAscending = !lastSignonSortAscending; // prevents sort from being reversed
}
LoadSignons();
} else if (state == "rejects") {
rejects.length = 0;
if (lastRejectSortColumn == "host") {
lastRejectSortAscending = !lastRejectSortAscending; // prevents sort from being reversed
}
LoadRejects();
}
} else if (topic == "signonSelectUser") {
if (state == "suspend") {
gSelectUserInUse = true;
document.getElementById("removeSignon").disabled = true;
document.getElementById("removeAllSignons").disabled = true;
document.getElementById("togglePasswords").disabled = true;
} else if (state == "resume") {
gSelectUserInUse = false;
var selections = GetTreeSelections(signonsTree);
if (selections.length > 0) {
document.getElementById("removeSignon").disabled = false;
}
if (signons.length > 0) {
document.getElementById("removeAllSignons").disabled = false;
document.getElementById("togglePasswords").disabled = false;
}
} else if (state == "inUse") {
gSelectUserInUse = true;
}
}
}
}
/*** =================== SAVED SIGNONS CODE =================== ***/
var signonsTreeView = {
rowCount : 0,
setTree : function(tree) {},
getImageSrc : function(row,column) {},
getProgressMode : function(row,column) {},
getCellValue : function(row,column) {},
getCellText : function(row,column) {
var rv="";
if (column.id=="siteCol") {
rv = signons[row].host;
} else if (column.id=="userCol") {
rv = signons[row].user;
} else if (column.id=="passwordCol") {
rv = signons[row].password;
}
return rv;
},
isSeparator : function(index) { return false; },
isSorted : function() { return false; },
isContainer : function(index) { return false; },
cycleHeader : function(column) {},
getRowProperties : function(row,prop) {},
getColumnProperties : function(column,prop) {},
getCellProperties : function(row,column,prop) {}
};
var signonsTree;
function Signon(number, host, user, rawuser, password) {
this.number = number;
this.host = host;
this.user = user;
this.rawuser = rawuser;
this.password = password;
}
function LoadSignons() {
// loads signons into table
var enumerator = passwordmanager.enumerator;
var count = 0;
while (enumerator.hasMoreElements()) {
var nextPassword;
try {
nextPassword = enumerator.getNext();
} catch(e) {
/* user supplied invalid database key */
window.close();
return false;
}
nextPassword = nextPassword.QueryInterface(Components.interfaces.nsIPassword);
var host = nextPassword.host;
var user;
var password;
// try/catch in case decryption fails (invalid signon entry)
try {
user = nextPassword.user;
password = nextPassword.password;
} catch (e) {
// hide this entry
dump("could not decrypt user/password for host " + host + "\n");
continue;
}
var rawuser = user;
// if no username supplied, try to parse it out of the url
if (user == "") {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
try {
user = ioService.newURI(host, null, null).username;
if (user == "") {
user = kSignonBundle.getString('noUserNameForPassword');
}
} catch(e) {
user = kSignonBundle.getString('noUserNameForPassword');
}
}
signons[count] = new Signon(count++, host, user, rawuser, password);
}
signonsTreeView.rowCount = signons.length;
// sort and display the table
signonsTree.treeBoxObject.view = signonsTreeView;
SignonColumnSort('host');
// disable "remove all signons" button if there are no signons
var element = document.getElementById("removeAllSignons");
var toggle = document.getElementById("togglePasswords");
if (signons.length == 0 || gSelectUserInUse) {
element.setAttribute("disabled","true");
toggle.setAttribute("disabled","true");
} else {
element.removeAttribute("disabled");
toggle.removeAttribute("disabled");
}
return true;
}
function SignonSelected() {
var selections = GetTreeSelections(signonsTree);
if (selections.length && !gSelectUserInUse) {
document.getElementById("removeSignon").removeAttribute("disabled");
}
}
function DeleteSignon() {
DeleteSelectedItemFromTree(signonsTree, signonsTreeView,
signons, deletedSignons,
"removeSignon", "removeAllSignons");
FinalizeSignonDeletions();
}
function DeleteAllSignons() {
DeleteAllFromTree(signonsTree, signonsTreeView,
signons, deletedSignons,
"removeSignon", "removeAllSignons");
FinalizeSignonDeletions();
}
function TogglePasswordVisible() {
if (!showingPasswords && !ConfirmShowPasswords())
return;
showingPasswords = !showingPasswords;
document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords");
document.getElementById("passwordCol").hidden = !showingPasswords;
}
function AskUserShowPasswords() {
var prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var dummy = { value: false };
// Confirm the user wants to display passwords
return prompter.confirmEx(window,
null,
kSignonBundle.getString("noMasterPasswordPrompt"),
prompter.BUTTON_TITLE_YES * prompter.BUTTON_POS_0 + prompter.BUTTON_TITLE_NO * prompter.BUTTON_POS_1,
null, null, null, null, dummy) == 0; // 0=="Yes" button
}
function ConfirmShowPasswords() {
// This doesn't harm if passwords are not encrypted
var tokendb = Components.classes["@mozilla.org/security/pk11tokendb;1"]
.createInstance(Components.interfaces.nsIPK11TokenDB);
var token = tokendb.getInternalKeyToken();
// If there is no master password, still give the user a chance to opt-out of displaying passwords
if (token.checkPassword(""))
return AskUserShowPasswords();
// So there's a master password. But since checkPassword didn't succeed, we're logged out (per nsIPK11Token.idl).
try {
// Relogin and ask for the master password.
token.login(true); // 'true' means always prompt for token password. User will be prompted until
// clicking 'Cancel' or entering the correct password.
} catch (e) {
// An exception will be thrown if the user cancels the login prompt dialog.
// User is also logged out of Software Security Device.
}
return token.isLoggedIn();
}
function FinalizeSignonDeletions() {
for (var s=0; s<deletedSignons.length; s++) {
passwordmanager.removeUser(deletedSignons[s].host, deletedSignons[s].rawuser);
}
deletedSignons.length = 0;
}
function HandleSignonKeyPress(e) {
if (e.keyCode == 46) {
DeleteSignonSelected();
}
}
var lastSignonSortColumn = "";
var lastSignonSortAscending = false;
function SignonColumnSort(column) {
lastSignonSortAscending =
SortTree(signonsTree, signonsTreeView, signons,
column, lastSignonSortColumn, lastSignonSortAscending);
lastSignonSortColumn = column;
}
/*** =================== REJECTED SIGNONS CODE =================== ***/
var rejectsTreeView = {
rowCount : 0,
setTree : function(tree){},
getImageSrc : function(row,column) {},
getProgressMode : function(row,column) {},
getCellValue : function(row,column) {},
getCellText : function(row,column){
var rv="";
if (column.id=="rejectCol") {
rv = rejects[row].host;
}
return rv;
},
isSeparator : function(index) {return false;},
isSorted: function() { return false; },
isContainer : function(index) {return false;},
cycleHeader : function(column) {},
getRowProperties : function(row,prop){},
getColumnProperties : function(column,prop){},
getCellProperties : function(row,column,prop){}
};
var rejectsTree;
function Reject(number, host) {
this.number = number;
this.host = host;
}
function LoadRejects() {
var enumerator = passwordmanager.rejectEnumerator;
var count = 0;
while (enumerator.hasMoreElements()) {
var nextReject = enumerator.getNext();
nextReject = nextReject.QueryInterface(Components.interfaces.nsIPassword);
var host = nextReject.host;
rejects[count] = new Reject(count++, host);
}
rejectsTreeView.rowCount = rejects.length;
// sort and display the table
rejectsTree.treeBoxObject.view = rejectsTreeView;
RejectColumnSort('host');
var element = document.getElementById("removeAllRejects");
if (rejects.length == 0) {
element.setAttribute("disabled","true");
} else {
element.removeAttribute("disabled");
}
}
function RejectSelected() {
var selections = GetTreeSelections(rejectsTree);
if (selections.length) {
document.getElementById("removeReject").removeAttribute("disabled");
}
}
function DeleteReject() {
DeleteSelectedItemFromTree(rejectsTree, rejectsTreeView,
rejects, deletedRejects,
"removeReject", "removeAllRejects");
FinalizeRejectDeletions();
}
function DeleteAllRejects() {
DeleteAllFromTree(rejectsTree, rejectsTreeView,
rejects, deletedRejects,
"removeReject", "removeAllRejects");
FinalizeRejectDeletions();
}
function FinalizeRejectDeletions() {
for (var r=0; r<deletedRejects.length; r++) {
passwordmanager.removeReject(deletedRejects[r].host);
}
deletedRejects.length = 0;
}
function HandleRejectKeyPress(e) {
if (e.keyCode == 46) {
DeleteRejectSelected();
}
}
var lastRejectSortColumn = "";
var lastRejectSortAscending = false;
function RejectColumnSort(column) {
lastRejectSortAscending =
SortTree(rejectsTree, rejectsTreeView, rejects,
column, lastRejectSortColumn, lastRejectSortAscending);
lastRejectSortColumn = column;
}
/*** =================== GENERAL CODE =================== ***/
// Remove whitespace from both ends of a string
function TrimString(string)
{
if (!string) {
return "";
}
return string.replace(/(^\s+)|(\s+$)/g, '')
}
function DeleteAllFromTree
(tree, view, table, deletedTable, removeButton, removeAllButton) {
// remove all items from table and place in deleted table
for (var i=0; i<table.length; i++) {
deletedTable[deletedTable.length] = table[i];
}
table.length = 0;
// clear out selections
view.selection.select(-1);
// update the tree view and notify the tree
view.rowCount = 0;
var box = tree.treeBoxObject;
box.rowCountChanged(0, -deletedTable.length);
box.invalidate();
// disable buttons
document.getElementById(removeButton).setAttribute("disabled", "true")
document.getElementById(removeAllButton).setAttribute("disabled","true");
}
function DeleteSelectedItemFromTree
(tree, view, table, deletedTable, removeButton, removeAllButton) {
var box = tree.treeBoxObject;
// Remove selected items from list (by setting them to null) and place in
// deleted list. At the same time, notify the tree of the row count changes.
var selection = box.view.selection;
var oldSelectStart = table.length;
box.beginUpdateBatch();
var selCount = selection.getRangeCount();
var min = new Object();
var max = new Object();
for (var s = 0; s < selCount; ++s) {
selection.getRangeAt(s, min, max);
var minVal = min.value;
var maxVal = max.value;
oldSelectStart = minVal < oldSelectStart ? minVal : oldSelectStart;
var rowCount = maxVal - minVal + 1;
view.rowCount -= rowCount;
box.rowCountChanged(minVal, -rowCount);
for (var i = minVal; i <= maxVal; ++i) {
deletedTable[deletedTable.length] = table[i];
table[i] = null;
}
}
// collapse list by removing all the null entries
for (var j = 0; j < table.length; ++j) {
if (!table[j]) {
var k = j;
while (k < table.length && !table[k])
k++;
table.splice(j, k-j);
}
}
box.endUpdateBatch();
// update selection and/or buttons
var removeButton = document.getElementById(removeButton);
var removeAllButton = document.getElementById(removeAllButton);
if (table.length) {
removeButton.removeAttribute("disabled");
removeAllButton.removeAttribute("disabled");
selection.select(oldSelectStart < table.length ? oldSelectStart : table.length - 1);
} else {
removeButton.setAttribute("disabled", "true");
removeAllButton.setAttribute("disabled", "true");
}
}
function GetTreeSelections(tree) {
var selections = [];
var select = tree.view.selection;
if (select) {
var count = select.getRangeCount();
var min = new Object();
var max = new Object();
for (var i=0; i<count; i++) {
select.getRangeAt(i, min, max);
for (var k=min.value; k<=max.value; k++) {
if (k != -1) {
selections[selections.length] = k;
}
}
}
}
return selections;
}
function SortTree(tree, view, table, column, lastSortColumn, lastSortAscending, updateSelection) {
// remember which item was selected so we can restore it after the sort
var selections = GetTreeSelections(tree);
var selectedNumber = selections.length ? table[selections[0]].number : -1;
// determine if sort is to be ascending or descending
var ascending = (column == lastSortColumn) ? !lastSortAscending : true;
// do the sort
var compareFunc;
if (ascending) {
compareFunc = function compare(first, second) {
return CompareLowerCase(first[column], second[column]);
}
} else {
compareFunc = function compare(first, second) {
return CompareLowerCase(second[column], first[column]);
}
}
table.sort(compareFunc);
// restore the selection
var selectedRow = -1;
if (selectedNumber>=0 && updateSelection) {
for (var s=0; s<table.length; s++) {
if (table[s].number == selectedNumber) {
// update selection
// note: we need to deselect before reselecting in order to trigger ...Selected()
tree.view.selection.select(-1);
tree.view.selection.select(s);
selectedRow = s;
break;
}
}
}
// display the results
tree.treeBoxObject.invalidate();
if (selectedRow >= 0) {
tree.treeBoxObject.ensureRowIsVisible(selectedRow)
}
return ascending;
}
/**
* Case insensitive string comparator.
*/
function CompareLowerCase(first, second) {
var firstLower = first.toLowerCase();
var secondLower = second.toLowerCase();
if (firstLower < secondLower) {
return -1;
}
if (firstLower > secondLower) {
return 1;
}
return 0;
}

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

@ -0,0 +1,121 @@
<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil -*- -->
# ***** 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 Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger
# Brian Ryner <bryner@brianryner.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 *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/preferences/viewpasswords.dtd" >
<prefwindow id="SignonViewerDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept"
onload="Startup();" onunload="Shutdown();"
title="&windowtitle.label;"
persist="width height screenX screenY">
<prefpane id="SignonViewerDialogPane">
<script src="chrome://messenger/content/preferences/viewpasswords.js"/>
<stringbundle id="signonBundle"
src="chrome://communicator/locale/wallet/SignonViewer.properties"/>
<tabbox id="tabbox" flex="1">
<tabs>
<tab id="signonsTab" label="&tab.signonsstored.label;"/>
<tab id="signonsitesTab" label="&tab.signonsnotstored.label;"/>
</tabs>
<tabpanels id="panel" flex="1">
<!-- saved signons -->
<vbox id="savedsignons" flex="1">
<description>&spiel.signonsstored.label;</description>
<separator class="thin"/>
<tree id="signonsTree" flex="1" style="height: 20em;" hidecolumnpicker="true"
onkeypress="HandleSignonKeyPress(event)"
onselect="SignonSelected();">
<treecols>
<treecol id="siteCol" label="&treehead.site.label;" flex="5"
onclick="SignonColumnSort('host');" persist="width"/>
<splitter class="tree-splitter"/>
<treecol id="userCol" label="&treehead.username.label;" flex="2"
onclick="SignonColumnSort('user');" persist="width"/>
<splitter class="tree-splitter"/>
<treecol id="passwordCol" label="&treehead.password.label;" flex="2"
onclick="SignonColumnSort('password');" persist="width"
hidden="true"/>
</treecols>
<treechildren/>
</tree>
<separator class="thin"/>
<hbox>
<button id="removeSignon" disabled="true"
label="&remove.label;" oncommand="DeleteSignon();"/>
<button id="removeAllSignons"
label="&removeall.label;"
oncommand="DeleteAllSignons();"/>
<spacer flex="1"/>
<button id="togglePasswords"
oncommand="TogglePasswordVisible();"/>
</hbox>
</vbox>
<!-- rejected signon sites -->
<vbox id="rejectedsites" flex="1">
<description>&spiel.signonsnotstored.label;</description>
<separator class="thin"/>
<tree id="rejectsTree" flex="1" style="height: 10em;" hidecolumnpicker="true"
onkeypress="HandleRejectKeyPress(event)"
onselect="RejectSelected();">
<treecols>
<treecol id="rejectCol" label="&treehead.site.label;" flex="5"
onclick="RejectColumnSort('host');"/>
</treecols>
<treechildren/>
</tree>
<separator class="thin"/>
<hbox>
<button id="removeReject" disabled="true"
label="&remove.label;" oncommand="DeleteReject();"/>
<button id="removeAllRejects"
label="&removeall.label;"
oncommand="DeleteAllRejects();"/>
</hbox>
</vbox>
</tabpanels>
</tabbox>
</prefpane>
</prefwindow>