Bug 306453: Remove "Read Mail" and "New Message..." from Tools menu, r=mconnor+beltzner

This commit is contained in:
gavin@gavinsharp.com
2006-01-16 22:52:03 +00:00
parent 74ce143200
commit f0a02f424e
8 changed files with 17 additions and 160 deletions

View File

@@ -405,23 +405,9 @@
#endif
<menu id="tools-menu" label="&toolsMenu.label;" accesskey="&toolsMenu.accesskey;">
<menupopup id="menu_ToolsPopup"
#ifdef XP_WIN
onpopupshowing="MailIntegration.updateUnreadCount();"
#endif
>
<menupopup id="menu_ToolsPopup">
<menuitem label="&search.label;" accesskey="&search.accesskey;"
key="key_search" command="Tools:Search"/>
#ifdef HAVE_SHELL_SERVICE
<menuseparator/>
<menuitem label="&mailButton.readMail.label;"
accesskey="&mailButton.readMail.accesskey;"
command="Browser:ReadMail"/>
<menuitem label="&mailButton.newMessage.label;"
accesskey="&mailButton.newMessage.accesskey;"
key="key_newMessage" command="Browser:NewMessage"/>
#endif
<menuseparator/>
<menuitem label="&downloads.label;" accesskey="&downloads.accesskey;"
key="key_openDownloads" command="Tools:Downloads"/>

View File

@@ -91,11 +91,6 @@
<command id="Browser:SaveFrame" oncommand="saveFrameDocument();"/>
<command id="Browser:SendLink" oncommand="MailIntegration.sendLinkForContent();"/>
<command id="Browser:NewMessage" oncommand="MailIntegration.sendMessage('', '');"/>
#ifdef HAVE_SHELL_SERVICE
<command id="Browser:ReadMail" oncommand="MailIntegration.readMail();" label="&mailButton.readMail.label;"/>
<command id="Browser:ReadNews" oncommand="MailIntegration.readNews();"/>
#endif
<command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
<command id="cmd_print" oncommand="PrintUtils.print();"/>
@@ -321,15 +316,6 @@
#else
<key id="key_gotoHistory" key="&historySidebarCmd.commandKey;" command="viewHistorySidebar" modifiers="accel"/>
#endif
<key id="key_newMessage"
key="&sendMessage.commandkey;"
command="Browser:NewMessage"
#ifdef XP_MACOSX
modifiers="accel,shift"/>
#else
modifiers="accel"/>
#endif
<key id="key_textZoomReduce" key="&textZoomReduceCmd.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
<key id="key_textZoomEnlarge" key="&textZoomEnlargeCmd.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
<key key="&textZoomEnlargeCmd.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>

View File

@@ -928,11 +928,6 @@ function delayedStartup()
shell.setDefaultBrowser(true, false);
shell.shouldCheckDefaultBrowser = checkEveryTime.value;
}
} else {
// We couldn't get the shell service; go hide the mail toolbar button.
var mailbutton = document.getElementById("mail-button");
if (mailbutton)
mailbutton.hidden = true;
}
#endif
@@ -5674,67 +5669,37 @@ function WindowIsClosing()
}
var MailIntegration = {
sendLinkForContent: function ()
{
sendLinkForContent: function () {
this.sendMessage(window.content.location.href,
window.content.document.title);
},
sendMessage: function (aBody, aSubject)
{
sendMessage: function (aBody, aSubject) {
// generate a mailto url based on the url and the url's title
var mailtoUrl = aBody ? "mailto:?body=" + encodeURIComponent(aBody) + "&subject=" + encodeURIComponent(aSubject) : "mailto:";
var mailtoUrl = "mailto:";
if (aBody) {
mailtoUrl += "?body=" + encodeURIComponent(aBody);
mailtoUrl += "&subject=" + encodeURIComponent(aSubject);
}
var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var uri = ioService.newURI(mailtoUrl, null, null);
// now pass this url to the operating system
// now pass this uri to the operating system
this._launchExternalUrl(uri);
},
// a generic method which can be used to pass arbitrary urls to the operating system.
// a generic method which can be used to pass arbitrary urls to the operating
// system.
// aURL --> a nsIURI which represents the url to launch
_launchExternalUrl: function(aURL)
{
var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService);
_launchExternalUrl: function (aURL) {
var extProtocolSvc =
Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
if (extProtocolSvc)
extProtocolSvc.loadUrl(aURL);
#ifdef HAVE_SHELL_SERVICE
},
readMail: function ()
{
var shell = getShellService();
if (shell)
shell.openApplication(Components.interfaces.nsIShellService.APPLICATION_MAIL);
},
readNews: function ()
{
var shell = getShellService();
if (shell)
shell.openApplication(Components.interfaces.nsIShellService.APPLICATION_NEWS);
},
updateUnreadCount: function ()
{
#ifdef XP_WIN
var shell = Components.classes["@mozilla.org/browser/shell-service;1"]
.getService(Components.interfaces.nsIWindowsShellService);
var unreadCount = shell.unreadMailCount;
var message = gNavigatorBundle.getFormattedString("mailUnreadTooltip", [unreadCount]);
var element = document.getElementById("mail-button");
if (element)
element.setAttribute("tooltiptext", message);
message = gNavigatorBundle.getFormattedString("mailUnreadMenuitem", [unreadCount]);
element = document.getElementById("Browser:ReadMail");
element.setAttribute("label", message);
#endif
}
#else
}
#endif
};
function BrowserOpenExtensions(aOpenMode)

View File

@@ -330,21 +330,6 @@
observes="viewHistorySidebar"
tooltiptext="&historyButton.tooltip;"/>
#ifdef HAVE_SHELL_SERVICE
<toolbarbutton id="mail-button" type="menu" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&mailButton.label;" orient="vertical"
onmouseover="MailIntegration.updateUnreadCount();"
tooltiptext="&mailButton.tooltip;">
<menupopup tooltiptext="">
<menuitem accesskey="&mailButton.readMail.accesskey;"
command="Browser:ReadMail"/>
<menuitem label="&mailButton.newMessage.label;"
accesskey="&mailButton.newMessage.accesskey;"
command="Browser:NewMessage"/>
</menupopup>
</toolbarbutton>
#endif
#ifndef MOZ_PLACES
<toolbarbutton id="bookmarks-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="viewBookmarksSidebar"