4 * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "empathy-app-plugin.h"
25 #include "empathy-client-factory.h"
27 #include "empathy-app-plugin-widget.h"
29 G_DEFINE_TYPE (EmpathyAppPlugin, empathy_app_plugin, AP_TYPE_APPLICATION_PLUGIN)
32 widget_done_cb (EmpathyAppPluginWidget *widget,
33 ApApplicationPlugin *plugin)
35 ap_application_plugin_emit_finished (plugin);
39 empathy_app_plugin_build_widget (ApApplicationPlugin *plugin)
43 widget = empathy_app_plugin_widget_new (
44 ap_application_plugin_get_account (plugin));
46 g_signal_connect (widget, "done",
47 G_CALLBACK (widget_done_cb), plugin);
49 gtk_widget_show (widget);
55 empathy_app_plugin_class_init (EmpathyAppPluginClass *klass)
57 ApApplicationPluginClass *app_class = AP_APPLICATION_PLUGIN_CLASS (klass);
59 app_class->build_widget = empathy_app_plugin_build_widget;
63 empathy_app_plugin_init (EmpathyAppPlugin *self)
65 if (tp_account_manager_can_set_default ())
67 EmpathyClientFactory *factory;
70 factory = empathy_client_factory_dup ();
71 am = tp_account_manager_new_with_factory (
72 TP_SIMPLE_CLIENT_FACTORY (factory));
73 tp_account_manager_set_default (am);
75 g_object_unref (factory);
81 ap_module_get_object_type (void)
83 return EMPATHY_TYPE_APP_PLUGIN;