[evince] Don't jump to find result when the findbar is shown with search text
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] Don't jump to find result when the findbar is shown with search text
- Date: Sat, 30 Apr 2011 11:10:08 +0000 (UTC)
commit 1c1fe3110118254e3e6ab4661517697d91e99ff8
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat Apr 30 13:08:20 2011 +0200
Don't jump to find result when the findbar is shown with search text
Fixes bug #647378.
shell/ev-window.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 9ef85aa..6d19c95 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -5187,30 +5187,23 @@ find_bar_close_cb (EggFindBar *find_bar,
}
static void
-find_bar_search_changed_cb (EggFindBar *find_bar,
- GParamSpec *param,
- EvWindow *ev_window)
+ev_window_search_start (EvWindow *ev_window)
{
- gboolean case_sensitive;
+ EggFindBar *find_bar = EGG_FIND_BAR (ev_window->priv->find_bar);
const char *search_string;
if (!ev_window->priv->document || !EV_IS_DOCUMENT_FIND (ev_window->priv->document))
return;
-
- /* Either the string or case sensitivity could have changed. */
- case_sensitive = egg_find_bar_get_case_sensitive (find_bar);
- search_string = egg_find_bar_get_search_string (find_bar);
- ev_view_find_search_changed (EV_VIEW (ev_window->priv->view));
+ search_string = egg_find_bar_get_search_string (find_bar);
ev_window_clear_find_job (ev_window);
-
if (search_string && search_string[0]) {
ev_window->priv->find_job = ev_job_find_new (ev_window->priv->document,
ev_document_model_get_page (ev_window->priv->model),
ev_document_get_n_pages (ev_window->priv->document),
search_string,
- case_sensitive);
+ egg_find_bar_get_case_sensitive (find_bar));
g_signal_connect (ev_window->priv->find_job, "finished",
G_CALLBACK (ev_window_find_job_finished_cb),
ev_window);
@@ -5220,13 +5213,22 @@ find_bar_search_changed_cb (EggFindBar *find_bar,
ev_job_scheduler_push_job (ev_window->priv->find_job, EV_JOB_PRIORITY_NONE);
} else {
ev_window_update_actions (ev_window);
- egg_find_bar_set_status_text (EGG_FIND_BAR (ev_window->priv->find_bar),
- NULL);
+ egg_find_bar_set_status_text (find_bar, NULL);
gtk_widget_queue_draw (GTK_WIDGET (ev_window->priv->view));
}
}
static void
+find_bar_search_changed_cb (EggFindBar *find_bar,
+ GParamSpec *param,
+ EvWindow *ev_window)
+{
+ /* Either the string or case sensitivity could have changed. */
+ ev_view_find_search_changed (EV_VIEW (ev_window->priv->view));
+ ev_window_search_start (ev_window);
+}
+
+static void
find_bar_visibility_changed_cb (EggFindBar *find_bar,
GParamSpec *param,
EvWindow *ev_window)
@@ -5238,11 +5240,10 @@ find_bar_visibility_changed_cb (EggFindBar *find_bar,
if (ev_window->priv->document &&
EV_IS_DOCUMENT_FIND (ev_window->priv->document)) {
ev_view_find_set_highlight_search (EV_VIEW (ev_window->priv->view), visible);
- ev_view_find_search_changed (EV_VIEW (ev_window->priv->view));
ev_window_update_actions (ev_window);
if (visible)
- find_bar_search_changed_cb (find_bar, NULL, ev_window);
+ ev_window_search_start (ev_window);
else
egg_find_bar_set_status_text (EGG_FIND_BAR (ev_window->priv->find_bar), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]