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/ChangeLog | 8 ++++++++ widgets/misc/e-send-options.c | 19 ++++++++++++++++++- widgets/misc/e-send-options.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index cdfc8195ec..38965e6d96 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,11 @@ +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) + 2005-07-20 Srinivasa Ragavan * e-attachment-bar.[ch]:(remove_attachment) (update) (e_attachment_bar_get_selector) 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) diff --git a/widgets/misc/e-send-options.h b/widgets/misc/e-send-options.h index ba48734e5a..0ea71e269b 100644 --- a/widgets/misc/e-send-options.h +++ b/widgets/misc/e-send-options.h @@ -104,6 +104,7 @@ struct _ESendOptionsDialog { struct _ESendOptionsDialogClass { GObjectClass parent_class; + void (* sod_response) (ESendOptionsDialog *sd, gint status); }; GType e_sendoptions_dialog_get_type (void); -- cgit v1.2.3