From 67430590bb00c7265876fc25e6339c3fa33ca1de Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 31 Oct 2003 13:13:06 +0000 Subject: Correctly set the embed for the print dialogue. 2003-10-31 Christian Persch * embed/mozilla/MozillaPrivate.cpp: * embed/mozilla/MozillaPrivate.h: * embed/mozilla/PrintingPromptService.cpp: Correctly set the embed for the print dialogue. --- ChangeLog | 8 ++++++++ embed/mozilla/MozillaPrivate.cpp | 15 +++++++++++++-- embed/mozilla/MozillaPrivate.h | 2 ++ embed/mozilla/PrintingPromptService.cpp | 7 +++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba303787e..e2463ed22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-10-31 Christian Persch + + * embed/mozilla/MozillaPrivate.cpp: + * embed/mozilla/MozillaPrivate.h: + * embed/mozilla/PrintingPromptService.cpp: + + Correctly set the embed for the print dialogue. + 2003-10-31 Marco Pesenti Gritti * embed/mozilla/ContentHandler.cpp: diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp index 48d29fc10..1950f0e6c 100644 --- a/embed/mozilla/MozillaPrivate.cpp +++ b/embed/mozilla/MozillaPrivate.cpp @@ -6,7 +6,10 @@ #include #include -GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow) +#include "ephy-embed.h" +#include "mozilla-embed.h" + +GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow) { nsresult result; @@ -34,7 +37,15 @@ GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow) result = window->GetSiteWindow ((void **)&mozembed); if (NS_FAILED(result)) return nsnull; - return gtk_widget_get_toplevel (GTK_WIDGET(mozembed)); + return mozembed; +} + +GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow) +{ + GtkWidget *embed = MozillaFindEmbed (aDOMWindow); + if (!embed) return nsnull; + + return gtk_widget_get_toplevel (GTK_WIDGET (embed)); } #define MM_TO_INCH(x) (((double) x) / 25.4) diff --git a/embed/mozilla/MozillaPrivate.h b/embed/mozilla/MozillaPrivate.h index be9ab4905..c2f9a4b42 100644 --- a/embed/mozilla/MozillaPrivate.h +++ b/embed/mozilla/MozillaPrivate.h @@ -3,6 +3,8 @@ #include "ephy-embed.h" +GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow); + GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow); NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info, diff --git a/embed/mozilla/PrintingPromptService.cpp b/embed/mozilla/PrintingPromptService.cpp index a66cb5379..1288e2cc8 100644 --- a/embed/mozilla/PrintingPromptService.cpp +++ b/embed/mozilla/PrintingPromptService.cpp @@ -14,10 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ */ #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #include @@ -53,8 +55,9 @@ NS_IMETHODIMP GPrintingPromptService::ShowPrintDialog(nsIDOMWindow *parent, nsIW EmbedPrintInfo *info; GtkWidget *gtkParent = MozillaFindGtkParent(parent); + EphyEmbed *embed = EPHY_EMBED (MozillaFindEmbed (parent)); - dialog = print_dialog_new_with_parent (gtkParent, NULL, &info); + dialog = print_dialog_new_with_parent (gtkParent, embed, &info); ephy_dialog_set_modal (dialog, TRUE); gint ret = ephy_dialog_run (dialog); -- cgit v1.2.3