From 8eae40f7e895782fae19d289090edbb102b01bfd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 6 Jul 2012 11:42:06 -0400 Subject: EMailConfigWindow: Add a "changes-committed" signal. Emitted after all changes are successfully committed over D-Bus. Can connect to this signal to perform followup actions, such as disconnecting the corresponding CamelService. --- mail/e-mail-config-window.c | 17 +++++++++++++++++ mail/e-mail-config-window.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/mail/e-mail-config-window.c b/mail/e-mail-config-window.c index 18cd143a7d..5e8262ac6b 100644 --- a/mail/e-mail-config-window.c +++ b/mail/e-mail-config-window.c @@ -52,10 +52,17 @@ enum { PROP_SESSION }; +enum { + CHANGES_COMMITTED, + LAST_SIGNAL +}; + /* Forward Declarations */ static void e_mail_config_window_alert_sink_init (EAlertSinkInterface *interface); +static guint signals[LAST_SIGNAL]; + G_DEFINE_TYPE_WITH_CODE ( EMailConfigWindow, e_mail_config_window, @@ -161,6 +168,7 @@ mail_config_window_commit_cb (GObject *object, g_error_free (error); } else { + g_signal_emit (window, signals[CHANGES_COMMITTED], 0); gtk_widget_destroy (GTK_WIDGET (window)); } } @@ -475,6 +483,15 @@ e_mail_config_window_class_init (EMailConfigWindowClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + + signals[CHANGES_COMMITTED] = g_signal_new ( + "changes-committed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMailConfigWindowClass, changes_committed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void diff --git a/mail/e-mail-config-window.h b/mail/e-mail-config-window.h index 78a7c073b8..6699e8ad38 100644 --- a/mail/e-mail-config-window.h +++ b/mail/e-mail-config-window.h @@ -55,6 +55,9 @@ struct _EMailConfigWindow { struct _EMailConfigWindowClass { GtkDialogClass parent_class; + + /* Signals */ + void (*changes_committed) (EMailConfigWindow *window); }; GType e_mail_config_window_get_type (void) G_GNUC_CONST; -- cgit