]> www.fi.muni.cz Git - evince.git/commitdiff
Add mnemonic for edit toolbar. ctrl+l focus the page entry.
authorMarco Pesenti Gritti <mpg@redhat.com>
Tue, 10 May 2005 15:48:46 +0000 (15:48 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Tue, 10 May 2005 15:48:46 +0000 (15:48 +0000)
2005-05-10  Marco Pesenti Gritti  <mpg@redhat.com>

        * 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.

ChangeLog
data/evince-ui.xml
shell/ev-page-action.c
shell/ev-page-action.h
shell/ev-window.c

index e474af63dca6189778c3a8cf1519f9007e3ed5bc..3906c701566420ad9106fef34c4c69f18f438719 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-05-10  Marco Pesenti Gritti  <mpg@redhat.com>
+
+       * 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  <mpg@redhat.com>
 
        * lib/Makefile.am:
index bd9566d3a8b67c5fe53098ec9d80892775698d1a..38753226812677966ba624e756647d913f82ec60 100644 (file)
@@ -69,5 +69,6 @@
   <accelerator name="BackSpaceAccel" action="BackSpace"/>
   <accelerator name="ShiftSpaceAccel" action="ShiftSpace"/>
   <accelerator name="ShiftBackSpaceAccel" action="ShiftBackSpace"/>
+  <accelerator name="FocusPageSelectorAccel" action="FocusPageSelector"/>
 
 </ui>
index 57b9bfceb886b3a1002c753b51ba083fbc0c8977..8ba9d77b9ff9b903854556f573eca0a08260936b 100644 (file)
@@ -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)
 {
index 636a24d9a7a3706821b67da1f11ef8e5ff0e2c20..8ac0d54cfa2c3441246882ba5e945b53a0a7d4ad 100644 (file)
@@ -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
 
index 2db012df0006f153d79a61ec20eb203922764576..fe1c2263a049c44c68051d1b328ce5e80a6ec040 100644 (file)
@@ -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"), "<control>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, "<shift>space",
+        { "ShiftSpace", NULL, "", "<shift>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, "<shift>BackSpace",
+        { "ShiftBackSpace", NULL, "", "<shift>BackSpace",
           N_("Scroll one page forward"),
-          G_CALLBACK (ev_window_cmd_scroll_forward) }
+          G_CALLBACK (ev_window_cmd_scroll_forward) },
+        { "FocusPageSelector", NULL, "", "<control>l",
+          N_("Focus the page selector"),
+          G_CALLBACK (ev_window_cmd_focus_page_selector) }
 };
 
 /* Toggle items */