Bug 445012 – Migrate MailNews Character Encoding to the new prefwindow

p=me r=mnyromyr sr=neil
This commit is contained in:
Ian Neal 2008-08-09 00:28:00 +01:00
Родитель 23161bdc6d
Коммит 4a23b7e11f
4 изменённых файлов: 176 добавлений и 59 удалений

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

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE overlay [
<!ENTITY % mailPrefsOverlayDTD SYSTEM "chrome://messenger/locale/mailPrefsOverlay.dtd" >
<!ENTITY % mailPrefsOverlayDTD SYSTEM "chrome://messenger/locale/mailPrefsOverlay.dtd">
%mailPrefsOverlayDTD;
]>
@ -86,6 +86,11 @@
prefpane="receipts_pane"
url="chrome://messenger/content/pref-receipts.xul"
helpTopic="mail-prefs-receipts"/>
<treeitem id="characterEncodingItem"
label="&characterEncoding.label;"
prefpane="character_encoding_pane"
url="chrome://messenger/content/pref-character_encoding.xul"
helpTopic="mail_prefs_character_encoding"/>
<treeitem id="offlineItem"
label="&offline.label;"
prefpane="offline_pane"
@ -145,7 +150,7 @@
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://messenger/content/pref-character_encoding.xul" label="&characterEncoding.label;"/>
<treecell label="(Migrated: &characterEncoding.label;)"/>
</treerow>
</treeitem>
<treeitem>
@ -156,5 +161,5 @@
</treechildren>
</treeitem>
</treechildren>
</overlay>
</overlay>

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

@ -0,0 +1,60 @@
/* ***** 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 SeaMonkey Project code.
*
* The Initial Developer of the Original Code is
* Ian Neal <iann_bugzilla@blueyonder.co.uk>
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* 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 ***** */
// The contents of this file will be loaded into the scope of the object
// <prefpane id="character_encoding_pane">!
function Startup ()
{
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(null, "charsetmenu-selected", "other");
observerService.notifyObservers(null, "charsetmenu-selected", "mailedit");
var viewCharsetList = document.getElementById("viewDefaultCharsetList");
// Need to set ref attribute once overlay has loaded.
viewCharsetList.setAttribute("ref", "NC:DecodersRoot");
// Since the menulist starts off empty it has no selected item
// so try and set it to the preference value.
viewCharsetList.value = document.getElementById("mailnews.view_default_charset").value;
var sendCharsetList = document.getElementById("sendDefaultCharsetList");
// Need to set ref attribute once overlay has loaded.
sendCharsetList.setAttribute("ref", "NC:MaileditCharsetMenuRoot");
// Since the menulist starts off empty it has no selected item
// so try and set it to the preference value.
sendCharsetList.value = document.getElementById("mailnews.send_default_charset").value;
}

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

@ -1,64 +1,115 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!-- ***** 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.org Code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998-2000
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://messenger/skin/prefPanels.css" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://messenger/locale/pref-character_encoding.dtd">
<!DOCTYPE overlay SYSTEM "chrome://messenger/locale/pref-character_encoding.dtd">
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://messenger/content/pref-character_encoding.xul');"
headertitle="&pref.character.encoding.title;">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="character_encoding_pane"
label="&pref.character.encoding.title;"
script="chrome://messenger/content/pref-character_encoding.js">
<preferences id="character_encoding_preferences">
<preference id="mailnews.view_default_charset"
name="mailnews.view_default_charset"
type="wstring"/>
<preference id="mail.strictly_mime"
name="mail.strictly_mime"
type="bool"/>
<preference id="mailnews.send_default_charset"
name="mailnews.send_default_charset"
type="wstring"/>
<preference id="mailnews.reply_in_default_charset"
name="mailnews.reply_in_default_charset"
type="bool"/>
</preferences>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["viewDefaultCharsetList",
"strictlyMime", "sendDefaultCharsetList",
"replyInDefaultCharset"];
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.notifyObservers(null, "charsetmenu-selected", "other");
observerService.notifyObservers(null, "charsetmenu-selected", "mailedit");
]]>
</script>
<groupbox align="start">
<caption label="&messageDisplay.caption;"/>
<hbox align="center">
<label control="viewDefaultCharsetList"
value="&viewDefaultCharset.label;"
accesskey="&viewDefaultCharset.accesskey;"/>
<menulist id="viewDefaultCharsetList"
ref=""
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>
</hbox>
</groupbox>
<groupbox align="start">
<caption label="&messageDisplay.caption;"/>
<hbox align="center">
<label control="viewDefaultCharsetList"
value="&viewDefaultCharset.label;" accesskey="&viewDefaultCharset.accesskey;"/>
<menulist id="viewDefaultCharsetList" ref="NC:DecodersRoot" datasources="rdf:charset-menu"
preftype="localizedstring" prefstring="mailnews.view_default_charset">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
</menupopup>
</template>
</menulist>
</hbox>
</groupbox>
<!-- Composing Mail -->
<groupbox align="start">
<caption label="&composingMessages.caption;"/>
<!-- Composing Mail -->
<groupbox align="start">
<caption label="&composingMessages.caption;"/>
<checkbox id="strictlyMime"
label="&useMIME.label;"
accesskey="&useMIME.accesskey;"
preference="mail.strictly_mime"/>
<checkbox id="strictlyMime" label="&useMIME.label;"
prefstring="mail.strictly_mime"
accesskey="&useMIME.accesskey;"/>
<hbox align="center">
<label value="&sendDefaultCharset.label;" accesskey="&sendDefaultCharset.accesskey;"
page="sendDefaultCharsetList" control="sendDefaultCharsetList"/>
<menulist id="sendDefaultCharsetList" ref="NC:MaileditCharsetMenuRoot" datasources="rdf:charset-menu"
preftype="localizedstring" prefstring="mailnews.send_default_charset">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name" value="..." uri="..."/>
</menupopup>
</template>
</menulist>
</hbox>
<checkbox id="replyInDefaultCharset" label="&replyInDefaultCharset2.label;"
prefstring="mailnews.reply_in_default_charset"
accesskey="&replyInDefaultCharset2.accesskey;"/>
</groupbox>
</page>
<hbox align="center">
<label value="&sendDefaultCharset.label;"
accesskey="&sendDefaultCharset.accesskey;"
control="sendDefaultCharsetList"/>
<menulist id="sendDefaultCharsetList"
ref=""
datasources="rdf:charset-menu"
preference="mailnews.send_default_charset">
<template>
<menupopup>
<menuitem label="rdf:http://home.netscape.com/NC-rdf#Name"
value="..."
uri="..."/>
</menupopup>
</template>
</menulist>
</hbox>
<checkbox id="replyInDefaultCharset"
label="&replyInDefaultCharset2.label;"
accesskey="&replyInDefaultCharset2.accesskey;"
preference="mailnews.reply_in_default_charset"/>
</groupbox>
</prefpane>
</overlay>

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

@ -90,6 +90,7 @@ messenger.jar:
content/messenger/pref-receipts.xul (base/prefs/resources/content/pref-receipts.xul)
content/messenger/pref-receipts.js (base/prefs/resources/content/pref-receipts.js)
content/messenger/pref-character_encoding.xul (base/prefs/resources/content/pref-character_encoding.xul)
content/messenger/pref-character_encoding.js (base/prefs/resources/content/pref-character_encoding.js)
content/messenger/pref-offline.xul (base/prefs/resources/content/pref-offline.xul)
content/messenger/pref-offline.js (base/prefs/resources/content/pref-offline.js)
* content/messenger/AccountWizard.xul (base/prefs/resources/content/AccountWizard.xul)