change to reflect the view | header state in the menu, using a radio

menu type.  r=hangas.  one thing isn't working, and that is having
it come up checked with the choice from prefs.  I'll log a bug now.
This commit is contained in:
sspitzer%netscape.com 1999-12-24 01:08:05 +00:00
Родитель 94a3b9e839
Коммит 9211b9189f
3 изменённых файлов: 48 добавлений и 11 удалений

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

@ -237,11 +237,11 @@ Rights Reserved.
<menuitem value="&ignoreThreadMsgsCmd.label;" oncommand="MsgViewIgnoreThread();"/>
</menupopup>
</menu>
<menu value="&headersMenu.label;">
<menu id="viewheadersmenu" value="&headersMenu.label;">
<menupopup>
<menuitem value="&headersAllCmd.label;" oncommand="MsgViewAllHeaders();"/>
<menuitem value="&headersNormalCmd.label;" oncommand="MsgViewNormalHeaders();"/>
<menuitem value="&headersBriefCmd.label;" oncommand="MsgViewBriefHeaders();"/>
<menuitem id="viewallheaders" type="radio" name="viewheadergroup" value="&headersAllCmd.label;" oncommand="MsgViewAllHeaders();"/>
<menuitem id="viewnormalheaders" type="radio" name="viewheadergroup" value="&headersNormalCmd.label;" oncommand="MsgViewNormalHeaders();"/>
<menuitem id="viewbriefheaders" type="radio" name="viewheadergroup" value="&headersBriefCmd.label;" oncommand="MsgViewBriefHeaders();"/>
</menupopup>
</menu>
<menuseparator/>

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

@ -44,6 +44,7 @@ var gCurrentLoadingFolderURI;
var gCurrentLoadingFolderIsThreaded = false;
var gCurrentLoadingFolderSortID ="";
// get the messenger instance
var messenger = Components.classes[messengerProgID].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
@ -53,6 +54,8 @@ var accountManagerDataSource = Components.classes[accountManagerDSProgID].create
var folderDataSource = Components.classes[folderDSProgID].createInstance();
var messageDataSource = Components.classes[messageDSProgID].createInstance();
var pref = Components.classes[prefProgID].getService(Components.interfaces.nsIPref);
//Create windows status feedback
var statusFeedback = Components.classes[statusFeedbackProgID].createInstance();
statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback);
@ -148,6 +151,41 @@ function OnLoadMessenger()
loadStartFolder();
AddToSession();
var id = null;
var headerchoice = null;
try {
headerchoice = pref.GetIntPref("mail.show_headers");
}
catch (ex) {
dump("failed to get the header pref\n");
}
switch (headerchoice) {
case 2:
id = "viewallheaders";
break;
case 0:
id = "viewbriefheaders";
break;
case 1:
id = "viewnormalheaders";
break;
default:
id = "viewnormalheaders";
break;
}
var menuitem = document.getElementById(id);
try {
// not working right yet. see bug #??????
// menuitem.setAttribute("checked", "true");
}
catch (ex) {
dump("failed to set the view headers menu item\n");
}
}
function OnUnloadMessenger()
@ -218,8 +256,6 @@ function loadStartPage() {
var startpage = "about:blank";
try {
var pref = Components.classes[prefProgID].getService(Components.interfaces.nsIPref);
startpageenabled= pref.GetBoolPref("mailnews.start_page.enabled");
if (startpageenabled)
@ -238,8 +274,6 @@ function loadStartFolder()
{
//Load StartFolder
try {
var pref = Components.classes[prefProgID].getService(Components.interfaces.nsIPref);
var startFolder = pref.CopyCharPref("mailnews.start_folder");
//ChangeFolderByURI(startFolder);
// var folder = OpenFolderTreeToFolder(startFolder);

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

@ -801,17 +801,20 @@ function MsgViewIgnoreThread() {}
function MsgViewAllHeaders()
{
prefs.SetIntPref("mail.show_headers",2);
MsgReload()
MsgReload();
return true;
}
function MsgViewNormalHeaders()
{
prefs.SetIntPref("mail.show_headers",1);
MsgReload()
MsgReload();
return true;
}
function MsgViewBriefHeaders()
{
prefs.SetIntPref("mail.show_headers",0);
MsgReload()
MsgReload();
return true;
}
function MsgViewAttachInline() {}