aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-09 08:35:45 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-09 08:35:45 +0800
commit2427e942801133136a6d63874eee960f1249f0d2 (patch)
treeb22aee6daf3eb6f4838286574cc36469ddfc8101 /embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
parentba0aafaf687b42c36ce032e31e94a9013d843d41 (diff)
downloadgsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar.gz
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar.bz2
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar.lz
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar.xz
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.tar.zst
gsoc2013-epiphany-2427e942801133136a6d63874eee960f1249f0d2.zip
Set default response to ACCEPT in send-to-insecure dialogue, only write
2005-01-09 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/GtkNSSSecurityWarningDialogs.cpp: * embed/mozilla/GtkNSSSecurityWarningDialogs.h: Set default response to ACCEPT in send-to-insecure dialogue, only write back show_once pref when not shown by default, and add the dialogue to its parent's window group (note that there isn't a parent without a mozilla patch, currently).
Diffstat (limited to 'embed/mozilla/GtkNSSSecurityWarningDialogs.cpp')
-rw-r--r--embed/mozilla/GtkNSSSecurityWarningDialogs.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp b/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
index 0517189a7..5c3c30a9c 100644
--- a/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
+++ b/embed/mozilla/GtkNSSSecurityWarningDialogs.cpp
@@ -91,6 +91,7 @@ GtkNSSSecurityWarningDialogs::ConfirmEnteringSecure (nsIInterfaceRequestor *aCon
ENTER_SITE_PREF,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
+ GTK_RESPONSE_OK,
_("Security Notice"),
_("This page is loaded over a secure connection."),
_("You can always see the security status of a page from "
@@ -109,6 +110,7 @@ GtkNSSSecurityWarningDialogs::ConfirmEnteringWeak (nsIInterfaceRequestor *aConte
WEAK_SITE_PREF,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
+ GTK_RESPONSE_OK,
_("Security Warning"),
_("This page is loaded over a low security connection."),
_("Any information you see or enter on this page could "
@@ -136,6 +138,7 @@ GtkNSSSecurityWarningDialogs::ConfirmMixedMode (nsIInterfaceRequestor *aContext,
MIXEDCONTENT_PREF,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
+ GTK_RESPONSE_OK,
_("Security Warning"),
_("Some parts of this page are loaded over an insecure connection."),
_("Some information you see or enter will be sent over an insecure "
@@ -154,6 +157,7 @@ GtkNSSSecurityWarningDialogs::ConfirmPostToInsecure (nsIInterfaceRequestor *aCon
INSECURE_SUBMIT_PREF,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
+ GTK_RESPONSE_ACCEPT,
_("Security Warning"),
_("Send this information over an insecure connection?"),
_("The information you have entered will be sent over an "
@@ -162,7 +166,6 @@ GtkNSSSecurityWarningDialogs::ConfirmPostToInsecure (nsIInterfaceRequestor *aCon
_("Send"),
_retval);
- *_retval = PR_TRUE;
return NS_OK;
}
@@ -174,6 +177,7 @@ GtkNSSSecurityWarningDialogs::ConfirmPostToInsecureFromSecure (nsIInterfaceReque
nsnull, /* No preference for this one - it's too important */
GTK_MESSAGE_WARNING,
GTK_BUTTONS_CANCEL,
+ GTK_RESPONSE_CANCEL,
_("Security Warning"),
_("Send this information over an insecure connection?"),
_("Although this page was loaded over a secure connection, "
@@ -191,6 +195,7 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
const char *aPrefName,
GtkMessageType aType,
GtkButtonsType aButtons,
+ int aDefaultResponse,
const char *aTitle,
const char *aPrimary,
const char *aSecondary,
@@ -211,7 +216,7 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
char *showOncePref = NULL;
PRBool showOnce = PR_FALSE;
- if (prefBranch && aPrefName)
+ if (!show && prefBranch && aPrefName)
{
showOncePref = g_strconcat (aPrefName, ".show_once", NULL);
rv = prefBranch->GetBoolPref (showOncePref, &showOnce);
@@ -240,6 +245,12 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
GTK_DIALOG_MODAL, aType,
aButtons, aPrimary);
+ if (parent && GTK_WINDOW (parent)->group)
+ {
+ gtk_window_group_add_window (GTK_WINDOW (parent)->group,
+ GTK_WINDOW (dialog));
+ }
+
if (aSecondary)
{
gtk_message_dialog_format_secondary_markup
@@ -250,15 +261,10 @@ GtkNSSSecurityWarningDialogs::DoDialog (nsIInterfaceRequestor *aContext,
{
gtk_dialog_add_button (GTK_DIALOG (dialog), aButtonText,
GTK_RESPONSE_ACCEPT);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_CANCEL);
- }
- else
- {
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK);
}
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), aDefaultResponse);
+
gtk_window_set_title (GTK_WINDOW (dialog), aTitle);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");