diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-08-09 12:21:35 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-08-09 12:21:35 +0800 |
commit | 14899f2d17dd5943b28fb83e79aa998125159fff (patch) | |
tree | 9d494028c6933c8d1fde9f74262b6f723fe80199 /libempathy-gtk/empathy-log-window.c | |
parent | 4133101266b116d34b04a69e9957c0502daf72e8 (diff) | |
download | gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar.gz gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar.bz2 gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar.lz gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar.xz gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.tar.zst gsoc2013-empathy-14899f2d17dd5943b28fb83e79aa998125159fff.zip |
Add icons to the new log viewer
Diffstat (limited to 'libempathy-gtk/empathy-log-window.c')
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index f2aafda31..ba634205b 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -375,17 +375,33 @@ insert_or_change_row (EmpathyLogWindow *self, GtkTreeIter *iter) { char *str = gtk_tree_path_to_string (path); - char *script, *text, *date; + char *script, *text, *date, *stock_icon; + char *icon = NULL; gtk_tree_model_get (model, iter, COL_EVENTS_TEXT, &text, COL_EVENTS_PRETTY_DATE, &date, + COL_EVENTS_ICON, &stock_icon, -1); - script = g_strdup_printf ("javascript:%s([%s], '%s', '%s');", + if (!tp_str_empty (stock_icon)) + { + GtkIconInfo *icon_info = gtk_icon_theme_lookup_icon ( + gtk_icon_theme_get_default (), + stock_icon, + GTK_ICON_SIZE_MENU, 0); + + if (icon_info != NULL) + icon = g_strdup (gtk_icon_info_get_filename (icon_info)); + + gtk_icon_info_free (icon_info); + } + + script = g_strdup_printf ("javascript:%s([%s], '%s', '%s', '%s');", method, g_strdelimit (str, ":", ','), text, + icon != NULL ? icon: "", date); // g_print ("%s\n", script); @@ -395,6 +411,8 @@ insert_or_change_row (EmpathyLogWindow *self, g_free (str); g_free (text); g_free (date); + g_free (stock_icon); + g_free (icon); g_free (script); } |