Follow up to Bug #240138 --> Add pref UI for turning on / off showing just the display name

for contacts you know.
This commit is contained in:
scott%scott-macgregor.org 2004-04-15 23:36:17 +00:00
Родитель 25d84ac621
Коммит bd9553c285
4 изменённых файлов: 32 добавлений и 2 удалений

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

@ -44,6 +44,8 @@ pref("general.useragent.vendorSub",
// Overrides of the seamonkey suite mailnews.js prefs
/////////////////////////////////////////////////////////////////
pref("mail.showFolderPaneColumns", false); // setting to true will allow total/unread/size columns
pref("mail.showCondensedAddresses", true); // show the friendly display name for people I know
pref("mailnews.message_display.allow.plugins", false); // disable plugins by default
// hidden pref for changing how we present attachments in the message pane

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

@ -65,6 +65,7 @@ var gMessengerBundle;
var gProfileDirURL;
var gIOService;
var gFileHandler;
var gShowCondensedEmailAddresses = true; // show the friendly display names for people I know instead of the name + email address
var gPersonalAddressBookDirectory; // used for determining if we want to show just the display name in email address nodes
var msgHeaderParser = Components.classes[msgHeaderParserContractID].getService(Components.interfaces.nsIMsgHeaderParser);
@ -219,6 +220,11 @@ function OnLoadMsgHeaderPane()
gMinNumberOfHeaders = pref.getIntPref("mailnews.headers.minNumHeaders");
gShowOrganization = pref.getBoolPref("mailnews.headers.showOrganization");
gShowLargeAttachmentView = pref.getBoolPref("mailnews.attachments.display.largeView");
gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses");
// listen to the
pref.addObserver("mail.showCondensedAddresses", MsgHdrViewObserver, false);
initializeHeaderViewTables();
var toggleHeaderView = document.getElementById("msgHeaderView");
@ -235,6 +241,8 @@ function OnLoadMsgHeaderPane()
function OnUnloadMsgHeaderPane()
{
pref.removeObserver("mail.showCondensedAddresses", MsgHdrViewObserver);
// dispatch an event letting any listeners know that we have unloaded the message pane
var event = document.createEvent('Events');
event.initEvent('messagepane-unloaded', false, true);
@ -242,6 +250,22 @@ function OnUnloadMsgHeaderPane()
headerViewElement.dispatchEvent(event);
}
const MsgHdrViewObserver =
{
observe: function(subject, topic, prefName)
{
// verify that we're changing the mail pane config pref
if (topic == "nsPref:changed")
{
if (prefName == "mail.showCondensedAddresses")
{
gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses");
MsgReload();
}
}
}
};
// The messageHeaderSink is the class that gets notified of a message's headers as we display the message
// through our mime converter.
@ -845,7 +869,7 @@ function AddExtraAddressProcessing(emailAddress, addressNode)
var displayName = addressNode.getTextAttribute("displayName");
var emailAddress = addressNode.getTextAttribute("emailAddress");
if (displayName && useDisplayNameForAddress(emailAddress))
if (gShowCondensedEmailAddresses && displayName && useDisplayNameForAddress(emailAddress))
addressNode.setAttribute('label', displayName);
}

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

@ -62,7 +62,7 @@
"emailCollectionOutgoing", "localDirectoriesList",
// general settings
"markAsRead", "markAsReadDelay", "showFolderPaneColumns",
"showCondensedAddresses", "markAsRead", "markAsReadDelay", "showFolderPaneColumns",
// connection
"networkProxyType",
@ -125,6 +125,9 @@
<!-- Message Display Extras -->
<expander id="generalSettings" label="&generalSettings.label;" open="true" persist="open" clearhidden="true">
<hbox align="center" pack="start">
<checkbox id="showCondensedAddresses" label="&showCondensedAddresses.label;" prefstring="mail.showCondensedAddresses"/>
</hbox>
<hbox align="center" pack="start">
<checkbox id="markAsRead" label="&markAsRead.label;" prefstring="mailnews.mark_message_read.delay"/>
<textbox id="markAsReadDelay" size="2" preftype="int" prefstring="mailnews.mark_message_read.delay.interval"/>

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

@ -15,6 +15,7 @@
<!-- General -->
<!ENTITY generalSettings.label "General Settings">
<!ENTITY showCondensedAddresses.label "Show only display name for people in my address book.">
<!ENTITY markAsRead.label "Mark message read after displaying for">
<!ENTITY markAsReadEnd.label "second(s).">
<!ENTITY showFolderColumns.label "Show expanded columns in the folder pane.">