aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-01-08 22:50:07 +0800
committerChristian Persch <chpe@src.gnome.org>2006-01-08 22:50:07 +0800
commit15130661034c26f7b4040c2bb49ffac94b4694ba (patch)
treebae5238a7b0684e483b916d939a024ae9ac961e9 /embed
parentf765c0efaf46cc7b24b7eda0ca0a3576094c8f7f (diff)
downloadgsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar.gz
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar.bz2
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar.lz
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar.xz
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.tar.zst
gsoc2013-epiphany-15130661034c26f7b4040c2bb49ffac94b4694ba.zip
Make ESC cancel the content handler dialogue. Bug #325811.
2006-01-08 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/ContentHandler.cpp: Make ESC cancel the content handler dialogue. Bug #325811.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/ContentHandler.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index 678ea5077..e7d7ca885 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -154,7 +154,7 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile(
nsILocalFile **_retval)
{
EphyFileChooser *dialog;
- gint response;
+ int response;
char *filename = NULL;
nsEmbedCString defaultFile;
@@ -375,15 +375,18 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, CONTENT_ACTION_SAVEAS);
gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, CONTENT_ACTION_NONE);
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
action_label, mAction);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
+
+ int defaultResponse = mAction == CONTENT_ACTION_NONE
+ ? (int) GTK_RESPONSE_CANCEL
+ : (int) mAction;
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), defaultResponse);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), (guint) mAction);
-
- NS_ADDREF (this);
+ NS_ADDREF_THIS();
g_signal_connect_data (dialog, "response",
G_CALLBACK (response_cb), this,
(GClosureNotify) release_cb, (GConnectFlags) 0);