From: Marco Pesenti Gritti Date: Tue, 10 May 2005 15:48:46 +0000 (+0000) Subject: Add mnemonic for edit toolbar. ctrl+l focus the page entry. X-Git-Tag: EVINCE_0_3_1~39 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=f7d8183b26d763d0501f40720aed357d5aa35029;p=evince.git 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 e474af63..3906c701 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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: diff --git a/data/evince-ui.xml b/data/evince-ui.xml index bd9566d3..38753226 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 57b9bfce..8ba9d77b 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 636a24d9..8ac0d54c 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 2db012df..fe1c2263 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -338,6 +338,16 @@ update_chrome_flag (EvWindow *window, EvChrome flag, const char *pref, gboolean update_chrome_visibility (window); } +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) { @@ -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 */