From 03ad9a29cbe1a89dfc5e8b94a74f6f86c4cba076 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Thu, 31 Mar 2005 18:43:05 +0000 Subject: Cr 31 13:27:50 2005 Jonathan Blandford Cr 31 13:27:50 2005 Jonathan Blandford * backend/ev-document.c: (ev_document_get_page_label): * backend/ev-document.h: * backend/ev-page-cache.c: (_ev_page_cache_new), (ev_page_cache_get_page_label): * backend/ev-page-cache.h: * pdf/ev-poppler.cc: * shell/ev-sidebar-links.c: (ev_sidebar_links_construct), (links_page_num_func): * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_set_document): * shell/ev-view.c: (status_message_from_link), (ev_view_motion_notify_event): * shell/ev-window.c: (document_supports_sidebar): Add in page label support. It's not perfect yet, but it's the first 'feature' in a while. Also, fix a bogus comment noticed by crispin. VS: Modified Files: --- (limited to 'shell/ev-sidebar-thumbnails.c') diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 7bbaa09..b439e4b 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -222,7 +222,6 @@ ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails, GdkPixbuf *loading_icon; gint i, n_pages; GtkTreeIter iter; - gchar *page; gint width = THUMBNAIL_WIDTH; gint height = THUMBNAIL_WIDTH; EvPageCache *page_cache; @@ -249,18 +248,22 @@ ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails, gtk_list_store_clear (priv->list_store); for (i = 0; i < n_pages; i++) { EvJob *job; + gchar *page_label; + gchar *page_string; - /* FIXME: Bah. This is still -1 for some reason. Need to track it down.. */ job = ev_job_thumbnail_new (priv->document, i, THUMBNAIL_WIDTH); - page = g_strdup_printf ("%d", i + 1); /* FIXME: replace with string. */ + page_label = ev_page_cache_get_page_label (page_cache, i); + page_string = g_markup_printf_escaped ("%s", page_label); + gtk_list_store_append (priv->list_store, &iter); gtk_list_store_set (priv->list_store, &iter, - COLUMN_PAGE_STRING, page, + COLUMN_PAGE_STRING, page_string, COLUMN_PIXBUF, loading_icon, COLUMN_THUMBNAIL_SET, FALSE, COLUMN_JOB, job, -1); - g_free (page); + g_free (page_label); + g_free (page_string); ev_job_queue_add_job (job, EV_JOB_PRIORITY_LOW); g_object_set_data_full (G_OBJECT (job), "tree_iter", gtk_tree_iter_copy (&iter), -- cgit v0.9.1