/* empathy-import-widget.c */
+#include <config.h>
+
#include "empathy-import-dialog.h"
#include "empathy-import-widget.h"
#include "empathy-import-pidgin.h"
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/util.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
G_DEFINE_TYPE (EmpathyImportWidget, empathy_import_widget, G_TYPE_OBJECT)
EmpathyImportWidgetPriv *priv = GET_PRIV (self);
GError *error = NULL;
- if (!tp_account_manager_prepare_finish (manager, result, &error))
+ if (!tp_proxy_prepare_finish (manager, result, &error))
{
DEBUG ("Failed to prepare account manager: %s", error->message);
g_error_free (error);
manager = tp_account_manager_dup ();
- tp_account_manager_prepare_async (manager, NULL,
+ tp_proxy_prepare_async (manager, NULL,
account_manager_prepared_cb, self);
g_object_unref (manager);
GAsyncResult *result,
gpointer user_data)
{
+ TpAccountManager *account_manager;
TpAccount *account;
GError *error = NULL;
EmpathyImportWidget *self = user_data;
DEBUG ("account created\n");
+ if (tp_account_is_enabled (account))
+ {
+ account_manager = tp_account_manager_dup ();
+ empathy_connect_new_account (account, account_manager);
+ g_object_unref (account_manager);
+ }
+
g_object_unref (self);
}
DEBUG ("display name: %s\n", display_name);
- properties = g_hash_table_new (NULL, NULL);
+ properties = tp_asv_new (NULL, NULL);
+ tp_asv_set_boolean (properties, TP_IFACE_ACCOUNT ".Enabled", data->enabled);
tp_account_manager_create_account_async (account_manager,
(const gchar*) data->connection_manager, data->protocol, display_name,
}
static void
-import_widget_cms_ready_cb (EmpathyConnectionManagers *cms,
- const GError *error,
+import_widget_cms_prepare_cb (GObject *source,
+ GAsyncResult *result,
gpointer user_data)
{
EmpathyImportWidget *self = user_data;
- if (error != NULL)
+ if (!empathy_connection_managers_prepare_finish (
+ EMPATHY_CONNECTION_MANAGERS (source), result, NULL))
return;
import_widget_set_up_account_list (self);
g_signal_connect (priv->vbox, "destroy",
G_CALLBACK (import_widget_destroy_cb), self);
- empathy_connection_managers_call_when_ready (priv->cms,
- import_widget_cms_ready_cb, self);
+ empathy_connection_managers_prepare_async (priv->cms,
+ import_widget_cms_prepare_cb, self);
}
static void