aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-19 05:51:48 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-19 05:51:48 +0800
commitfb964a82fd2244d91b6303853d3a49ec338b94cc (patch)
tree529320e1e933bc2a41945c51f6374818158a4898 /embed
parent419bf3af0979b9d9c0bc04e0e8c02ad68bcd4dd6 (diff)
downloadgsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar.gz
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar.bz2
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar.lz
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar.xz
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.tar.zst
gsoc2013-epiphany-fb964a82fd2244d91b6303853d3a49ec338b94cc.zip
Make sure we don't have any app-modal dialogues. Fixes bug #110479.
2004-12-18 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/ContentHandler.cpp: * embed/mozilla/FilePicker.cpp: * embed/mozilla/GtkNSSClientAuthDialogs.cpp: * embed/mozilla/GtkNSSDialogs.cpp: * embed/mozilla/GtkNSSKeyPairDialogs.cpp: * lib/ephy-file-chooser.c: (ephy_file_chooser_new): * lib/ephy-gui.c: (ephy_gui_ensure_window_group), (ephy_gui_confirm_overwrite_file): * lib/ephy-gui.h: * src/bookmarks/ephy-bookmarks-editor.c: (delete_topic_dialog_construct), (ephy_bookmarks_editor_construct): * src/ephy-window.c: (ephy_window_init): * src/pdm-dialog.c: (show_cookies_properties): Make sure we don't have any app-modal dialogues. Fixes bug #110479.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/ContentHandler.cpp6
-rw-r--r--embed/mozilla/FilePicker.cpp7
-rw-r--r--embed/mozilla/GtkNSSClientAuthDialogs.cpp11
-rw-r--r--embed/mozilla/GtkNSSDialogs.cpp67
-rw-r--r--embed/mozilla/GtkNSSKeyPairDialogs.cpp14
5 files changed, 81 insertions, 24 deletions
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index f4a0f0166..14a3438ec 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -149,6 +149,12 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile(
EPHY_FILE_FILTER_ALL);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), defaultFile.get());
+ if (parentWindow)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parentWindow)),
+ GTK_WINDOW (dialog));
+ }
+
/* FIXME: modal -- mozilla sucks! */
do
{
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index 049f690bf..2a72e3adf 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -117,6 +117,13 @@ NS_IMETHODIMP GFilePicker::Init(nsIDOMWindowInternal *parent, const PRUnichar *t
CONF_STATE_UPLOAD_DIR,
EPHY_FILE_FILTER_NONE);
+ if (parent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (gtkparent)),
+ GTK_WINDOW (mDialog));
+ gtk_dialog_set_destroy_with_parent (GTK_DIALOG (mDialog), TRUE);
+ }
+
if (mode == nsIFilePicker::modeOpenMultiple)
{
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (mDialog), TRUE);
diff --git a/embed/mozilla/GtkNSSClientAuthDialogs.cpp b/embed/mozilla/GtkNSSClientAuthDialogs.cpp
index d8f68c883..4a0531e6d 100644
--- a/embed/mozilla/GtkNSSClientAuthDialogs.cpp
+++ b/embed/mozilla/GtkNSSClientAuthDialogs.cpp
@@ -57,6 +57,7 @@
#include "GtkNSSClientAuthDialogs.h"
+#include "ephy-gui.h"
#include "ephy-state.h"
#include "ephy-debug.h"
@@ -144,7 +145,7 @@ GtkNSSClientAuthDialogs::ChooseCertificate (nsIInterfaceRequestor *ctx,
PRUint32 i;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
dialog = gtk_dialog_new_with_buttons ("",
GTK_WINDOW (gparent),
@@ -154,7 +155,13 @@ GtkNSSClientAuthDialogs::ChooseCertificate (nsIInterfaceRequestor *ctx,
_("_Select Certificate"),
GTK_RESPONSE_OK,
NULL);
-
+
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp
index 52a2e351a..bf4707e25 100644
--- a/embed/mozilla/GtkNSSDialogs.cpp
+++ b/embed/mozilla/GtkNSSDialogs.cpp
@@ -207,16 +207,21 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx,
int res;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
g_return_val_if_fail (markup_text, GTK_RESPONSE_CANCEL);
g_return_val_if_fail (!checkbox_text || checkbox_value, GTK_RESPONSE_CANCEL);
- dialog = gtk_dialog_new_with_buttons ("",
- gparent ? GTK_WINDOW (gparent) : NULL,
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
GTK_DIALOG_DESTROY_WITH_PARENT,
NULL);
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+ gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
higgy_setup_dialog (GTK_DIALOG (dialog),
@@ -543,10 +548,9 @@ GtkNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx,
char *ttCommonName, *msg, *tertiary;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
- dialog = gtk_dialog_new_with_buttons ("",
- GTK_WINDOW (gparent),
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
GTK_DIALOG_DESTROY_WITH_PARENT,
_("_View Certificate"),
NSSDIALOG_RESPONSE_VIEW_CERT,
@@ -554,6 +558,12 @@ GtkNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx,
_("_Trust CA"), GTK_RESPONSE_ACCEPT,
NULL);
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
higgy_setup_dialog (GTK_DIALOG (dialog), GTK_STOCK_DIALOG_WARNING,
@@ -642,15 +652,20 @@ GtkNSSDialogs::NotifyCACertExists (nsIInterfaceRequestor *ctx)
char * msg;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
- dialog = gtk_dialog_new_with_buttons ("",
- GTK_WINDOW (gparent),
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK,
GTK_RESPONSE_OK,
NULL);
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
higgy_setup_dialog (GTK_DIALOG (dialog), GTK_STOCK_DIALOG_ERROR,
@@ -764,16 +779,20 @@ GtkNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
char *msg;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
-
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
- dialog = gtk_dialog_new_with_buttons ("",
- GTK_WINDOW (gparent),
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
NULL);
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
higgy_setup_dialog (GTK_DIALOG (dialog), GTK_STOCK_DIALOG_QUESTION,
@@ -877,15 +896,20 @@ GtkNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
char *msg;
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
- dialog = gtk_dialog_new_with_buttons ("",
- GTK_WINDOW (gparent),
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("I_mport Certificate"), GTK_RESPONSE_OK,
NULL);
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
+
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
higgy_setup_dialog (GTK_DIALOG (dialog), GTK_STOCK_DIALOG_QUESTION,
@@ -1309,9 +1333,14 @@ GtkNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx,
&dialog, NULL, NULL);
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
- gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(gparent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
+ if (gparent)
+ {
+ gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(gparent));
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (gparent)),
+ GTK_WINDOW (dialog));
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+ }
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
diff --git a/embed/mozilla/GtkNSSKeyPairDialogs.cpp b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
index 066cd44f5..ed987b105 100644
--- a/embed/mozilla/GtkNSSKeyPairDialogs.cpp
+++ b/embed/mozilla/GtkNSSKeyPairDialogs.cpp
@@ -66,6 +66,7 @@
#include <glib/gi18n.h>
#include "GtkNSSKeyPairDialogs.h"
+#include "ephy-gui.h"
#include "ephy-debug.h"
GtkNSSKeyPairDialogs::GtkNSSKeyPairDialogs ()
@@ -198,13 +199,20 @@ GtkNSSKeyPairDialogs::DisplayGeneratingKeypairInfo (nsIInterfaceRequestor *ctx,
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
- GtkWidget *gparent = EphyUtils::FindGtkParent (parent);
+ GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
- dialog = gtk_dialog_new_with_buttons ("", GTK_WINDOW (gparent),
- GTK_DIALOG_NO_SEPARATOR, NULL);
+ dialog = gtk_dialog_new_with_buttons ("", gparent,
+ GTK_DIALOG_DESTROY_WITH_PARENT, NULL);
+
+ if (gparent)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (gparent),
+ GTK_WINDOW (dialog));
+ }
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
+ gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);