Fix bug 42817 -- overlay a Page Setup menu item for Mac, which displays the page setup dialog. r=jag/hwaara, sr=sspitzer/blake/fm

This commit is contained in:
sfraser%netscape.com 2001-10-13 02:27:35 +00:00
Родитель 0b2c624cb3
Коммит d54f2254b7
5 изменённых файлов: 41 добавлений и 3 удалений

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

@ -242,6 +242,7 @@ nsCloseCommand::DoCommand(const nsAReadableString & aCommandName, const nsAReada
#pragma mark -
#endif
#if 0
NS_IMETHODIMP
nsPrintingCommands::IsCommandEnabled(const nsAReadableString & aCommandName, nsISupports *refCon, PRBool *outCmdEnabled)
{
@ -284,6 +285,7 @@ nsPrintingCommands::DoCommand(const nsAReadableString & aCommandName, nsISupport
return rv;
}
#endif
#ifdef XP_MAC
#pragma mark -

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

@ -253,7 +253,7 @@ protected:
// composer commands
NS_DECL_COMPOSER_COMMAND(nsCloseCommand)
NS_DECL_COMPOSER_COMMAND(nsPrintingCommands)
//NS_DECL_COMPOSER_COMMAND(nsPrintingCommands)
// Generic commands

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

@ -162,10 +162,12 @@ nsresult nsComposerController::RegisterComposerCommands(nsIControllerCommandMana
nsresult rv;
// File menu
/*
NS_REGISTER_FIRST_COMMAND(nsPrintingCommands, "cmd_print");
NS_REGISTER_NEXT_COMMAND(nsPrintingCommands, "cmd_printSetup");
NS_REGISTER_NEXT_COMMAND(nsPrintingCommands,"cmd_print_button");
NS_REGISTER_LAST_COMMAND(nsPrintingCommands, "cmd_printPreview");
*/
// Edit menu
NS_REGISTER_ONE_COMMAND(nsPasteQuotationCommand, "cmd_pasteQuote");

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

@ -173,6 +173,8 @@ function SetupComposerWindowCommands()
commandManager.registerCommand("cmd_openRemote", nsOpenRemoteCommand);
commandManager.registerCommand("cmd_preview", nsPreviewCommand);
commandManager.registerCommand("cmd_editSendPage", nsSendPageCommand);
commandManager.registerCommand("cmd_print", nsPrintCommand);
commandManager.registerCommand("cmd_printSetup", nsPrintSetupCommand);
commandManager.registerCommand("cmd_quit", nsQuitCommand);
commandManager.registerCommand("cmd_close", nsCloseCommand);
commandManager.registerCommand("cmd_preferences", nsPreferencesCommand);
@ -569,6 +571,38 @@ var nsSendPageCommand =
}
};
//-----------------------------------------------------------------------------------
var nsPrintCommand =
{
isCommandEnabled: function(aCommand, dummy)
{
return true; // we can always do this
},
doCommand: function(aCommand)
{
// In editor.js
FinishHTMLSource();
window.editorShell.Print();
}
};
//-----------------------------------------------------------------------------------
var nsPrintSetupCommand =
{
isCommandEnabled: function(aCommand, dummy)
{
return true; // we can always do this
},
doCommand: function(aCommand)
{
// In editor.js
FinishHTMLSource();
goPageSetup();
}
};
//-----------------------------------------------------------------------------------
var nsQuitCommand =
{

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

@ -302,7 +302,7 @@
<menuitem label="&previewCmd.label;" accesskey="&filepreview.accesskey;" observes="cmd_preview"/>
<!-- menuitem id="menu_SendPage" is merged here from mailEditorOverlay.xul,
where "position" is assumed to be 14. Change that label if menu position changes. -->
<menuitem accesskey="&fileprintsetup.accesskey;" observes="cmd_printSetup" />
<!--Page setup gets overlaid here from platformGlobalOverlay.xul / -->
<menuitem id="printMenuItem" accesskey="&fileprint.accesskey;" key="printkb" observes="cmd_print" label="&printCmd.label;"/>
<menuseparator/>
<!-- The Exit/Quit item is merged from platformGlobalOverlay.xul -->
@ -656,7 +656,7 @@
tooltip="aTooltip" tooltiptext="&printToolbarCmd.tooltip;">
<menupopup id="printMenu">
<menuitem accesskey="&fileprint.accesskey;" label="&printCmd.label;" default="true"/>
<menuitem accesskey="&fileprintsetup.accesskey;" observes="cmd_printSetup" />
<menuitem accesskey="&fileprintsetup.accesskey;" label="&printSetupCmd.label;" oncommand="goDoCommand('cmd_printSetup'); event.preventBubble();"/>
</menupopup>
</toolbarbutton>