Bug 17796 Reply, Reply All, Forward and Next should be dual menubuttons r=Mnyromyr et. al.

This commit is contained in:
neil%parkwaycc.co.uk 2006-11-16 15:17:47 +00:00
Родитель e69e9a438b
Коммит 5a8ed96726
6 изменённых файлов: 191 добавлений и 47 удалений

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

@ -152,6 +152,8 @@ var DefaultController =
case "cmd_replyGroup":
case "cmd_replyall":
case "button_replyall":
case "cmd_replySenderAndGroup":
case "cmd_replyAllRecipients":
case "cmd_forward":
case "button_forward":
case "cmd_forwardInline":
@ -287,6 +289,8 @@ var DefaultController =
case "cmd_replyGroup":
case "cmd_replyall":
case "button_replyall":
case "cmd_replySenderAndGroup":
case "cmd_replyAllRecipients":
case "cmd_forward":
case "button_forward":
case "cmd_forwardInline":
@ -460,6 +464,12 @@ var DefaultController =
case "cmd_replyall":
MsgReplyToAllMessage(null);
break;
case "cmd_replySenderAndGroup":
MsgReplyToSenderAndGroup(null);
break;
case "cmd_replyAllRecipients":
MsgReplyToAllRecipients(null);
break;
case "cmd_forward":
MsgForwardMessage(null);
break;

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

