зеркало из https://github.com/mozilla/pjs.git
Fix bug 42817 -- overlay a Page Setup menu item for Mac, which displays the page setup dialog. r=jag/hwaara, sr=sspitzer/blake
This commit is contained in:
Родитель
d54f2254b7
Коммит
12fd7d9e86
|
@ -75,6 +75,7 @@ Rights Reserved.
|
|||
<commandset id="globalEditMenuItems"/>
|
||||
<command id="cmd_newNavigator"/>
|
||||
<command id="cmd_newEditor"/>
|
||||
<command id="cmd_printSetup" oncommand="goPageSetup()"/>
|
||||
<command id="cmd_PrintCard" oncommand="AbPrintCard()"/>
|
||||
<command id="cmd_quit"/>
|
||||
<command id="cmd_close" oncommand="AbClose()"/>
|
||||
|
@ -132,6 +133,7 @@ Rights Reserved.
|
|||
<menuseparator/>
|
||||
<menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport()"/>
|
||||
<menuseparator/>
|
||||
<!--Page setup gets overlaid here from platformGlobalOverlay.xul / -->
|
||||
<menuitem id="printMenuItem" label="&printCardViewCmd.label;" accesskey="&printCardViewCmd.accesskey;" key="key_PrintCard" command="cmd_PrintCard"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
|
|
|
@ -228,6 +228,7 @@ var DefaultController =
|
|||
case "cmd_openMessage":
|
||||
case "button_print":
|
||||
case "cmd_print":
|
||||
case "cmd_printSetup":
|
||||
case "cmd_saveAsFile":
|
||||
case "cmd_saveAsTemplate":
|
||||
case "cmd_properties":
|
||||
|
@ -345,6 +346,8 @@ var DefaultController =
|
|||
}
|
||||
}
|
||||
return false;
|
||||
case "cmd_printSetup":
|
||||
return true;
|
||||
case "cmd_markThreadAsRead":
|
||||
case "cmd_markAsFlagged":
|
||||
case "button_file":
|
||||
|
@ -547,6 +550,9 @@ var DefaultController =
|
|||
case "cmd_openMessage":
|
||||
MsgOpenSelectedMessages();
|
||||
return;
|
||||
case "cmd_printSetup":
|
||||
goPageSetup();
|
||||
return;
|
||||
case "cmd_print":
|
||||
PrintEnginePrint();
|
||||
return;
|
||||
|
|
|
@ -77,6 +77,7 @@ Rights Reserved.
|
|||
<command id="cmd_settingsOffline" oncommand="goDoCommand('cmd_settingsOffline')" disabled="true"/>
|
||||
|
||||
<command id="cmd_openMessage" oncommand="goDoCommand('cmd_openMessage')" disabled="true"/>
|
||||
<command id="cmd_printSetup" oncommand="goDoCommand('cmd_printSetup')" disabled="true"/>
|
||||
<command id="cmd_print" oncommand="goDoCommand('cmd_print')" disabled="true"/>
|
||||
<command id="cmd_saveAsFile" oncommand="goDoCommand('cmd_saveAsFile')" disabled="true"/>
|
||||
<command id="cmd_saveAsTemplate" oncommand="goDoCommand('cmd_saveAsTemplate')" disabled="true"/>
|
||||
|
@ -866,6 +867,7 @@ Rights Reserved.
|
|||
</menu>
|
||||
|
||||
<menuseparator/>
|
||||
<!--Page setup gets overlaid here from platformGlobalOverlay.xul / -->
|
||||
<menuitem id="printMenuItem" key="key_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;" observes="cmd_print"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
|
|
|
@ -429,6 +429,7 @@ var MessageWindowController =
|
|||
case "cmd_shiftDelete":
|
||||
case "button_print":
|
||||
case "cmd_print":
|
||||
case "cmd_printSetup":
|
||||
case "cmd_saveAsFile":
|
||||
case "cmd_saveAsTemplate":
|
||||
case "cmd_viewPageSource":
|
||||
|
@ -515,6 +516,8 @@ var MessageWindowController =
|
|||
case "button_file":
|
||||
case "cmd_file":
|
||||
return ( gCurrentMessageUri != null);
|
||||
case "cmd_printSetup":
|
||||
return true;
|
||||
case "cmd_getNewMessages":
|
||||
case "button_getNewMessages":
|
||||
case "cmd_getMsgsForAuthAccounts":
|
||||
|
@ -606,6 +609,9 @@ var MessageWindowController =
|
|||
case "button_delete":
|
||||
MsgDeleteMessageFromMessageWindow(false, true);
|
||||
break;
|
||||
case "cmd_printSetup":
|
||||
goPageSetup();
|
||||
break;
|
||||
case "cmd_print":
|
||||
PrintEnginePrint();
|
||||
break;
|
||||
|
|
|
@ -228,7 +228,7 @@ var defaultController =
|
|||
case "cmd_sendNow":
|
||||
case "cmd_sendWithCheck":
|
||||
case "cmd_sendLater":
|
||||
// case "cmd_printSetup":
|
||||
case "cmd_printSetup":
|
||||
case "cmd_print":
|
||||
case "cmd_quit":
|
||||
|
||||
|
@ -336,7 +336,7 @@ var defaultController =
|
|||
case "cmd_saveAsTemplate":
|
||||
case "cmd_sendButton":
|
||||
case "cmd_sendLater":
|
||||
// case "cmd_printSetup":
|
||||
case "cmd_printSetup":
|
||||
case "cmd_print":
|
||||
case "cmd_sendWithCheck":
|
||||
return !gWindowLocked;
|
||||
|
@ -467,7 +467,7 @@ var defaultController =
|
|||
case "cmd_sendNow" : if (defaultController.isCommandEnabled(command)) SendMessage(); break;
|
||||
case "cmd_sendWithCheck" : if (defaultController.isCommandEnabled(command)) SendMessageWithCheck(); break;
|
||||
case "cmd_sendLater" : if (defaultController.isCommandEnabled(command)) SendMessageLater(); break;
|
||||
// case "cmd_printSetup" : dump("PRINT SETUP\n"); break;
|
||||
case "cmd_printSetup" : goPageSetup(); break;
|
||||
case "cmd_print" : DoCommandPrint(); break;
|
||||
|
||||
//Edit Menu
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<command id="cmd_sendNow" oncommand="goDoCommand('cmd_sendNow')"/>
|
||||
<command id="cmd_sendWithCheck" oncommand="goDoCommand('cmd_sendWithCheck')"/>
|
||||
<command id="cmd_sendLater" oncommand="goDoCommand('cmd_sendLater')"/>
|
||||
<!--NYI <command id="cmd_printSetup" oncommand="dump('PRINT SETUP\n');"/> -->
|
||||
<command id="cmd_printSetup" oncommand="goDoCommand('cmd_printSetup')"/>
|
||||
<command id="cmd_print" oncommand="goDoCommand('cmd_print')"/>
|
||||
|
||||
<!-- Edit Menu -->
|
||||
|
@ -206,7 +206,7 @@
|
|||
<menuitem label="&sendNowCmd.label;" accesskey="&sendNowCmd.accesskey;" key="key_send" command="cmd_sendNow" id="menu-item-send-now"/>
|
||||
<menuitem label="&sendLaterCmd.label;" accesskey="&sendLaterCmd.accesskey;" key="key_sendLater" command="cmd_sendLater"/>
|
||||
<menuseparator/>
|
||||
<!--NYI <menuitem label="&printSetupCmd.label;" accesskey="&printSetupCmd.accesskey;" command="cmd_printSetup"/> -->
|
||||
<!--Page setup gets overlaid here from platformGlobalOverlay.xul / -->
|
||||
<menuitem id="printMenuItem" label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="key_print" command="cmd_print"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
|
|
|
@ -852,13 +852,18 @@ function BrowserPrintPreview()
|
|||
// implement me
|
||||
}
|
||||
|
||||
function BrowserPrintSetup()
|
||||
{
|
||||
goPageSetup(); // from utilityOverlay.js
|
||||
}
|
||||
|
||||
function BrowserPrint()
|
||||
{
|
||||
// using _content.print() until printing becomes scriptable on docShell
|
||||
try {
|
||||
_content.print();
|
||||
} catch (e) {
|
||||
// Pressing cancel is expressed as an NS_ERROR_FAILURE return value,
|
||||
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
|
||||
// causing an exception to be thrown which we catch here.
|
||||
// Unfortunately this will also consume helpful failures, so add a
|
||||
// dump(e); // if you need to debug
|
||||
|
@ -1065,7 +1070,7 @@ function hiddenWindowStartup()
|
|||
window.focus();
|
||||
|
||||
// Disable menus which are not appropriate
|
||||
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', /*'Browser:PrintSetup', 'Browser:PrintPreview',*/
|
||||
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', 'Browser:PrintSetup', /*'Browser:PrintPreview',*/
|
||||
'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo',
|
||||
'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll'];
|
||||
for (id in disabledItems) {
|
||||
|
|
|
@ -106,12 +106,12 @@
|
|||
<!-- NOT IMPLEMENTED
|
||||
<command id="cmd_newEditorTemplate"/>
|
||||
<command id="cmd_newEditorDraft"/>
|
||||
<command id="Browser:PrintSetup" disabled ="true" oncommand=""/>
|
||||
<command id="Browser:PrintPreview" disabled="true" oncommand=""/> -->
|
||||
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
|
||||
<command id="Browser:SavePage" oncommand="savePage();"/>
|
||||
<command id="Browser:EditPage" oncommand="editPage(window._content.location.href,window, false);"/>
|
||||
<command id="Browser:Open" oncommand="BrowserOpenWindow();"/>
|
||||
<command id="cmd_printSetup" oncommand="goPageSetup();"/>
|
||||
<command id="Browser:Print" oncommand="BrowserPrint();"/>
|
||||
<command id="cmd_quit"/>
|
||||
<command id="cmd_close" oncommand="BrowserClose()"/>
|
||||
|
@ -187,6 +187,7 @@
|
|||
<menuseparator/>
|
||||
<menuitem label="&editPageCmd.label;" accesskey="&editPageCmd.accesskey;" key="key_editPage" command="Browser:EditPage" />
|
||||
<menuseparator/>
|
||||
<!-- Page setup gets inserted here on some platforms -->
|
||||
<menuitem id="printMenuItem" label="&printCmd.label;" accesskey="&printCmd.accesskey;" key="printKb" command="Browser:Print"/>
|
||||
<menuseparator />
|
||||
<menuitem id="offlineGoOfflineCmd"/>
|
||||
|
|
|
@ -127,6 +127,13 @@ function getBrowserURL() {
|
|||
|
||||
function goPageSetup()
|
||||
{
|
||||
// This code brings up the native page setup dialog (for platforms that
|
||||
// implement nsIPrintOptions.ShowNativeDialog()).
|
||||
var printOptionsService = Components.classes["@mozilla.org/gfx/printoptions;1"]
|
||||
.getService(Components.interfaces.nsIPrintOptions);
|
||||
printOptionsService.ReadPrefs();
|
||||
printOptionsService.ShowNativeDialog();
|
||||
printOptionsService.WritePrefs();
|
||||
}
|
||||
|
||||
function goEditCardDialog(abURI, card, okCallback, abCardURI)
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
|
||||
<!DOCTYPE window SYSTEM "chrome://global-platform/locale/platformGlobalOverlay.dtd">
|
||||
|
||||
|
||||
<overlay id="platformGlobalOverlay"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!-- close -->
|
||||
<!-- close -->
|
||||
<menuitem id="menu_close" label="&closeCmd.label;" key="key_close" command="cmd_close"/>
|
||||
<key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
|
||||
|
||||
<!-- quit -->
|
||||
|
||||
<menupopup id="menu_FilePopup">
|
||||
<!-- Page setup -->
|
||||
<menuitem id="printSetupMenuItem"
|
||||
insertbefore="printMenuItem"
|
||||
label="&printSetupCmd.label;"
|
||||
accesskey="&printSetupCmd.accesskey;"
|
||||
command="cmd_printSetup"/>
|
||||
<!-- quit -->
|
||||
<menuitem label="&quitApplicationCmd.label;" key="key_quit" command="cmd_quit"/>
|
||||
</menupopup>
|
||||
<key id="key_quit" key="&quitApplicationCmd.key;" command="cmd_quit" modifiers="accel"/>
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<!-- mac -->
|
||||
<!-- LOCALIZATION NOTE : FILE Do not translate all the Cmd.key-->
|
||||
|
||||
<!ENTITY closeCmd.label "Close">
|
||||
<!ENTITY closeCmd.key "W">
|
||||
<!ENTITY quitApplicationCmd.label "Quit">
|
||||
<!ENTITY quitApplicationCmd.key "Q">
|
||||
|
||||
<!ENTITY redoCmd.label "Redo">
|
||||
<!ENTITY redoCmd.key "Z">
|
Загрузка…
Ссылка в новой задаче