From f7d8183b26d763d0501f40720aed357d5aa35029 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 10 May 2005 15:48:46 +0000 Subject: Add mnemonic for edit toolbar. ctrl+l focus the page entry. 2005-05-10 Marco Pesenti Gritti * data/evince-ui.xml: * shell/ev-page-action.c: (ev_page_action_grab_focus): * shell/ev-page-action.h: * shell/ev-window.c: (ev_window_cmd_focus_page_selector): Add mnemonic for edit toolbar. ctrl+l focus the page entry. --- diff --git a/ChangeLog b/ChangeLog index e474af6..3906c70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2005-05-10 Marco Pesenti Gritti + * data/evince-ui.xml: + * shell/ev-page-action.c: (ev_page_action_grab_focus): + * shell/ev-page-action.h: + * shell/ev-window.c: (ev_window_cmd_focus_page_selector): + + Add mnemonic for edit toolbar. + ctrl+l focus the page entry. + +2005-05-10 Marco Pesenti Gritti + * lib/Makefile.am: * shell/ev-window.c: (ev_window_cmd_edit_toolbar_cb), (ev_window_init): diff --git a/data/evince-ui.xml b/data/evince-ui.xml index bd9566d..3875322 100644 --- a/data/evince-ui.xml +++ b/data/evince-ui.xml @@ -69,5 +69,6 @@ + diff --git a/shell/ev-page-action.c b/shell/ev-page-action.c index 57b9bfc..8ba9d77 100644 --- a/shell/ev-page-action.c +++ b/shell/ev-page-action.c @@ -534,6 +534,20 @@ ev_page_action_set_model (EvPageAction *page_action, NULL); } +void +ev_page_action_grab_focus (EvPageAction *page_action) +{ + GSList *proxies; + + proxies = gtk_action_get_proxies (GTK_ACTION (page_action)); + for (; proxies != NULL; proxies = proxies->next) { + EvPageActionWidget *proxy; + + proxy = EV_PAGE_ACTION_WIDGET (proxies->data); + gtk_widget_grab_focus (proxy->entry); + } +} + static void ev_page_action_init (EvPageAction *page) { diff --git a/shell/ev-page-action.h b/shell/ev-page-action.h index 636a24d..8ac0d54 100644 --- a/shell/ev-page-action.h +++ b/shell/ev-page-action.h @@ -60,7 +60,7 @@ void ev_page_action_set_document (EvPageAction *page_action, EvDocument *document); void ev_page_action_set_model (EvPageAction *page_action, GtkTreeModel *model); - +void ev_page_action_grab_focus (EvPageAction *page_action); G_END_DECLS diff --git a/shell/ev-window.c b/shell/ev-window.c index 2db012d..fe1c226 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -339,6 +339,16 @@ update_chrome_flag (EvWindow *window, EvChrome flag, const char *pref, gboolean } static void +ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window) +{ + GtkAction *action; + + action = gtk_action_group_get_action (window->priv->action_group, + PAGE_SELECTOR_ACTION); + ev_page_action_grab_focus (EV_PAGE_ACTION (action)); +} + +static void ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window) { ev_view_scroll (EV_VIEW (window->priv->view), EV_SCROLL_PAGE_FORWARD); @@ -2335,8 +2345,8 @@ static const GtkActionEntry entries[] = { { "EditFindNext", NULL, N_("Find Ne_xt"), "G", N_("Find next occurrence of the word or phrase"), G_CALLBACK (ev_window_cmd_edit_find_next) }, - { "EditToolbar", NULL, N_("Toolbar..."), NULL, - N_("Open Toolbar Editor Dialog"), + { "EditToolbar", NULL, N_("T_oolbar"), NULL, + N_("Customize the toolbar"), G_CALLBACK (ev_window_cmd_edit_toolbar) }, /* View menu */ @@ -2382,23 +2392,26 @@ static const GtkActionEntry entries[] = { G_CALLBACK (ev_window_cmd_leave_fullscreen) }, /* Accellerators */ - { "Escape", NULL, N_("Selection Caret"), "Escape", "", + { "Escape", NULL, "", "Escape", "", G_CALLBACK (ev_window_cmd_escape) }, { "Slash", GTK_STOCK_FIND, NULL, "slash", N_("Find a word or phrase in the document"), G_CALLBACK (ev_window_cmd_edit_find) }, - { "Space", GTK_STOCK_FIND, NULL, "space", + { "Space", NULL, "", "space", N_("Scroll one page forward"), G_CALLBACK (ev_window_cmd_scroll_forward) }, - { "ShiftSpace", GTK_STOCK_FIND, NULL, "space", + { "ShiftSpace", NULL, "", "space", N_("Scroll one page backward"), G_CALLBACK (ev_window_cmd_scroll_backward) }, - { "BackSpace", GTK_STOCK_FIND, NULL, "BackSpace", + { "BackSpace", NULL, "", "BackSpace", N_("Scroll one page backward"), G_CALLBACK (ev_window_cmd_scroll_backward) }, - { "ShiftBackSpace", GTK_STOCK_FIND, NULL, "BackSpace", + { "ShiftBackSpace", NULL, "", "BackSpace", N_("Scroll one page forward"), - G_CALLBACK (ev_window_cmd_scroll_forward) } + G_CALLBACK (ev_window_cmd_scroll_forward) }, + { "FocusPageSelector", NULL, "", "l", + N_("Focus the page selector"), + G_CALLBACK (ev_window_cmd_focus_page_selector) } }; /* Toggle items */ -- cgit v0.9.1