@ -120,6 +120,7 @@ function fillThreadPaneContextMenu()
SetupReplyToSenderMenuItem("threadPaneContext-replySender", numSelected, false);
SetupReplyToNewsgroupMenuItem("threadPaneContext-replyNewsgroup", numSelected, isNewsgroup, false);
SetupReplyToSenderAndNewsgroupMenuItem("threadPaneContext-replySenderAndNewsgroup", numSelected, isNewsgroup, false);
SetupReplyAllMenuItem("threadPaneContext-replyAll", numSelected, false);
SetupForwardMenuItem("threadPaneContext-forward", numSelected, false);
SetupForwardAsAttachmentMenuItem("threadPaneContext-forwardAsAttachment", numSelected, false);
@ -167,6 +168,12 @@ function SetupReplyToNewsgroupMenuItem(menuID, numSelected, isNewsgroup, forceHi
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupReplyToSenderAndNewsgroupMenuItem(menuID, numSelected, isNewsgroup, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && isNewsgroup && !forceHide);
EnableMenuItem(menuID, (numSelected == 1));
}
function SetupReplyAllMenuItem(menuID, numSelected, forceHide)
{
ShowMenuItem(menuID, (numSelected <= 1) && !forceHide);

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

@ -101,9 +101,9 @@ var disallow_classes_no_html = 1; /* the user preference,
value > 1 in his prefs.js or user.js, but that the value will not
change during runtime other than through the MsgBody*() functions below.*/
// Disable the new account menu item if the account preference is locked.
// Disable the File | New | Account... menu item if the account preference is locked.
// Two other affected areas are the account central and the account manager
// dialog.
// dialogs.
function menu_new_init()
{
if (!gMessengerBundle)
@ -113,7 +113,7 @@ function menu_new_init()
if (gPrefBranch.prefIsLocked("mail.disable_new_account_addition"))
newAccountItem.setAttribute("disabled","true");
// Change "New Folder..." menu according to the context
// Change New Folder... menu according to the context
var folderArray = GetSelectedMsgFolders();
if (folderArray.length == 0)
return;
@ -176,11 +176,9 @@ function view_init()
message_menuitem.setAttribute('disabled', gAccountCentralLoaded);
}
var folderPane_menuitem = document.getElementById('menu_showFolderPane');
if (folderPane_menuitem && !folderPane_menuitem.hidden)
folderPane_menuitem.setAttribute('checked', !IsFolderPaneCollapsed());
// Disable some menus if account manager is showing
var sort_menuitem = document.getElementById('viewSortMenu');
if (sort_menuitem) {
sort_menuitem.setAttribute("disabled", gAccountCentralLoaded);
@ -194,7 +192,7 @@ function view_init()
threads_menuitem.setAttribute("disabled", gAccountCentralLoaded);
}
// Initialize the View Attachment Inline menu
// Initialize the Display Attachments Inline menu.
var viewAttachmentInline = pref.getBoolPref("mail.inline_attachments");
document.getElementById("viewAttachmentsInlineMenuitem").setAttribute("checked", viewAttachmentInline ? "true" : "false");
@ -312,11 +310,11 @@ function InitViewMessageViewMenu()
function viewRefreshCustomMailViews(aCurrentViewValue)
{
// for each mail view in the msg view list, add a menu item
// For each mail view in the msg view list, add a menu item.
var mailViewList = Components.classes["@mozilla.org/messenger/mailviewlist;1"].getService(Components.interfaces.nsIMsgMailViewList);
// XXX TODO, fix code in msgViewPickerOverlay.js, to be like this.
// remove any existing entries...
// Remove any existing entries...
var menupopupNode = document.getElementById('viewMessageViewPopup');
var userDefinedItems = menupopupNode.getElementsByAttribute("userdefined","true");
for (var i=0; userDefinedItems.item(i); )
@ -325,7 +323,7 @@ function viewRefreshCustomMailViews(aCurrentViewValue)
++i;
}
// now rebuild the list
// Now rebuild the list.
var numItems = mailViewList.mailViewCount;
var viewCreateCustomViewSeparator = document.getElementById('viewCreateCustomViewSeparator');
@ -349,8 +347,8 @@ function viewRefreshCustomMailViews(aCurrentViewValue)
viewCreateCustomViewSeparator.removeAttribute('collapsed');
}
// called by the View | Messages | Views ... menu items
// see mailWindowOverlay.xul
// Called by the various View | Messages menu items.
// See mailWindowOverlay.xul.
function ViewMessagesBy(id)
{
var viewPicker = document.getElementById('viewPicker');
@ -366,7 +364,7 @@ function InitMessageMenu()
isNews = IsNewsMessage(aMessage);
}
//We show reply to Newsgroups only for news messages.
// We show Reply to Newsgroups only for news messages.
var replyNewsgroupMenuItem = document.getElementById("replyNewsgroupMainMenu");
if(replyNewsgroupMenuItem)
{
@ -386,7 +384,21 @@ function InitMessageMenu()
replySenderMenuItem.setAttribute("hidden", isNews ? "" : "true");
}
// we only kill and watch threads for news
//We show Reply to Sender and Newsgroup only for news messages.
var replySenderAndNewsgroupMenuItem = document.getElementById("replySenderAndNewsgroupMainMenu");
if (replySenderAndNewsgroupMenuItem)
replySenderAndNewsgroupMenuItem.hidden = !isNews;
// For mail messages we say reply all. For news we say ReplyToAllRecipients.
var replyAllMenuItem = document.getElementById("replyallMainMenu");
if (replyAllMenuItem)
replyAllMenuItem.hidden = isNews;
var replyAllRecipientsMenuItem = document.getElementById("replyAllRecipientsMainMenu");
if (replyAllRecipientsMenuItem)
replyAllRecipientsMenuItem.hidden = !isNews;
// We only show Ignore Thread and Watch Thread menu itmes for news.
var threadMenuSeparator = document.getElementById("threadItemsSeparator");
if (threadMenuSeparator) {
threadMenuSeparator.setAttribute("hidden", isNews ? "" : "true");
@ -400,8 +412,8 @@ function InitMessageMenu()
watchThreadMenuItem.setAttribute("hidden", isNews ? "" : "true");
}
// disable the move and copy menus if there are no messages selected.
// disable the move menu if we can't delete msgs from the folder
// Disable the Move and Copy menus if there are no messages selected.
// Disable the Move menu if we can't delete msgs from the folder.
var moveMenu = document.getElementById("moveMenu");
var msgFolder = GetLoadedMsgFolder();
if(moveMenu)
@ -414,7 +426,7 @@ function InitMessageMenu()
if(copyMenu)
copyMenu.setAttribute("disabled", !aMessage);
// Disable Forward as/tag menu items if no message is selected
// Disable the Forward as/Tag menu items if no message is selected.
var forwardAsMenu = document.getElementById("forwardAsMenu");
if(forwardAsMenu)
forwardAsMenu.setAttribute("disabled", !aMessage);
@ -423,7 +435,7 @@ function InitMessageMenu()
if(tagMenu)
tagMenu.setAttribute("disabled", !aMessage);
// Disable mark menu when we're not in a folder
// Disable the Mark menu when we're not in a folder.
var markMenu = document.getElementById("markMenu");
if(markMenu)
markMenu.setAttribute("disabled", !msgFolder);
@ -981,10 +993,9 @@ function MsgNewMessage(event)
var loadedFolder = GetFirstSelectedMsgFolder();
var messageArray = GetSelectedMessages();
if (event && event.shiftKey)
ComposeMessage(msgComposeType.New, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.New, msgComposeFormat.Default, loadedFolder, messageArray);
ComposeMessage(msgComposeType.New,
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
function MsgReplyMessage(event)
@ -1018,21 +1029,40 @@ function MsgReplyGroup(event)
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
if (event && event.shiftKey)
ComposeMessage(msgComposeType.ReplyToGroup, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ReplyToGroup, msgComposeFormat.Default, loadedFolder, messageArray);
ComposeMessage(msgComposeType.ReplyToGroup,
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
function MsgReplyToAllMessage(event)
{
var loadedFolder = GetLoadedMsgFolder();
var server = loadedFolder.server;
if (server && server.type == "nntp")
MsgReplyToSenderAndGroup(event);
else
MsgReplyToAllRecipients(event);
}
function MsgReplyToAllRecipients(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
if (event && event.shiftKey)
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.Default, loadedFolder, messageArray);
ComposeMessage(msgComposeType.ReplyToAll,
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
function MsgReplyToSenderAndGroup(event)
{
var loadedFolder = GetLoadedMsgFolder();
var messageArray = GetSelectedMessages();
ComposeMessage(msgComposeType.ReplyToSenderAndGroup,
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
function MsgForwardMessage(event)
@ -1060,11 +1090,9 @@ function MsgForwardAsAttachment(event)
var messageArray = GetSelectedMessages();
//dump("\nMsgForwardAsAttachment from XUL\n");
if (event && event.shiftKey)
ComposeMessage(msgComposeType.ForwardAsAttachment,
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ForwardAsAttachment, msgComposeFormat.Default, loadedFolder, messageArray);
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
function MsgForwardAsInline(event)
@ -1073,11 +1101,9 @@ function MsgForwardAsInline(event)
var messageArray = GetSelectedMessages();
//dump("\nMsgForwardAsInline from XUL\n");
if (event && event.shiftKey)
ComposeMessage(msgComposeType.ForwardInline,
msgComposeFormat.OppositeOfDefault, loadedFolder, messageArray);
else
ComposeMessage(msgComposeType.ForwardInline, msgComposeFormat.Default, loadedFolder, messageArray);
(event && event.shiftKey) ? msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default,
loadedFolder, messageArray);
}
@ -1762,6 +1788,8 @@ function IsCompactFolderEnabled()
isCommandEnabled("cmd_compactFolder")); // checks e.g. if IMAP is offline
}
var gReplyAllButton = null;
var gReplyButton = null;
var gDeleteButton = null;
var gMarkButton = null;
@ -1775,15 +1803,23 @@ function SetUpToolbarButtons(uri)
if(!gMarkButton) gMarkButton = document.getElementById("button-mark");
if(!gDeleteButton) gDeleteButton = document.getElementById("button-delete");
if (!gReplyButton) gReplyButton = document.getElementById("button-reply");
if (!gReplyAllButton) gReplyAllButton = document.getElementById("button-replyall");
var buttonToHide = null;
var buttonToShow = null;
if (forNews) {
gReplyButton.setAttribute("type", "menu-button");
gReplyAllButton.setAttribute("type", "menu-button");
gReplyAllButton.setAttribute("tooltiptext", gReplyAllButton.getAttribute("tooltiptextnews"));
buttonToHide = gDeleteButton;
buttonToShow = gMarkButton;
}
else {
gReplyButton.removeAttribute("type");
gReplyAllButton.removeAttribute("type");
gReplyAllButton.setAttribute("tooltiptext", gReplyAllButton.getAttribute("tooltiptextmail"));
buttonToHide = gMarkButton;
buttonToShow = gDeleteButton;
}

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

@ -232,6 +232,8 @@
<command id="cmd_replySender" oncommand="goDoCommand('cmd_replySender')"/>
<command id="cmd_replyGroup" oncommand="goDoCommand('cmd_replyGroup')"/>
<command id="cmd_replyall" oncommand="goDoCommand('cmd_replyall')"/>
<command id="cmd_replySenderAndGroup" oncommand="goDoCommand('cmd_replySenderAndGroup')"/>
<command id="cmd_replyAllRecipients" oncommand="goDoCommand('cmd_replyAllRecipients')"/>
<command id="cmd_forward" oncommand="goDoCommand('cmd_forward')"/>
<command id="cmd_forwardInline" oncommand="goDoCommand('cmd_forwardInline')"/>
<command id="cmd_forwardAttachment" oncommand="goDoCommand('cmd_forwardAttachment')"/>
@ -411,10 +413,14 @@
label="&contextReplyNewsgroup.label;"
accesskey="&contextReplyNewsgroup.accesskey;"
oncommand="MsgReplyGroup(event);"/>
<menuitem id="threadPaneContext-replySenderAndNewsgroup"
label="&contextReplySenderAndNewsgroup.label;"
accesskey="&contextReplySenderAndNewsgroup.accesskey;"
oncommand="MsgReplyToSenderAndGroup(event);"/>
<menuitem id="threadPaneContext-replyAll"
label="&contextReplyAll.label;"
accesskey="&contextReplyAll.accesskey;"
oncommand="MsgReplyToAllMessage(event);"/>
oncommand="MsgReplyToAllRecipients(event);"/>
<menuitem id="threadPaneContext-forward"
label="&contextForward.label;"
accesskey="&contextForward.accesskey;"
@ -738,7 +744,7 @@
<menuitem id="messagePaneContext-replyAll"
label="&contextReplyAll.label;"
accesskey="&contextReplyAll.accesskey;"
oncommand="MsgReplyToAllMessage(event);"/>
oncommand="MsgReplyAll(event);"/>
<menuitem id="messagePaneContext-forward"
label="&contextForward.label;"
accesskey="&contextForward.accesskey;"
@ -1408,10 +1414,17 @@
accesskey="&replyNewsgroupCmd.accesskey;"
key="key_reply"
command="cmd_replyGroup"/>
<menuitem label="&replyToAllMsgCmd.label;"
<menuitem id="replyallMainMenu" label="&replyToAllMsgCmd.label;"
accesskey="&replyToAllMsgCmd.accesskey;"
key="key_replyall"
command="cmd_replyall"/>
<menuitem id="replySenderAndNewsgroupMainMenu" label="&replyToSenderAndNewsgroupCmd.label;"
accesskey="&replyToSenderAndNewsgroupCmd.accesskey;"
key="key_replyall"
command="cmd_replySenderAndGroup"/>
<menuitem id="replyAllRecipientsMainMenu" label="&replyToAllRecipientsCmd.label;"
accesskey="&replyToAllRecipientsCmd.accesskey;"
command="cmd_replyAllRecipients"/>
<menuitem label="&forwardMsgCmd.label;"
accesskey="&forwardMsgCmd.accesskey;"
key="key_forward"
@ -1707,9 +1720,50 @@
</toolbarbutton>
<toolbarbutton id="button-newmsg" class="toolbarbutton-1" label="&newMsgButton.label;" tooltiptext="&newMsgButton.tooltip;" oncommand="MsgNewMessage(event)"/>
<toolbarseparator class="toolbarseparator-primary"/>
<toolbarbutton id="button-reply" class="toolbarbutton-1" label="&replyButton.label;" tooltiptext="&replyButton.tooltip;" observes="button_reply" oncommand="MsgReplyMessage(event)"/>
<toolbarbutton class="toolbarbutton-1" id="button-replyall" label="&replyAllButton.label;" tooltiptext="&replyAllButton.tooltip;" observes="button_replyall" oncommand="MsgReplyToAllMessage(event)"/>
<toolbarbutton class="toolbarbutton-1" id="button-forward" label="&forwardButton.label;" tooltiptext="&forwardButton.tooltip;" observes="button_forward" oncommand="MsgForwardMessage(event)"/>
<toolbarbutton class="toolbarbutton-1" id="button-reply"
label="&replyButton.label;"
tooltiptext="&replyButton.tooltip;"
observes="button_reply"
oncommand="MsgReplyMessage(event)">
<menupopup>
<menuitem label="&replySenderCmd.label;"
accesskey="&replySenderCmd.accesskey;"
command="cmd_replySender"/>
<menuitem label="&replyNewsgroupCmd.label;"
accesskey="&replyNewsgroupCmd.accesskey;"
command="cmd_replyGroup" default="true"/>
</menupopup>
</toolbarbutton>
<toolbarbutton class="toolbarbutton-1" id="button-replyall"
label="&replyAllButton.label;"
tooltiptext="&replyAllButton.tooltip;"
tooltiptextmail="&replyAllButton.tooltip;"
tooltiptextnews="&replyAllButtonNews.tooltip;"
observes="button_replyall"
oncommand="MsgReplyToAllMessage(event)">
<menupopup>
<menuitem label="&replyToSenderAndNewsgroupCmd.label;"
accesskey="&replyToSenderAndNewsgroupCmd.accesskey;"
command="cmd_replySenderAndGroup" default="true"/>
<menuitem label="&replyToAllRecipientsCmd.label;"
accesskey="&replyToAllRecipientsCmd.accesskey;"
command="cmd_replyAllRecipients"/>
</menupopup>
</toolbarbutton>
<toolbarbutton class="toolbarbutton-1" id="button-forward"
type="menu-button" label="&forwardButton.label;"
tooltiptext="&forwardButton.tooltip;"
observes="button_forward"
oncommand="MsgForwardMessage(event)">
<menupopup onpopupshowing="InitMessageForward(this);">
<menuitem label="&forwardAsInline.label;"
accesskey="&forwardAsInline.accesskey;"
command="cmd_forwardInline"/>
<menuitem label="&forwardAsAttachmentCmd.label;"
accesskey="&forwardAsAttachmentCmd.accesskey;"
command="cmd_forwardAttachment"/>
</menupopup>
</toolbarbutton>
<toolbarseparator class="toolbarseparator-primary"/>
<toolbarbutton type="menu" id="button-file" class="toolbarbutton-1"
label="&fileButton.label;" observes="button_file"
@ -1778,7 +1832,27 @@
</template>
<menupopup/>
</toolbarbutton>
<toolbarbutton class="toolbarbutton-1" id="button-next" label="&nextButton.label;" oncommand="goDoCommand('button_next')" tooltiptext="&nextButton.tooltip;" observes="button_next"/>
<toolbarbutton class="toolbarbutton-1" id="button-next"
type="menu-button" label="&nextButton.label;"
tooltiptext="&nextButton.tooltip;"
observes="button_next"
oncommand="goDoCommand('button_next')">
<menupopup onpopupshowing="InitGoMessagesMenu();">
<menuitem label="&nextMsgCmd.label;"
accesskey="&nextMsgCmd.accesskey;"
command="cmd_nextMsg"/>
<menuitem label="&nextUnreadMsgCmd.label;"
accesskey="&nextUnreadMsgCmd.accesskey;"
command="cmd_nextUnreadMsg" default="true"/>
<menuitem label="&nextFlaggedMsgCmd.label;"
accesskey="&nextFlaggedMsgCmd.accesskey;"
command="cmd_nextFlaggedMsg"/>
<menuseparator/>
<menuitem label="&nextUnreadThread.label;"
accesskey="&nextUnreadThreadCmd.accesskey;"
command="cmd_nextUnreadThread"/>
</menupopup>
</toolbarbutton>
<deck id="button-junk" observes="button_junk"
oncommand="goDoCommand('button_junk')">

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

@ -654,6 +654,8 @@ var MessageWindowController =
case "cmd_replySender":
case "cmd_replyGroup":
case "cmd_replyall":
case "cmd_replySenderAndGroup":
case "cmd_replyAllRecipients":
case "button_replyall":
case "cmd_forward":
case "button_forward":
@ -717,6 +719,8 @@ var MessageWindowController =
case "cmd_replyGroup":
case "cmd_replyall":
case "button_replyall":
case "cmd_replySenderAndGroup":
case "cmd_replyAllRecipients":
case "cmd_forward":
case "button_forward":
case "cmd_forwardInline":
@ -824,6 +828,12 @@ var MessageWindowController =
case "cmd_replyall":
MsgReplyToAllMessage(null);
break;
case "cmd_replySenderAndGroup":
MsgReplyToSenderAndGroup(null);
break;
case "cmd_replyAllRecipients":
MsgReplyToAllRecipients(null);
break;
case "cmd_forward":
MsgForwardMessage(null);
break;

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

@ -358,6 +358,10 @@
<!ENTITY replyToAllMsgCmd.label "Reply to All">
<!ENTITY replyToAllMsgCmd.accesskey "p">
<!ENTITY replyToAllMsgCmd.key "r">
<!ENTITY replyToSenderAndNewsgroupCmd.label "Reply to Sender and Newsgroup">
<!ENTITY replyToSenderAndNewsgroupCmd.accesskey "p">
<!ENTITY replyToAllRecipientsCmd.label "Reply to All Recipients">
<!ENTITY replyToAllRecipientsCmd.accesskey "a">
<!ENTITY forwardMsgCmd.label "Forward">
<!ENTITY forwardMsgCmd.accesskey "F">
<!ENTITY forwardMsgCmd.key "l">
@ -474,6 +478,7 @@
<!ENTITY newMsgButton.tooltip "Create a new message">
<!ENTITY replyButton.tooltip "Reply to the message">
<!ENTITY replyAllButton.tooltip "Reply to sender and all recipients">
<!ENTITY replyAllButtonNews.tooltip "Reply to sender and newsgroup">
<!ENTITY forwardButton.tooltip "Forward selected message">
<!ENTITY fileButton.tooltip "File selected message">
<!ENTITY nextButton.tooltip "Move to the next unread message">
@ -501,6 +506,8 @@
<!ENTITY contextReplyNewsgroup.accesskey "y">
<!ENTITY contextReplyAll.label "Reply to All">
<!ENTITY contextReplyAll.accesskey "R">
<!ENTITY contextReplySenderAndNewsgroup.label "Reply to Sender and Newsgroup">
<!ENTITY contextReplySenderAndNewsgroup.accesskey "p">
<!ENTITY contextForward.label "Forward">
<!ENTITY contextForward.accesskey "F">
<!ENTITY contextForwardAsAttachment.label "Forward as Attachments">