aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/ContentHandler.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-09-25 21:41:52 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-09-25 21:41:52 +0800
commitd321a476c7fe2d9a8174cf0f6a23ea523c469395 (patch)
tree5396bb68048a43b230fa925a2f1dfd1cabf6309a /embed/mozilla/ContentHandler.cpp
parent3a96f0a59387535ba03ba622639e76b3ac0d23a8 (diff)
downloadgsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar.gz
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar.bz2
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar.lz
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar.xz
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.tar.zst
gsoc2013-epiphany-d321a476c7fe2d9a8174cf0f6a23ea523c469395.zip
Fix #123176. Use response instead of connecting 210 callbacks.
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.
Diffstat (limited to 'embed/mozilla/ContentHandler.cpp')
-rw-r--r--embed/mozilla/ContentHandler.cpp45
1 files changed, 25 insertions, 20 deletions
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;
+ }
}