frontend support for message aging, 11055, r=neil, sr=mscott, a=chofmann

This commit is contained in:
bienvenu%nventure.com 2005-06-01 17:15:30 +00:00
parent 2f42bb8e81
commit 81c373d79e
9 changed files with 263 additions and 117 deletions

View File

@ -12,15 +12,15 @@
<!ENTITY nntpNotDownloadRead.accesskey "R">
<!ENTITY nntpDownloadMsg.label "Messages more than">
<!ENTITY nntpDownloadMsg.accesskey "e">
<!ENTITY nntpCleanup.label "Keep:">
<!ENTITY nntpKeepMsg.label "Messages which have arrived within the last">
<!ENTITY nntpKeepMsg.accesskey "w">
<!ENTITY nntpKeepAll.label "All messages">
<!ENTITY nntpKeepAll.accesskey "A">
<!ENTITY nntpKeepNew.label "The newest">
<!ENTITY nntpKeepNew.accesskey "n">
<!ENTITY nntpKeepUnread.label "Only unread messages">
<!ENTITY nntpKeepUnread.accesskey "u">
<!ENTITY retentionCleanup.label "To recover disk space, old messages can be permanently deleted">
<!ENTITY retentionKeepMsg.label "Delete messages more than">
<!ENTITY retentionKeepMsg.accesskey "m">
<!ENTITY retentionKeepAll.label "Don't delete any messages">
<!ENTITY retentionKeepAll.accesskey "A">
<!ENTITY retentionKeepNew.label "Delete all but the last">
<!ENTITY retentionKeepNew.accesskey "l">
<!ENTITY retentionKeepUnread.label "Always delete read messages">
<!ENTITY retentionKeepUnread.accesskey "r">
<!ENTITY nntpRemoveBody.label "Only message bodies less than">
<!ENTITY nntpRemoveBody.accesskey "O">
<!ENTITY offlineSelectNntp.label "Select newsgroups for offline use...">

View File

@ -46,6 +46,22 @@
<!ENTITY folderCharsetOverride.label "Apply default to all messages in the folder (individual message character encoding settings and auto-detection will be ignored)">
<!ENTITY folderCharsetOverride.accesskey "A">
<!ENTITY retention.label "Retention Policy">
<!ENTITY retentionUseDefault.label "Use server defaults">
<!ENTITY retentionUseDefault.accesskey "d">
<!ENTITY days.label "days">
<!ENTITY daysOld.label "days old">
<!ENTITY message.label "messages">
<!ENTITY retentionCleanup.label "To recover disk space, old messages can be permanently deleted">
<!ENTITY retentionKeepMsg.label "Delete messages more than">
<!ENTITY retentionKeepMsg.accesskey "m">
<!ENTITY retentionKeepAll.label "Don't delete any messages">
<!ENTITY retentionKeepAll.accesskey "A">
<!ENTITY retentionKeepNew.label "Delete all but the last">
<!ENTITY retentionKeepNew.accesskey "l">
<!ENTITY retentionKeepUnread.label "Always delete read messages">
<!ENTITY retentionKeepUnread.accesskey "r">
<!ENTITY folderOfflineTab.label "Offline">
<!ENTITY folderCheckForNewMessages.label "Check this folder for new messages">
<!ENTITY folderCheckForNewMessages.accesskey "C">

View File

