diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-07-06 21:22:35 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-07-06 21:22:35 +0800 |
commit | d86cac67a766a04b93c94365ff162f64a1954644 (patch) | |
tree | f37e82765868a2343b94dd4574c826ad05780e9f /embed/mozilla/GtkNSSDialogs.cpp | |
parent | 942d6ff58714449de8ad005313811db0b3177a4d (diff) | |
download | gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar.gz gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar.bz2 gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar.lz gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar.xz gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.tar.zst gsoc2013-epiphany-d86cac67a766a04b93c94365ff162f64a1954644.zip |
A embed/mozilla/AutoWindowModalState.cpp: A
2006-07-06 Christian Persch <chpe@cvs.gnome.org>
A embed/mozilla/AutoWindowModalState.cpp:
A embed/mozilla/AutoWindowModalState.h:
* embed/mozilla/ContentHandler.cpp:
* embed/mozilla/EphyPromptService.cpp:
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/FilePicker.h:
* embed/mozilla/GtkNSSClientAuthDialogs.cpp:
* embed/mozilla/GtkNSSDialogs.cpp:
* embed/mozilla/GtkNSSKeyPairDialogs.cpp:
* embed/mozilla/GtkNSSSecurityWarningDialogs.cpp:
* embed/mozilla/Makefile.am:
Prevent DOM window closure while we display a modal dialogue on it.
Diffstat (limited to 'embed/mozilla/GtkNSSDialogs.cpp')
-rw-r--r-- | embed/mozilla/GtkNSSDialogs.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp index e3c9b5bcc..9c7f4cd12 100644 --- a/embed/mozilla/GtkNSSDialogs.cpp +++ b/embed/mozilla/GtkNSSDialogs.cpp @@ -87,6 +87,7 @@ #include "ephy-password-dialog.h" #include "AutoJSContextStack.h" +#include "AutoWindowModalState.h" #include "EphyUtils.h" #include "GtkNSSDialogs.h" @@ -227,6 +228,9 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx, GtkWidget *dialog, *label, *checkbox, *vbox, *button; int res; + g_return_val_if_fail (markup_text, GTK_RESPONSE_CANCEL); + g_return_val_if_fail (!checkbox_text || checkbox_value, GTK_RESPONSE_CANCEL); + nsresult rv; AutoJSContextStack stack; rv = stack.Init (); @@ -235,12 +239,11 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx, /* NOTE: Due to a mozilla bug [https://bugzilla.mozilla.org/show_bug.cgi?id=306288], * we will always end up without a parent! */ - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (ctx)); 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); - + AutoWindowModalState modalState (parent); + dialog = gtk_dialog_new_with_buttons ("", gparent, GTK_DIALOG_DESTROY_WITH_PARENT, (char *) NULL); @@ -612,9 +615,11 @@ GtkNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, rv = stack.Init (); if (NS_FAILED (rv)) return rv; - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (ctx)); GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent)); + AutoWindowModalState modalState (parent); + dialog = gtk_dialog_new_with_buttons (_("Trust new Certificate Authority?"), gparent, GTK_DIALOG_DESTROY_WITH_PARENT, _("_View Certificate"), @@ -743,9 +748,11 @@ GtkNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, rv = stack.Init (); if (NS_FAILED (rv)) return rv; - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (ctx)); GtkWidget *gparent = EphyUtils::FindGtkParent (parent); + AutoWindowModalState modalState (parent); + dialog = ephy_password_dialog_new (gparent, _("Select Password"), EphyPasswordDialogFlags(EPHY_PASSWORD_DIALOG_FLAGS_SHOW_NEW_PASSWORD | @@ -791,9 +798,11 @@ GtkNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, rv = stack.Init (); if (NS_FAILED (rv)) return rv; - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (ctx)); GtkWidget *gparent = EphyUtils::FindGtkParent (parent); + AutoWindowModalState modalState (parent); + GtkWidget *dialog = ephy_password_dialog_new (gparent, "", @@ -1208,8 +1217,11 @@ GtkNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx, dialog = glade_xml_get_widget (gxml, "viewcert_dialog"); g_return_val_if_fail (dialog != NULL, NS_ERROR_FAILURE); - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (ctx)); GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent)); + + AutoWindowModalState modalState (parent); + if (gparent) { gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(gparent)); @@ -1391,9 +1403,11 @@ GtkNSSDialogs::SetPassword(nsIInterfaceRequestor *aCtx, PRUint32 status = nsIPKCS11Slot::SLOT_UNINITIALIZED; slot->GetStatus (&status); - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (aCtx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (aCtx)); GtkWidget *gparent = EphyUtils::FindGtkParent (parent); + AutoWindowModalState modalState (parent); + EphyPasswordDialogFlags flags = EphyPasswordDialogFlags (EPHY_PASSWORD_DIALOG_FLAGS_SHOW_NEW_PASSWORD | EPHY_PASSWORD_DIALOG_FLAGS_SHOW_QUALITY_METER); @@ -1478,9 +1492,11 @@ GtkNSSDialogs::GetPassword(nsIInterfaceRequestor *aCtx, rv = stack.Init (); if (NS_FAILED (rv)) return rv; - nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (aCtx); + nsCOMPtr<nsIDOMWindow> parent (do_GetInterface (aCtx)); GtkWidget *gparent = EphyUtils::FindGtkParent (parent); + AutoWindowModalState modalState (parent); + EphyPasswordDialogFlags flags = EphyPasswordDialogFlags (EPHY_PASSWORD_DIALOG_FLAGS_SHOW_PASSWORD); |