From b3924f2a5509596645492d232c9b3dcf1ad35965 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 18 Feb 2008 13:40:59 +0000 Subject: Fix prompt service for xr 1.9 wrt. DOM notifications. Bug #504445. svn path=/trunk/; revision=7967 --- embed/mozilla/GeckoPrintService.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'embed/mozilla/GeckoPrintService.cpp') diff --git a/embed/mozilla/GeckoPrintService.cpp b/embed/mozilla/GeckoPrintService.cpp index 4d3de3fb8..de2020397 100644 --- a/embed/mozilla/GeckoPrintService.cpp +++ b/embed/mozilla/GeckoPrintService.cpp @@ -46,8 +46,7 @@ #include "ephy-prefs.h" #include "ephy-stock-icons.h" -#include "AutoJSContextStack.h" -#include "AutoWindowModalState.h" +#include "AutoModalDialog.h" #include "EphyUtils.h" #include "GeckoPrintSession.h" @@ -121,16 +120,12 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent, rv = aSettings->GetHowToEnableFrameUI (&frameUI); NS_ENSURE_SUCCESS (rv, rv); - GtkWidget *parent = EphyUtils::FindGtkParent (aParent); - NS_ENSURE_TRUE(parent, NS_ERROR_INVALID_POINTER); - - AutoJSContextStack stack; - rv = stack.Init (); - if (NS_FAILED (rv)) { - return rv; - } + AutoModalDialog modalDialog (aParent, PR_TRUE); + if (!modalDialog.ShouldShow ()) + return NS_ERROR_ABORT; - AutoWindowModalState modalState (aParent); + GtkWindow *parent = modalDialog.GetParent (); + NS_ENSURE_TRUE(parent, NS_ERROR_INVALID_POINTER); EphyEmbedShell *shell = ephy_embed_shell_get_default (); @@ -200,7 +195,7 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent, gtk_window_set_icon_name (GTK_WINDOW (dialog), EPHY_STOCK_EPHY); - int response = gtk_dialog_run (GTK_DIALOG (dialog)); + int response = modalDialog.Run (GTK_DIALOG (dialog)); gtk_widget_hide (dialog); GtkPrinter *printer = gtk_print_unix_dialog_get_selected_printer (print_dialog); -- cgit v1.2.3