From 81ad14a2dbcb5d71ed7befff0c7e2d7516a24dcd Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Tue, 21 Jun 2011 21:00:07 +0800 Subject: Add a close signal, emitted by both cancel and apply --- libempathy-gtk/empathy-account-widget.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index be195fd8b..68a91c902 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -21,6 +21,7 @@ * Martyn Russell * Cosimo Cecchi * Jonathan Tellier + * Danielle Madeley */ #include @@ -130,6 +131,7 @@ enum { HANDLE_APPLY, ACCOUNT_CREATED, CANCELLED, + CLOSE, LAST_SIGNAL }; @@ -890,6 +892,7 @@ account_widget_cancel_clicked_cb (GtkWidget *button, EmpathyAccountWidget *self) { g_signal_emit (self, signals[CANCELLED], 0); + g_signal_emit (self, signals[CLOSE], 0, GTK_RESPONSE_CANCEL); } static void @@ -954,6 +957,7 @@ account_widget_applied_cb (GObject *source_object, tp_account_set_enabled_async (account, TRUE, account_widget_account_enabled_cb, widget); g_signal_emit (widget, signals[ACCOUNT_CREATED], 0, account); + // FIXME: should we emit a signal here? } else { @@ -981,6 +985,9 @@ account_widget_applied_cb (GObject *source_object, priv->contains_pending_changes = FALSE; + /* announce the widget can be closed */ + g_signal_emit (widget, signals[CLOSE], 0, GTK_RESPONSE_APPLY); + /* unref the widget - part of the workaround */ g_object_unref (widget); } @@ -2376,6 +2383,13 @@ empathy_account_widget_class_init (EmpathyAccountWidgetClass *klass) G_TYPE_NONE, 0); + signals[CLOSE] = + g_signal_new ("close", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, 0, NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, G_TYPE_INT); + g_type_class_add_private (klass, sizeof (EmpathyAccountWidgetPriv)); } -- cgit v1.2.3