Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-12-23 06:59:04 (GMT)
committer Havoc Pennington <hp@src.gnome.org>2004-12-23 06:59:04 (GMT)
commit1f7e03f2861f4b8d2bb75bd220754b7a89b7847e (patch)
tree3611ca7d83d0ed053c4333fde49467fec742cd3a /pdf
parent99c9d3fafb8944bedbad648b8ba8f2c9a5c7ac29 (diff)
hook up potentially-questionable "find results status text" feature -
2004-12-23 Havoc Pennington <hp@redhat.com> * shell/ev-window.c: hook up potentially-questionable "find results status text" feature - something involving the sidebar or scrollbar or a continuous all-pages-on-giant-roll-of-paper-view might be better in the end. * shell/ev-view.c (ev_view_get_find_status_message): new function, with corresponding signal when it should be updated * shell/eggfindbar.c (egg_find_bar_set_status_text): new function
Diffstat (limited to 'pdf')
-rw-r--r--pdf/xpdf/pdf-document.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/pdf/xpdf/pdf-document.cc b/pdf/xpdf/pdf-document.cc
index 64d592c..50055f0 100644
--- a/pdf/xpdf/pdf-document.cc
+++ b/pdf/xpdf/pdf-document.cc
@@ -314,13 +314,15 @@ pdf_document_search_emit_found (PdfDocumentSearch *search)
{
PdfDocument *pdf_document = search->document;
int n_pages;
- double pages_done;
+ int pages_done;
GArray *tmp_results;
int i;
n_pages = ev_document_get_n_pages (EV_DOCUMENT (search->document));
if (search->search_page > search->start_page) {
pages_done = search->search_page - search->start_page;
+ } else if (search->search_page == search->start_page) {
+ pages_done = n_pages;
} else {
pages_done = n_pages - search->start_page + search->search_page;
}
@@ -467,15 +469,16 @@ pdf_document_search_idle_callback (void *data)
&xMin, &yMin, &xMax, &yMax)) {
/* This page has results */
search->other_page_flags[search->search_page] = TRUE;
-
- pdf_document_search_emit_found (search);
}
-
+
search->search_page += 1;
if (search->search_page > n_pages) {
/* wrap around */
search->search_page = 1;
}
+
+ /* We do this even if nothing was found, to update the percent complete */
+ pdf_document_search_emit_found (search);
return TRUE;
@@ -537,8 +540,11 @@ pdf_document_find_begin (EvDocumentFind *document,
search->document = pdf_document;
- search->idle = g_idle_add (pdf_document_search_idle_callback,
- search);
+ /* We add at low priority so the progress bar repaints */
+ search->idle = g_idle_add_full (G_PRIORITY_LOW,
+ pdf_document_search_idle_callback,
+ search,
+ NULL);
search->output_dev = 0;