Rework pref panels to make them look better given the new look of prefs under the new toolkit.

In particular, get rid of the notifications panel, move it under General.
Refactor the labels panel and return receipts under a unified 'Advanced' panel.

As a short term hack, expose the proxy connection prefs in the privacy panel until I can make room for it in
another panel.
This commit is contained in:
scott%scott-macgregor.org 2003-05-20 02:26:20 +00:00
Родитель 46bd47de9e
Коммит 6fc516071c
8 изменённых файлов: 303 добавлений и 126 удалений

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

@ -0,0 +1,112 @@
function Startup()
{
var startupFunc;
try {
startupFunc = document.getElementById("mailnewsEnableMapi").getAttribute('startupFunc');
}
catch (ex) {
startupFunc = null;
}
if (startupFunc)
eval(startupFunc);
StartPageCheck();
// now do some Notification panel startup work:
PlaySoundCheck();
// if we don't have the alert service, hide the pref UI for using alerts to notify on new mail
// see bug #158711
var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert");
newMailNotificationAlertUI.hidden = !("@mozilla.org/alerts-service;1" in Components.classes);
}
function setColorWell(menu)
{
// Find the colorWell and colorPicker in the hierarchy.
var colorWell = menu.firstChild.nextSibling;
var colorPicker = menu.firstChild.nextSibling.nextSibling.firstChild;
// Extract color from colorPicker and assign to colorWell.
var color = colorPicker.getAttribute('color');
colorWell.style.backgroundColor = color;
}
function StartPageCheck()
{
var checked = document.getElementById("mailnewsStartPageEnabled").checked;
document.getElementById("mailnewsStartPageUrl").disabled = !checked;
}
function setHomePageToDefaultPage(folderFieldId)
{
var homePageField = document.getElementById(folderFieldId);
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefs = prefService.getDefaultBranch(null);
var url = prefs.getComplexValue("mailnews.start_page.url",
Components.interfaces.nsIPrefLocalizedString).data;
homePageField.value = url;
}
function PlaySoundCheck()
{
var playSound = document.getElementById("newMailNotification").checked;
var playSoundType = document.getElementById("newMailNotificationType");
playSoundType.disabled = !playSound;
var disableCustomUI = !(playSound && playSoundType.value == 1);
var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl");
mailnewsSoundFileUrl.disabled = disableCustomUI
document.getElementById("preview").disabled = disableCustomUI || (mailnewsSoundFileUrl.value == "");
document.getElementById("browse").disabled = disableCustomUI;
}
function onCustomWavInput()
{
document.getElementById("preview").disabled = (document.getElementById("mailnewsSoundFileUrl").value == "");
}
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function Browse()
{
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
// XXX todo, persist the last sound directory and pass it in
// XXX todo filter by .wav
fp.init(window, document.getElementById("browse").getAttribute("filepickertitle"), nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterAll);
var ret = fp.show();
if (ret == nsIFilePicker.returnOK) {
var mailnewsSoundFileUrl = document.getElementById("mailnewsSoundFileUrl");
mailnewsSoundFileUrl.value = fp.file.path;
}
onCustomWavInput();
}
var gSound = null;
function PreviewSound()
{
var soundURL = document.getElementById("mailnewsSoundFileUrl").value;
if (!gSound)
gSound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
if (soundURL.indexOf("file://") == -1) {
// XXX todo see if we can create a nsIURL from the native file path
// otherwise, play a system sound
gSound.playSystemSound(soundURL);
}
else {
var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURL);
url.spec = soundURL;
gSound.play(url)
}
}

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

