[evince] [shell] Improve findbar message when there are no matches



commit 5fa25dfa71018662facc53affd30fdcb76dbc4cf
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Aug 14 10:56:14 2010 +0200

    [shell] Improve findbar message when there are no matches
    
    The message "0 found on this page" is confusing when there are no
    matches in any page, so now we use just "Not found" in that case. Based
    on patch by José Aliste.
    Fixes bug #626334.

 shell/ev-window.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index fac2a11..f1d3bd9 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4858,17 +4858,23 @@ ev_window_update_find_status_message (EvWindow *ev_window)
 		return;
 	
 	if (ev_job_is_finished (ev_window->priv->find_job)) {
-		gint n_results;
-
-		n_results = ev_job_find_get_n_results (EV_JOB_FIND (ev_window->priv->find_job),
-						       ev_document_model_get_page (ev_window->priv->model));
-		/* TRANS: Sometimes this could be better translated as
-		                      "%d hit(s) on this page".  Therefore this string
-				      contains plural cases. */
-		message = g_strdup_printf (ngettext ("%d found on this page",
-						     "%d found on this page",
-						     n_results),
-					   n_results);
+		EvJobFind *job_find = EV_JOB_FIND (ev_window->priv->find_job);
+
+		if (ev_job_find_has_results (job_find)) {
+			gint n_results;
+
+			n_results = ev_job_find_get_n_results (job_find,
+							       ev_document_model_get_page (ev_window->priv->model));
+			/* TRANS: Sometimes this could be better translated as
+			   "%d hit(s) on this page".  Therefore this string
+			   contains plural cases. */
+			message = g_strdup_printf (ngettext ("%d found on this page",
+							     "%d found on this page",
+							     n_results),
+						   n_results);
+		} else {
+			message = g_strdup (_("Not found"));
+		}
 	} else {
 		gdouble percent;
 



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