]> git.0d.be Git - empathy.git/blobdiff - src/empathy-preferences.c
include telepathy-glib.h
[empathy.git] / src / empathy-preferences.c
index df5e39187bc3d45e1f1d501975e865f5670fc449..02b34dcf0f6919b5865f5baa62ba160e35df95e0 100644 (file)
@@ -30,9 +30,9 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/util.h>
+#include <telepathy-glib/telepathy-glib.h>
 
+#include <libempathy/empathy-client-factory.h>
 #include <libempathy/empathy-gsettings.h>
 #include <libempathy/empathy-utils.h>
 
@@ -75,7 +75,7 @@ struct _EmpathyPreferencesPriv {
        GtkWidget *combobox_chat_theme_variant;
        GtkWidget *hbox_chat_theme_variant;
        GtkWidget *sw_chat_theme_preview;
-       EmpathyChatView *chat_theme_preview;
+       EmpathyThemeAdium *chat_theme_preview;
        EmpathyThemeManager *theme_manager;
 
        GSettings *gsettings;
@@ -584,7 +584,7 @@ preferences_languages_cell_toggled_cb (GtkCellRendererToggle *cell,
 }
 
 static void
-preferences_preview_theme_append_message (EmpathyChatView *view,
+preferences_preview_theme_append_message (EmpathyThemeAdium *view,
                                          EmpathyContact *sender,
                                          EmpathyContact *receiver,
                                          const gchar *text,
@@ -598,7 +598,7 @@ preferences_preview_theme_append_message (EmpathyChatView *view,
                "body", text,
                NULL);
 
-       empathy_chat_view_append_message (view, message, should_highlight);
+       empathy_theme_adium_append_message (view, message, should_highlight);
        g_object_unref (message);
 }
 
@@ -607,7 +607,7 @@ preferences_preview_theme_changed_cb (EmpathyThemeManager *manager,
                                      EmpathyPreferences  *preferences)
 {
        EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
-       TpDBusDaemon *dbus;
+       EmpathyClientFactory *factory;
        TpAccount *account;
        EmpathyContact *juliet;
        EmpathyContact *romeo;
@@ -625,9 +625,11 @@ preferences_preview_theme_changed_cb (EmpathyThemeManager *manager,
        /* FIXME: It is ugly to add a fake conversation like that.
         * Would be cool if we could request a TplLogManager for a fake
         * conversation */
-       dbus = tp_dbus_daemon_dup (NULL);
-       account = tp_account_new (dbus,
-               TP_ACCOUNT_OBJECT_PATH_BASE "cm/jabber/account", NULL);
+       factory = empathy_client_factory_dup ();
+
+       account = tp_simple_client_factory_ensure_account (
+               TP_SIMPLE_CLIENT_FACTORY (factory),
+               TP_ACCOUNT_OBJECT_PATH_BASE "cm/jabber/account", NULL, NULL);
        juliet = g_object_new (EMPATHY_TYPE_CONTACT,
                "account", account,
                "id", "juliet",
@@ -661,12 +663,12 @@ preferences_preview_theme_changed_cb (EmpathyThemeManager *manager,
                romeo, juliet, _("Shall I hear more, or shall I speak at this?"), FALSE);
 
        /* translators: Quote from Romeo & Julier, for chat theme preview */
-       empathy_chat_view_append_event (priv->chat_theme_preview, _("Juliet has disconnected"));
+       empathy_theme_adium_append_event (priv->chat_theme_preview, _("Juliet has disconnected"));
 
        g_object_unref (juliet);
        g_object_unref (romeo);
        g_object_unref (account);
-       g_object_unref (dbus);
+       g_object_unref (factory);
 }
 
 static void