@ -27,7 +27,10 @@ Contributor(s):
<?xml-stylesheet href="chrome://messenger/skin/prefPanels.css" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://messenger/locale/pref-mailnews.dtd">
<!DOCTYPE overlay [
<!ENTITY % dtd1 SYSTEM "chrome://messenger/locale/pref-mailnews.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://messenger/locale/pref-notifications.dtd" > %dtd2;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://messenger/content/pref-mailnews.xul');"
@ -35,10 +38,15 @@ Contributor(s):
<script type="application/x-javascript" src="chrome://messenger/content/pref-mailnews.js"/>
<!-- temporarily remove mailPaneConfig from the element IDs list -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["mailnewsConfirmMoveFoldersToTrash",
"mailnewsStartPageEnabled", "mailnewsStartPageUrl", "mailPaneConfig"];
"mailnewsStartPageEnabled", "mailnewsStartPageUrl",
"mailnewsSoundFileUrl", "newMailNotification", "newMailNotificationType",
"newMailNotificationAlert"];
]]>
</script>
@ -75,8 +83,7 @@ Contributor(s):
<label value="&location.label;" accesskey="&location.accesskey;"
control="mailnewsStartPageUrl"/>
<textbox id="mailnewsStartPageUrl" flex="1" preftype="localizedstring"
type="autocomplete" prefstring="mailnews.start_page.url"
searchSessions="history" timeout="50" maxrows="6" class="uri-element"/>
prefstring="mailnews.start_page.url"/>
</hbox>
<hbox pack="end">
@ -87,6 +94,9 @@ Contributor(s):
</hbox>
</groupbox>
<!-- Temporarily hide the window setting for the alternate 3-pane until we can
create more room for it in the prefs panel.
<groupbox>
<caption label="&windowSettings.label;"/>
@ -99,5 +109,38 @@ Contributor(s):
</radiogroup>
</hbox>
</groupbox>
-->
<groupbox>
<caption label="&newMessagesArrive.label;"/>
<hbox align="center">
<checkbox id="newMailNotificationAlert" label="&showAnimatedAlert.label;"
prefstring="mail.biff.show_alert"
accesskey="&showAnimatedAlert.accesskey;" />
</hbox>
<checkbox id="newMailNotification" accesskey="&playSound.accesskey;"
prefstring="mail.biff.play_sound" label="&playSound.label;"
oncommand="PlaySoundCheck()"/>
<hbox align="center" class="indent">
<radiogroup id="newMailNotificationType" prefstring="mail.biff.play_sound.type" orient="vertical">
<radio class="iconic" value="0" oncommand="PlaySoundCheck()" label="&systemsound.label;" id="system"/>
<radio class="iconic" value="1" oncommand="PlaySoundCheck()" label="&customsound.label;" id="custom"/>
</radiogroup>
</hbox>
<hbox align="center" class="indent">
<textbox flex="1" oninput="onCustomWavInput()" id="mailnewsSoundFileUrl" preftype="string"
prefstring="mail.biff.play_sound.url"/>
<hbox autostretch="never">
<button id="browse" label="&browse.label;" filepickertitle="&browse.title;"
accesskey="&browse.accesskey;" oncommand="Browse()"/>
<button id="preview" label="&preview.label;"
accesskey="&preview.accesskey;" oncommand="PreviewSound()"/>
</hbox>
</hbox>
</groupbox>
</page>

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

