[gnumeric] Add a keyboard shortcut to jump to the current cell indicator. [#699710]



commit 90271713846cb026485c33e1a29692ab97728720
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon May 27 20:16:39 2013 -0600

    Add a keyboard shortcut to jump to the current cell indicator. [#699710]
    
    2013-05-27  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * component/Gnumeric-embed.xml.in: add accelerator
        * src/GNOME_Gnumeric-gtk.xml.in: add accelerator
        * src/wbc-gtk-actions.c (cb_edit_goto_cell_indicator): new
        (EditGotoCellIndicator): new
        * src/wbc-gtk.c (cb_post_activate): do not interfere with EditGotoCellIndicator
        (wbcg_focus_current_cell_indicator): new
        * src/wbc-gtk.h (wbcg_focus_current_cell_indicator): new
    
    2013-05-27  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * appendix-keybindings.xml: add some keybindings info

 ChangeLog                       |   10 ++++++++++
 NEWS                            |    2 ++
 component/Gnumeric-embed.xml.in |    1 +
 doc/C/ChangeLog                 |    4 ++++
 doc/C/appendix-keybindings.xml  |   12 ++++++++++++
 src/GNOME_Gnumeric-gtk.xml.in   |    1 +
 src/wbc-gtk-actions.c           |   10 ++++++++++
 src/wbc-gtk.c                   |   13 ++++++++++---
 src/wbc-gtk.h                   |    2 ++
 9 files changed, 52 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 30c94c2..19e95e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,16 @@
 
 2013-05-27  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * component/Gnumeric-embed.xml.in: add accelerator
+       * src/GNOME_Gnumeric-gtk.xml.in: add accelerator
+       * src/wbc-gtk-actions.c (cb_edit_goto_cell_indicator): new
+       (EditGotoCellIndicator): new
+       * src/wbc-gtk.c (cb_post_activate): do not interfere with EditGotoCellIndicator
+       (wbcg_focus_current_cell_indicator): new
+       * src/wbc-gtk.h (wbcg_focus_current_cell_indicator): new
+
+2013-05-27  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * component/Gnumeric-embed.xml.in: ctrl-a will be handled in gnm-pane.c
        * src/GNOME_Gnumeric-gtk.xml.in: ctrl-a will be handled in gnm-pane.c
        * src/wbc-gtk-actions.c: ctrl-a will be handled in gnm-pane.c
diff --git a/NEWS b/NEWS
index 91f781a..7842b81 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Andreas:
        * Warn when encountering extLst in xlsx import. [#700018]
        * Use ctrl-a only to select the whole sheet, if the sheet
          has focus. [#699746]
+       * Add a keyboard shortcut to jump to the current cell indicator.
+         [#699710]
 
 Darrell Tangman:
        * Update documentation for Edit and Insert menus. [#700596]
diff --git a/component/Gnumeric-embed.xml.in b/component/Gnumeric-embed.xml.in
index 8461e92..711921b 100644
--- a/component/Gnumeric-embed.xml.in
+++ b/component/Gnumeric-embed.xml.in
@@ -417,5 +417,6 @@
   <accelerator name="FormatClearBorders" action="FormatClearBorders"/>
   <accelerator name="Repeat"            action="Repeat"/>
   <accelerator name="EditDeleteCellsXL"         action="EditDeleteCellsXL"/>
+  <accelerator name="EditGotoCellIndicator" action="EditGotoCellIndicator"/>
   <accelerator name="InsertCellsXL"     action="InsertCellsXL"/>
 </ui>
diff --git a/doc/C/ChangeLog b/doc/C/ChangeLog
index b74ab25..078082c 100644
--- a/doc/C/ChangeLog
+++ b/doc/C/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-27  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * appendix-keybindings.xml: add some keybindings info
+
 2013-05-25  Andreas J. Guelzow <aguelzow pyrshep ca>
        for Darrell Tangman <dgtangman acm org>
 
diff --git a/doc/C/appendix-keybindings.xml b/doc/C/appendix-keybindings.xml
index ecbb96d..3af153c 100644
--- a/doc/C/appendix-keybindings.xml
+++ b/doc/C/appendix-keybindings.xml
@@ -160,6 +160,18 @@
        Toggles strikethrough of the current selection.
       </para>
     </listitem>
+    <listitem>
+      <para>
+        <keycap>Shift-Ctrl-G</keycap>
+       Changes the keyboard focus to the current cell indicator described in <xref 
linkend="data-entry-currentcell" />.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        <keycap>Ctrl-a</keycap>
+       Select all cells on the currently focused sheet.
+      </para>
+    </listitem>
 
   </itemizedlist>
 </appendix>
diff --git a/src/GNOME_Gnumeric-gtk.xml.in b/src/GNOME_Gnumeric-gtk.xml.in
index b7f0e59..28a7b4e 100644
--- a/src/GNOME_Gnumeric-gtk.xml.in
+++ b/src/GNOME_Gnumeric-gtk.xml.in
@@ -423,5 +423,6 @@
   <accelerator name="FormatClearBorders" action="FormatClearBorders"/>
   <accelerator name="Repeat"            action="Repeat"/>
   <accelerator name="EditDeleteCellsXL"         action="EditDeleteCellsXL"/>
+  <accelerator name="EditGotoCellIndicator" action="EditGotoCellIndicator"/>
   <accelerator name="InsertCellsXL"     action="InsertCellsXL"/>
 </ui>
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 8e07141..ea301b2 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -677,6 +677,11 @@ static GNM_ACTION_DEF (cb_edit_goto)
 {
        dialog_goto_cell (wbcg);
 }
+static GNM_ACTION_DEF (cb_edit_goto_cell_indicator)
+{
+       if (IS_WBC_GTK (wbcg))
+               wbcg_focus_current_cell_indicator (WBC_GTK (wbcg));
+}
 
 static GNM_ACTION_DEF (cb_edit_recalc)
 {
@@ -2259,6 +2264,11 @@ static GtkActionEntry const actions[] = {
        { "EditGoto", GTK_STOCK_JUMP_TO, N_("_Go to Cell..."),
                "<control>G", N_("Jump to a specified cell"),
                G_CALLBACK (cb_edit_goto) },
+       /* Tis is a navigational aid that is not supposed to appear */
+       /* in the menu */
+       { "EditGotoCellIndicator", NULL, "Go to Current Cell Indicator",
+               "<shift><control>G", "Go to Current Cell Indicator",
+               G_CALLBACK (cb_edit_goto_cell_indicator) },
 
 /* Edit */
        { "Repeat", NULL, N_("Repeat"),
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 8221a51..052be7f 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4418,9 +4418,9 @@ cb_disconnect_proxy (G_GNUC_UNUSED GtkUIManager *ui,
 }
 
 static void
-cb_post_activate (WBCGtk *wbcg)
+cb_post_activate (G_GNUC_UNUSED GtkUIManager *manager, GtkAction *action, WBCGtk *wbcg)
 {
-       if (!wbcg_is_editing (wbcg))
+       if (!wbcg_is_editing (wbcg) && strcmp(gtk_action_get_name (action), "EditGotoCellIndicator") != 0)
                wbcg_focus_cur_scg (wbcg);
 }
 
@@ -5662,7 +5662,7 @@ wbc_gtk_init (GObject *obj)
                "signal::add_widget",    G_CALLBACK (cb_add_menus_toolbars), wbcg,
                "signal::connect_proxy",    G_CALLBACK (cb_connect_proxy), wbcg,
                "signal::disconnect_proxy", G_CALLBACK (cb_disconnect_proxy), wbcg,
-               "swapped_object_signal::post_activate", G_CALLBACK (cb_post_activate), wbcg,
+               "signal::post_activate", G_CALLBACK (cb_post_activate), wbcg,
                NULL);
        gtk_ui_manager_insert_action_group (wbcg->ui, wbcg->permanent_actions, 0);
        gtk_ui_manager_insert_action_group (wbcg->ui, wbcg->actions, 0);
@@ -5981,3 +5981,10 @@ wbcg_find_for_workbook (Workbook *wb,
 
        return candidate;
 }
+
+void
+wbcg_focus_current_cell_indicator (WBCGtk const *wbcg)
+{
+       gtk_widget_grab_focus (GTK_WIDGET (wbcg->selection_descriptor));
+       gtk_editable_select_region (GTK_EDITABLE (wbcg->selection_descriptor), 0, -1);
+}
diff --git a/src/wbc-gtk.h b/src/wbc-gtk.h
index f5539cb..3d4e296 100644
--- a/src/wbc-gtk.h
+++ b/src/wbc-gtk.h
@@ -83,6 +83,8 @@ void        wbcg_set_entry            (WBCGtk *wbc,
                                         GnmExprEntry *new_entry);
 gboolean      wbcg_entry_has_logical   (WBCGtk const *wbcg);
 
+void          wbcg_focus_current_cell_indicator (WBCGtk const *wbcg);
+
 G_END_DECLS
 
 #endif /* _GNM_WBC_GTK_H_ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]