OSX only: add a Windows menu item to the mac build to keep track of all open windows.

Thanks to Don Crandall for the patch!
This commit is contained in:
scott%scott-macgregor.org 2003-11-06 06:23:28 +00:00
Родитель ac108683c6
Коммит 3b88c7692a
10 изменённых файлов: 191 добавлений и 7 удалений

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

@ -92,6 +92,7 @@
events="focus"
oncommandupdate="FocusRingUpdate_Mail()"/>
<commandset id="tasksCommands"/>
<commandset id="macWindowMenuItems"/>
</commandset>
<!-- it's the whole mailWindowOverlay.xul menubar! hidden windows need to

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

@ -127,3 +127,42 @@ function openOptionsDialog(containerID, paneURL, itemID)
openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow",
"chrome,titlebar,resizable=yes", paneURL, containerID, itemID);
}
# Macintosh window menu functions
#ifdef XP_MACOSX
const nsIWindowDataSource = Components.interfaces.nsIWindowDataSource;
function checkFocusedWindow()
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var sep = document.getElementById("sep-window-list");
// Using double parens to avoid warning
while ((sep = sep.nextSibling)) {
var url = sep.getAttribute('id');
var win = windowManagerDS.getWindowForResource(url);
if (win == window) {
sep.setAttribute("checked", "true");
break;
}
}
}
function toOpenWindow( aWindow )
{
aWindow.document.commandDispatcher.focusedWindow.focus();
}
function ShowWindowFromResource( node )
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var desiredWindow = null;
var url = node.getAttribute('id');
desiredWindow = windowManagerDS.getWindowForResource( url );
if ( desiredWindow )
{
toOpenWindow(desiredWindow);
}
}
#endif

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

@ -271,6 +271,15 @@
<command id="cmd_deleteJunk" oncommand="goDoCommand('cmd_deleteJunk');" disabled="true"/>
</commandset>
#ifdef XP_MACOSX
<commandset id="macWindowMenuItems">
<!-- Mac Window menu -->
<command id="minimizeWindow" label="&minimizeWindow.label;" disabled="true"/>
<command id="Tasks:Mail" oncommand="toMessengerWindow();"/>
<command id="Tasks:AddressBook" oncommand="toAddressBook();"/>
</commandset>
#endif
<keyset id="mailKeys">
<key id="space" key=" " oncommand="SpaceHit(event)"/>
@ -352,6 +361,11 @@
<key id="key_searchMail" key="&searchMailCmd.key;" oncommand="MsgSearchMessages();" modifiers="accel, shift"/>
<key id="key_mail" key="&messengerCmd.commandkey;" oncommand="toMessengerWindow();" modifiers="accel"/>
<key id="key_addressbook" key="&addressBookCmd.commandkey;" oncommand="toAddressBook();" modifiers="accel"/>
#ifdef XP_MACOSX
<!-- Mac Window keys -->
<key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
#endif
</keyset>
<popup id="threadPaneContext" onpopupshowing="return fillThreadPaneContextMenu();"
@ -1539,6 +1553,32 @@
<menuitem id="menu_preferences" oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
</menupopup>
</menu>
#ifdef XP_MACOSX
<!-- XXXnoririty localize! -->
<menu id="windowMenu" label="&windowMenu.label;" accesskey="&windowMenu.accesskey;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshown="checkFocusedWindow();">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" type="radio"
oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
<menupopup id="windowPopup">
<menuitem label="&zoomWindow.label;" disabled="true"/>
<menuitem command="minimizeWindow" key="key_minimizeWindow"/>
<menuseparator/>
<menuitem label="&bringAllToFront.label;" disabled="true"/>
<menuseparator/>
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
<menuseparator id="sep-window-list"/>
</menupopup>
</menu>
#endif
<!-- Help -->
<menu label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">

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

@ -93,7 +93,10 @@
commandupdater="true"
events="focus"
oncommandupdate="FocusRingUpdate_Mail()"/>
<commandset id="tasksCommands"/>
<commandset id="tasksCommands"/>
#ifdef XP_MACOSX
<commandset id="macWindowMenuItems"/>
#endif
</commandset>
<broadcasterset id="mailBroadcasters">

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

@ -22,4 +22,7 @@
<!ENTITY javaScriptConsoleCmd.accesskey "S">
<!ENTITY tasksMenu.label "Tools">
<!ENTITY tasksMenu.accesskey "T">
<!ENTITY tasksMenu.accesskey "T">
<!ENTITY windowMenu.label "Window">
<!ENTITY windowMenu.accesskey "W">

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

@ -561,3 +561,9 @@
<!ENTITY statusText.label "Done">
<!ENTITY unreadCountText.label "Unread: ">
<!ENTITY totalCountText.label " Total: ">
<!-- Mac OS X Window Menu -->
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize Window">
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom Window">

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