@ -41,13 +41,23 @@
<!DOCTYPE window SYSTEM "chrome://messenger/locale/pref-privacy.dtd">
<!-- HACK ALERT: shamelesly hack in the connection pref panel into the privacy panel until we can find
a better home.... -->
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://messenger/content/pref-privacy.xul');"
headertitle="&pane.title;">
<script type="application/x-javascript" src="chrome://messenger/content/pref-privacy.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["javascriptAllowMailNews", "networkImageDisableImagesInMailNews", "networkDisableCookieForMailNews"];
var _elementIDs = ["javascriptAllowMailNews", "networkImageDisableImagesInMailNews", "networkDisableCookieForMailNews",
"networkProxyType",
"networkProxyHTTP", "networkProxyHTTP_Port",
"networkProxySOCKS", "networkProxySOCKS_Port",
"networkProxySOCKSVersion",
"networkProxySSL", "networkProxySSL_Port",
"networkProxyNone", "networkProxyAutoconfigURL"];
]]>
</script>
@ -73,4 +83,86 @@
<separator class="thin"/>
</groupbox>
<groupbox>
<caption label="&proxyTitle.label;"/>
<radiogroup id="networkProxyType" prefstring="network.proxy.type">
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;" oncommand="DoEnabling();"/>
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;" oncommand="DoEnabling();"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<hbox align="center" pack="end">
<label value="&http.label;" accesskey="&http.accesskey;" control="networkProxyHTTP"/>
</hbox>
<hbox align="center">
<textbox id="networkProxyHTTP" preftype="string" prefstring="network.proxy.http"
flex="1"/>
<label value="&port.label;" accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port"/>
<textbox id="networkProxyHTTP_Port" preftype="int" prefstring="network.proxy.http_port"
size="5"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&ssl.label;" accesskey="&ssl.accesskey;" control="networkProxySSL"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySSL" preftype="string" prefstring="network.proxy.ssl"
flex="1"/>
<label value="&port.label;" accesskey="&SSLport.accesskey;" control="networkProxySSL_Port"/>
<textbox id="networkProxySSL_Port" preftype="int" prefstring="network.proxy.ssl_port"
size="5"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&socks.label;" accesskey="&socks.accesskey;" control="networkProxySOCKS"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySOCKS" preftype="string" prefstring="network.proxy.socks"
flex="1"/>
<label value="&port.label;" accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port"/>
<textbox id="networkProxySOCKS_Port" preftype="int" prefstring="network.proxy.socks_port"
size="5"/>
</hbox>
</row>
<row>
<spacer/>
<radiogroup id="networkProxySOCKSVersion" orient="horizontal"
prefstring="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" preftype="string" prefstring="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;" oncommand="DoEnabling();"/>
<hbox class="indent" flex="1" align="center">
<textbox id="networkProxyAutoconfigURL" flex="1"
preftype="string" prefstring="network.proxy.autoconfig_url"/>
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
oncommand="ReloadPAC();"
prefstring="pref.advanced.proxies.disable_button.reload"/>
</hbox>
</radiogroup>
</groupbox>
</page>

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

@ -61,7 +61,6 @@
src="chrome://communicator/locale/pref/prefutilities.properties"/>
<script type="application/x-javascript" src="chrome://global/content/nsWidgetStateManager.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/pref/nsPrefWindow.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-help.js"/>
<hbox flex="1">
@ -69,13 +68,11 @@
<button id="mailnews" orient="vertical" class="buttonBoxButton" type="radio" group="categories" label="&mailonly.label;" url="chrome://messenger/content/pref-mailnews.xul"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://communicator/content/pref/pref-themes.xul" label="&themes.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" label="&viewingMessages.label;" url="chrome://messenger/content/pref-viewing_messages.xul"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/pref-notifications.xul" label="&notifications.label;"/>
<button id="mailcomposepref" orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/messengercompose/pref-composing_messages.xul" label="&composingMessages.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://communicator/content/pref/pref-fonts.xul" label="&fonts.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/messengercompose/pref-formatting.xul" label="&format.label;"/>
<button id="mailaddressbookpref" orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/addressbook/pref-addressing.xul" label="&address.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/pref-labels.xul" label="&labels.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/pref-receipts.xul" label="&return.label;"/>/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/pref-advanced.xul" label="&advanced.label;"/>
<button orient="vertical" class="buttonBoxButton" type="radio" group="categories" url="chrome://messenger/content/pref-privacy.xul" label="&privacy.label;"/>
</vbox>
@ -92,8 +89,8 @@
document.getElementById("panelFrame").setAttribute("tag", window.arguments[0] );
}
else {
document.getElementById("panelFrame").setAttribute("src", "chrome://communicator/content/pref/pref-navigator.xul" );
document.getElementById("panelFrame").setAttribute("tag", "chrome://communicator/content/pref/pref-navigator.xul" );
document.getElementById("panelFrame").setAttribute("src", "chrome://messenger/content/pref-mailnews.xul" );
document.getElementById("panelFrame").setAttribute("tag", "chrome://messenger/content/pref-mailnews.xul" );
}
]]>
</script>

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

