Bug 193001 - "Use gnome's native print dialog" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr+a1.9=roc]

This commit is contained in:
2008-01-20 19:47:25 -08:00
parent ea3fbbec06
commit 6b8c86b0e6
26 changed files with 1833 additions and 970 deletions

View File

@@ -44,6 +44,7 @@
#include "nsISupportsUtils.h"
#include "nsISupportsArray.h"
#include "nsString.h"
#include "nsIPrintDialogService.h"
// Printing Progress Includes
#include "nsPrintProgress.h"
@@ -109,6 +110,13 @@ nsPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIWebBrowserPrin
NS_ENSURE_ARG(webBrowserPrint);
NS_ENSURE_ARG(printSettings);
// Try to access a component dialog
nsCOMPtr<nsIPrintDialogService> dlgPrint(do_GetService(
NS_PRINTDIALOGSERVICE_CONTRACTID));
if (dlgPrint)
return dlgPrint->Show(printSettings);
// Show the built-in dialog instead
ParamBlock block;
nsresult rv = block.Init();
if (NS_FAILED(rv))
@@ -177,6 +185,12 @@ nsPrintingPromptService::ShowPageSetup(nsIDOMWindow *parent, nsIPrintSettings *p
{
NS_ENSURE_ARG(printSettings);
// Try to access a component dialog
nsCOMPtr<nsIPrintDialogService> dlgPrint(do_GetService(
NS_PRINTDIALOGSERVICE_CONTRACTID));
if (dlgPrint)
return dlgPrint->ShowPageSetup(printSettings);
ParamBlock block;
nsresult rv = block.Init();
if (NS_FAILED(rv))