aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog18
-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
-rw-r--r--lib/ephy-file-chooser.c4
-rw-r--r--lib/ephy-gui.c27
-rw-r--r--lib/ephy-gui.h2
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c25
-rw-r--r--src/ephy-window.c6
-rwxr-xr-xsrc/pdm-dialog.c9
12 files changed, 142 insertions, 54 deletions
diff --git a/ChangeLog b/ChangeLog
index 59e53b8d6..6efd46b8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
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.
+
+2004-12-18 Christian Persch <chpe@cvs.gnome.org>
+
* src/ephy-window.c: (update_print_actions),
(update_actions_sensitivity), (sync_tab_load_status):
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);
diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c
index d759416aa..1f3c80f63 100644
--- a/lib/ephy-file-chooser.c
+++ b/lib/ephy-file-chooser.c
@@ -25,6 +25,7 @@
#include "ephy-file-helpers.h"
#include "eel-gconf-extensions.h"
#include "ephy-state.h"
+#include "ephy-gui.h"
#include "ephy-debug.h"
#include <gtk/gtkstock.h>
@@ -377,7 +378,8 @@ ephy_file_chooser_new (const char *title,
{
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (parent));
-
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parent)),
+ GTK_WINDOW (dialog));
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
}
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index cd8f09e02..622c145c2 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -168,8 +168,25 @@ ephy_gui_menu_position_on_panel (GtkMenu *menu,
ephy_gui_sanitise_popup_position (menu, widget, x, y);
}
+GtkWindowGroup *
+ephy_gui_ensure_window_group (GtkWindow *window)
+{
+ GtkWindowGroup *group;
+
+ group = window->group;
+ if (group == NULL)
+ {
+ group = gtk_window_group_new ();
+ gtk_window_group_add_window (group, window);
+ g_object_unref (group);
+ }
+
+ return group;
+}
+
gboolean
-ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
+ephy_gui_confirm_overwrite_file (GtkWidget *parent,
+ const char *filename)
{
GtkWidget *dialog;
char *display_name;
@@ -186,7 +203,7 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
dialog = gtk_message_dialog_new
(parent ? GTK_WINDOW (parent) : NULL,
- GTK_DIALOG_MODAL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
_("A file %s already exists."), display_name);
@@ -204,6 +221,12 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
+ if (parent != NULL)
+ {
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parent)),
+ GTK_WINDOW (dialog));
+ }
+
retval = (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT);
gtk_widget_destroy (dialog);
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 73f2e5bce..aa40c0de2 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -53,6 +53,8 @@ void ephy_gui_menu_position_on_panel (GtkMenu *menu,
gboolean *push_in,
gpointer user_data);
+GtkWindowGroup *ephy_gui_ensure_window_group (GtkWindow *window);
+
gboolean ephy_gui_is_middle_click (void);
gboolean ephy_gui_select_row_by_key (GtkTreeView *treeview,
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 556984c5a..514e51280 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -454,10 +454,10 @@ cmd_open_bookmarks_in_browser (GtkAction *action,
}
static GtkWidget*
-delete_topic_dialog_construct (GtkWindow *parent, const char *topic)
+delete_topic_dialog_construct (GtkWindow *parent,
+ const char *topic)
{
GtkWidget *dialog;
- GtkWindowGroup *group;
char *str;
str = g_strdup_printf (_("Delete topic %s?"), topic);
@@ -478,16 +478,7 @@ delete_topic_dialog_construct (GtkWindow *parent, const char *topic)
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Delete Topic"), GTK_RESPONSE_ACCEPT);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
- group = GTK_WINDOW (parent)->group;
-
- if (group == NULL)
- {
- group = gtk_window_group_new ();
- gtk_window_group_add_window (group, GTK_WINDOW (parent));
- g_object_unref (group);
- }
-
- gtk_window_group_add_window (group, GTK_WINDOW (dialog));
+ gtk_window_group_add_window (GTK_WINDOW (parent)->group, GTK_WINDOW (dialog));
return dialog;
}
@@ -1542,17 +1533,9 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
EphyNode *node;
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
- GtkWindowGroup *group;
int col_id, details_value;
- /* ensure window group */
- group = GTK_WINDOW (editor)->group;
- if (group == NULL)
- {
- group = gtk_window_group_new ();
- gtk_window_group_add_window (group, GTK_WINDOW (editor));
- g_object_unref (group);
- }
+ ephy_gui_ensure_window_group (GTK_WINDOW (editor));
gtk_window_set_title (GTK_WINDOW (editor), _("Bookmarks"));
gtk_window_set_icon_name (GTK_WINDOW (editor), EPHY_STOCK_BOOKMARKS);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 72c3bfb20..ec33e5e48 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2452,13 +2452,13 @@ ephy_window_init (EphyWindow *window)
LOG ("EphyWindow initialising %p", window)
+ g_object_ref (ephy_shell);
+
window->priv = EPHY_WINDOW_GET_PRIVATE (window);
window->priv->chrome = EPHY_EMBED_CHROME_ALL;
- g_object_ref (ephy_shell);
-
- ensure_window_group (window);
+ ephy_gui_ensure_window_group (GTK_WINDOW (window));
/* Setup the UI manager and connect verbs */
setup_ui_manager (window);
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index a6dfa8c77..ec92f3b4d 100755
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -900,8 +900,8 @@ show_cookies_properties (PdmDialog *dialog,
gdialog = gtk_dialog_new_with_buttons
(_("Cookie Properties"),
- GTK_WINDOW(parent),
- GTK_DIALOG_MODAL,
+ GTK_WINDOW (parent),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, 0, NULL);
ephy_state_add_window (GTK_WIDGET (gdialog), "cookie_properties",
-1, -1, FALSE,
@@ -993,7 +993,10 @@ show_cookies_properties (PdmDialog *dialog,
table,
FALSE, FALSE, 0);
- gtk_dialog_run (GTK_DIALOG(gdialog));
+ gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (parent)),
+ GTK_WINDOW (gdialog));
+
+ gtk_dialog_run (GTK_DIALOG (gdialog));
gtk_widget_destroy (gdialog);
}