aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--data/glade/epiphany.glade8
-rw-r--r--embed/mozilla/ContentHandler.cpp45
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 <marco@gnome.org>
+
+ * data/glade/epiphany.glade:
+ * embed/mozilla/ContentHandler.cpp:
+
+ Fix #123176. Use response instead of
+ connecting 210 callbacks.
+
2003-09-24 Christian Persch <chpe@cvs.gnome.org>
* 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 @@
<property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>
+ <signal name="response" handler="mime_ask_dialog_response_cb" last_modification_time="Thu, 25 Sep 2003 19:25:28 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox28">
@@ -1002,8 +1003,7 @@
<property name="label">gtk-save</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="mime_ask_dialog_save_clicked_cb" last_modification_time="Sun, 01 Sep 2002 13:39:41 GMT"/>
+ <property name="response_id">1</property>
</widget>
</child>
@@ -1016,7 +1016,6 @@
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-6</property>
- <signal name="clicked" handler="mime_ask_dialog_cancel_clicked_cb" last_modification_time="Sun, 01 Sep 2002 13:08:43 GMT"/>
</widget>
</child>
@@ -1029,8 +1028,7 @@
<property name="label">gtk-open</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="mime_ask_dialog_open_clicked_cb" last_modification_time="Sun, 01 Sep 2002 13:09:36 GMT"/>
+ <property name="response_id">2</property>
</widget>
</child>
</widget>
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<nsIHelperAppLauncher> 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<nsIHelperAppLauncher> 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;
+ }
}