Bug 634101 - Port |Bug 243631 - Availability to show the name out of the addressbook for a display name| 2nd patch to SeaMonkey; (Av1) Port it, s/MailPaneConfigObserver/MailPrefObserver/g.

r=iann.
This commit is contained in:
Serge Gautherie 2011-02-19 16:31:21 +01:00
Родитель 48b4ee6118
Коммит 5f0f318e3c
1 изменённых файлов: 18 добавлений и 6 удалений

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

@ -684,11 +684,21 @@ function UpdateMailPaneConfig() {
}
}
const MailPaneConfigObserver = {
const MailPrefObserver = {
observe: function observe(subject, topic, prefName) {
// verify that we're changing the mail pane config pref
if (topic == "nsPref:changed")
UpdateMailPaneConfig();
if (topic == "nsPref:changed") {
if (prefName == "mail.pane_config.dynamic") {
UpdateMailPaneConfig();
} else if (prefName == "mail.showCondensedAddresses") {
let currentDisplayNameVersion =
pref.getIntPref("mail.displayname.version");
pref.setIntPref("mail.displayname.version",
++currentDisplayNameVersion);
// Refresh the thread pane.
GetThreadTree().treeBoxObject.invalid();
}
}
}
};
@ -697,7 +707,8 @@ function OnLoadMessenger()
{
AddMailOfflineObserver();
CreateMailWindowGlobals();
pref.addObserver("mail.pane_config.dynamic", MailPaneConfigObserver, false);
pref.addObserver("mail.pane_config.dynamic", MailPrefObserver, false);
pref.addObserver("mail.showCondensedAddresses", MailPrefObserver, false);
UpdateMailPaneConfig();
Create3PaneGlobals();
verifyAccounts(null, false);
@ -807,7 +818,8 @@ function HandleAppCommandEvent(evt)
function OnUnloadMessenger()
{
pref.removeObserver("mail.pane_config.dynamic", MailPaneConfigObserver, false);
pref.removeObserver("mail.pane_config.dynamic", MailPrefObserver, false);
pref.removeObserver("mail.showCondensedAddresses", MailPrefObserver, false);
window.removeEventListener("AppCommand", HandleAppCommandEvent, true);
OnLeavingFolder(gMsgFolderSelected); // mark all read in current folder