diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-31 20:54:49 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-09-06 13:37:08 +0800 |
commit | 2f5e2d1fdb7220291a75357c6c51ab7000e8b897 (patch) | |
tree | 5150163e09a9bf3c91ff2f3d64e8f45bb00bb862 | |
parent | 2278e8e11be7614d15d8c1a081dc49e68e5924eb (diff) | |
download | gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar.gz gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar.bz2 gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar.lz gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar.xz gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.tar.zst gsoc2013-empathy-2f5e2d1fdb7220291a75357c6c51ab7000e8b897.zip |
watch for Chat feature changes to enable/disable the account
-rw-r--r-- | goa-mc-plugin/mcp-account-manager-goa.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/goa-mc-plugin/mcp-account-manager-goa.c b/goa-mc-plugin/mcp-account-manager-goa.c index 0e3fb4bc5..390e8f10d 100644 --- a/goa-mc-plugin/mcp-account-manager-goa.c +++ b/goa-mc-plugin/mcp-account-manager-goa.c @@ -93,28 +93,6 @@ mcp_account_manager_goa_class_init (McpAccountManagerGoaClass *klass) sizeof (McpAccountManagerGoaPrivate)); } - -// static void -// _enable_chat_toggled (GConfClient *client, -// guint cnxn_id, -// GConfEntry *entry, -// gpointer user_data) -// { -// McpAccountStorage *self = MCP_ACCOUNT_STORAGE (user_data); -// McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self); -// gboolean enabled = gconf_value_get_bool (gconf_entry_get_value (entry)); -// -// DEBUG ("%s: %s", G_STRFUNC, enabled ? "enabled" : "disabled"); -// -// if (priv->ready && priv->facebook_available) -// { -// DEBUG ("Emitting toggled signal"); -// -// g_signal_emit_by_name (self, "toggled", FACEBOOK_ACCOUNT_NAME, enabled); -// } -// } - - static GHashTable * get_tp_parameters (GoaAccount *account) { @@ -243,6 +221,22 @@ _account_removed_cb (GoaClient *client, g_free (name); } +static void +_account_changed_cb (GoaClient *client, + GoaObject *object, + McpAccountManagerGoa *self) +{ + GoaAccount *account = goa_object_peek_account (object); + char *name = get_tp_account_name (account); + gboolean enabled; + + enabled = (goa_object_peek_chat (object) != NULL); + + DEBUG ("%s %s", name, enabled ? "enabled" : "disabled"); + + if (self->priv->ready) + g_signal_emit_by_name (self, "toggled", name, enabled); +} static void _goa_client_new_cb (GObject *obj, @@ -275,7 +269,8 @@ _goa_client_new_cb (GObject *obj, G_CALLBACK (_account_added_cb), self); g_signal_connect (self->priv->client, "account-removed", G_CALLBACK (_account_removed_cb), self); - /* FIXME: do we need to support account-changed ? */ + g_signal_connect (self->priv->client, "account-changed", + G_CALLBACK (_account_changed_cb), self); } |