[gnumeric] GUI: Ensure actions get accel paths.



commit 08397757cf0cb3c428c2768fbe3efd6ac4ed3e36
Author: Morten Welinder <terra gnome org>
Date:   Thu Dec 10 08:38:15 2015 -0500

    GUI: Ensure actions get accel paths.
    
    I don't see any difference, but the docs want it and it reduces
    deprecation warning count.

 ChangeLog             |    5 +++++
 src/gui-util.c        |   10 ++++++++++
 src/gui-util.h        |    1 +
 src/wbc-gtk-actions.c |   18 +++++++++---------
 4 files changed, 25 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e5b1c5c..9f66e8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-10  Morten Welinder  <terra gnome org>
+
+       * src/gui-util.c (gnm_action_group_add_action): New wrapper to
+       ensure actions get accel paths.
+
 2015-12-09  Morten Welinder  <terra gnome org>
 
        * src/wbc-gtk.c (wbcg_find_action): New function to look in
diff --git a/src/gui-util.c b/src/gui-util.c
index bcc2aa5..d634769 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -1328,3 +1328,13 @@ gnm_action_group_add_actions (GtkActionGroup *group,
                g_object_unref (a);
        }
 }
+
+void
+gnm_action_group_add_action (GtkActionGroup *group, GtkAction *act)
+{
+       /*
+        * See the docs for gtk_action_group_add_action as to why we don't
+        * call just that.
+        */
+       gtk_action_group_add_action_with_accel (group, act, NULL);
+}
diff --git a/src/gui-util.h b/src/gui-util.h
index 0ddd92d..37ca160 100644
--- a/src/gui-util.h
+++ b/src/gui-util.h
@@ -181,6 +181,7 @@ typedef struct
 void gnm_action_group_add_actions (GtkActionGroup *group,
                                   GnmActionEntry const *actions, size_t n,
                                   gpointer user);
+void gnm_action_group_add_action (GtkActionGroup *group, GtkAction *act);
 
 
 G_END_DECLS
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 4f2d585..9e9ab0b 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1943,7 +1943,7 @@ static GNM_ACTION_DEF (cb_file_menu)
 
 static GNM_ACTION_DEF (cb_insert_menu)
 {
-       GtkAction *action = gtk_action_group_get_action (wbcg->permanent_actions, "MenuInsertObject");
+       GtkAction *action = wbcg_find_action (wbcg, "MenuInsertObject");
        SheetControlGUI *scg = wbcg_cur_scg (wbcg);
        gtk_action_set_sensitive (action, go_components_get_mime_types () != NULL && scg && scg_sheet 
(scg)->sheet_type == GNM_SHEET_DATA);
 }
@@ -3743,7 +3743,7 @@ wbc_gtk_init_alignments (WBCGtk *wbcg)
        g_signal_connect (G_OBJECT (wbcg->halignment),
                "activate",
                G_CALLBACK (cb_halignment_activated), wbcg);
-       gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->halignment));
+       gnm_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->halignment));
 
        wbcg->valignment = go_action_combo_pixmaps_new ("VAlignmentSelector",
                                                       valignment_combo_info, 1, 3);
@@ -3754,7 +3754,7 @@ wbc_gtk_init_alignments (WBCGtk *wbcg)
        g_signal_connect (G_OBJECT (wbcg->valignment),
                "activate",
                G_CALLBACK (cb_valignment_activated), wbcg);
-       gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->valignment));
+       gnm_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->valignment));
 }
 
 /****************************************************************************/
@@ -3810,7 +3810,7 @@ wbc_gtk_init_color_fore (WBCGtk *gtk)
        g_signal_connect (G_OBJECT (gtk->fore_color),
                "display-custom-dialog",
                G_CALLBACK (cb_custom_color_created), gtk);
-       gtk_action_group_add_action (gtk->font_actions,
+       gnm_action_group_add_action (gtk->font_actions,
                GTK_ACTION (gtk->fore_color));
 }
 
@@ -3853,7 +3853,7 @@ wbc_gtk_init_color_back (WBCGtk *gtk)
                "signal::combo-activate", G_CALLBACK (cb_back_color_changed), gtk,
                "signal::display-custom-dialog", G_CALLBACK (cb_custom_color_created), gtk,
                NULL);
-       gtk_action_group_add_action (gtk->actions, GTK_ACTION (gtk->back_color));
+       gnm_action_group_add_action (gtk->actions, GTK_ACTION (gtk->back_color));
 }
 
 /****************************************************************************/
@@ -3975,7 +3975,7 @@ wbc_gtk_init_borders (WBCGtk *wbcg)
        g_signal_connect (G_OBJECT (wbcg->borders),
                "combo-activate",
                G_CALLBACK (cb_border_activated), wbcg);
-       gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->borders));
+       gnm_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->borders));
 }
 
 /****************************************************************************/
@@ -4135,7 +4135,7 @@ wbc_gtk_init_zoom (WBCGtk *wbcg)
        g_signal_connect (G_OBJECT (wbcg->zoom_haction),
                "activate",
                G_CALLBACK (cb_zoom_activated), wbcg);
-       gtk_action_group_add_action (wbcg->actions,
+       gnm_action_group_add_action (wbcg->actions,
                                     GTK_ACTION (wbcg->zoom_haction));
 
        /* ----- vertical ----- */
@@ -4150,7 +4150,7 @@ wbc_gtk_init_zoom (WBCGtk *wbcg)
        g_signal_connect (G_OBJECT (wbcg->zoom_vaction),
                          "activate",
                          G_CALLBACK (cb_vzoom_activated), wbcg);
-       gtk_action_group_add_action (wbcg->actions,
+       gnm_action_group_add_action (wbcg->actions,
                                     GTK_ACTION (wbcg->zoom_vaction));
 
        /* ----- chain ----- */
@@ -4398,7 +4398,7 @@ wbc_gtk_init_font_name (WBCGtk *gtk, gboolean horiz)
                           : G_CALLBACK (cb_font_name_vaction_clicked)),
                          gtk);
 
-       gtk_action_group_add_action (gtk->font_actions, act);
+       gnm_action_group_add_action (gtk->font_actions, act);
 
        return act;
 }


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