From 15130661034c26f7b4040c2bb49ffac94b4694ba Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 8 Jan 2006 14:50:07 +0000 Subject: Make ESC cancel the content handler dialogue. Bug #325811. 2006-01-08 Christian Persch * embed/mozilla/ContentHandler.cpp: Make ESC cancel the content handler dialogue. Bug #325811. --- ChangeLog | 6 ++++++ embed/mozilla/ContentHandler.cpp | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5aa82bc9c..92511f437 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-01-08 Christian Persch + + * embed/mozilla/ContentHandler.cpp: + + Make ESC cancel the content handler dialogue. Bug #325811. + 2006-01-06 Crispin Flowerday * src/window-commands.c (window_cmd_help_about): 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); -- cgit v1.2.3