@ -1,106 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape 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/NPL/
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 Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger <ben@netscape.com>
Scott MacGregor <mscott@netscape.com>
-->
<?xul-overlay href="chrome://communicator/content/pref/platformPrefOverlay.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://messenger/locale/mailPrefsOverlay.dtd" >
<overlay id="prefTreeOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
<![CDATA[
var _elementIDs = []; // hack
]]>
</script>
<tree id="prefsTree" seltype="single" hidecolumnpicker="true"
onselect="if( hPrefWindow ) hPrefWindow.switchPage();">
<treecols>
<treecol id="categoryCol" label="&category.label;" flex="1" primary="true"/>
</treecols>
<!-- category tree entries for mail/news -->
<treechildren id="panelChildren">
<treeitem id="mailnews">
<treerow>
<treecell url="chrome://messenger/content/pref-mailnews.xul" label="&mailonly.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://communicator/content/pref/pref-themes.xul" label="&themes.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-viewing_messages.xul" label="&viewingMessages.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-notifications.xul" label="&notifications.label;"/>
</treerow>
</treeitem>
<treeitem id="mailcomposepref">
<treerow>
<treecell url="chrome://messenger/content/messengercompose/pref-composing_messages.xul" label="&composingMessages.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://communicator/content/pref/pref-fonts.xul" label="&fonts.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/messengercompose/pref-formatting.xul" label="&format.label;"/>
</treerow>
</treeitem>
<treeitem id="mailaddressbookpref">
<treerow>
<treecell url="chrome://messenger/content/addressbook/pref-addressing.xul" label="&address.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-labels.xul" label="&labels.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-receipts.xul" label="&return.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-privacy.xul" label="&privacy.label;"/>
</treerow>
</treeitem>
</treechildren>
</tree>
</overlay>

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

@ -3,11 +3,15 @@ messenger.jar:
+ content/messenger/messengercompose/pref-composing_messages.xul (content/pref-composing_messages.xul)
+ content/messenger/messengercompose/pref-viewing_messages.xul (content/pref-viewing_messages.xul)
+ content/messenger/pref-mailnews.xul (content/pref-mailnews.xul)
+ content/messenger/pref-mailnews.js (content/pref-mailnews.js)
content/messenger/pref-advanced.xul (content/pref-advanced.xul)
content/messenger/pref-advanced.js (content/pref-advanced.js)
content/messenger/pref-privacy.xul (content/pref-privacy.xul)
content/messenger/pref-privacy.js (content/pref-privacy.js)
comm.jar:
+ content/communicator/pref/pref.xul (content/pref.xul)
*+ content/communicator/pref/nsPrefWindow.js (content/nsPrefWindow.js)
*+ content/communicator/pref/nsPrefWindow.js (content/nsPrefWindow.js)
en-US.jar:
+ locale/en-US/communicator/pref/pref-fonts.dtd (locale/pref-fonts.dtd)
@ -18,6 +22,7 @@ en-US.jar:
+ locale/en-US/messenger/pref-viewing_messages.dtd (locale/pref-viewing_messages.dtd)
+ locale/en-US/messenger/AccountManager.dtd (locale/AccountManager.dtd)
locale/en-US/messenger/pref-privacy.dtd (locale/pref-privacy.dtd)
locale/en-US/messenger/pref-advanced.dtd (locale/pref-advanced.dtd)
classic.jar:

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

