Bug #245483 --> Hook up print preview support for Thunderbird

This commit is contained in:
scott%scott-macgregor.org 2004-06-12 00:31:28 +00:00
parent ebf054acd7
commit 01eeea5e74
6 changed files with 69 additions and 3 deletions

View File

@ -0,0 +1,51 @@
<?xml version="1.0"?>
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
# Rights Reserved.
#
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
<window id="printEngineWin"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:nc="http://home.netscape.com/NC-rdf#"
onload="OnLoadPrintEngine()"
onunload="OnUnloadPrintEngine()"
width="750"
height="500"
screenX="10" screenY="10"
persist="width height screenX screenY sizemode"
windowtype="mail:printEngine">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
</stringbundleset>
<!-- XXX: utilityOverlay.xul uses strres.js - once it is converted, this should be removed-->
<script src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/printing.js"/>
<script src="chrome://messenger/content/msgPrintEngine.js"/>
<script type="application/x-javascript" src="chrome://global/content/printUtils.js"/>
<!-- The main display frame -->
<browser id="content" type="content-primary" name="content" src="about:blank" flex="1" disablehistory="true" disablesecurity="true"/>
</window>

View File

@ -28,6 +28,7 @@ messenger.jar:
*+ content/messenger/junkMail.xul (content/junkMail.xul)
*+ content/messenger/junkMail.js (content/junkMail.js)
*+ content/messenger/msgSelectOffline.xul (content/msgSelectOffline.xul)
*+ content/messenger/msgPrintEngine.xul (content/msgPrintEngine.xul)
*+ content/messenger-views/contents.rdf (content/messenger-views.rdf)
content/messenger/about-thunderbird.png (content/about-thunderbird.png)
content/messenger/about-credits.png (content/about-credits.png)

View File

@ -40,7 +40,6 @@
========================================================================== */
@import url("chrome://global/skin/");
@import url("chrome://communicator/content/communicator.css");
@import url("chrome://global/skin/formatting.css");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@ -49,6 +48,10 @@
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar");
}
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}
/* ::::: throbber ::::: */
#navigator-throbber {

View File

@ -40,7 +40,6 @@
========================================================================== */
@import url("chrome://global/skin/");
@import url("chrome://communicator/content/communicator.css");
@import url("chrome://global/skin/formatting.css");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@ -49,6 +48,10 @@
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar");
}
toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}
/* :::::: throbber :::::::::: */
#navigator-throbber {

View File

@ -26,7 +26,6 @@ content/editor-region, comm/content/editor-region
content/communicator-region, comm/content/communicator-region,
content/communicator-platform, comm/content/communicator-platform
content/communicator/contents.rdf, comm/content/communicator/contents.rdf
content/communicator/communicator.css, comm/content/communicator/communicator.css
content/communicator/communicatorOverlay.xul, comm/content/communicator/communicatorOverlay.xul
content/communicator/utilityOverlay.xul, comm/content/communicator/utilityOverlay.xul
content/communicator/utilityOverlay.js, comm/content/communicator/utilityOverlay.js

View File

@ -201,6 +201,8 @@ var PrintUtils = {
printPreviewTB = document.createElementNS(XUL_NS, "toolbar");
printPreviewTB.setAttribute("printpreview", true);
printPreviewTB.setAttribute("id", "print-preview-toolbar");
#ifdef MOZ_PHOENIX
getBrowser().parentNode.insertBefore(printPreviewTB, getBrowser());
// Tab browser...
@ -208,6 +210,7 @@ var PrintUtils = {
this._chromeState.hadTabStrip = getBrowser().getStripVisibility();
getBrowser().setStripVisibilityTo(false);
}
#endif
// copy the window close handler
if (document.documentElement.hasAttribute("onclose"))
@ -232,12 +235,18 @@ var PrintUtils = {
{
window.removeEventListener("keypress", this.onKeyPressPP, true);
#ifdef MOZ_THUNDERBIRD
BrowserExitPrintPreview(); // make the traditional call..don't do any of the inline toolbar browser stuff
return;
#endif
// restore the old close handler
document.documentElement.setAttribute("onclose", this._closeHandlerPP);
this._closeHandlerPP = null;
if ("getStripVisibility" in getBrowser())
getBrowser().setStripVisibilityTo(this._chromeState.hadTabStrip);
var webBrowserPrint = this.getWebBrowserPrint();
webBrowserPrint.exitPrintPreview();