mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Fix for bugs 79554, 80194, 82805, 82984. r=bhuvan, sr=sspitzer, a=asa@mozilla.org
This commit is contained in:
parent
3a5dee4898
commit
2e487bdf56
@ -31,20 +31,12 @@ function onInit()
|
||||
initRetentionSettings();
|
||||
initDownloadSettings();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function initServerSettings()
|
||||
{
|
||||
|
||||
var prefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);
|
||||
var compactFolder = prefs.GetBoolPref("mail.prompt_purge_threshhold");
|
||||
var compactFolderMin = prefs.GetIntPref("mail.purge_threshhold");
|
||||
if (compactFolderMin == null || compactFolderMin == 0 )
|
||||
compactFolderMin = 100;
|
||||
document.getElementById("offline.notDownload").checked = gIncomingServer.limitMessageSize;
|
||||
document.getElementById("offline.compactFolder").checked = compactFolder;
|
||||
document.getElementById("offline.compactFolderMin").setAttribute("value", compactFolderMin);
|
||||
if(gIncomingServer.maxMessageSize > 0)
|
||||
document.getElementById("offline.notDownloadMin").setAttribute("value", gIncomingServer.maxMessageSize);
|
||||
else
|
||||
@ -54,6 +46,7 @@ function initServerSettings()
|
||||
gImapIncomingServer = gIncomingServer.QueryInterface(Components.interfaces.nsIImapIncomingServer);
|
||||
document.getElementById("offline.downloadBodiesOnGetNewMail").checked = gImapIncomingServer.downloadBodiesOnGetNewMail;
|
||||
document.getElementById("offline.newFolder").checked = gImapIncomingServer.offlineDownload;
|
||||
onLockPreference();
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,13 +71,20 @@ function initRetentionSettings()
|
||||
else
|
||||
document.getElementById("nntp.removeBodyMin").setAttribute("value", "30");
|
||||
|
||||
if(retentionSettings.retainByPreference == 1)
|
||||
switch(retentionSettings.retainByPreference)
|
||||
{
|
||||
case 1:
|
||||
document.getElementById("nntp.keepAllMsg").checked = true;
|
||||
else if(retentionSettings.retainByPreference == 2)
|
||||
break;
|
||||
case 2:
|
||||
document.getElementById("nntp.keepOldMsg").checked = true;
|
||||
else if(retentionSettings.retainByPreference == 3)
|
||||
break;
|
||||
case 3:
|
||||
document.getElementById("nntp.keepNewMsg").checked = true;
|
||||
|
||||
break;
|
||||
default:
|
||||
document.getElementById("nntp.keepAllMsg").checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -200,10 +200,6 @@ function onSave()
|
||||
var retentionSettings = new Array;
|
||||
var downloadSettings = new Array;
|
||||
|
||||
var prefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);
|
||||
var compactFolderMin = document.getElementById("offline.compactFolderMin").value;
|
||||
var compactFolder = document.getElementById("offline.compactFolder").checked;
|
||||
|
||||
gIncomingServer.limitMessageSize = document.getElementById("offline.notDownload").checked;
|
||||
gIncomingServer.maxMessageSize = document.getElementById("offline.notDownloadMin").value;
|
||||
|
||||
@ -225,8 +221,6 @@ function onSave()
|
||||
downloadSettings.downloadUnreadOnly = document.getElementById("nntp.downloadUnread").checked;
|
||||
downloadSettings.ageLimitOfMsgsToDownload = document.getElementById("nntp.downloadMsgMin").value;
|
||||
|
||||
prefs.SetBoolPref("mail.prompt_purge_threshhold", compactFolder);
|
||||
prefs.SetIntPref("mail.purge_threshhold", compactFolderMin);
|
||||
gIncomingServer.retentionSettings = retentionSettings;
|
||||
gIncomingServer.downloadSettings = downloadSettings;
|
||||
|
||||
@ -236,3 +230,27 @@ function onSave()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onLockPreference()
|
||||
{
|
||||
var isDownloadLocked = false;
|
||||
var isGetNewLocked = false;
|
||||
var initPrefString = "mail.server";
|
||||
var finalPrefString;
|
||||
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"];
|
||||
prefService = prefService.getService();
|
||||
prefService = prefService.QueryInterface(Components.interfaces.nsIPrefService);
|
||||
|
||||
finalPrefString = initPrefString + "." + gIncomingServer.key + ".";
|
||||
var pref = prefService.getBranch(finalPrefString);
|
||||
isDownloadLocked = pref.PrefIsLocked("offline_download");
|
||||
if(isDownloadLocked)
|
||||
document.getElementById("offline.newFolder").disabled = true;
|
||||
|
||||
isGetNewLocked = pref.PrefIsLocked("download_bodies_on_get_new_mail");
|
||||
if(isGetNewLocked)
|
||||
document.getElementById("offline.downloadBodiesOnGetNewMail").disabled = true;
|
||||
|
||||
}
|
||||
|
||||
|
@ -53,12 +53,6 @@ Contributors:
|
||||
<text class="label" value="&kb.label;"/>
|
||||
</box>
|
||||
|
||||
<box iscontrolcontainer="true" orient="horizontal" autostretch="never">
|
||||
<checkbox wsm_persist="true" id="offline.compactFolder"
|
||||
label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"/>
|
||||
<textbox wsm_persist="true" id="offline.compactFolderMin" size="5" value="100"/>
|
||||
<text class="label" value="&kb.label;"/>
|
||||
</box>
|
||||
</titledbox>
|
||||
|
||||
<titledbox orient="vertical" id="offline.titlebox" hidable="true" hidefor="pop3">
|
||||
@ -99,13 +93,7 @@ Contributors:
|
||||
<text class="label" value="&kb.label;"/>
|
||||
</box>
|
||||
|
||||
<box iscontrolcontainer="true" orient="horizontal" autostretch="never">
|
||||
<checkbox wsm_persist="true" id="offline.compactFolder"
|
||||
label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"/>
|
||||
<textbox wsm_persist="true" id="offline.compactFolderMin" size="5" value="100"/>
|
||||
<text class="label" value="&kb.label;"/>
|
||||
</box>
|
||||
|
||||
|
||||
<checkbox iscontrolcontainer="true" hidable="true" hidefor="pop3,imap"
|
||||
wsm_persist="true" id="nntp.downloadUnread" label="&nntpDownloadUnread.label;" accesskey="&nntpDownloadUnread.accesskey;"/>
|
||||
<box iscontrolcontainer="true" hidable="true" hidefor="pop3,imap" orient="horizontal" autostretch="never">
|
||||
|
@ -5,8 +5,6 @@
|
||||
<!ENTITY offlineNewFolder.accesskey "h">
|
||||
<!ENTITY offlineNotDownload.label "Do not download messages locally that are larger than">
|
||||
<!ENTITY offlineNotDownload.accesskey "d">
|
||||
<!ENTITY offlineCompact.label "Compact folders when it will save over">
|
||||
<!ENTITY offlineCompact.accesskey "c">
|
||||
<!ENTITY kb.label "kB">
|
||||
<!ENTITY days.label "days">
|
||||
<!ENTITY daysAgo.label "days ago">
|
||||
|
@ -175,7 +175,7 @@ function LoadSyncTree()
|
||||
for (var i=0;i<allServers.Count();i++) {
|
||||
|
||||
var currentServer = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer);
|
||||
var rootURI = currentServer.serverURI
|
||||
var rootURI = currentServer.serverURI;
|
||||
var rootFolder = currentServer.RootFolder;
|
||||
|
||||
var rootMsgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
@ -306,3 +306,4 @@ pref("mail.biff.default_sound_url","");
|
||||
pref("mail.content_disposition_type", 0);
|
||||
|
||||
pref("mailnews.show_send_progress", true); //Will show a progress dialog when saving or sending a message
|
||||
pref("mail.server.default.retainBy", 1);
|
||||
|
@ -306,3 +306,4 @@ pref("mail.biff.default_sound_url","");
|
||||
pref("mail.content_disposition_type", 0);
|
||||
|
||||
pref("mailnews.show_send_progress", true); //Will show a progress dialog when saving or sending a message
|
||||
pref("mail.server.default.retainBy", 1);
|
||||
|
@ -19,7 +19,7 @@
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Contributor(s): Mohan Bhamidipati (mohanb@netscape.com)
|
||||
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["offlineStartupstate", "whengoingOnlinestate", "whengoingOfflinestate"];
|
||||
var _elementIDs = ["offlineStartupstate", "whengoingOnlinestate", "whengoingOfflinestate", "offlineCompactFolder", "offlineCompactFolderMin"];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
@ -49,37 +49,45 @@
|
||||
<titledbox orient="vertical" class="small-margin">
|
||||
<label value="&rHeader;"/>
|
||||
|
||||
<html> &descipt1;</html>
|
||||
|
||||
<text value="&textStart;"/>
|
||||
<radiogroup id="offlineStartupstate" orient="vertical" autostretch="never"
|
||||
pref="true" preftype="int" prefstring="offline.startup_state"
|
||||
prefattribute="value">
|
||||
<radio class="small-margin" group="offlineStartupstate" value="0" label="&prevRadio;"/>
|
||||
<radio class="small-margin" group="offlineStartupstate" value="1" label="&askOfflineRadio;"/>
|
||||
<radio class="small-margin" group="offlineStartupstate" value="0" label="&radioAskMode;"/>
|
||||
<radio class="small-margin" group="offlineStartupstate" value="1" label="&radioUsePrev;"/>
|
||||
</radiogroup>
|
||||
</titledbox>
|
||||
|
||||
<titledbox orient="vertical" class="small-margin">
|
||||
<label value="&header2;"/>
|
||||
<separator class="thin"/>
|
||||
<text value="&textGoingOnline;"/>
|
||||
<radiogroup id="whengoingOnlinestate" orient="vertical" autostretch="never"
|
||||
pref="true" preftype="int" prefstring="offline.send.unsent_messages"
|
||||
prefattribute="value">
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="0" label="&unsentAskRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="1" label="&unsentAutoRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="2" label="&unsentDoNotRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="0" label="&radioAskUnsent;"/>
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="1" label="&radioAutoSend;"/>
|
||||
<radio class="small-margin" group="whengoingOnlinestate" value="2" label="&radioNotSend;"/>
|
||||
</radiogroup>
|
||||
</titledbox>
|
||||
|
||||
<titledbox orient="vertical" class="small-margin">
|
||||
<label value="&header3;"/>
|
||||
|
||||
<separator class="thin"/>
|
||||
<text value="&textGoingOffline;"/>
|
||||
<radiogroup id="whengoingOfflinestate" orient="vertical" autostretch="never"
|
||||
pref="true" preftype="int" prefstring="offline.download.download_messages"
|
||||
prefattribute="value">
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="0" label="&unsentAskDownloadRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="1" label="&unsentAutoDownloadRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="2" label="&unsentDoNotDownloadRadio;"/>
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="0" label="&radioAskDownload;"/>
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="1" label="&radioAutoDownload;"/>
|
||||
<radio class="small-margin" group="whengoingOfflinestate" value="2" label="&radioNotDownload;"/>
|
||||
</radiogroup>
|
||||
|
||||
</titledbox>
|
||||
|
||||
<titledbox orient="vertical">
|
||||
<label value="&Diskspace;"/>
|
||||
<box orient="horizontal" autostretch="never">
|
||||
<checkbox id="offlineCompactFolder" label="&offlineCompact.label;" accesskey="&offlineCompact.accesskey;"
|
||||
pref="true" preftype="bool" prefstring="mail.prompt_purge_threshhold" prefattribute="checked"/>
|
||||
<textbox id="offlineCompactFolderMin" size="5" value="100"
|
||||
pref="true" preftype="int" prefstring="mail.purge_threshhold" prefattribute="value"/>
|
||||
<text class="label" value="&kb.label;"/>
|
||||
</box>
|
||||
</titledbox>
|
||||
|
||||
</window>
|
||||
|
@ -1,21 +1,25 @@
|
||||
<!-- extracted from content/pref-offline.xul -->
|
||||
|
||||
<!--LOCALIZATION NOTE : FILE The 'Offline' preferences dialog -->
|
||||
<!ENTITY window.title "Offline">
|
||||
<!ENTITY boxHeader "Offline">
|
||||
<!ENTITY rHeader "Startup Mode">
|
||||
<!ENTITY descipt1 "&brandShortName; can start in either online or offline mode. When online you have full
|
||||
access to your network. When offline you can only read messages that you have previously downloaded to your local computer.">
|
||||
<!ENTITY prevRadio "Remember my previous mode">
|
||||
<!ENTITY communRemember "&brandShortName; will remember the state it was in last and start in that mode.">
|
||||
<!ENTITY askOfflineRadio "Ask me at startup">
|
||||
<!ENTITY offlineStartAskEach "&brandShortName; will ask you each time you start the program.">
|
||||
<!ENTITY header2 "When Going Online">
|
||||
<!ENTITY unsentAskRadio "Ask me if I want to send my unsent messages">
|
||||
<!ENTITY unsentAutoRadio "Automatically send my unsent messages">
|
||||
<!ENTITY unsentDoNotRadio "Do not send my unsent messages">
|
||||
<!ENTITY header3 "When Going Offline">
|
||||
<!ENTITY unsentAskDownloadRadio "Ask me if I want to download messages for offline use">
|
||||
<!ENTITY unsentAutoDownloadRadio "Automatically download messages for offline use">
|
||||
<!ENTITY unsentDoNotDownloadRadio "Do not download messages for offline use">
|
||||
<!ENTITY promptSynchCheck "Prompt me to synchronize my messages">
|
||||
<!ENTITY window.title "Offline and Disk Space">
|
||||
<!ENTITY boxHeader "Offline and Disk Space">
|
||||
<!ENTITY rHeader "Offline">
|
||||
<!--LOCALIZATION NOTE (textStart): Don't translate "&brandShortName;".
|
||||
Place "&brandShortName;" in the phrase where the name of the application should
|
||||
appear
|
||||
-->
|
||||
<!ENTITY textStart "When starting &brandShortName;:">
|
||||
<!ENTITY radioAskMode "Ask me if I want online or offline mode">
|
||||
<!ENTITY radioUsePrev "Use my previous online/offline state">
|
||||
<!ENTITY textGoingOnline "When going online:">
|
||||
<!ENTITY radioAskUnsent "Ask me if I want to send my unsent messages">
|
||||
<!ENTITY radioAutoSend "Automatically send my unsent messages">
|
||||
<!ENTITY radioNotSend "Do not send my unsent messages">
|
||||
<!ENTITY textGoingOffline "When going offline:">
|
||||
<!ENTITY radioAskDownload "Ask me if I want to download messages for offline use">
|
||||
<!ENTITY radioAutoDownload "Automatically download messages for offline use">
|
||||
<!ENTITY radioNotDownload "Do not download messages for offline use">
|
||||
<!ENTITY Diskspace "Disk Space">
|
||||
<!ENTITY offlineCompact.label "Compact folders when it will save over">
|
||||
<!ENTITY offlineCompact.accesskey "c">
|
||||
<!ENTITY kb.label "KB">
|
@ -16,7 +16,7 @@
|
||||
<!ENTITY compose.label "Composer">
|
||||
<!ENTITY editing.label "New Page Settings">
|
||||
<!ENTITY publish.label "Publish">
|
||||
<!ENTITY offline.label "Offline">
|
||||
<!ENTITY offline.label "Offline and Disk Space">
|
||||
<!ENTITY security.label "Privacy and Security">
|
||||
<!ENTITY advance.label "Advanced">
|
||||
<!ENTITY down.label "Download">
|
||||
|
Loading…
x
Reference in New Issue
Block a user