From a49bfa652c7adebc3fe5466c8b9e273d38778965 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Sun, 1 Oct 2006 09:13:59 +0000 Subject: [PATCH] Don't enable Splash on documents which don't support find. Fixes bug 2006-10-01 Nickolay V. Shmyrev * shell/ev-window.c: (ev_window_setup_action_sensitivity), (ev_window_set_view_accels_sensitivity): Don't enable Splash on documents which don't support find. Fixes bug #358648. --- ChangeLog | 8 ++++++++ shell/ev-window.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3095681..cd8ca393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-10-01 Nickolay V. Shmyrev + + * shell/ev-window.c: (ev_window_setup_action_sensitivity), + (ev_window_set_view_accels_sensitivity): + + Don't enable Splash on documents which don't support + find. Fixes bug #358648. + 2006-10-01 Wouter Bolsterlee * shell/ev-window.c: (ev_window_cmd_file_open): Make the diff --git a/shell/ev-window.c b/shell/ev-window.c index 3593f40a..2612ac18 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -299,7 +299,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) can_get_text = TRUE; } - if (has_document && EV_IS_DOCUMENT_FIND (document)) { + if (has_pages && EV_IS_DOCUMENT_FIND (document)) { can_find = TRUE; } @@ -336,10 +336,8 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) /* Edit menu */ ev_window_set_action_sensitive (ev_window, "EditSelectAll", has_pages && can_get_text); - ev_window_set_action_sensitive (ev_window, "EditFind", - has_pages && EV_IS_DOCUMENT_FIND (document)); - ev_window_set_action_sensitive (ev_window, "Slash", - has_pages && EV_IS_DOCUMENT_FIND (document)); + ev_window_set_action_sensitive (ev_window, "EditFind", can_find); + ev_window_set_action_sensitive (ev_window, "Slash", can_find); ev_window_set_action_sensitive (ev_window, "EditRotateLeft", has_pages); ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages); @@ -414,6 +412,11 @@ ev_window_update_actions (EvWindow *ev_window) static void ev_window_set_view_accels_sensitivity (EvWindow *window, gboolean sensitive) { + gboolean can_find; + + can_find = window->priv->document && + EV_IS_DOCUMENT_FIND (window->priv->document); + if (window->priv->action_group) { ev_window_set_action_sensitive (window, "PageDown", sensitive); ev_window_set_action_sensitive (window, "PageUp", sensitive); @@ -423,12 +426,13 @@ ev_window_set_view_accels_sensitivity (EvWindow *window, gboolean sensitive) ev_window_set_action_sensitive (window, "ShiftBackSpace", sensitive); ev_window_set_action_sensitive (window, "Return", sensitive); ev_window_set_action_sensitive (window, "ShiftReturn", sensitive); - ev_window_set_action_sensitive (window, "Slash", sensitive); ev_window_set_action_sensitive (window, "Plus", sensitive); ev_window_set_action_sensitive (window, "Minus", sensitive); ev_window_set_action_sensitive (window, "KpPlus", sensitive); ev_window_set_action_sensitive (window, "KpMinus", sensitive); ev_window_set_action_sensitive (window, "Equal", sensitive); + + ev_window_set_action_sensitive (window, "Slash", sensitive && can_find); } } -- 2.43.5