static void contact_list_editor_render_destination (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter) { /* XXX Would be nice if EDestination had a text property * that we could just bind the GtkCellRenderer to. */ EDestination *destination; const gchar *textrep; gtk_tree_model_get (model, iter, 0, &destination, -1); textrep = e_destination_get_textrep (destination, TRUE); g_object_set (renderer, "text", textrep, NULL); g_object_unref (destination); }
static void render_contact_list_row (EABContactFormatter *formatter, EDestination *destination, GString *buffer) { gchar *evolution_imagesdir; gboolean list_collapsed = FALSE; const gchar *textrep; gchar *name = NULL, *email_addr = NULL; evolution_imagesdir = g_filename_to_uri (EVOLUTION_IMAGESDIR, NULL, NULL); textrep = e_destination_get_textrep (destination, TRUE); if (!eab_parse_qp_email (textrep, &name, &email_addr)) email_addr = g_strdup (textrep); g_string_append (buffer, "<tr>"); if (e_destination_is_evolution_list (destination)) { g_string_append_printf ( buffer, "<td width=" IMAGE_COL_WIDTH " valign=\"top\" align=\"left\">" "<img src=\"evo-file://%s/minus.png\" " "id=\"%s\" " "class=\"navigable _evo_collapse_button\">" "</td><td width=\"100%%\" align=\"left\">%s", evolution_imagesdir, e_destination_get_contact_uid (destination), name ? name : email_addr); if (!list_collapsed) { const GList *dest, *dests; g_string_append_printf ( buffer, "<br><table cellspacing=\"1\" id=\"list-%s\">", e_destination_get_contact_uid (destination)); dests = e_destination_list_get_root_dests (destination); for (dest = dests; dest; dest = dest->next) { render_contact_list_row ( formatter, dest->data, buffer); } g_string_append (buffer, "</table>"); } g_string_append (buffer, "</td>"); } else { if (name && *name) { g_string_append_printf ( buffer, "<td colspan=\"2\">%s <" "<a href=\"mailto:%s\">%s</a>>" "</td>", name, email_addr, email_addr); } else { g_string_append_printf ( buffer, "<td colspan=\"2\">" "<a href=\"mailto:%s\">%s</a>" "</td>", email_addr, email_addr); } } g_string_append (buffer, "</tr>"); g_free (evolution_imagesdir); g_free (name); g_free (email_addr); }
static void render_contact_list_row (EABContactFormatter *formatter, EDestination *destination, GString *buffer) { gboolean list_collapsed = FALSE; const gchar *textrep; gchar *name = NULL, *email_addr = NULL; textrep = e_destination_get_textrep (destination, TRUE); if (!eab_parse_qp_email (textrep, &name, &email_addr)) email_addr = g_strdup (textrep); g_string_append (buffer, "<tr>"); if (e_destination_is_evolution_list (destination)) { g_string_append_printf ( buffer, "<td width=" IMAGE_COL_WIDTH " valign=\"top\" align=\"left\">" "<button type=\"button\" id=\"%s\" class=\"header-collapse _evo_collapse_button\" style=\"display: inline-block;\">" "<img src=\"gtk-stock://pan-down-symbolic\" />" "</button>" "</td><td width=\"100%%\" align=\"left\">%s", e_destination_get_contact_uid (destination), name ? name : email_addr); if (!list_collapsed) { const GList *dest, *dests; g_string_append_printf ( buffer, "<br><table cellspacing=\"1\" id=\"list-%s\">", e_destination_get_contact_uid (destination)); dests = e_destination_list_get_root_dests (destination); for (dest = dests; dest; dest = dest->next) { render_contact_list_row ( formatter, dest->data, buffer); } g_string_append (buffer, "</table>"); } g_string_append (buffer, "</td>"); } else { if (name && *name) { g_string_append_printf ( buffer, "<td colspan=\"2\">%s <" "<a href=\"mailto:%s\">%s</a>>" "</td>", name, email_addr, email_addr); } else { g_string_append_printf ( buffer, "<td colspan=\"2\">" "<a href=\"mailto:%s\">%s</a>" "</td>", email_addr, email_addr); } } g_string_append (buffer, "</tr>"); g_free (name); g_free (email_addr); }