From 9435af9372734a2e9c7c3353b7ecad9cf3251a7b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 21 Jan 2004 23:39:43 +0000 Subject: *** empty log message *** --- embed/mozilla/ContentHandler.cpp | 12 ++++++++++-- embed/mozilla/ContentHandler.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp index 0e5664019..a92f2ce02 100644 --- a/embed/mozilla/ContentHandler.cpp +++ b/embed/mozilla/ContentHandler.cpp @@ -89,6 +89,7 @@ NS_IMETHODIMP GContentHandler::Show(nsIHelperAppLauncher *aLauncher, EphyEmbedSingle *single; gboolean handled = FALSE; + mContext = aContext; mLauncher = aLauncher; rv = Init (); NS_ENSURE_SUCCESS (rv, rv); @@ -129,7 +130,10 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile( _retval); } - dialog = ephy_file_chooser_new (_("Save"), NULL, + nsCOMPtr parentDOMWindow = do_QueryInterface (aWindowContext); + GtkWidget *parentWindow = GTK_WIDGET (MozillaFindGtkParent (parentDOMWindow)); + + dialog = ephy_file_chooser_new (_("Save"), parentWindow, GTK_FILE_CHOOSER_ACTION_SAVE, CONF_STATE_DOWNLOAD_DIR); gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), @@ -250,13 +254,17 @@ NS_METHOD GContentHandler::MIMEConfirmAction () char *text; int response; + nsCOMPtr parentDOMWindow = do_QueryInterface (mContext); + GtkWindow *parentWindow = GTK_WINDOW (MozillaFindGtkParent(parentDOMWindow)); + dialog = gtk_dialog_new_with_buttons - ("", NULL, GTK_DIALOG_NO_SEPARATOR, + ("", parentWindow, GTK_DIALOG_NO_SEPARATOR, _("_Save As..."), CONTENT_ACTION_SAVEAS, GTK_STOCK_CANCEL, CONTENT_ACTION_NONE, mAction == CONTENT_ACTION_OPEN ? _("_Open") : _("_Download"), mAction, NULL); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), (guint)mAction); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); diff --git a/embed/mozilla/ContentHandler.h b/embed/mozilla/ContentHandler.h index b692675f5..6aa39658d 100644 --- a/embed/mozilla/ContentHandler.h +++ b/embed/mozilla/ContentHandler.h @@ -77,9 +77,9 @@ class GContentHandler : public nsIHelperAppLauncherDialog NS_METHOD CheckAppSupportScheme (); nsCOMPtr mLauncher; - nsCOMPtr mUri; nsCOMPtr mTempFile; + nsCOMPtr mContext; char *mMimeType; PRBool mAppSupportScheme; -- cgit v1.2.3