@ -75,40 +75,14 @@ function initServerSettings()
function initRetentionSettings()
{
var retentionSettings = gIncomingServer.retentionSettings;
initCommonRetentionSettings(retentionSettings);
document.getElementById("nntp.keepUnread").checked = retentionSettings.keepUnreadMessagesOnly;
document.getElementById("nntp.removeBody").checked = retentionSettings.cleanupBodiesByDays;
document.getElementById("nntp.keepMsg").setAttribute("value", retentionSettings.retainByPreference);
if(retentionSettings.daysToKeepHdrs > 0)
document.getElementById("nntp.keepOldMsgMin").setAttribute("value", retentionSettings.daysToKeepHdrs);
else
document.getElementById("nntp.keepOldMsgMin").setAttribute("value", "30");
if(retentionSettings.numHeadersToKeep > 0)
document.getElementById("nntp.keepNewMsgMin").setAttribute("value", retentionSettings.numHeadersToKeep);
else
document.getElementById("nntp.keepNewMsgMin").setAttribute("value", "30");
if(retentionSettings.daysToKeepBodies > 0)
document.getElementById("nntp.removeBodyMin").setAttribute("value", retentionSettings.daysToKeepBodies);
else
document.getElementById("nntp.removeBodyMin").setAttribute("value", "30");
var keepAllMsg = document.getElementById("nntp.keepAllMsg");
switch(retentionSettings.retainByPreference)
{
case 1:
keepAllMsg.radioGroup.selectedItem = keepAllMsg;
break;
case 2:
keepAllMsg.radioGroup.selectedItem = document.getElementById("nntp.keepOldMsg");
break;
case 3:
keepAllMsg.radioGroup.selectedItem = document.getElementById("nntp.keepNewMsg");
break;
default:
keepAllMsg.radioGroup.selectedItem = keepAllMsg;
}
}
@ -134,19 +108,29 @@ function onPreInit(account, accountValues)
gIncomingServer= account.incomingServer;
gIncomingServer.type = gServerType;
var titleStringID;
// 10 is OFFLINE_SUPPORT_LEVEL_REGULAR, see nsIMsgIncomingServer.idl
// currently, there is no offline without diskspace
if (gIncomingServer.offlineSupportLevel >= 10) {
titleStringID = "prefPanel-offline-and-diskspace";
}
else {
titleStringID = "prefPanel-diskspace";
}
var titleStringID = (gIncomingServer.offlineSupportLevel >= 10) ?
"prefPanel-offline-and-diskspace" : "prefPanel-diskspace";
var prefBundle = document.getElementById("bundle_prefs");
var headertitle = document.getElementById("headertitle");
headertitle.setAttribute('title',prefBundle.getString(titleStringID));
if (gServerType == "pop3")
{
var pop3Server = gIncomingServer.QueryInterface(Components.interfaces.nsIPop3IncomingServer);
// hide retention settings for deferred accounts
if (pop3Server.deferredToAccount.length)
{
var retentionRadio = document.getElementById("retention.keepMsg");
retentionRadio.setAttribute("hidden", "true");
var retentionCheckbox = document.getElementById("retention.keepUnread");
retentionCheckbox.setAttribute("hidden", "true");
var retentionLabel = document.getElementById("retentionDescription");
retentionLabel.setAttribute("hidden", "true");
}
}
}
function onClickSelect()
@ -160,24 +144,14 @@ function onClickSelect()
function onSave()
{
var retentionSettings = new Array;
var downloadSettings = new Array;
gIncomingServer.limitOfflineMessageSize = document.getElementById("offline.notDownload").checked;
gIncomingServer.maxMessageSize = document.getElementById("offline.notDownloadMin").value;
if(document.getElementById("nntp.keepAllMsg").selected)
retentionSettings.retainByPreference = 1;
else if(document.getElementById("nntp.keepOldMsg").selected)
retentionSettings.retainByPreference = 2;
else if(document.getElementById("nntp.keepNewMsg").selected)
retentionSettings.retainByPreference = 3;
var retentionSettings = saveCommonRetentionSettings();
document.getElementById("nntp.keepMsg").value = retentionSettings.retainByPreference;
retentionSettings.daysToKeepHdrs = document.getElementById("nntp.keepOldMsgMin").value;
retentionSettings.daysToKeepBodies = document.getElementById("nntp.removeBodyMin").value;
retentionSettings.numHeadersToKeep = document.getElementById("nntp.keepNewMsgMin").value;
retentionSettings.keepUnreadMessagesOnly = document.getElementById("nntp.keepUnread").checked;
retentionSettings.cleanupBodiesByDays = document.getElementById("nntp.removeBody").checked;
downloadSettings.downloadByDate = document.getElementById("nntp.downloadMsg").checked;
@ -238,10 +212,10 @@ function onLockPreference()
{ prefstring:"downloadUnreadOnly", id:"nntp.notDownloadRead"},
{ prefstring:"downloadByDate", id:"nntp.downloadMsg"},
{ prefstring:"ageLimit", id:"nntp.downloadMsgMin"},
{ prefstring:"retainBy", id:"nntp.keepMsg"},
{ prefstring:"daysToKeepHdrs", id:"nntp.keepOldMsgMin"},
{ prefstring:"numHdrsToKeep", id:"nntp.keepNewMsgMin"},
{ prefstring:"keepUnreadOnly", id:"nntp.keepUnread"},
{ prefstring:"retainBy", id:"retention.keepMsg"},
{ prefstring:"daysToKeepHdrs", id:"retention.keepOldMsgMin"},
{ prefstring:"numHdrsToKeep", id:"retention.keepNewMsgMin"},
{ prefstring:"keepUnreadOnly", id:"retention.keepUnread"},
{ prefstring:"daysToKeepBodies", id:"nntp.removeBodyMin"},
{ prefstring:"cleanupBodies", id:"nntp.removeBody" },
{ prefstring:"disable_button.selectFolder", id:"selectNewsgroupsButton"},
@ -267,30 +241,3 @@ function onCheckItem(broadcasterElementId, checkElementId)
}
function onCheckKeepMsg()
{
if (gLockedPref["nntp.keepMsg"]) {
// if the pref associated with the radiobutton is locked, as indicated
// by the gLockedPref, skip this function. All elements in this
// radiogroup have been locked by the function onLockPreference.
return;
}
var checkedOld = document.getElementById("nntp.keepOldMsg").selected;
var checkedNew = document.getElementById("nntp.keepNewMsg").selected;
var checkedAll = document.getElementById("nntp.keepAllMsg").selected;
if(checkedAll) {
document.getElementById("nntp.keepNewMsgMin").setAttribute("disabled", "true");
document.getElementById("nntp.keepOldMsgMin").setAttribute("disabled", "true");
}
else if(checkedOld) {
document.getElementById("nntp.keepOldMsgMin").removeAttribute("disabled");
document.getElementById("nntp.keepNewMsgMin").setAttribute("disabled", "true");
}
else if(checkedNew) {
document.getElementById("nntp.keepNewMsgMin").removeAttribute("disabled");
document.getElementById("nntp.keepOldMsgMin").setAttribute("disabled", "true");
}
}

