Bug 452419 Message Header display shouldn't get the show references pref for each item of the header displayed. r=bienvenu

This commit is contained in:
Mark Banner 2008-08-28 09:16:08 +01:00
Родитель a746f05558
Коммит 8ece777fe0
1 изменённых файлов: 10 добавлений и 4 удалений

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

@ -63,6 +63,7 @@ var gBuiltExpandedView = false;
var gBuiltCollapsedView = false; var gBuiltCollapsedView = false;
var gMessengerBundle; var gMessengerBundle;
var gProfileDirURL; var gProfileDirURL;
var gHeadersShowReferences = false;
var gShowCondensedEmailAddresses = true; // show the friendly display names for people I know instead of the name + email address var gShowCondensedEmailAddresses = true; // show the friendly display names for people I know instead of the name + email address
// other components may listen to on start header & on end header notifications for each message we display // other components may listen to on start header & on end header notifications for each message we display
@ -231,9 +232,11 @@ function OnLoadMsgHeaderPane()
// displaying a message... // displaying a message...
gMinNumberOfHeaders = pref.getIntPref("mailnews.headers.minNumHeaders"); gMinNumberOfHeaders = pref.getIntPref("mailnews.headers.minNumHeaders");
gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses"); gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses");
gHeadersShowReferences = pref.getBoolPref("mailnews.headers.showReferences");
// listen to the // listen to the
pref.addObserver("mail.showCondensedAddresses", MsgHdrViewObserver, false); pref.addObserver("mail.showCondensedAddresses", MsgHdrViewObserver, false);
pref.addObserver("mailnews.headers.showReferences", MsgHdrViewObserver, false);
initializeHeaderViewTables(); initializeHeaderViewTables();
@ -250,6 +253,7 @@ function OnLoadMsgHeaderPane()
function OnUnloadMsgHeaderPane() function OnUnloadMsgHeaderPane()
{ {
pref.removeObserver("mail.showCondensedAddresses", MsgHdrViewObserver); pref.removeObserver("mail.showCondensedAddresses", MsgHdrViewObserver);
pref.removeObserver("mailnews.headers.showReferences", MsgHdrViewObserver);
// dispatch an event letting any listeners know that we have unloaded the message pane // dispatch an event letting any listeners know that we have unloaded the message pane
var event = document.createEvent('Events'); var event = document.createEvent('Events');
@ -270,6 +274,11 @@ const MsgHdrViewObserver =
gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses"); gShowCondensedEmailAddresses = pref.getBoolPref("mail.showCondensedAddresses");
MsgReload(); MsgReload();
} }
else if (prefName == "mailnews.headers.showReferences")
{
gHeadersShowReferences = pref.getBoolPref("mailnews.headers.showReferences");
MsgReload();
}
} }
} }
}; };
@ -802,11 +811,8 @@ function UpdateMessageHeaders()
if (headerEntry) if (headerEntry)
{ {
var showReference = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch2)
.getBoolPref("mailnews.headers.showReferences")
if (headerName == "references" && if (headerName == "references" &&
!(gViewAllHeaders || showReference || !(gViewAllHeaders || gHeadersShowReferences ||
(gDBView.msgFolder && gDBView.msgFolder.server.type == "nntp"))) (gDBView.msgFolder && gDBView.msgFolder.server.type == "nntp")))
{ {
// hide references header if view all headers mode isn't selected, the pref show references is // hide references header if view all headers mode isn't selected, the pref show references is