@ -1,6 +1,5 @@
<!ENTITY prefWindow.title "Options">
<!ENTITY categoryHeader "Category">
<!ENTITY enbJsCheckMailNews.label "Mail &amp; Newsgroups">
<!ENTITY enbJsCheckMailNews.accesskey "m">
@ -16,17 +15,14 @@
<!ENTITY mail.label "Mail &amp; Newsgroups">
<!ENTITY mail.accesskey "m">
<!ENTITY windows.label "Windows">
<!ENTITY viewingMessages.label "Message Display">
<!ENTITY notifications.label "Notifications">
<!ENTITY viewingMessages.label "Display">
<!ENTITY address.label "Addressing">
<!ENTITY composingMessages.label "Composition">
<!ENTITY format.label "Send Format">
<!ENTITY return.label "Return Receipts">
<!ENTITY disk.label "Disk Space">
<!ENTITY labels.label "Labels">
<!ENTITY category.label "Category">
<!ENTITY advanced.label "Advanced">
<!ENTITY mailonly.label "General">
<!ENTITY languages.label "Languages">
<!ENTITY themes.label "Themes">
<!ENTITY fonts.label "Fonts">
<!ENTITY privacy.label "Privacy &amp; Security">
<!ENTITY privacy.label "Privacy">

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

@ -1,4 +1,4 @@
<!ENTITY pane.title "Privacy &amp; Security">
<!ENTITY pane.title "Privacy">
<!ENTITY features.label "Allow the following features:">
<!ENTITY enbJsCheckMailNews.label "JavaScript">
<!ENTITY enbJsCheckMailNews.accesskey "s">
@ -8,3 +8,41 @@
<!ENTITY disableImageInMailNews.accesskey "L">
<!ENTITY disableCookieForMailNews.label "Cookies">
<!ENTITY disableCookieForMailNews.accesskey "C">
<!--LOCALIZATION NOTE : FILE The Proxies preferences dialog -->
<!ENTITY lHeader "Connection">
<!ENTITY proxyTitle.label "Configure Proxies to Access the Internet">
<!ENTITY directTypeRadio.label "Direct connection to the Internet">
<!ENTITY directTypeRadio.accesskey "d">
<!ENTITY manualTypeRadio.label "Manual proxy configuration">
<!ENTITY manualTypeRadio.accesskey "m">
<!ENTITY autoTypeRadio.label "Automatic proxy configuration URL:">
<!ENTITY autoTypeRadio.accesskey "a">
<!ENTITY configAutoconfigText.label "Configuration location (URL):">
<!ENTITY configAutoconfigText.accesskey "u">
<!ENTITY reload.label "Reload">
<!ENTITY reload.accesskey "l">
<!ENTITY ftp.label "FTP Proxy:">
<!ENTITY ftp.accesskey "f">
<!ENTITY gopher.label "Gopher Proxy:">
<!ENTITY gopher.accesskey "g">
<!ENTITY http.label "HTTP Proxy:">
<!ENTITY http.accesskey "h">
<!ENTITY ssl.label "SSL Proxy:">
<!ENTITY ssl.accesskey "s">
<!ENTITY socks.label "SOCKS Host:">
<!ENTITY socks.accesskey "c">
<!ENTITY socks4.label "SOCKS v4">
<!ENTITY socks4.accesskey "k">
<!ENTITY socks5.label "SOCKS v5">
<!ENTITY socks5.accesskey "v">
<!ENTITY port.label "Port:">
<!ENTITY HTTPport.accesskey "p">
<!ENTITY SSLport.accesskey "o">
<!ENTITY FTPport.accesskey "r">
<!-- No accesskey for gopher (':' doesn't go well) - mpt's going to redesign the window -->
<!ENTITY gopherPort.accesskey "">
<!ENTITY SOCKSport.accesskey "t">
<!ENTITY noproxy.label "No Proxy for:">
<!ENTITY noproxy.accesskey "n">
<!ENTITY noproxyExplain.label "Example: .mozilla.org, .net.nz">