View File

@ -52,6 +52,7 @@
<stringbundle id="bundle_prefs" src="chrome://messenger/locale/prefs.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/AccountManager.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/retention.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/am-offline.js"/>
<broadcaster id="bc_notDownload"/>
@ -114,32 +115,32 @@
<label value="&daysOld.label;"/>
</hbox>
<vbox hidefor="movemail,pop3,imap" align="start">
<vbox align="start">
<separator hidefor="none"/>
<description class="desc">&nntpCleanup.label;</description>
<description id="retentionDescription" hidefor="" class="desc">&retentionCleanup.label;</description>
<radiogroup wsm_persist="true" id="nntp.keepMsg" class="indent">
<radio wsm_persist="true" id="nntp.keepAllMsg" value="1" accesskey="&nntpKeepAll.accesskey;"
label="&nntpKeepAll.label;" oncommand="onCheckKeepMsg();"/>
<radiogroup wsm_persist="true" hidefor="" id="retention.keepMsg" class="indent">
<radio wsm_persist="true" id="retention.keepAllMsg" value="1" accesskey="&retentionKeepAll.accesskey;"
label="&retentionKeepAll.label;" oncommand="onCheckKeepMsg();"/>
<hbox flex="1" align="center">
<radio wsm_persist="true" id="nntp.keepNewMsg" accesskey="&nntpKeepNew.accesskey;"
value="3" label="&nntpKeepNew.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="nntp.keepNewMsgMin" size="2" value="30"/>
<radio wsm_persist="true" id="retention.keepNewMsg" accesskey="&retentionKeepNew.accesskey;"
value="3" label="&retentionKeepNew.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="retention.keepNewMsgMin" size="2" value="30"/>
<label value="&message.label;"/>
</hbox>
<hbox flex="1" align="center">
<radio wsm_persist="true" id="nntp.keepOldMsg" accesskey="&nntpKeepMsg.accesskey;"
value="2" label="&nntpKeepMsg.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="nntp.keepOldMsgMin" size="2" value="30"/>
<radio wsm_persist="true" id="retention.keepOldMsg" accesskey="&retentionKeepMsg.accesskey;"
value="2" label="&retentionKeepMsg.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="retention.keepOldMsgMin" size="2" value="30"/>
<label value="&days.label;"/>
</hbox>
</radiogroup>
<hbox align="center" class="indent">
<checkbox wsm_persist="true" id="nntp.keepUnread" accesskey="&nntpKeepUnread.accesskey;"
label="&nntpKeepUnread.label;" checked="true"/>
<checkbox wsm_persist="true" id="retention.keepUnread" accesskey="&retentionKeepUnread.accesskey;"
label="&retentionKeepUnread.label;" hidefor="" checked="true"/>
</hbox>
<hbox align="center" class="indent">
<hbox align="center" class="indent" hidefor="movemail,pop3,imap,none">
<checkbox wsm_persist="true" id="nntp.removeBody" accesskey="&nntpRemoveBody.accesskey;"
label="&nntpRemoveBody.label;" oncommand="onCheckItem('bc_removeBody','nntp.removeBody');"/>
<textbox wsm_persist="true" id="nntp.removeBodyMin" size="2" value="30" observes="bc_removeBody"/>

