From 7b0b66588bd9cc64ff0149c6743f35d5a6555698 Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Wed, 20 Jul 2005 11:59:53 +0000 Subject: ESendOptionsDialogClass: has a member new virtual method for default 2005-07-20 Vivek Jain * e-send-options.h : ESendOptionsDialogClass: has a member new virtual method for default callback of "sod_response" * e-send-options.c : introduced a new signal "sod_response" captures the response for the child dialog and makes it available at the object level (useful for the external members invoking the dialog) svn path=/trunk/; revision=29815 --- widgets/misc/e-send-options.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'widgets/misc/e-send-options.c') diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 4d0f5b1cfe..5f8a2991bd 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -104,6 +104,12 @@ static void e_sendoptions_dialog_dispose (GObject *object); static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data); static GObjectClass *parent_class = NULL; +enum { + SOD_RESPONSE, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = {0}; static void e_send_options_get_widgets_data (ESendOptionsDialog *sod) @@ -588,7 +594,7 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data sod = func_data; priv = sod->priv; - + switch (state) { case GTK_RESPONSE_OK: e_send_options_get_widgets_data (sod); @@ -607,6 +613,8 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data g_warning ("%s", error->message); break; } + g_signal_emit (G_OBJECT (func_data), signals[SOD_RESPONSE], 0, state); + } gboolean @@ -787,6 +795,15 @@ e_sendoptions_dialog_class_init (GObjectClass *object) object_class->finalize = e_sendoptions_dialog_finalize; object_class->dispose = e_sendoptions_dialog_dispose; + signals[SOD_RESPONSE] = g_signal_new ("sod_response", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ESendOptionsDialogClass, sod_response), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + } GType e_sendoptions_dialog_get_type (void) -- cgit v1.2.3