1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2005-2007 Imendio AB
4 * Copyright (C) 2007-2008 Collabora Ltd.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301 USA
21 * Authors: Martyn Russell <martyn@imendio.com>
22 * Xavier Claessens <xclaesse@gmail.com>
29 #include <glib/gi18n-lib.h>
32 #include <telepathy-glib/account-manager.h>
33 #include <telepathy-glib/util.h>
35 #include <libempathy/empathy-utils.h>
37 #include "empathy-ui-utils.h"
38 #include "empathy-account-chooser.h"
40 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
41 #include <libempathy/empathy-debug.h>
44 * SECTION:empathy-account-chooser
45 * @title:EmpathyAccountChooser
46 * @short_description: A widget used to choose from a list of accounts
47 * @include: libempathy-gtk/empathy-account-chooser.h
49 * #EmpathyAccountChooser is a widget which extends #GtkComboBox to provide
50 * a chooser of available accounts.
54 * EmpathyAccountChooser:
55 * @parent: parent object
57 * Widget which extends #GtkComboBox to provide a chooser of available accounts.
60 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountChooser)
62 TpAccountManager *manager;
63 gboolean set_active_item;
64 gboolean account_manually_set;
65 gboolean has_all_option;
66 EmpathyAccountChooserFilterFunc filter;
69 } EmpathyAccountChooserPriv;
72 EmpathyAccountChooser *chooser;
78 EmpathyAccountChooser *chooser;
81 } FilterResultCallbackData;
83 static FilterResultCallbackData *
84 filter_result_callback_data_new (EmpathyAccountChooser *chooser,
88 FilterResultCallbackData *data;
90 data = g_slice_new0 (FilterResultCallbackData);
91 data->chooser = g_object_ref (chooser);
92 data->account = g_object_ref (account);
93 data->iter = gtk_tree_iter_copy (iter);
99 filter_result_callback_data_free (FilterResultCallbackData *data)
101 g_object_unref (data->chooser);
102 g_object_unref (data->account);
103 gtk_tree_iter_free (data->iter);
104 g_slice_free (FilterResultCallbackData, data);
107 /* Distinguishes between store entries which are actually accounts, and special
108 * items like the "All" entry and the separator below it, so they can be sorted
109 * correctly. Higher-numbered entries will sort earlier.
120 COL_ACCOUNT_ENABLED, /* Usually tied to connected state */
121 COL_ACCOUNT_ROW_TYPE,
126 static void account_chooser_finalize (GObject *object);
127 static void account_chooser_get_property (GObject *object,
131 static void account_chooser_set_property (GObject *object,
135 static void account_chooser_setup (EmpathyAccountChooser *chooser);
136 static void account_chooser_account_validity_changed_cb (TpAccountManager *manager,
139 EmpathyAccountChooser *chooser);
140 static void account_chooser_account_add_foreach (TpAccount *account,
141 EmpathyAccountChooser *chooser);
142 static void account_chooser_account_removed_cb (TpAccountManager *manager,
144 EmpathyAccountChooser *chooser);
145 static void account_chooser_account_remove_foreach (TpAccount *account,
146 EmpathyAccountChooser *chooser);
147 static void account_chooser_update_iter (EmpathyAccountChooser *chooser,
149 static void account_chooser_status_changed_cb (TpAccount *account,
153 gchar *dbus_error_name,
156 static gboolean account_chooser_separator_func (GtkTreeModel *model,
158 EmpathyAccountChooser *chooser);
159 static gboolean account_chooser_set_account_foreach (GtkTreeModel *model,
162 SetAccountData *data);
174 static guint signals[LAST_SIGNAL] = { 0 };
176 G_DEFINE_TYPE (EmpathyAccountChooser, empathy_account_chooser, GTK_TYPE_COMBO_BOX);
179 empathy_account_chooser_class_init (EmpathyAccountChooserClass *klass)
181 GObjectClass *object_class = G_OBJECT_CLASS (klass);
183 object_class->finalize = account_chooser_finalize;
184 object_class->get_property = account_chooser_get_property;
185 object_class->set_property = account_chooser_set_property;
188 * EmpathyAccountChooser:has-all-option:
190 * Have an additional option in the list to mean all accounts.
192 g_object_class_install_property (object_class,
194 g_param_spec_boolean ("has-all-option",
196 "Have a separate option in the list to mean ALL accounts",
201 g_signal_new ("ready",
202 G_OBJECT_CLASS_TYPE (object_class),
206 g_cclosure_marshal_VOID__VOID,
210 g_type_class_add_private (object_class, sizeof (EmpathyAccountChooserPriv));
214 empathy_account_chooser_init (EmpathyAccountChooser *chooser)
216 EmpathyAccountChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
217 EMPATHY_TYPE_ACCOUNT_CHOOSER, EmpathyAccountChooserPriv);
219 chooser->priv = priv;
220 priv->set_active_item = FALSE;
221 priv->account_manually_set = FALSE;
223 priv->filter_data = NULL;
225 priv->manager = tp_account_manager_dup ();
227 g_signal_connect (priv->manager, "account-validity-changed",
228 G_CALLBACK (account_chooser_account_validity_changed_cb),
230 g_signal_connect (priv->manager, "account-removed",
231 G_CALLBACK (account_chooser_account_removed_cb),
234 account_chooser_setup (EMPATHY_ACCOUNT_CHOOSER (chooser));
238 account_chooser_finalize (GObject *object)
240 EmpathyAccountChooserPriv *priv = GET_PRIV (object);
242 g_signal_handlers_disconnect_by_func (priv->manager,
243 account_chooser_account_validity_changed_cb,
245 g_signal_handlers_disconnect_by_func (priv->manager,
246 account_chooser_account_removed_cb,
248 g_object_unref (priv->manager);
250 G_OBJECT_CLASS (empathy_account_chooser_parent_class)->finalize (object);
254 account_chooser_get_property (GObject *object,
259 EmpathyAccountChooserPriv *priv;
261 priv = GET_PRIV (object);
264 case PROP_HAS_ALL_OPTION:
265 g_value_set_boolean (value, priv->has_all_option);
268 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
274 account_chooser_set_property (GObject *object,
279 EmpathyAccountChooserPriv *priv;
281 priv = GET_PRIV (object);
284 case PROP_HAS_ALL_OPTION:
285 empathy_account_chooser_set_has_all_option (EMPATHY_ACCOUNT_CHOOSER (object),
286 g_value_get_boolean (value));
289 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
295 * empathy_account_chooser_new:
297 * Creates a new #EmpathyAccountChooser.
299 * Return value: A new #EmpathyAccountChooser
302 empathy_account_chooser_new (void)
306 chooser = g_object_new (EMPATHY_TYPE_ACCOUNT_CHOOSER, NULL);
312 * empathy_account_chooser_dup_account:
313 * @chooser: an #EmpathyAccountChooser
315 * Returns the account which is currently selected in the chooser or %NULL
316 * if there is no account selected. The #TpAccount returned should be
317 * unrefed with g_object_unref() when finished with.
319 * Return value: a new ref to the #TpAccount currently selected, or %NULL.
322 empathy_account_chooser_dup_account (EmpathyAccountChooser *chooser)
324 EmpathyAccountChooserPriv *priv;
329 g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), NULL);
331 priv = GET_PRIV (chooser);
333 model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser));
334 if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (chooser), &iter)) {
338 gtk_tree_model_get (model, &iter, COL_ACCOUNT_POINTER, &account, -1);
344 * empathy_account_chooser_get_connection:
345 * @chooser: an #EmpathyAccountChooser
347 * Returns a borrowed reference to the #TpConnection associated with the
348 * account currently selected. The caller must reference the returned object with
349 * g_object_ref() if it will be kept
351 * Return value: a borrowed reference to the #TpConnection associated with the
352 * account curently selected.
355 empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser)
357 EmpathyAccountChooserPriv *priv;
359 TpConnection *connection;
361 g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), NULL);
363 priv = GET_PRIV (chooser);
365 account = empathy_account_chooser_dup_account (chooser);
367 /* if the returned account is NULL, then the account manager probably
368 * hasn't been prepared yet. It should be safe to return NULL here
370 if (account == NULL) {
374 connection = tp_account_get_connection (account);
375 g_object_unref (account);
381 * empathy_account_chooser_set_account:
382 * @chooser: an #EmpathyAccountChooser
383 * @account: a #TpAccount
385 * Sets the currently selected account to @account, if it exists in the list.
387 * Return value: whether the chooser was set to @account.
390 empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
393 EmpathyAccountChooserPriv *priv;
394 GtkComboBox *combobox;
399 g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), FALSE);
401 priv = GET_PRIV (chooser);
403 combobox = GTK_COMBO_BOX (chooser);
404 model = gtk_combo_box_get_model (combobox);
405 gtk_combo_box_get_active_iter (combobox, &iter);
407 data.chooser = chooser;
408 data.account = account;
410 gtk_tree_model_foreach (model,
411 (GtkTreeModelForeachFunc) account_chooser_set_account_foreach,
414 priv->account_manually_set = data.set;
420 * empathy_account_chooser_get_has_all_option:
421 * @chooser: an #EmpathyAccountChooser
423 * Returns whether @chooser has the #EmpathyAccountChooser:has-all-option property
426 * Return value: whether @chooser has the #EmpathyAccountChooser:has-all-option property
430 empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser)
432 EmpathyAccountChooserPriv *priv;
434 g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), FALSE);
436 priv = GET_PRIV (chooser);
438 return priv->has_all_option;
442 * empathy_account_chooser_set_has_all_option:
443 * @chooser: an #EmpathyAccountChooser
444 * @has_all_option: a new value for the #EmpathyAccountChooser:has-all-option property
446 * Sets the #EmpathyAccountChooser:has-all-option property.
449 empathy_account_chooser_set_has_all_option (EmpathyAccountChooser *chooser,
450 gboolean has_all_option)
452 EmpathyAccountChooserPriv *priv;
453 GtkComboBox *combobox;
458 g_return_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser));
460 priv = GET_PRIV (chooser);
462 if (priv->has_all_option == has_all_option) {
466 combobox = GTK_COMBO_BOX (chooser);
467 model = gtk_combo_box_get_model (combobox);
468 store = GTK_LIST_STORE (model);
470 priv->has_all_option = has_all_option;
473 * The first 2 options are the ALL and separator
476 if (has_all_option) {
477 gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser),
478 (GtkTreeViewRowSeparatorFunc)
479 account_chooser_separator_func,
483 gtk_list_store_prepend (store, &iter);
484 gtk_list_store_set (store, &iter,
485 COL_ACCOUNT_TEXT, NULL,
486 COL_ACCOUNT_ENABLED, TRUE,
487 COL_ACCOUNT_POINTER, NULL,
488 COL_ACCOUNT_ROW_TYPE, ROW_SEPARATOR,
491 gtk_list_store_prepend (store, &iter);
492 gtk_list_store_set (store, &iter,
493 COL_ACCOUNT_TEXT, _("All"),
494 COL_ACCOUNT_ENABLED, TRUE,
495 COL_ACCOUNT_POINTER, NULL,
496 COL_ACCOUNT_ROW_TYPE, ROW_ALL,
499 if (gtk_tree_model_get_iter_first (model, &iter)) {
500 if (gtk_list_store_remove (GTK_LIST_STORE (model), &iter)) {
501 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
505 gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser),
506 (GtkTreeViewRowSeparatorFunc)
512 g_object_notify (G_OBJECT (chooser), "has-all-option");
516 account_manager_prepared_cb (GObject *source_object,
517 GAsyncResult *result,
521 TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
522 EmpathyAccountChooser *chooser = user_data;
523 EmpathyAccountChooserPriv *priv = GET_PRIV (chooser);
524 GError *error = NULL;
526 if (!tp_account_manager_prepare_finish (manager, result, &error)) {
527 DEBUG ("Failed to prepare account manager: %s", error->message);
528 g_error_free (error);
532 accounts = tp_account_manager_get_valid_accounts (manager);
534 for (l = accounts; l != NULL; l = l->next) {
535 TpAccount *account = l->data;
537 account_chooser_account_add_foreach (account, chooser);
539 tp_g_signal_connect_object (account, "status-changed",
540 G_CALLBACK (account_chooser_status_changed_cb),
544 g_list_free (accounts);
547 g_signal_emit (chooser, signals[READY], 0);
551 account_cmp (GtkTreeModel *model,
556 RowType a_type, b_type;
557 gboolean a_enabled, b_enabled;
558 gchar *a_text, *b_text;
561 gtk_tree_model_get (model, a,
562 COL_ACCOUNT_ENABLED, &a_enabled,
563 COL_ACCOUNT_ROW_TYPE, &a_type,
565 gtk_tree_model_get (model, b,
566 COL_ACCOUNT_ENABLED, &b_enabled,
567 COL_ACCOUNT_ROW_TYPE, &b_type,
570 /* This assumes that we have at most one of each special row type. */
571 if (a_type != b_type) {
572 /* Display higher-numbered special row types first. */
573 return (b_type - a_type);
576 /* Enabled accounts are displayed first */
577 if (a_enabled != b_enabled)
578 return a_enabled ? -1: 1;
580 gtk_tree_model_get (model, a, COL_ACCOUNT_TEXT, &a_text, -1);
581 gtk_tree_model_get (model, b, COL_ACCOUNT_TEXT, &b_text, -1);
583 if (a_text == b_text)
585 else if (a_text == NULL)
587 else if (b_text == NULL)
590 result = g_ascii_strcasecmp (a_text, b_text);
599 account_chooser_setup (EmpathyAccountChooser *chooser)
601 EmpathyAccountChooserPriv *priv;
603 GtkCellRenderer *renderer;
604 GtkComboBox *combobox;
606 priv = GET_PRIV (chooser);
608 /* Set up combo box with new store */
609 combobox = GTK_COMBO_BOX (chooser);
611 gtk_cell_layout_clear (GTK_CELL_LAYOUT (combobox));
613 store = gtk_list_store_new (COL_ACCOUNT_COUNT,
614 G_TYPE_STRING, /* Image */
615 G_TYPE_STRING, /* Name */
616 G_TYPE_BOOLEAN, /* Enabled */
617 G_TYPE_UINT, /* Row type */
620 gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
621 account_cmp, chooser, NULL);
622 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
623 GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
625 gtk_combo_box_set_model (combobox, GTK_TREE_MODEL (store));
627 renderer = gtk_cell_renderer_pixbuf_new ();
628 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), renderer, FALSE);
629 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
630 "icon-name", COL_ACCOUNT_IMAGE,
631 "sensitive", COL_ACCOUNT_ENABLED,
633 g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
635 renderer = gtk_cell_renderer_text_new ();
636 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), renderer, TRUE);
637 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
638 "text", COL_ACCOUNT_TEXT,
639 "sensitive", COL_ACCOUNT_ENABLED,
642 /* Populate accounts */
643 tp_account_manager_prepare_async (priv->manager, NULL,
644 account_manager_prepared_cb, chooser);
646 g_object_unref (store);
650 account_chooser_account_validity_changed_cb (TpAccountManager *manager,
653 EmpathyAccountChooser *chooser)
656 account_chooser_account_add_foreach (account, chooser);
658 account_chooser_account_remove_foreach (account, chooser);
663 account_chooser_account_add_foreach (TpAccount *account,
664 EmpathyAccountChooser *chooser)
667 GtkComboBox *combobox;
671 combobox = GTK_COMBO_BOX (chooser);
672 store = GTK_LIST_STORE (gtk_combo_box_get_model (combobox));
674 position = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL);
675 gtk_list_store_insert_with_values (store, &iter, position,
676 COL_ACCOUNT_POINTER, account,
678 account_chooser_update_iter (chooser, &iter);
682 account_chooser_account_removed_cb (TpAccountManager *manager,
684 EmpathyAccountChooser *chooser)
686 account_chooser_account_remove_foreach (account, chooser);
696 account_chooser_find_account_foreach (GtkTreeModel *model,
701 FindAccountData *data = user_data;
704 gtk_tree_model_get (model, iter, COL_ACCOUNT_POINTER, &account, -1);
706 if (account == data->account) {
708 *(data->iter) = *iter;
709 g_object_unref (account);
714 g_object_unref (account);
720 account_chooser_find_account (EmpathyAccountChooser *chooser,
725 GtkComboBox *combobox;
726 FindAccountData data;
728 combobox = GTK_COMBO_BOX (chooser);
729 store = GTK_LIST_STORE (gtk_combo_box_get_model (combobox));
731 data.account = account;
733 gtk_tree_model_foreach (GTK_TREE_MODEL (store),
734 account_chooser_find_account_foreach,
741 account_chooser_account_remove_foreach (TpAccount *account,
742 EmpathyAccountChooser *chooser)
745 GtkComboBox *combobox;
748 combobox = GTK_COMBO_BOX (chooser);
749 store = GTK_LIST_STORE (gtk_combo_box_get_model (combobox));
751 if (account_chooser_find_account (chooser, account, &iter)) {
752 gtk_list_store_remove (store, &iter);
757 account_chooser_filter_ready_cb (gboolean is_enabled,
760 FilterResultCallbackData *fr_data = data;
761 EmpathyAccountChooser *chooser;
762 EmpathyAccountChooserPriv *priv;
766 GtkComboBox *combobox;
767 const gchar *icon_name;
769 chooser = fr_data->chooser;
770 priv = GET_PRIV (chooser);
771 account = fr_data->account;
772 iter = fr_data->iter;
773 combobox = GTK_COMBO_BOX (chooser);
774 store = GTK_LIST_STORE (gtk_combo_box_get_model (combobox));
776 icon_name = tp_account_get_icon_name (account);
778 gtk_list_store_set (store, iter,
779 COL_ACCOUNT_IMAGE, icon_name,
780 COL_ACCOUNT_TEXT, tp_account_get_display_name (account),
781 COL_ACCOUNT_ENABLED, is_enabled,
784 /* set first connected account as active account */
785 if (priv->account_manually_set == FALSE &&
786 priv->set_active_item == FALSE && is_enabled) {
787 priv->set_active_item = TRUE;
788 gtk_combo_box_set_active_iter (combobox, iter);
791 g_object_unref (account);
792 filter_result_callback_data_free (fr_data);
796 account_chooser_update_iter (EmpathyAccountChooser *chooser,
799 EmpathyAccountChooserPriv *priv;
801 GtkComboBox *combobox;
803 FilterResultCallbackData *data;
805 priv = GET_PRIV (chooser);
807 combobox = GTK_COMBO_BOX (chooser);
808 store = GTK_LIST_STORE (gtk_combo_box_get_model (combobox));
810 gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
811 COL_ACCOUNT_POINTER, &account,
814 /* Skip rows without account associated */
818 data = filter_result_callback_data_new (chooser, account, iter);
821 priv->filter (account, account_chooser_filter_ready_cb,
822 (gpointer) data, priv->filter_data);
824 account_chooser_filter_ready_cb (TRUE, (gpointer) data);
828 account_chooser_status_changed_cb (TpAccount *account,
832 gchar *dbus_error_name,
836 EmpathyAccountChooser *chooser = user_data;
839 if (account_chooser_find_account (chooser, account, &iter)) {
840 account_chooser_update_iter (chooser, &iter);
845 account_chooser_separator_func (GtkTreeModel *model,
847 EmpathyAccountChooser *chooser)
851 gtk_tree_model_get (model, iter, COL_ACCOUNT_ROW_TYPE, &row_type, -1);
852 return (row_type == ROW_SEPARATOR);
856 account_chooser_set_account_foreach (GtkTreeModel *model,
859 SetAccountData *data)
864 gtk_tree_model_get (model, iter, COL_ACCOUNT_POINTER, &account, -1);
866 equal = (data->account == account);
869 g_object_unref (account);
873 GtkComboBox *combobox;
875 combobox = GTK_COMBO_BOX (data->chooser);
876 gtk_combo_box_set_active_iter (combobox, iter);
885 account_chooser_filter_foreach (GtkTreeModel *model,
890 account_chooser_update_iter (chooser, iter);
895 * empathy_account_chooser_set_filter:
896 * @chooser: an #EmpathyAccountChooser
898 * @user_data: data to pass to @filter, or %NULL
900 * Sets a filter on the @chooser so only accounts that are %TRUE in the eyes
901 * of the filter are visible in the @chooser.
904 empathy_account_chooser_set_filter (EmpathyAccountChooser *chooser,
905 EmpathyAccountChooserFilterFunc filter,
908 EmpathyAccountChooserPriv *priv;
911 g_return_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser));
913 priv = GET_PRIV (chooser);
915 priv->filter = filter;
916 priv->filter_data = user_data;
918 /* Refilter existing data */
919 priv->set_active_item = FALSE;
920 model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser));
921 gtk_tree_model_foreach (model, account_chooser_filter_foreach, chooser);
925 * EmpathyAccountChooserFilterFunc:
926 * @account: a #TpAccount
927 * @user_data: user data, or %NULL
929 * A function which decides whether the account indicated by @account
932 * Return value: whether the account indicated by @account is visible.
936 * empathy_account_chooser_filter_is_connected:
937 * @account: a #TpAccount
938 * @callback: an #EmpathyAccountChooserFilterResultCallback accepting the result
939 * @callback_data: data passed to the @callback
940 * @user_data: user data or %NULL
942 * A useful #EmpathyAccountChooserFilterFunc that one could pass into
943 * empathy_account_chooser_set_filter() and only show connected accounts.
945 * Returns (via the callback) TRUE is @account is connected
948 empathy_account_chooser_filter_is_connected (
950 EmpathyAccountChooserFilterResultCallback callback,
951 gpointer callback_data,
954 gboolean is_connected =
955 tp_account_get_connection_status (account, NULL)
956 == TP_CONNECTION_STATUS_CONNECTED;
957 callback (is_connected, callback_data);
961 empathy_account_chooser_is_ready (EmpathyAccountChooser *self)
963 EmpathyAccountChooserPriv *priv = GET_PRIV (self);
969 empathy_account_chooser_get_account (EmpathyAccountChooser *chooser)
973 account = empathy_account_chooser_dup_account (chooser);
977 g_object_unref (account);