View File

@ -12,15 +12,15 @@
<!ENTITY nntpNotDownloadRead.accesskey "R">
<!ENTITY nntpDownloadMsg.label "Messages more than">
<!ENTITY nntpDownloadMsg.accesskey "e">
<!ENTITY nntpCleanup.label "Keep:">
<!ENTITY nntpKeepMsg.label "Messages which have arrived within the last">
<!ENTITY nntpKeepMsg.accesskey "w">
<!ENTITY nntpKeepAll.label "All messages">
<!ENTITY nntpKeepAll.accesskey "A">
<!ENTITY nntpKeepNew.label "The newest">
<!ENTITY nntpKeepNew.accesskey "n">
<!ENTITY nntpKeepUnread.label "Only unread messages">
<!ENTITY nntpKeepUnread.accesskey "u">
<!ENTITY retentionCleanup.label "To recover disk space, old messages can be permanently deleted">
<!ENTITY retentionKeepMsg.label "Delete messages more than">
<!ENTITY retentionKeepMsg.accesskey "m">
<!ENTITY retentionKeepAll.label "Don't delete any messages">
<!ENTITY retentionKeepAll.accesskey "A">
<!ENTITY retentionKeepNew.label "Delete all but the last">
<!ENTITY retentionKeepNew.accesskey "l">
<!ENTITY retentionKeepUnread.label "Always delete read messages">
<!ENTITY retentionKeepUnread.accesskey "r">
<!ENTITY nntpRemoveBody.label "Only message bodies less than">
<!ENTITY nntpRemoveBody.accesskey "O">
<!ENTITY offlineSelectNntp.label "Select newsgroups for offline use...">

View File