@ -93,6 +93,11 @@
<command id="cmd_paste" oncommand="goDoCommand('cmd_paste')" disabled="true"/>
<command id="cmd_delete" oncommand="goDoCommand('cmd_delete')" valueDefault="&deleteCmd.label;" disabled="true"/>
<command id="cmd_selectAll" oncommand="goDoCommand('cmd_selectAll')" disabled="true"/>
#ifdef XP_MACOSX
<!-- Mac Window menu -->
<command id="minimizeWindow" label="&minimizeWindow.label;" disabled="true"/>
<command id="Tasks:Mail" oncommand="toMessengerWindow();"/>
#endif
</commandset>
<broadcasterset id="abBroadcasters">
@ -135,6 +140,11 @@
<key keycode="VK_F6" oncommand="SwitchPaneFocus(event);"/>
<key id="key_mail" key="&messengerCmd.commandkey;" oncommand="toMessengerWindow();" modifiers="accel"/>
#ifdef XP_MACOSX
<!-- Mac Window keys -->
<key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
#endif
</keyset>
<popup id="dirTreeContext">
@ -390,8 +400,12 @@
<menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
<menupopup id="taskPopup">
<!-- Moving the messengerCmd menu item item to the Window menu on the Mac -->
#ifndef XP_MACOSX
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuseparator />
#endif
<menuitem label="&searchAddressesCmd.label;"
accesskey="&searchAddressesCmd.accesskey;"
id="menu_search_addresses"
@ -404,6 +418,30 @@
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" label="&windowMenu.label;" accesskey="&windowMenu.accesskey;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshown="checkFocusedWindow();">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" type="radio"
oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
<menupopup id="windowPopup">
<menuitem label="&zoomWindow.label;" disabled="true"/>
<menuitem command="minimizeWindow" key="key_minimizeWindow"/>
<menuseparator/>
<menuitem label="&bringAllToFront.label;" disabled="true"/>
<menuseparator/>
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuseparator id="sep-window-list"/>
</menupopup>
</menu>
#endif
<menu label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
<menupopup id="menu_HelpPopup">
<menuitem accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="loadThrobberUrl('mailnews.release_notes.url');"/>

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

@ -225,3 +225,9 @@
<!-- Status Bar -->
<!ENTITY statusText.label "">
<!-- Mac OS X Window Menu -->
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize Window">
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom Window">

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

@ -134,7 +134,15 @@
<!-- Options Menu -->
<command id="cmd_quoteMessage" oncommand="goDoCommand('cmd_quoteMessage')"/>
<command id="cmd_insert"/>
<command id="cmd_insert"/>
#ifdef XP_MACOSX
<!-- Mac Window menu -->
<command id="minimizeWindow" label="&minimizeWindow.label;" disabled="true"/>
<command id="Tasks:Mail" oncommand="toMessengerWindow();"/>
<command id="Tasks:AddressBook" oncommand="toAddressBook();"/>
#endif
</commandset>
<broadcasterset id="composeBroadcasters">
@ -189,8 +197,15 @@
<key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control"/>
<key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="control,shift"/>
<key keycode="VK_F6" oncommand="SwitchElementFocus(event);" modifiers="shift"/>
<key keycode="VK_F6" oncommand="SwitchElementFocus(event);"/>
</keyset>
<key keycode="VK_F6" oncommand="SwitchElementFocus(event);"/>
#ifdef XP_MACOSX
<!-- Mac Window Menu -->
<key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
#endif
</keyset>
<keyset id="editorKeys"/>
<popup id="msgComposeContext" onpopupshowing="updateEditItems();">
@ -430,15 +445,42 @@
</menu>
<menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
<menupopup id="taskPopup">
<menupopup id="taskPopup">
<!-- Moving the first two items to the Window menu on the Mac -->
#ifndef XP_MACOSX
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" oncommand="toAddressBook();" id="tasksMenuAddressBook" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
<menuseparator/>
<menuseparator/>
#endif
<menuitem label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" command="cmd_account"/>
<menuitem id="menu_preferences" label="&preferencesCmd.label;" accesskey="&preferencesCmd.accesskey;"
oncommand="openOptionsDialog('mailcomposepref', 'chrome://messenger/content/messengercompose/pref-composing_messages.xul', 'mailcomposepref');"/>
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" label="&windowMenu.label;" accesskey="&windowMenu.accesskey;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshown="checkFocusedWindow();">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" type="radio" oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
<menupopup id="windowPopup">
<menuitem label="&zoomWindow.label;" disabled="true"/>
<menuitem command="minimizeWindow" key="key_minimizeWindow"/>
<menuseparator/>
<menuitem label="&bringAllToFront.label;" disabled="true"/>
<menuseparator/>
<menuitem accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;" key="key_mail" command="Tasks:Mail" id="tasksMenuMail" class="menuitem-iconic icon-mail16 menu-iconic"/>
<menuitem label="&addressBookCmd.label;" accesskey="&addressBookCmd.accesskey;" key="key_addressbook" command="Tasks:AddressBook" id="tasksMenuAddressBook" class="menuitem-iconic icon-addressbook16 menu-iconic"/>
<menuseparator id="sep-window-list"/>
</menupopup>
</menu>
#endif
<menu label="&helpMenu.label;" accesskey="&helpMenu.accesskey;">
<menupopup id="menu_HelpPopup">

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

@ -166,6 +166,12 @@
<!ENTITY preferencesCmd.label "Options...">
<!ENTITY preferencesCmd.key "O">
<!ENTITY preferencesCmd.accesskey "O">
<!-- Mac OS X Window Menu -->
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize Window">
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom Window">
<!-- Help Menu -->
<!ENTITY helpMenu.label "Help">