Bug #262300 --> Finish implementing multiple identity UI. Add tabs for altering Copies & Folders and Composition and Addressing settings to the identity editor UI.

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2004-11-10 21:41:00 +00:00
Родитель 3837ec61c8
Коммит 5771f31ec1
11 изменённых файлов: 478 добавлений и 251 удалений

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

@ -8,6 +8,11 @@ function onLoad()
}
function onInit()
{
onInitCompositionAndAddressing();
}
function onInitCompositionAndAddressing()
{
setupDirectoriesList();
enabling();
@ -69,6 +74,11 @@ function enabling()
}
function onSave()
{
onSaveCompositionAndAddressing();
}
function onSaveCompositionAndAddressing()
{
var override = document.getElementById("identity.overrideGlobalPref");
var autocomplete = document.getElementById("ldapAutocomplete");

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

@ -40,89 +40,12 @@
***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://messenger/skin/accountManage.css" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://messenger/locale/am-addressing.dtd" >
<?xul-overlay href="chrome://messenger/content/am-addressingOverlay.xul"?>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-addressing.js"/>
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
<label hidden="true" wsm_persist="true" id="identity.directoryServer"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.directoryServer"/>
<label hidden="true" wsm_persist="true" id="identity.overrideGlobalPref"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.overrideGlobal_Pref"/>
<label hidden="true" wsm_persist="true" id="overrideGlobalPref" value=""/>
<label hidden="true" wsm_persist="true" id="directoryServer" value=""/>
<checkbox hidden="true" wsm_persist="true" id="identity.attachSignature"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.attach_signature"/>
<dialogheader title="&addressing.label;"/>
<separator class="thin"/>
<groupbox>
<caption label="&compositionGroupTitle.label;"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.composeHtml" label="&useHtml.label;"
accesskey="&useHtml.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.compose_html"/>
</hbox>
<separator class="thin"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.autoQuote" label="&autoQuote.label;"
oncommand="quoteEnabling();" accesskey="&autoQuote.accesskey;"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.auto_quote"/>
</hbox>
<hbox class="indent" align="center" id="thenBox">
<label value="&then.label;" accesskey="&then.accesskey;" control="identity.replyOnTop"/>
<menulist wsm_persist="true" id="identity.replyOnTop" oncommand="quoteEnabling();"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.reply_on_top">
<menupopup>
<menuitem value="1" label="&aboveQuote.label;"/>
<menuitem value="0" label="&belowQuote.label;"/>
<menuitem value="2" label="&selectAndQuote.label;"/>
</menupopup>
</menulist>
</hbox>
<hbox class="indent" align="center" id="placeBox">
<label value="&place.label;" accesskey="&place.accesskey;" control="identity.sig_bottom"/>
<menulist wsm_persist="true" id="identity.sig_bottom" genericattr="true"
pref="true" preftype="bool" prefattribute="value">
<menupopup>
<menuitem value="true" label="&belowText.label;"/>
<menuitem value="false" label="&aboveText.label;"/>
</menupopup>
</menulist>
</hbox>
</groupbox>
<separator class="thin"/>
<groupbox>
<caption label="&addressingGroupTitle.label;"/>
<description>&addressingText.label;</description>
<radiogroup class="indent" id="ldapAutocomplete" wsm_persist="true" oncommand="enabling();">
<observes element="identity.overrideGlobalPref" attribute="disabled"/>
<radio id="useGlobalPref" value="0" label="&useGlobal.label;"
accesskey="&useGlobal.accesskey;"/>
<radio id="directories" value="1" label="&directories.label;"
accesskey="&directories.accesskey;"/>
<hbox class="indent">
<menulist id="directoriesList" wsm_persist="true" style="min-width: 16em;">
<menupopup onpopupshowing="createDirectoriesList(false);" id="directoriesListPopup"/>
</menulist>
<button id="editButton" label="&editDirectories.label;"
accesskey="&editDirectories.accesskey;" oncommand="onEditDirectories();"/>
</hbox>
</radiogroup>
</groupbox>
<vbox id="compositionAndAddressing"/>
</page>

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

@ -0,0 +1,122 @@
<?xml version="1.0"?>
<!-- ***** 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 Account Manager Addressing Settings Overlay.
#
# Contributor(s):
# Scott MacGregor <mscott@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# 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://messenger/skin/accountManage.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://messenger/locale/am-addressing.dtd">
<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-addressing.js"/>
<vbox flex="1" id="compositionAndAddressing">
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
<label hidden="true" wsm_persist="true" id="identity.directoryServer"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.directoryServer"/>
<label hidden="true" wsm_persist="true" id="identity.overrideGlobalPref"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.overrideGlobal_Pref"/>
<label hidden="true" wsm_persist="true" id="overrideGlobalPref" value=""/>
<label hidden="true" wsm_persist="true" id="directoryServer" value=""/>
<checkbox hidden="true" wsm_persist="true" id="identity.attachSignature"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.attach_signature"/>
<separator class="thin"/>
<groupbox>
<caption label="&compositionGroupTitle.label;"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.composeHtml" label="&useHtml.label;"
accesskey="&useHtml.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.compose_html"/>
</hbox>
<separator class="thin"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.autoQuote" label="&autoQuote.label;"
oncommand="quoteEnabling();" accesskey="&autoQuote.accesskey;"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.identity.%identitykey%.auto_quote"/>
</hbox>
<hbox class="indent" align="center" id="thenBox">
<label value="&then.label;" accesskey="&then.accesskey;" control="identity.replyOnTop"/>
<menulist wsm_persist="true" id="identity.replyOnTop" oncommand="quoteEnabling();"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.reply_on_top">
<menupopup>
<menuitem value="1" label="&aboveQuote.label;"/>
<menuitem value="0" label="&belowQuote.label;"/>
<menuitem value="2" label="&selectAndQuote.label;"/>
</menupopup>
</menulist>
</hbox>
<hbox class="indent" align="center" id="placeBox">
<label value="&place.label;" accesskey="&place.accesskey;" control="identity.sig_bottom"/>
<menulist wsm_persist="true" id="identity.sig_bottom" genericattr="true"
pref="true" preftype="bool" prefattribute="value">
<menupopup>
<menuitem value="true" label="&belowText.label;"/>
<menuitem value="false" label="&aboveText.label;"/>
</menupopup>
</menulist>
</hbox>
</groupbox>
<separator class="thin"/>
<groupbox>
<caption label="&addressingGroupTitle.label;"/>
<description>&addressingText.label;</description>
<radiogroup class="indent" id="ldapAutocomplete" wsm_persist="true" oncommand="enabling();">
<observes element="identity.overrideGlobalPref" attribute="disabled"/>
<radio id="useGlobalPref" value="0" label="&useGlobal.label;"
accesskey="&useGlobal.accesskey;"/>
<radio id="directories" value="1" label="&directories.label;"
accesskey="&directories.accesskey;"/>
<hbox class="indent">
<menulist id="directoriesList" wsm_persist="true" style="min-width: 16em;">
<menupopup onpopupshowing="createDirectoriesList(false);" id="directoriesListPopup"/>
</menulist>
<button id="editButton" label="&editDirectories.label;"
accesskey="&editDirectories.accesskey;" oncommand="onEditDirectories();"/>
</hbox>
</radiogroup>
</groupbox>
</vbox>
</overlay>

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

@ -58,6 +58,11 @@ var tmplFolderPickerId = "msgStationeryFolderPicker";
* Also, initialize other UI elements (bcc self, fcc picker controller checkboxes).
*/
function onInit()
{
onInitCopiesAndFolders();
}
function onInitCopiesAndFolders()
{
SetGlobalRadioElemChoices();
@ -219,6 +224,11 @@ function SetSpecialFolderNamesWithDelims()
// Save all changes on this page
function onSave()
{
onSaveCopiesAndFolders();
}
function onSaveCopiesAndFolders()
{
SaveFolderSettings( gFccRadioElemChoice,
"doFcc",
@ -361,14 +371,14 @@ function setPickersState(enablePickerId, disablePickerId, event)
{
SetPickerEnabling(enablePickerId, disablePickerId);
var serverId = GetCurrentServerId();
var selectedElementUri;
var radioElemValue = event.target.value;
var account = parent.getAccountFromServerId(serverId);
var account = getAccountForFolderPickerState();
if (!account) return;
var server = account.incomingServer;
var serverId = server.key;
// if special folders are not to be made on the server,
// then Local Folders is the home for it's special folders

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

@ -1,170 +1,23 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://messenger/skin/accountManage.css" type="text/css"?>
<?xul-overlay href="chrome://messenger/content/am-copiesOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
<!DOCTYPE page SYSTEM "chrome://messenger/locale/am-copies.dtd">
<!DOCTYPE page SYSTEM "chrome://messenger/locale/am-copies.dtd" >
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.onPanelLoaded('am-copies.xul');">
<!-- stringbundle is used by msgFolderPickerOverlay.js-->
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/AccountManager.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-copies.js"/>
<broadcaster id="broadcaster_doFcc"/>
<label hidden="true" wsm_persist="true" id="identity.fccFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc_folder"/>
<label hidden="true" wsm_persist="true" id="identity.draftFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.draft_folder"/>
<label hidden="true" wsm_persist="true" id="identity.stationeryFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.stationary_folder"/>
<label hidden="true" wsm_persist="true" id="identity.email"/>
<label hidden="true" wsm_persist="true" id="identity.fccFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc_folder_picker_mode"/>
<label hidden="true" wsm_persist="true" id="identity.draftsFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.drafts_folder_picker_mode"/>
<label hidden="true" wsm_persist="true" id="identity.tmplFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.tmpl_folder_picker_mode"/>
<script type="application/x-javascript">
<![CDATA[
function getAccountForFolderPickerState()
{
var serverId = GetCurrentServerId();
return parent.getAccountFromServerId(serverId);
}
]]>
</script>
<dialogheader title="&copyAndFolderTitle.label;"/>
<groupbox>
<caption label="&sendingPrefix.label;"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.doFcc" label="&fccMailFolder.label;"
accesskey="&fccMailFolder.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc"
oncommand="setupFccItems();"/>
</hbox>
<radiogroup id="doFcc">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="fcc_selectAccount"
value="0" label="&sentFolderOn.label;"
accesskey="&sentFolderOn.accesskey;"
oncommand="setPickersState('msgFccAccountPicker', 'msgFccFolderPicker', event)"
observes="broadcaster_doFcc"/>
<menulist id="msgFccAccountPicker"
oncommand="noteSelectionChange('fcc_selectAccount')"
observes="broadcaster_doFcc"/>
</row>
<row align="center">
<radio id="fcc_selectFolder"
value="1" label="&sentInOtherFolder.label;"
accesskey="&sentInOtherFolder.accesskey;"
oncommand="setPickersState('msgFccFolderPicker', 'msgFccAccountPicker', event)"
observes="broadcaster_doFcc"/>
<menulist id="msgFccFolderPicker"
oncommand="noteSelectionChange('fcc_selectFolder')"
observes="broadcaster_doFcc"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.doBcc" label="&bccAddress.label;"
accesskey="&bccAddress.accesskey;"
control="identity.doBccList"
oncommand="setupBccTextbox();"
prefattribute="value"
prefstring="mail.identity.%identitykey%.doBcc"/>
<textbox wsm_persist="true" id="identity.doBccList" flex="1"
prefstring="mail.identity.%identitykey%.doBccList" class="uri-element"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&specialFoldersTitle.label;"/>
<hbox align="center">
<label value="&keepDrafts.label;"/>
</hbox>
<radiogroup id="messageDrafts">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="draft_selectAccount"
oncommand="setPickersState('msgDraftsAccountPicker', 'msgDraftsFolderPicker', event)"
value="0" label="&draftsFolderOn.label;"
accesskey="&draftsFolderOn.accesskey;"/>
<menulist id="msgDraftsAccountPicker"
oncommand="noteSelectionChange('draft_selectAccount')"/>
</row>
<row align="center">
<radio id="draft_selectFolder"
oncommand="setPickersState('msgDraftsFolderPicker', 'msgDraftsAccountPicker', event)"
value="1" label="&draftInOtherFolder.label;"
accesskey="&draftInOtherFolder.accesskey;"/>
<menulist id="msgDraftsFolderPicker"
oncommand="noteSelectionChange('draft_selectFolder')"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<label value="&keepTempltes.label;"/>
</hbox>
<radiogroup id="messageTemplates">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="tmpl_selectAccount"
oncommand="setPickersState('msgStationeryAccountPicker', 'msgStationeryFolderPicker', event)"
value="0" label="&templatesFolderOn.label;"
accesskey="&templatesFolderOn.accesskey;"/>
<menulist id="msgStationeryAccountPicker"
oncommand="noteSelectionChange('tmpl_selectAccount')"/>
</row>
<row align="center">
<radio id="tmpl_selectFolder"
oncommand="setPickersState('msgStationeryFolderPicker', 'msgStationeryAccountPicker', event)"
value="1" label="&templateInOtherFolder.label;"
accesskey="&templateInOtherFolder.accesskey;"/>
<menulist id="msgStationeryFolderPicker"
oncommand="noteSelectionChange('tmpl_selectFolder')"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.showSaveMsgDlg" label="&saveMessageDlg.label;"
accesskey="&saveMessageDlg.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.showSaveMsgDlg"/>
</hbox>
</groupbox>
<vbox id="copiesAndFolders"/>
</page>

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

@ -0,0 +1,199 @@
<?xml version="1.0"?>
<!-- ***** 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 copiesAndFolderOverlay.
#
# Contributor(s):
# Scott MacGregor <mscott@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# 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://messenger/skin/accountManage.css" type="text/css"?>
<?xul-overlay href="chrome://messenger/content/msgFolderPickerOverlay.xul"?>
<!DOCTYPE overlay SYSTEM "chrome://messenger/locale/am-copies.dtd" >
<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-copies.js"/>
<vbox flex="1" id="copiesAndFolders">
<!-- stringbundle is used by msgFolderPickerOverlay.js-->
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
</stringbundleset>
<broadcaster id="broadcaster_doFcc"/>
<label hidden="true" wsm_persist="true" id="identity.fccFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc_folder"/>
<label hidden="true" wsm_persist="true" id="identity.draftFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.draft_folder"/>
<label hidden="true" wsm_persist="true" id="identity.stationeryFolder"
pref="true" preftype="string" prefattribute="value"
prefstring="mail.identity.%identitykey%.stationary_folder"/>
<label hidden="true" wsm_persist="true" id="identity.email"/>
<label hidden="true" wsm_persist="true" id="identity.fccFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc_folder_picker_mode"/>
<label hidden="true" wsm_persist="true" id="identity.draftsFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.drafts_folder_picker_mode"/>
<label hidden="true" wsm_persist="true" id="identity.tmplFolderPickerMode"
pref="true" preftype="int" prefattribute="value"
prefstring="mail.identity.%identitykey%.tmpl_folder_picker_mode"/>
<groupbox>
<caption label="&sendingPrefix.label;"/>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.doFcc" label="&fccMailFolder.label;"
accesskey="&fccMailFolder.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.fcc"
oncommand="setupFccItems();"/>
</hbox>
<radiogroup id="doFcc">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="fcc_selectAccount"
value="0" label="&sentFolderOn.label;"
accesskey="&sentFolderOn.accesskey;"
oncommand="setPickersState('msgFccAccountPicker', 'msgFccFolderPicker', event)"
observes="broadcaster_doFcc"/>
<menulist id="msgFccAccountPicker"
oncommand="noteSelectionChange('fcc_selectAccount')"
observes="broadcaster_doFcc"/>
</row>
<row align="center">
<radio id="fcc_selectFolder"
value="1" label="&sentInOtherFolder.label;"
accesskey="&sentInOtherFolder.accesskey;"
oncommand="setPickersState('msgFccFolderPicker', 'msgFccAccountPicker', event)"
observes="broadcaster_doFcc"/>
<menulist id="msgFccFolderPicker"
oncommand="noteSelectionChange('fcc_selectFolder')"
observes="broadcaster_doFcc"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.doBcc" label="&bccAddress.label;"
accesskey="&bccAddress.accesskey;"
control="identity.doBccList"
oncommand="setupBccTextbox();"
prefattribute="value"
prefstring="mail.identity.%identitykey%.doBcc"/>
<textbox wsm_persist="true" id="identity.doBccList" flex="1"
prefstring="mail.identity.%identitykey%.doBccList" class="uri-element"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&specialFoldersTitle.label;"/>
<hbox align="center">
<label value="&keepDrafts.label;"/>
</hbox>
<radiogroup id="messageDrafts">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="draft_selectAccount"
oncommand="setPickersState('msgDraftsAccountPicker', 'msgDraftsFolderPicker', event)"
value="0" label="&draftsFolderOn.label;"
accesskey="&draftsFolderOn.accesskey;"/>
<menulist id="msgDraftsAccountPicker"
oncommand="noteSelectionChange('draft_selectAccount')"/>
</row>
<row align="center">
<radio id="draft_selectFolder"
oncommand="setPickersState('msgDraftsFolderPicker', 'msgDraftsAccountPicker', event)"
value="1" label="&draftInOtherFolder.label;"
accesskey="&draftInOtherFolder.accesskey;"/>
<menulist id="msgDraftsFolderPicker"
oncommand="noteSelectionChange('draft_selectFolder')"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<label value="&keepTempltes.label;"/>
</hbox>
<radiogroup id="messageTemplates">
<grid class="specialFolderPickerGrid">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<radio id="tmpl_selectAccount"
oncommand="setPickersState('msgStationeryAccountPicker', 'msgStationeryFolderPicker', event)"
value="0" label="&templatesFolderOn.label;"
accesskey="&templatesFolderOn.accesskey;"/>
<menulist id="msgStationeryAccountPicker"
oncommand="noteSelectionChange('tmpl_selectAccount')"/>
</row>
<row align="center">
<radio id="tmpl_selectFolder"
oncommand="setPickersState('msgStationeryFolderPicker', 'msgStationeryAccountPicker', event)"
value="1" label="&templateInOtherFolder.label;"
accesskey="&templateInOtherFolder.accesskey;"/>
<menulist id="msgStationeryFolderPicker"
oncommand="noteSelectionChange('tmpl_selectFolder')"/>
</row>
</rows>
</grid>
</radiogroup>
<hbox align="center">
<checkbox wsm_persist="true" id="identity.showSaveMsgDlg" label="&saveMessageDlg.label;"
accesskey="&saveMessageDlg.accesskey;"
prefattribute="value"
prefstring="mail.identity.%identitykey%.showSaveMsgDlg"/>
</hbox>
</groupbox>
</vbox>
</overlay>

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

@ -57,6 +57,9 @@ function onLoad()
// extract the account from
refreshIdentityList();
// try selecting the first identity
gIdentityListBox.selectedIndex = 0;
}
function refreshIdentityList()
@ -89,8 +92,13 @@ function openIdentityEditor(identity)
window.openDialog('am-identity-edit.xul', 'identity-edit', 'modal,titlebar,chrome', args);
var selectedItemIndex = gIdentityListBox.selectedIndex;
if (args.result)
{
refreshIdentityList();
gIdentityListBox.selectedIndex = selectedItemIndex;
}
}
function getSelectedIdentity()

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

@ -36,13 +36,15 @@ var gAccount = null; // the account the identity is (or will be) associated wi
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function onLoad()
function onLoadIdentityProperties()
{
// extract the account
gIdentity = window.arguments[0].identity;
gAccount = window.arguments[0].account;
initIdentityValues(gIdentity);
initCopiesAndFolder(gIdentity);
initCompositionAndAddressing(gIdentity);
}
// based on the values of gIdentity, initialize the identity fields we expose to the user
@ -66,6 +68,43 @@ function initIdentityValues(identity)
setupSignatureItems();
}
function initCopiesAndFolder(identity)
{
// if we are editing an existing identity, use it...otherwise copy our values from the default identity
var copiesAndFoldersIdentity = identity ? identity : gAccount.defaultIdentity;
document.getElementById('identity.fccFolder').value = copiesAndFoldersIdentity.fccFolder;
document.getElementById('identity.draftFolder').value = copiesAndFoldersIdentity.draftFolder;
document.getElementById('identity.stationeryFolder').value = copiesAndFoldersIdentity.stationeryFolder;
document.getElementById('identity.fccFolderPickerMode').value = copiesAndFoldersIdentity.fccFolderPickerMode ? copiesAndFoldersIdentity.fccFolderPickerMode : 0;
document.getElementById('identity.draftsFolderPickerMode').value = copiesAndFoldersIdentity.draftsFolderPickerMode ? copiesAndFoldersIdentity.draftsFolderPickerMode : 0;
document.getElementById('identity.tmplFolderPickerMode').value = copiesAndFoldersIdentity.tmplFolderPickerMode ? copiesAndFoldersIdentity.tmplFolderPickerMode : 0;
document.getElementById('identity.doBcc').checked = copiesAndFoldersIdentity.doBcc;
document.getElementById('identity.doBccList').value = copiesAndFoldersIdentity.doBccList;
document.getElementById('identity.doFcc').checked = copiesAndFoldersIdentity.doFcc;
document.getElementById('identity.showSaveMsgDlg').checked = identity.showSaveMsgDlg;
onInitCopiesAndFolders(); // am-copies.js method
}
function initCompositionAndAddressing(identity)
{
createDirectoriesList(false);
// if we are editing an existing identity, use it...otherwise copy our values from the default identity
var addressingIdentity = identity ? identity : gAccount.defaultIdentity;
document.getElementById('identity.directoryServer').value = addressingIdentity.directoryServer;
document.getElementById('identity.overrideGlobalPref').value = addressingIdentity.overrideGlobalPref;
document.getElementById('identity.composeHtml').checked = addressingIdentity.composeHtml;
document.getElementById('identity.autoQuote').checked = addressingIdentity.autoQuote;
document.getElementById('identity.replyOnTop').value = addressingIdentity.replyOnTop;
document.getElementById('identity.sig_bottom').value = addressingIdentity.sigBottom;
onInitCompositionAndAddressing(); // am-addressing.js method
}
function onOk()
{
if (!validEmailAddress())
@ -94,6 +133,8 @@ function onOk()
// if we are modifying an existing identity, save the fields
saveIdentitySettings(gIdentity);
saveCopiesAndFolderSettings(gIdentity);
saveAddressingAndCompositionSettings(gIdentity);
window.arguments[0].result = true;
@ -151,6 +192,34 @@ function saveIdentitySettings(identity)
}
}
function saveCopiesAndFolderSettings(identity)
{
onSaveCopiesAndFolders(); // am-copies.js routine
identity.fccFolder = document.getElementById('identity.fccFolder').value;
identity.draftFolder = document.getElementById('identity.draftFolder').value;
identity.stationeryFolder = document.getElementById('identity.stationeryFolder').value;
identity.fccFolderPickerMode = document.getElementById('identity.fccFolderPickerMode').value;
identity.draftsFolderPickerMode = document.getElementById('identity.draftsFolderPickerMode').value;
identity.tmplFolderPickerMode = document.getElementById('identity.tmplFolderPickerMode').value;
identity.doBcc = document.getElementById('identity.doBcc').checked;
identity.doBccList = document.getElementById('identity.doBccList').value;
identity.doFcc = document.getElementById('identity.doFcc').checked;
identity.showSaveMsgDlg = document.getElementById('identity.showSaveMsgDlg').checked;
}
function saveAddressingAndCompositionSettings(identity)
{
onSaveCompositionAndAddressing(); // am-addressing.js routine
identity.directoryServer = document.getElementById('identity.directoryServer').value;
identity.overrideGlobalPref = document.getElementById('identity.overrideGlobalPref').value;
identity.composeHtml = document.getElementById('identity.composeHtml').checked;
identity.autoQuote = document.getElementById('identity.autoQuote').checked;
identity.replyOnTop = document.getElementById('identity.replyOnTop').value;
identity.sigBottom = document.getElementById('identity.sig_bottom').value;
}
function selectFile()
{
var fp = Components.classes["@mozilla.org/filepicker;1"]
@ -239,3 +308,8 @@ function editVCard()
{escapedVCardStr:escapedVCard.value, okCallback:editVCardCallback,
titleProperty:"editVCardTitle", hideABPicker:true});
}
function getAccountForFolderPickerState()
{
return gAccount;
}

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