@ -1,3 +1,40 @@
/* ***** 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) 2000-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Bienvenu <bienvenu@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 gMsgFolder;
var gServerTypeFolder = null;
var gPreselectedFolderURI = null;
@ -5,6 +42,7 @@ var gParentMsgWindow = null;
var gNameTextbox;
var gOldName;
var gOkButton;
var gLockedPref = null;
// services used
var RDF;
@ -129,6 +167,11 @@ function folderPropsOKButton()
gMsgFolder.setFlag(MSG_FOLDER_FLAG_CHECK_NEW);
else
gMsgFolder.clearFlag(MSG_FOLDER_FLAG_CHECK_NEW);
var retentionSettings = saveCommonRetentionSettings();
retentionSettings.useServerDefaults = document.getElementById("retention.useDefault").checked;
gMsgFolder.retentionSettings = retentionSettings;
}
try
@ -146,8 +189,6 @@ function folderPropsOKButton()
function folderPropsOnLoad()
{
dump("folder props loaded"+'\n');
gOkButton = document.documentElement.getButton("accept");
RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
@ -188,9 +229,6 @@ function folderPropsOnLoad()
gServerTypeFolder = window.arguments[0].serverType;
dump("preselectfolder uri = "+gPreselectedFolderURI+'\n');
dump("serverType = "+gServerTypeFolder+'\n');
if (window.arguments && window.arguments[0]) {
if (window.arguments[0].msgWindow) {
gParentMsgWindow = window.arguments[0].msgWindow;
@ -245,7 +283,11 @@ function folderPropsOnLoad()
imapFolder.fillInFolderProps(gFolderPropsSink);
}
var retentionSettings = gMsgFolder.retentionSettings;
initCommonRetentionSettings(retentionSettings);
document.getElementById("retention.useDefault").checked = retentionSettings.useServerDefaults;
// select the initial tab
if (window.arguments[0].tabID) {
// set index for starting panel on the <tabpanel> element
@ -259,7 +301,9 @@ function folderPropsOnLoad()
catch (ex) {}
}
hideShowControls(gServerTypeFolder);
onCheckKeepMsg();
onUseDefaultRetentionSettings();
moveToAlertPosition();
}
@ -357,3 +401,8 @@ function onFolderPrivileges()
}
function onUseDefaultRetentionSettings()
{
var useDefault = document.getElementById("retention.useDefault").checked;
document.getElementById('retention.keepMsg').disabled = useDefault;
}

View File

@ -53,8 +53,9 @@
ondialogaccept="return folderPropsOKButton();">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
<script type="application/x-javascript" src="chrome://messenger/content/folderProps.js"></script>
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/retention.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/folderProps.js"/>
<script type="application/x-javascript">
<![CDATA[
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
@ -65,6 +66,7 @@
<tabbox>
<tabs>
<tab id="GeneralTab" label="&generalInfo.label;"/>
<tab id="Retention" label="&retention.label;"/>
<tab hidefor="movemail,pop3,rss,none" hidable="true" id="OfflineTab" label="&folderOfflineTab.label;"/>
<tab hidefor="movemail,pop3,rss,none,nntp" hidable="true" id="SharingTab" label="&folderSharingTab.label;"/>
<tab hidefor="movemail,pop3,rss,none,nntp" hidable="true" id="QuotaTab" label="&folderQuotaTab.label;"/>
@ -99,6 +101,37 @@
</vbox>
</vbox>
<vbox align="start">
<description class="desc">&retentionCleanup.label;</description>
<hbox align="center" class="indent">
<checkbox wsm_persist="true" id="retention.useDefault" accesskey="&retentionUseDefault.accesskey;"
label="&retentionUseDefault.label;" checked="true" oncommand="onUseDefaultRetentionSettings()"/>
</hbox>
<vbox class="indent">
<radiogroup wsm_persist="true" id="retention.keepMsg" class="indent">
<radio wsm_persist="true" value="1" accesskey="&retentionKeepAll.accesskey;"
label="&retentionKeepAll.label;" oncommand="onCheckKeepMsg();"/>
<hbox flex="1" >
<radio wsm_persist="true" accesskey="&retentionKeepNew.accesskey;"
value="3" label="&retentionKeepNew.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="retention.keepNewMsgMin" size="2" value="30"/>
<label value="&message.label;"/>
</hbox>
<hbox flex="1">
<radio wsm_persist="true" accesskey="&retentionKeepMsg.accesskey;"
value="2" label="&retentionKeepMsg.label;" oncommand="onCheckKeepMsg();"/>
<textbox wsm_persist="true" id="retention.keepOldMsgMin" size="2" value="30"/>
<label value="&days.label;"/>
</hbox>
</radiogroup>
<hbox>
<checkbox wsm_persist="true" id="retention.keepUnread" accesskey="&retentionKeepUnread.accesskey;"
label="&retentionKeepUnread.label;" observes="retention.keepMsg" checked="true"/>
</hbox>
</vbox>
</vbox>
<vbox hidable="true" hidefor="movemail,pop3,rss,none" valign="top" align="start">
<vbox>
<checkbox iscontrolcontainer="true" hidable="true"

View File

@ -0,0 +1,80 @@
/*
* -*- 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 Initial Developer of the Original Code is
* The Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Bienvenu <bienvenu@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 ****** */
function initCommonRetentionSettings(retentionSettings)
{
document.getElementById("retention.keepUnread").checked = retentionSettings.keepUnreadMessagesOnly;
document.getElementById("retention.keepMsg").value = retentionSettings.retainByPreference;
if(retentionSettings.daysToKeepHdrs > 0)
document.getElementById("retention.keepOldMsgMin").value =
(retentionSettings.daysToKeepHdrs > 0) ? retentionSettings.daysToKeepHdrs : 30;
document.getElementById("retention.keepNewMsgMin").value =
(retentionSettings.numHeadersToKeep > 0) ? retentionSettings.numHeadersToKeep : 30;
document.getElementById("retention.keepMsg").value = retentionSettings.retainByPreference;
}
function saveCommonRetentionSettings()
{
var retentionSettings = new Object;
retentionSettings.retainByPreference = document.getElementById("retention.keepMsg").value;
retentionSettings.daysToKeepHdrs = document.getElementById("retention.keepOldMsgMin").value;
retentionSettings.numHeadersToKeep = document.getElementById("retention.keepNewMsgMin").value;
retentionSettings.keepUnreadMessagesOnly = document.getElementById("retention.keepUnread").checked;
return retentionSettings;
}
function onCheckKeepMsg()
{
if (gLockedPref && gLockedPref["retention.keepMsg"]) {
// if the pref associated with the radiobutton is locked, as indicated
// by the gLockedPref, skip this function. All elements in this
// radiogroup have been locked by the function onLockPreference.
return;
}
var keepMsg = document.getElementById("retention.keepMsg").value;
document.getElementById("retention.keepOldMsgMin").disabled = keepMsg != 2;
document.getElementById("retention.keepNewMsgMin").disabled = keepMsg != 3;
}

