From d321a476c7fe2d9a8174cf0f6a23ea523c469395 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 25 Sep 2003 13:41:52 +0000 Subject: Fix #123176. Use response instead of connecting 210 callbacks. 2003-09-25 Marco Pesenti Gritti * data/glade/epiphany.glade: * embed/mozilla/ContentHandler.cpp: Fix #123176. Use response instead of connecting 210 callbacks. --- ChangeLog | 8 +++++++ data/glade/epiphany.glade | 8 +++---- embed/mozilla/ContentHandler.cpp | 45 ++++++++++++++++++++++------------------ 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbe5f0f11..0533aa3bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-09-25 Marco Pesenti Gritti + + * data/glade/epiphany.glade: + * embed/mozilla/ContentHandler.cpp: + + Fix #123176. Use response instead of + connecting 210 callbacks. + 2003-09-24 Christian Persch * idl/EphyAutomation.idl: diff --git a/data/glade/epiphany.glade b/data/glade/epiphany.glade index 4ec1fb0f7..11707fab2 100644 --- a/data/glade/epiphany.glade +++ b/data/glade/epiphany.glade @@ -982,6 +982,7 @@ False False False + @@ -1002,8 +1003,7 @@ gtk-save True GTK_RELIEF_NORMAL - 0 - + 1 @@ -1016,7 +1016,6 @@ True GTK_RELIEF_NORMAL -6 - @@ -1029,8 +1028,7 @@ gtk-open True GTK_RELIEF_NORMAL - 0 - + 2 diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp index 12724907c..e1a571bce 100644 --- a/embed/mozilla/ContentHandler.cpp +++ b/embed/mozilla/ContentHandler.cpp @@ -195,15 +195,11 @@ class GDownloadProgressListener; struct MimeAskActionDialog; struct HelperAppChooserDialog; -extern "C" -void mime_ask_dialog_save_clicked_cb (GtkButton *button, - MimeAskActionDialog *dialog); -extern "C" -void mime_ask_dialog_open_clicked_cb (GtkButton *button, - MimeAskActionDialog *dialog); -extern "C" -gint mime_ask_dialog_cancel_clicked_cb (GtkButton *button, - MimeAskActionDialog *dialog); +enum +{ + RESPONSE_SAVE = 1, + RESPONSE_OPEN = 2 +}; /* * MimeAskActionDialog: the representation of dialogs used to ask @@ -601,8 +597,8 @@ MimeAskActionDialog::~MimeAskActionDialog() // begin MIMEAskActionDialog callbacks. //////////////////////////////////////////////////////////////////////////////// -extern "C" void -mime_ask_dialog_save_clicked_cb (GtkButton *button, MimeAskActionDialog *dialog) +static void +mime_ask_dialog_save (MimeAskActionDialog *dialog) { gtk_widget_hide (glade_xml_get_widget (dialog->mGXml, "mime_ask_action_dialog")); @@ -617,7 +613,7 @@ mime_ask_dialog_save_clicked_cb (GtkButton *button, MimeAskActionDialog *dialog) } static void -mime_ask_dialog_download_cancel (MimeAskActionDialog *dialog) +mime_ask_dialog_cancel (MimeAskActionDialog *dialog) { nsresult rv; nsCOMPtr launcher; @@ -628,8 +624,8 @@ mime_ask_dialog_download_cancel (MimeAskActionDialog *dialog) delete dialog; } -extern "C" void -mime_ask_dialog_open_clicked_cb (GtkButton *button, MimeAskActionDialog *dialog) +static void +mime_ask_dialog_open (MimeAskActionDialog *dialog) { nsresult rv; nsCOMPtr launcher; @@ -644,15 +640,24 @@ mime_ask_dialog_open_clicked_cb (GtkButton *button, MimeAskActionDialog *dialog) } else { - mime_ask_dialog_download_cancel (dialog); + mime_ask_dialog_cancel (dialog); ephy_embed_utils_nohandler_dialog_run (dialog->mParent); } } -extern "C" gint -mime_ask_dialog_cancel_clicked_cb (GtkButton *button, - MimeAskActionDialog *dialog) +extern "C" void +mime_ask_dialog_response_cb (GtkDialog *gtkdialog, int response, MimeAskActionDialog *dialog) { - mime_ask_dialog_download_cancel (dialog); - return 0; /* FIXME: philipl, is this the right thing to return? */ + switch (response) + { + case RESPONSE_SAVE: + mime_ask_dialog_save (dialog); + break; + case RESPONSE_OPEN: + mime_ask_dialog_open (dialog); + break; + default: + mime_ask_dialog_cancel (dialog); + break; + } } -- cgit