[evince] shell: Show description of attachments in sidebar



commit b4d99c3dba5d08073f605123a1fb21a0be50a423
Author: Fernando Herrera <fherrera onirica com>
Date:   Wed Nov 10 03:42:00 2010 -0800

    shell: Show description of attachments in sidebar
    
    Use a column tooltip to store the description of every
    attachment, so the user can obtain more information of
    each attachment in a document.
    
    Close #166

 shell/ev-sidebar-attachments.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c
index 3414b402..5f754a23 100644
--- a/shell/ev-sidebar-attachments.c
+++ b/shell/ev-sidebar-attachments.c
@@ -740,7 +740,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
        /* Data Model */
        ev_attachbar->priv->model = gtk_list_store_new (N_COLS,
                                                        GDK_TYPE_PIXBUF, 
-                                                       G_TYPE_STRING,  
+                                                       G_TYPE_STRING,
                                                        G_TYPE_STRING,
                                                        EV_TYPE_ATTACHMENT);
 
@@ -753,6 +753,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
        g_object_set (G_OBJECT (ev_attachbar->priv->icon_view),
                      "text-column", COLUMN_NAME,
                      "pixbuf-column", COLUMN_ICON,
+                     "tooltip-column", COLUMN_DESCRIPTION,
                      NULL);
        g_signal_connect_swapped (ev_attachbar->priv->icon_view,
                                  "button-press-event",
@@ -815,19 +816,24 @@ job_finished_callback (EvJobAttachments     *job,
                GtkTreeIter   iter;
                GdkPixbuf    *pixbuf = NULL;
                const gchar  *mime_type;
+               gchar        *description;
 
                attachment = EV_ATTACHMENT (l->data);
 
                mime_type = ev_attachment_get_mime_type (attachment);
                pixbuf = ev_sidebar_attachments_icon_cache_get (ev_attachbar,
                                                                mime_type);
+               description =  g_markup_printf_escaped ("%s",
+                                                        ev_attachment_get_description (attachment));
 
                gtk_list_store_append (ev_attachbar->priv->model, &iter);
                gtk_list_store_set (ev_attachbar->priv->model, &iter,
                                    COLUMN_NAME, ev_attachment_get_name (attachment),
+                                   COLUMN_DESCRIPTION, description,
                                    COLUMN_ICON, pixbuf,
                                    COLUMN_ATTACHMENT, attachment, 
                                    -1);
+               g_free (description);
        }
 
        g_object_unref (job);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]