View File

@ -46,6 +46,26 @@
<!ENTITY folderCharsetOverride.label "Apply default to all messages in the folder (individual message character encoding settings and auto-detection will be ignored)">
<!ENTITY folderCharsetOverride.accesskey "A">
<!ENTITY retention.label "Retention Policy">
<!ENTITY retentionUseDefault.label "Use server defaults">
<!ENTITY retentionUseDefault.accesskey "d">
<!ENTITY days.label "days">
<!ENTITY daysOld.label "days old">
<!ENTITY message.label "messages">
<!ENTITY retentionNotDownloadRead.label "Read messages">
<!ENTITY retentionNotDownloadRead.accesskey "R">
<!ENTITY retentionDownloadMsg.label "Messages more than">
<!ENTITY retentionDownloadMsg.accesskey "e">
<!ENTITY retentionCleanup.label "Keep:">
<!ENTITY retentionKeepMsg.label "Messages which have arrived within the last">
<!ENTITY retentionKeepMsg.accesskey "w">
<!ENTITY retentionKeepAll.label "All messages">
<!ENTITY retentionKeepAll.accesskey "A">
<!ENTITY retentionKeepNew.label "The newest">
<!ENTITY retentionKeepNew.accesskey "n">
<!ENTITY retentionKeepUnread.label "Only unread messages">
<!ENTITY retentionKeepUnread.accesskey "u">
<!ENTITY folderOfflineTab.label "Offline">
<!ENTITY folderCheckForNewMessages.label "Check this folder for new messages">
<!ENTITY folderCheckForNewMessages.accesskey "C">