@ -34,6 +34,9 @@
***** END LICENSE BLOCK ***** -->
<?xul-overlay href="chrome://messenger/content/am-copiesOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/am-addressingOverlay.xul"?>
<!DOCTYPE dialog [
<!ENTITY % identityEditDTD SYSTEM "chrome://messenger/locale/am-identity-edit.dtd" >
%identityEditDTD;
@ -44,7 +47,7 @@
<dialog title="&identityTitle.label;"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
onload="onLoadIdentityProperties();"
ondialogaccept="return onOk();"
style="width: 35em;">
@ -52,16 +55,31 @@
<stringbundle id="bundle_prefs" src="chrome://messenger/locale/prefs.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-prefs.js"/>
<script type="application/x-javascript" src="am-identity-edit.js"/>
<script type="application/x-javascript">
<![CDATA[
function getServerIdAndPageIdFromTree(tree)
{
return {"serverId": gAccount.incomingServer.key, "pageId": "" }
}
]]>
</script>
<broadcaster id="broadcaster_attachSignature"/>
<description flex="1">&identityListDesc.label;</description>
<separator class="thin"/>
<groupbox style="width: 20em !important;">
<caption label="&editIdentityTitle.label;"/>
<separator class="thin"/>
<grid flex="1">
<tabbox>
<tabs id="identitySettings">
<tab label="&settingsTab.label;"/>
<tab label="&copiesFoldersTab.label;"/>
<tab label="&addressingTab.label;"/>
</tabs>
<tabpanels id="identityTabsPanels" flex="1">
<!-- Identity Settings Tab -->
<vbox flex="1" name="settings">
<grid>
<columns>
<column/>
<column flex="1"/>
@ -112,7 +130,14 @@
oncommand="editVCard()"/>
<label hidden="true" id="identity.escapedVCard"/>
</hbox>
</vbox>
<!-- Copies & Folders Tab -->
<vbox flex="1" name="copiesAndFolders" id="copiesAndFolders"/>
</groupbox>
<!-- Composition & Addressing Tab -->
<vbox flex="1" name="composeAddressing" id="compositionAndAddressing"/>
</tabpanels>
</tabbox>
</dialog>

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

@ -1,5 +1,6 @@
<!ENTITY identityTitle.label "Identity Settings">
<!ENTITY identityListDesc.label "Configure the settings for this identity:">
<!ENTITY editIdentityTitle.label "Settings">
<!ENTITY settingsTab.label "Settings">
<!ENTITY copiesFoldersTab.label "Copies &amp; Folders">
<!ENTITY addressingTab.label "Composition &amp; Addressing">

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

@ -48,6 +48,7 @@ messenger.jar:
content/messenger/am-offline.xul (base/prefs/resources/content/am-offline.xul)
content/messenger/am-offline.js (base/prefs/resources/content/am-offline.js)
content/messenger/am-addressing.xul (base/prefs/resources/content/am-addressing.xul)
content/messenger/am-addressingOverlay.xul (base/prefs/resources/content/am-addressingOverlay.xul)
content/messenger/am-addressing.js (base/prefs/resources/content/am-addressing.js)
content/messenger/am-server-advanced.xul (base/prefs/resources/content/am-server-advanced.xul)
content/messenger/am-server-advanced.js (base/prefs/resources/content/am-server-advanced.js)
@ -58,6 +59,7 @@ messenger.jar:
content/messenger/am-identities-list.xul (base/prefs/resources/content/am-identities-list.xul)
content/messenger/am-identity-edit.js (base/prefs/resources/content/am-identity-edit.js)
content/messenger/am-identity-edit.xul (base/prefs/resources/content/am-identity-edit.xul)
content/messenger/am-copiesOverlay.xul (base/prefs/resources/content/am-copiesOverlay.xul)
content/messenger/pref-mailnews.xul (base/prefs/resources/content/pref-mailnews.xul)
content/messenger/pref-mailnews.js (base/prefs/resources/content/pref-mailnews.js)
content/messenger/pref-notifications.xul (base/prefs/resources/content/pref-notifications.xul)