]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkactiongroup.c
Use _gtk_action_emit_activate() instead of directly emitting the activate
[~andy/gtk] / gtk / gtkactiongroup.c
index 67cc65247d0f7d068aabc292eda3fcbef4180357..f265bd2c298a2007ca3a2e4efaa65426519914cb 100644 (file)
@@ -525,7 +525,12 @@ gtk_action_group_get_action (GtkActionGroup *action_group,
  * @action_group: the action group
  * @action: an action
  *
- * Adds an action object to the action group. 
+ * Adds an action object to the action group. Note that this function
+ * does not set up the accel path of the action, which can lead to problems
+ * if a user tries to modify the accelerator of a menuitem associated with
+ * the action. Therefore you must either set the accel path yourself with
+ * gtk_action_set_accel_path(), or use 
+ * <literal>gtk_action_group_add_action_with_accel (..., NULL)</literal>.
  *
  * Since: 2.4
  */
@@ -579,7 +584,12 @@ gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
                            action_group->private_data->name, "/", name, NULL);
 
   if (accelerator)
+    {
     gtk_accelerator_parse (accelerator, &accel_key, &accel_mods);
+      if (accel_key == 0)
+       g_warning ("Unable to parse accelerator '%s' for action '%s'",
+                  accelerator, name);
+    }
   else if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
     {
       accel_key = stock_item.keyval;